SDK: stdlib error and GCC may not be using proper compiler?
Username: MyS5Droid
Origin: https://bugs.openwrt.org/index.php?do=details&task_id=1613
Hi all,
I am trying to build a package for OpenWRT. I have sorted out all the smaller problems (hopefully) but now I am encountering an error that I suspect is related to the
SDK
.
Device: TPL-AC1750
OpenWRT: Chaos Chalmer
Device Page:
https://wiki.openwrt.org/toh/hwdata/tp-link/tp-link_archer_c7_ac1750_v2.0
Problem 1:
When compiling the toolchain and libs, I noticed it uses “/usr/bin/gcc” and not toolchain_dir/bin/mips-openwrt-linux-musl-gcc.
– THIS could be the problem causing problem #2 (closed)!
LS of GCC produces:
kthx@pizone:~/OpenWRT-SDK/AR7xx$ ls -al /usr/bin/gcc* lrwxrwxrwx 1 root root 5 Apr 8 2017 /usr/bin/gcc -> gcc-6 lrwxrwxrwx 1 root root 22 Feb 14 11:53 /usr/bin/gcc-6 -> x86_64-linux-gnu-gcc-6 lrwxrwxrwx 1 root root 8 Apr 8 2017 /usr/bin/gcc-ar -> gcc-ar-6 lrwxrwxrwx 1 root root 25 Feb 14 11:53 /usr/bin/gcc-ar-6 -> x86_64-linux-gnu-gcc-ar-6 lrwxrwxrwx 1 root root 8 Apr 8 2017 /usr/bin/gcc-nm -> gcc-nm-6 lrwxrwxrwx 1 root root 25 Feb 14 11:53 /usr/bin/gcc-nm-6 -> x86_64-linux-gnu-gcc-nm-6 lrwxrwxrwx 1 root root 12 Apr 8 2017 /usr/bin/gcc-ranlib -> gcc-ranlib-6 lrwxrwxrwx 1 root root 29 Feb 14 11:53 /usr/bin/gcc-ranlib-6 -> x86_64-linux-gnu-gcc-ranlib-6
My .bashrc contains:
export STAGING_DIR=/home/kthx/OpenWRT-SDK/AR7xx/staging_dir export TOOLCHAIN_DIR=$STAGING_DIR/toolchain-mips_24kc_gcc-7.3.0_musl
export LDCFLAGS=$TOOLCHAIN_DIR/usr/lib export LD_LIBRARY_PATH=$TOOLCHAIN_DIR/usr/lib
export PATH=TOOLCHAIN_DIR/bin:
PATH
Problem 2:
This could be caused by problem 1 because it has to do with the compiler and libraries.
When compiling my package I get:
[100%] Linking CXX executable xmrig-proxy /home/kthx/OpenWRT-SDK/AR7xx/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/lib/gcc/mips-openwrt-linux-musl/7.3.0/../../../../mips-openwrt-linux-musl/bin/ld: /home/kthx/OpenWRT-SDK/AR7xx/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/lib/libstdc++.a(eh_throw.o): undefined reference to symbol '_Unwind_Resume_or_Rethrow@@GCC_3.3' /home/kthx/OpenWRT-SDK/AR7xx/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/mips-openwrt-linux-musl/bin/../../../toolchain-mips_24kc_gcc-7.3.0_musl/lib/libgcc_s.so.1: error adding symbols: DSO missing from command line
I am no C programmer, but it looks like it is complaining about the STDLib not having defined a symbol/reference?
I suspect either the LIB was not compiled with the correct compiler (problem 1) or the library is an old enough version to not have that symbol defined?
If the toolchain is compiling with the wrong compiler, I would suspect this is either a toolchain setup problem (PATH?) or a compatibility problem with the lib version.
If anyone could help point me in the right direction, that would be awesome :)
Also I am not sure if I am posting my bug reports in the right area, if someone could confirm I am not spamming the wrong system? Thanks :P
Thank You :)