Hello, I'm new to openwrt. I followed instructions from [OpenWrt Wiki] Preparing your OpenWrt build system for use
When I execute
make toolchain/install
I got the following error:
WARNING: Makefile 'package/utils/busybox/Makefile' has a build dependency on 'libpam', which does not exist
WARNING: Makefile 'package/boot/kexec-tools/Makefile' has a dependency on 'liblzma', which does not exist
WARNING: Makefile 'package/network/services/lldpd/Makefile' has a dependency on 'libnetsnmp', which does not exist
WARNING: Makefile 'package/luci-app-xray/Makefile' has a dependency on 'curl', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a build dependency on 'libpam', which does not exist
make[2]: Entering directory '/mnt/d/code/openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/mnt/d/code/openwrt/scripts/config'
make[1] toolchain/install
make[2] tools/compile
make[3] -C tools/flock compile
make[3] -C tools/xz compile
ERROR: tools/xz failed to build.
make -r toolchain/install: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
/mnt/d/code/openwrt/include/toplevel.mk:228: recipe for target 'toolchain/install' failed
make: *** [toolchain/install] Error 1
My WSL2 environment:
Distributor ID: Debian
Description: Debian GNU/Linux 9.13 (stretch)
Release: 9.13
Codename: stretch
And I use the openwrt-22.03
branch and target device is Xiaomi-CR6608.
I already make sure I execute
./scripts/feeds update -a
./scripts/feeds install -a
and every commands is running by non-sudo priviledge.
I tried to run with -j1 V=s
and the output is:
...
checking whether ln -s works... yes
checking whether make supports the include directive... cat: -: No such file or
directory
no
checking for x86_64-pc-linux-gnu-gcc... gcc
cat: -: No such file or directory
checking whether the C compiler works... no
configure: error: in `/mnt/d/code/openwrt/build_dir/host/xz-5.2.5':
configure: error: C compiler cannot create executables
See `config.log' for more details
Makefile:36: recipe for target '/mnt/d/code/openwrt/build_dir/host/xz-5.2.5/.con
figured' failed
make[3]: *** [/mnt/d/code/openwrt/build_dir/host/xz-5.2.5/.configured] Error 77
make[3]: Leaving directory '/mnt/d/code/openwrt/tools/xz'
time: tools/xz/compile#0.27#0.05#1.65
ERROR: tools/xz failed to build.
tools/Makefile:166: recipe for target 'tools/xz/compile' failed
make[2]: *** [tools/xz/compile] Error 1
make[2]: Leaving directory '/mnt/d/code/openwrt'
tools/Makefile:164: recipe for target '/mnt/d/code/openwrt/staging_dir/host/stam
p/.tools_compile_yyyyyynnyyyyynyyyyyynyynyyynynyyyyyyyyyyyyyyyyynynnyyyyyyyy' fa
iled
make[1]: *** [/mnt/d/code/openwrt/staging_dir/host/stamp/.tools_compile_yyyyyynn
yyyyynyyyyyynyynyyynynyyyyyyyyyyyyyyyyynynnyyyyyyyy] Error 2
make[1]: Leaving directory '/mnt/d/code/openwrt'
/mnt/d/code/openwrt/include/toplevel.mk:228: recipe for target 'toolchain/instal
l' failed
make: *** [toolchain/install] Error 2
%
and in the build_dir/host/xz-5.2.5/config.log
:
...
Configured with: ../src/configure -v --with-pkgversion='Debian 6.3.0-18+deb9u1' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)
configure:5286: $? = 0
configure:5275: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:5286: $? = 1
configure:5275: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:5286: $? = 1
configure:5306: checking whether the C compiler works
configure:5328: gcc -O2 -I/mnt/d/code/openwrt/staging_dir/host/include -I/mnt/d/code/openwrt/staging_dir/host/include -L/mnt/d/code/openwrt/staging_dir/host/lib conftest.c >&5
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
...