Closed harleylg closed 9 years ago
我的路由器是R6300v2,编译用的是dd-wrt的新版toolchain:http://download1.dd-wrt.com/dd-wrtv2/downloads/toolchains/toolchains.tar.xz (6月15日版本),里面一大堆toolchain实在不知道该用哪个,dd的文档实在是一坨屎,想用OpenWrt的toolchain,不过dd最近似乎都用musl libc,OpenWrt用的还是uClibc。
如果用toolchain-arm_cortex-a9_gcc-4.8-linaro_musl-1.1.5_eabi编译(这个似乎是官方使用的toolchain,论坛里面几篇帖子提及toolchain的似乎都用这个),会报以下错误:
make all-recursive make[1]: Entering directory '/tmp/ChinaDNS-1.3.1' Making all in src make[2]: Entering directory '/tmp/ChinaDNS-1.3.1/src' arm-linux-gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT chinadns.o -MD -MP -MF .deps/chinadns.Tpo -c -o chinadns.o chinadns.c mv -f .deps/chinadns.Tpo .deps/chinadns.Po arm-linux-gcc -g -O2 -o chinadns chinadns.o -lresolv chinadns.o: In function `main': /tmp/ChinaDNS-1.3.1/src/chinadns.c:190: undefined reference to `MAX' collect2: error: ld returned 1 exit status Makefile:317: recipe for target 'chinadns' failed make[2]: *** [chinadns] Error 1 make[2]: Leaving directory '/tmp/ChinaDNS-1.3.1/src' Makefile:393: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/tmp/ChinaDNS-1.3.1' Makefile:312: recipe for target 'all' failed make: *** [all] Error 2
尝试用toolchain-arm_cortex-a9+neon_gcc-4.8-linaro_musl-1.1.2_eabi编译,configure失败。我用的命令是:CC=arm-linux-gcc CXX=arm-linux-g++ AR=arm-linux-ar RANLIB=arm-linux-ranlib ./configure --prefix=/home/harley/packages/chinadns --host=arm-linux
CC=arm-linux-gcc CXX=arm-linux-g++ AR=arm-linux-ar RANLIB=arm-linux-ranlib ./configure --prefix=/home/harley/packages/chinadns --host=arm-linux
尝试用toolchain-arm_mpcore+vfp_gcc-4.8-linaro_musl-1.1.4_eabi编译,则报告以下错误:
(CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /tmp/ChinaDNS-1.3.1/missing autoheader) rm -f stamp-h1 touch config.h.in cd . && /bin/bash ./config.status config.h config.status: creating config.h config.status: config.h is unchanged make all-recursive make[1]: Entering directory '/tmp/ChinaDNS-1.3.1' Making all in src make[2]: Entering directory '/tmp/ChinaDNS-1.3.1/src' arm-linux-gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT chinadns.o -MD -MP -MF .deps/chinadns.Tpo -c -o chinadns.o chinadns.c mv -f .deps/chinadns.Tpo .deps/chinadns.Po arm-linux-gcc -g -O2 -o chinadns chinadns.o -lresolv chinadns.o: In function `hostname_from_question': /tmp/ChinaDNS-1.3.1/src/chinadns.c:727: undefined reference to `ns_parserr' chinadns.o: In function `main': /tmp/ChinaDNS-1.3.1/src/chinadns.c:190: undefined reference to `MAX' chinadns.o: In function `dns_handle_remote': /tmp/ChinaDNS-1.3.1/src/chinadns.c:655: undefined reference to `ns_initparse' chinadns.o: In function `dns_handle_local': /tmp/ChinaDNS-1.3.1/src/chinadns.c:567: undefined reference to `ns_initparse' chinadns.o: In function `should_filter_query': /tmp/ChinaDNS-1.3.1/src/chinadns.c:767: undefined reference to `ns_parserr' collect2: error: ld returned 1 exit status Makefile:317: recipe for target 'chinadns' failed make[2]: *** [chinadns] Error 1 make[2]: Leaving directory '/tmp/ChinaDNS-1.3.1/src' Makefile:393: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/tmp/ChinaDNS-1.3.1' Makefile:312: recipe for target 'all' failed make: *** [all] Error 2
用 git master 版的代码编译试试。
master的一次通过,用的toolchain是toolchain-arm_cortex-a9_gcc-4.8-linaro_musl-1.1.5_eabi
我的路由器是R6300v2,编译用的是dd-wrt的新版toolchain:http://download1.dd-wrt.com/dd-wrtv2/downloads/toolchains/toolchains.tar.xz (6月15日版本),里面一大堆toolchain实在不知道该用哪个,dd的文档实在是一坨屎,想用OpenWrt的toolchain,不过dd最近似乎都用musl libc,OpenWrt用的还是uClibc。
如果用toolchain-arm_cortex-a9_gcc-4.8-linaro_musl-1.1.5_eabi编译(这个似乎是官方使用的toolchain,论坛里面几篇帖子提及toolchain的似乎都用这个),会报以下错误:
尝试用toolchain-arm_cortex-a9+neon_gcc-4.8-linaro_musl-1.1.2_eabi编译,configure失败。我用的命令是:
CC=arm-linux-gcc CXX=arm-linux-g++ AR=arm-linux-ar RANLIB=arm-linux-ranlib ./configure --prefix=/home/harley/packages/chinadns --host=arm-linux
尝试用toolchain-arm_mpcore+vfp_gcc-4.8-linaro_musl-1.1.4_eabi编译,则报告以下错误: