OpenWrt Forum Archive

Topic: Build error for target tl-wr703n under Ubuntu 17.04

The content of this topic has been archived on 12 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Dear all,

I'm trying to build my own image of OpenWRT for the tl-wr703n target because of a lack of space to install the required package. I selected all the right options in the "make menuconfig", then when trying to make the image, i got the following error :

administrator@SC0031VL:~/openwrt/build_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.16/gcc-5.3.0-initial/gcc$ x86_64-linux-gnu-gcc -v  -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H  -o lto1 lto/lto-lang.o lto/lto.o lto/lto-object.o attribs.o lto/lto-partition.o lto/lto-symtab.o libbackend.a main.o  libcommon-target.a libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a  -L/home/administrator/openwrt/staging_dir/host/lib -L/home/administrator/openwrt/staging_dir/host/lib -L/home/administrator/openwrt/staging_dir/host/lib -lmpc -lmpfr -lgmp -rdynamic -ldl -lstdc++ -L../zlib -lz libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -lstdc++
Using built-in specs.
COLLECT_GCC=x86_64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 6.3.0-12ubuntu2' --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 --disable-werror --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 20170406 (Ubuntu 6.3.0-12ubuntu2)
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-g' '-O2' '-D' 'IN_GCC' '-D' 'CROSS_DIRECTORY_STRUCTURE' '-fno-exceptions' '-fno-rtti' '-fasynchronous-unwind-tables' '-Wextra' '-Wall' '-Wno-narrowing' '-Wwrite-strings' '-Wcast-qual' '-Wsuggest-attribute=format' '-Woverloaded-virtual' '-Wpedantic' '-Wno-long-long' '-Wno-variadic-macros' '-Wno-overlength-strings' '-D' 'HAVE_CONFIG_H' '-o' 'lto1' '-L/home/administrator/openwrt/staging_dir/host/lib' '-L/home/administrator/openwrt/staging_dir/host/lib' '-L/home/administrator/openwrt/staging_dir/host/lib' '-rdynamic' '-L../zlib' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/6/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/6/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper -plugin-opt=-fresolution=/tmp/ccsh43eH.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o lto1 /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/6/crtbeginS.o -L/home/administrator/openwrt/staging_dir/host/lib -L/home/administrator/openwrt/staging_dir/host/lib -L/home/administrator/openwrt/staging_dir/host/lib -L../zlib -L/usr/lib/gcc/x86_64-linux-gnu/6 -L/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/6/../../.. lto/lto-lang.o lto/lto.o lto/lto-object.o attribs.o lto/lto-partition.o lto/lto-symtab.o libbackend.a main.o libcommon-target.a libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a -lmpc -lmpfr -lgmp -ldl -lstdc++ -lz libcommon.a ../libcpp/libcpp.a ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -lstdc++ -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/6/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crtn.o
collect2: error: ld returned 1 exit status
administrator@SC0031VL:~/openwrt/build_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.16/gcc-5.3.0-initial/gcc$

It would be realy nice to help me in order to build that specific image.

Many thanks in advance,
Best regards,
Jean

Run the buildroot by running make from the top level directory.  Also do it as a regular user.  You never need to be, and should never be, the root user on your PC to run any of the OpenWrt build system.

If you are only trying to put together a custom 4 MB image with some packages left out and others added, download and run the Image Builder tool from the release directory for your architecture.  It is much simpler than running a build from scratch.

Dear mk24,

Thx for your answer.

I tried to compile from that directory to ensure the error was related to that especially, which it sounds to be really ... so I got the error from the top level of the building environment. I'm not root, nor sudo user when compiling any kind of stuff (the "administrator" account is just to be compliant with some user name's rules).

I try to build the image just to fit the low space available on the tl-703n and followed the build rules from the OpenWRT web pages, but if there's another way easier to follow, I would like to know that way ? Can you maybe explain me how to do that (the only packages that I require are the one related to use an USB sound card and the shairport-sync package ...).

Many thanks in advance for your reply,
Sincerely,
Jean

Dear tmo26,

Thx for your repli, i'll go for a read on the given link ...

Here's the exact error :

make[5]: Entering directory '/home/administrator/openwrt/build_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.16/gcc-5.3.0-initial/gcc'
x86_64-linux-gnu-gcc   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H  -o lto1 \
        lto/lto-lang.o lto/lto.o lto/lto-object.o attribs.o lto/lto-partition.o lto/lto-symtab.o libbackend.a main.o  libcommon-target.a libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a  -L/home/administrator/openwrt/staging_dir/host/lib -L/home/administrator/openwrt/staging_dir/host/lib -L/home/administrator/openwrt/staging_dir/host/lib -lmpc -lmpfr -lgmp -rdynamic -ldl -lstdc++ -L../zlib -lz libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -lstdc++
collect2: error: ld returned 1 exit status
/home/administrator/openwrt/build_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.16/gcc-5.3.0/gcc/lto/Make-lang.in:71: recipe for target 'lto1' failed
make[5]: *** [lto1] Error 1
make[5]: Leaving directory '/home/administrator/openwrt/build_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.16/gcc-5.3.0-initial/gcc'
Makefile:4101: recipe for target 'all-gcc' failed
make[4]: *** [all-gcc] Error 2
make[4]: Leaving directory '/home/administrator/openwrt/build_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.16/gcc-5.3.0-initial'
Makefile:36: recipe for target '/home/administrator/openwrt/build_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.16/gcc-5.3.0-initial/.built' failed
make[3]: *** [/home/administrator/openwrt/build_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.16/gcc-5.3.0-initial/.built] Error 2
make[3]: Leaving directory '/home/administrator/openwrt/toolchain/gcc/initial'
toolchain/Makefile:81: recipe for target 'toolchain/gcc/initial/compile' failed
make[2]: *** [toolchain/gcc/initial/compile] Error 2
make[2]: Leaving directory '/home/administrator/openwrt'
toolchain/Makefile:80: recipe for target '/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.16/stamp/.toolchain_install' failed
make[1]: *** [/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.16/stamp/.toolchain_install] Error 2
make[1]: Leaving directory '/home/administrator/openwrt'
/home/administrator/openwrt/include/toplevel.mk:192 : la recette pour la cible « world » a échouée
make: *** [world] Erreur 2

I just need an image that can be installed onto the router, without any other USB external memory (as the USB connector has to be used by an USB sound card). The only packages that should be installed are the one that will provide access to that USB external audio adapter, and the "shairport-sync" package, and the needed packages ...

Many thanks in advance,
Best regards,
Jean

The discussion might have continued from here.