Post Go back to editing

Failed to build Linux Kernel using Cygwin

Category: Software

Hi,

I tried to use Cygwin to help me build a linux kernel on my Xilinx VC707 board. I followed this link: wiki.analog.com/.../microblaze
I successfully completed all the steps until the last step "Build kernel". After I command "make simpleImage.vc707_fmcjesdadc1", it shows the following error messages:

User@User /cygdrive/c/linux
$ make simpleImage.vc707_fmcjesdadc1
  CC      scripts/mod/empty.o
: No such file or directory
make[1]: *** [scripts/Makefile.build:279: scripts/mod/empty.o] Error 2
make[1]: *** Deleting file 'scripts/mod/empty.o'
make: *** [Makefile:1205: prepare0] Error 2

Does anybody know what's the reason for this error and how to fix it? thanks.

Parents
  • Can you double check that your toolchain is on the PATH and your 

    CROSS_COMPILE variable is set correctly?

    -Michael
  • I believe it's correct. I did the following again, but there's still the same result after I do the make command.

    User@User /cygdrive/c/linux
    $ export PATH=/cygdrive/c/Xilinx/Vivado/2021.1/gnu/microblaze/linux_toolchain/nt64_le/bin/:$PATH
    
    User@User /cygdrive/c/linux
    $ export ARCH=microblaze
    
    User@User /cygdrive/c/linux
    $ export CROSS_COMPILE=microblazeel-xilinx-linux-gnu-
    

  • Can you try 

    $ microblazeel-xilinx-linux-gnu-gcc --version

  • Thanks. Here's the result.

    User@User /cygdrive/c/linux
    $ microblazeel-xilinx-linux-gnu-gcc --version
    microblazeel-xilinx-linux-gcc.exe (GCC) 10.2.0
    Copyright (C) 2020 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    

  • $ make V=1 simpleImage.vc707_fmcjesdadc1

  • Thanks. I think the errors are still same...

    User@User /cygdrive/c/linux
    $ make V=1 simpleImage.vc707_fmcjesdadc1
    make -f ./scripts/Makefile.build obj=arch/microblaze/kernel/syscalls all
    make -f ./scripts/Makefile.build obj=scripts/basic
    rm -f .tmp_quiet_recordmcount
    make -f ./scripts/Makefile.build obj=scripts/dtc
    make -f ./scripts/Makefile.build obj=scripts
    set -e; mkdir -p include/config/; trap "rm -f include/config/.kernel.release.tmp" EXIT; { echo "5.10.0$(sh ./scripts/setlocalversion .)"; } > include/config/.kernel.release.tmp; if [ ! -r include/config/kernel.release ] || ! cmp -s include/config/kernel.release include/config/.kernel.release.tmp; then : '  UPD     include/config/kernel.release'; mv -f include/config/.kernel.release.tmp include/config/kernel.release; fi
    make -f ./scripts/Makefile.asm-generic obj=arch/microblaze/include/generated/uapi/asm \
    generic=include/uapi/asm-generic
    make -f ./scripts/Makefile.asm-generic obj=arch/microblaze/include/generated/asm \
    generic=include/asm-generic
    set -e; mkdir -p include/generated/uapi/linux/; trap "rm -f include/generated/uapi/linux/.version.h.tmp" EXIT; {        echo \#define LINUX_VERSION_CODE 330240; echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; } > include/generated/uapi/linux/.version.h.tmp; if [ ! -r include/generated/uapi/linux/version.h ] || ! cmp -s include/generated/uapi/linux/version.h include/generated/uapi/linux/.version.h.tmp; then : '  UPD     include/generated/uapi/linux/version.h'; mv -f include/generated/uapi/linux/.version.h.tmp include/generated/uapi/linux/version.h; fi
    rm -f include/linux/version.h
    set -e; mkdir -p include/generated/; trap "rm -f include/generated/.utsrelease.h.tmp" EXIT; {   if [ `echo -n "5.10.0-98697-g9278a7cb3140-dirty" | wc -c ` -gt 64 ]; then echo '"5.10.0-98697-g9278a7cb3140-dirty" exceeds 64 characters' >&2; exit 1; fi; echo \#define UTS_RELEASE \"5.10.0-98697-g9278a7cb3140-dirty\"; } > include/generated/.utsrelease.h.tmp; if [ ! -r include/generated/utsrelease.h ] || ! cmp -s include/generated/utsrelease.h include/generated/.utsrelease.h.tmp; then : '  UPD     include/generated/utsrelease.h'; mv -f include/generated/.utsrelease.h.tmp include/generated/utsrelease.h; fi
    make -f ./scripts/Makefile.build obj=scripts/mod
      microblazeel-xilinx-linux-gnu-gcc -Wp,-MMD,scripts/mod/.empty.o.d -nostdinc -isystem c:/xilinx/vivado/2021.1/gnu/microblaze/linux_toolchain/nt64_le/x86_64-petalinux-mingw32/usr/bin/microblazeel-xilinx-linux/../../lib/microblazeel-xilinx-linux/gcc/microblazeel-xilinx-linux/10.2.0/include -I./arch/microblaze/include -I./arch/microblaze/include/generated  -I./include -I./arch/microblaze/include/uapi -I./arch/microblaze/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 -mlittle-endian -ffixed-r31 -mno-xl-soft-div -mxl-barrel-shift -mxl-pattern-compare -mxl-multiply-high -mno-xl-soft-mul -Os -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fomit-frame-pointer -g -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -fno-strict-overflow -fno-stack-check -Werror=date-time    -DKBUILD_MODFILE='"scripts/mod/empty"' -DKBUILD_BASENAME='"empty"' -DKBUILD_MODNAME='"empty"' -c -o scripts/mod/empty.o scripts/mod/empty.c
    : No such file or directory
    make[1]: *** [scripts/Makefile.build:279: scripts/mod/empty.o] Error 2
    make[1]: *** Deleting file 'scripts/mod/empty.o'
    make: *** [Makefile:1205: prepare0] Error 2
    

  • Looks like this toolchain doesn't work with cygwin.

    I would either build on default Linux or use WSL2 instead.

    -Michael

Reply Children
No Data