Make: *** [toplevel.mk:227: world] Error 2 (WSL)

Can somebody help me with this problem?

I am trying to compile openwrt v18.07.4 on Debian in WSL with additional Packages.
I updated all Debian Packages via APT and followed this guide: https://openwrt.org/docs/guide-developer/quickstart-build-images

However i always get a toplevel.mk error at Line 227:

make[5]: *** [Makefile:293: /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/compex_wpq864-fit-uImage.itb] Error 1
make[5]: Leaving directory '/home/mcotting/programming/openwrt/target/linux/ipq806x/image'
make[4]: *** [Makefile:27: install] Error 2
make[4]: Leaving directory '/home/mcotting/programming/openwrt/target/linux/ipq806x'
make[3]: *** [Makefile:13: install] Error 2
make[3]: Leaving directory '/home/mcotting/programming/openwrt/target/linux'
time: target/linux/install#316.56#28.79#343.27
make[2]: *** [target/Makefile:25: target/linux/install] Error 2
make[2]: Leaving directory '/home/mcotting/programming/openwrt'
make[1]: *** [target/Makefile:19: /home/mcotting/programming/openwrt/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/stamp/.target_install] Error 2
make[1]: Leaving directory '/home/mcotting/programming/openwrt'
make: *** [/home/mcotting/programming/openwrt/include/toplevel.mk:227: world] Error 2

Interestingly, the Image Files already exist, however i dont know if they are actually complete/ready for usage.
Thanks in advance for your help!

The interesting part should be just above the error messages you've posted.

2 Likes

You may also want to run make -j1 V=s to get the full error message, in case you’re running it with multiple cores.

I did a make clean; make -j1 V=s and looked at the Logs again, however i could not really find anything weird. As pastebin is not working i am posting the Logs here:

cat /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/image-qcom-ipq8064-wxr-2533dhp.dtb >> /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/buffalo_wxr-2533dhp-uImage
mkimage -A arm -O linux -T kernel -C none -a 0x42208000 -e 0x42208000 -n 'ARM OpenWrt Linux-4.14.195' -d /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/buffalo_wxr-2533dhp-uImage /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/buffalo_wxr-2533dhp-uImage.new
Image Name:   ARM OpenWrt Linux-4.14.195
Created:      Sun Sep  6 16:19:39 2020
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    2349424 Bytes = 2294.36 KiB = 2.24 MiB
Load Address: 42208000
Entry Point:  42208000
mv /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/buffalo_wxr-2533dhp-uImage.new /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/buffalo_wxr-2533dhp-uImage
rm -f /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/compex_wpq864-fit-uImage.itb
cp /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/Image /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/compex_wpq864-fit-uImage.itb
gzip -f -9n -c /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/compex_wpq864-fit-uImage.itb  > /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/compex_wpq864-fit-uImage.itb.new
/home/mcotting/programming/openwrt/scripts/mkits.sh -D compex_wpq864 -o /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/compex_wpq864-fit-uImage.itb.its -k /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/compex_wpq864-fit-uImage.itb -d /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/linux-4.14.195/arch/arm/boot/dts/qcom-ipq8064-wpq864.dtb -C gzip -a 0x42208000 -e 0x42208000 -c "config@1" -A arm -v 4.14.195
PATH=/home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/linux-4.14.195/scripts/dtc:/home/mcotting/programming/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.5.0_musl_eabi/bin:/home/mcotting/programming/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.5.0_musl_eabi/bin:/home/mcotting/programming/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.5.0_musl_eabi/bin:/home/mcotting/programming/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.5.0_musl_eabi/bin:/home/mcotting/programming/openwrt/staging_dir/host/bin:/home/mcotting/programming/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.5.0_musl_eabi/bin:/home/mcotting/programming/openwrt/staging_dir/host/bin:/home/mcotting/programming/openwrt/staging_dir/host/bin:/home/mcotting/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program:Files/WindowsApps/TheDebianProject.DebianGNULinux_1.2.0.0_x64__76v4gfsz19hv4:/mnt/c/Python39/Scripts/:/mnt/c/Python39/:/mnt/c/Program:Files:(x86)/Razer:Chroma:SDK/bin:/mnt/c/Program:Files/Razer:Chroma:SDK/bin:/mnt/c/Program:Files:(x86)/Common:Files/Oracle/Java/javapath:/mnt/c/Program:Files:(x86)/Razer/ChromaBroadcast/bin:/mnt/c/Program:Files/Razer/ChromaBroadcast/bin:/mnt/c/program:files:(x86)/razer:chroma:sdk/bin:/mnt/c/program:files/razer:chroma:sdk/bin:/mnt/c/programdata/oracle/java/javapath:/mnt/c/windows/system32:/mnt/c/windows:/mnt/c/windows/system32/wbem:/mnt/c/windows/system32/windowspowershell/v1.0/:/mnt/c/program:files/openssh:/mnt/c/programdata/chocolatey/bin:/mnt/c/windows/system32/openssh/:/mnt/c/program:files:(x86)/ivi:foundation/visa/winnt/bin:/mnt/c/windows/system32/config/systemprofile/appdata/local/microsoft/windowsapps:/mnt/c/android:/mnt/c/users/matthias:cotting/appdata/local/programs/python/launcher/:/mnt/c/users/matthias:cotting/appdata/local/programs/python/python37-32/:/mnt/c/program:files/nvidia:corporation/nvidia:nvdlisr:/mnt/c/Program:Files:(x86)/NVIDIA:Corporation/PhysX/Common:/mnt/c/WINDOWS/system32/config/systemprofile/AppData/Local/Microsoft/WindowsApps:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program:Files/Git/cmd:/mnt/c/Users/Matthias:Cotting/AppData/Local/Programs/Python/Launcher/:/mnt/c/Users/Matthias:Cotting/AppData/Local/Programs/Microsoft:VS:Code/bin:/mnt/c/Users/Matthias:Cotting/AppData/Local/Microsoft/WindowsApps mkimage -f /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/compex_wpq864-fit-uImage.itb.its /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/compex_wpq864-fit-uImage.itb.new
bash: -c: line 0: syntax error near unexpected token `('
bash: -c: line 0: `PATH=/home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/linux-4.14.195/scripts/dtc:/home/mcotting/programming/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.5.0_musl_eabi/bin:/home/mcotting/programming/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.5.0_musl_eabi/bin:/home/mcotting/programming/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.5.0_musl_eabi/bin:/home/mcotting/programming/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.5.0_musl_eabi/bin:/home/mcotting/programming/openwrt/staging_dir/host/bin:/home/mcotting/programming/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.5.0_musl_eabi/bin:/home/mcotting/programming/openwrt/staging_dir/host/bin:/home/mcotting/programming/openwrt/staging_dir/host/bin:/home/mcotting/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program:Files/WindowsApps/TheDebianProject.DebianGNULinux_1.2.0.0_x64__76v4gfsz19hv4:/mnt/c/Python39/Scripts/:/mnt/c/Python39/:/mnt/c/Program:Files:(x86)/Razer:Chroma:SDK/bin:/mnt/c/Program:Files/Razer:Chroma:SDK/bin:/mnt/c/Program:Files:(x86)/Common:Files/Oracle/Java/javapath:/mnt/c/Program:Files:(x86)/Razer/ChromaBroadcast/bin:/mnt/c/Program:Files/Razer/ChromaBroadcast/bin:/mnt/c/program:files:(x86)/razer:chroma:sdk/bin:/mnt/c/program:files/razer:chroma:sdk/bin:/mnt/c/programdata/oracle/java/javapath:/mnt/c/windows/system32:/mnt/c/windows:/mnt/c/windows/system32/wbem:/mnt/c/windows/system32/windowspowershell/v1.0/:/mnt/c/program:files/openssh:/mnt/c/programdata/chocolatey/bin:/mnt/c/windows/system32/openssh/:/mnt/c/program:files:(x86)/ivi:foundation/visa/winnt/bin:/mnt/c/windows/system32/config/systemprofile/appdata/local/microsoft/windowsapps:/mnt/c/android:/mnt/c/users/matthias:cotting/appdata/local/programs/python/launcher/:/mnt/c/users/matthias:cotting/appdata/local/programs/python/python37-32/:/mnt/c/program:files/nvidia:corporation/nvidia:nvdlisr:/mnt/c/Program:Files:(x86)/NVIDIA:Corporation/PhysX/Common:/mnt/c/WINDOWS/system32/config/systemprofile/AppData/Local/Microsoft/WindowsApps:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program:Files/Git/cmd:/mnt/c/Users/Matthias:Cotting/AppData/Local/Programs/Python/Launcher/:/mnt/c/Users/Matthias:Cotting/AppData/Local/Programs/Microsoft:VS:Code/bin:/mnt/c/Users/Matthias:Cotting/AppData/Local/Microsoft/WindowsApps mkimage -f /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/compex_wpq864-fit-uImage.itb.its /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/compex_wpq864-fit-uImage.itb.new'
make[5]: *** [Makefile:293: /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/compex_wpq864-fit-uImage.itb] Error 1
make[5]: Leaving directory '/home/mcotting/programming/openwrt/target/linux/ipq806x/image'
make[4]: *** [Makefile:27: install] Error 2
make[4]: Leaving directory '/home/mcotting/programming/openwrt/target/linux/ipq806x'
make[3]: *** [Makefile:13: install] Error 2
make[3]: Leaving directory '/home/mcotting/programming/openwrt/target/linux'
time: target/linux/install#325.61#30.61#353.94
make[2]: *** [target/Makefile:25: target/linux/install] Error 2
make[2]: Leaving directory '/home/mcotting/programming/openwrt'
make[1]: *** [target/Makefile:19: /home/mcotting/programming/openwrt/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/stamp/.target_install] Error 2
make[1]: Leaving directory '/home/mcotting/programming/openwrt'
make: *** [/home/mcotting/programming/openwrt/include/toplevel.mk:227: world] Error 2

The actual error should still be above these, maybe previous 20-30 lines?

Okay, I think its easier to just share the whole Log File:
https://drive.google.com/file/d/1rzDlYZlhiW7lP6l8Rs0Ku27Q6ibSCBl4/view?usp=sharing

I tried compiling the Image agian using a Debian VM, same Error. It seems to be my make config tha is causing the Issue: make.config

My guess is that it is about that "(x86)" in your directory names inclucded in PATH. I think that "(" and ")" might need to get escaped. That current unescaped "(" gets understood as a token starting a subshell block or something.

PATH=/home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/linux-4.14.195/scripts/dtc:/home/mcotting/programming/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.5.0_musl_eabi/bin:/home/mcotting/programming/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.5.0_musl_eabi/bin:/home/mcotting/programming/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.5.0_musl_eabi/bin:/home/mcotting/programming/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.5.0_musl_eabi/bin:/home/mcotting/programming/openwrt/staging_dir/host/bin:/home/mcotting/programming/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.5.0_musl_eabi/bin:/home/mcotting/programming/openwrt/staging_dir/host/bin:/home/mcotting/programming/openwrt/staging_dir/host/bin:/home/mcotting/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program:Files/WindowsApps/TheDebianProject.DebianGNULinux_1.2.0.0_x64__76v4gfsz19hv4:/mnt/c/Python39/Scripts/:/mnt/c/Python39/:/mnt/c/Program:Files:(x86)/Razer:Chroma:SDK/bin:/mnt/c/Program:Files/Razer:Chroma:SDK/bin:/mnt/c/Program:Files:(x86)/Common:Files/Oracle/Java/javapath:/mnt/c/Program:Files:(x86)/Razer/ChromaBroadcast/bin:/mnt/c/Program:Files/Razer/ChromaBroadcast/bin:/mnt/c/program:files:(x86)/razer:chroma:sdk/bin:/mnt/c/program:files/razer:chroma:sdk/bin:/mnt/c/programdata/oracle/java/javapath:/mnt/c/windows/system32:/mnt/c/windows:/mnt/c/windows/system32/wbem:/mnt/c/windows/system32/windowspowershell/v1.0/:/mnt/c/program:files/openssh:/mnt/c/programdata/chocolatey/bin:/mnt/c/windows/system32/openssh/:/mnt/c/program:files:(x86)/ivi:foundation/visa/winnt/bin:/mnt/c/windows/system32/config/systemprofile/appdata/local/microsoft/windowsapps:/mnt/c/android:/mnt/c/users/matthias:cotting/appdata/local/programs/python/launcher/:/mnt/c/users/matthias:cotting/appdata/local/programs/python/python37-32/:/mnt/c/program:files/nvidia:corporation/nvidia:nvdlisr:/mnt/c/Program:Files:(x86)/NVIDIA:Corporation/PhysX/Common:/mnt/c/WINDOWS/system32/config/systemprofile/AppData/Local/Microsoft/WindowsApps:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program:Files/Git/cmd:/mnt/c/Users/Matthias:Cotting/AppData/Local/Programs/Python/Launcher/:/mnt/c/Users/Matthias:Cotting/AppData/Local/Programs/Microsoft:VS:Code/bin:/mnt/c/Users/Matthias:Cotting/AppData/Local/Microsoft/WindowsApps mkimage -f /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/compex_wpq864-fit-uImage.itb.its /home/mcotting/programming/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/compex_wpq864-fit-uImage.itb.new

> bash: -c: line 0: syntax error near unexpected token `('

See:

1 Like

Okay, i will look at this after work.
My compile was successful, now that i removed the Image Builder in the Make Config.
I will try to compile it with all the Windows Paths removed, although i doubt that this is the Error, because the compile on a full Debian 10 VM also failed with similar Error(s).
EDIT: I was wrong, see post below.

So as it turns out, it is the PATH imported from Windows that can cause Problems. I had to disable PATH Syncing with my host System and create a new WSL instance. After that, everyting worked flawlessly. Thanks!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.