编译c-ares库从失败到成功的过程
c-ares-master: apt-get install libtool
####https://github.com/c-ares/c-ares
==============================
失败的过程;
{ 1.host配错了 ./configure --host=x86_64-pokysdk-linux --target=arm-poky-linux-gnueabi --prefix=/root/work/lib_arm/c-ares make root@ubuntu:~/work/share/mqtt/c-ares-master# find . -name "*.so*" ./.libs/libcares.so.2.2.0 ./.libs/libcares.so ./.libs/libcares.so.2 root@ubuntu:~/work/share/mqtt/c-ares-master# file ./.libs/libcares.so.2.2.0 ./.libs/libcares.so.2.2.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=0e375b908f27eba4b86bd572c4716c1671b4b849, not stripped 2. arm-poky-linux-gnueabi-gcc 交叉编译工具的配置不适合代码 ld: error: a.out uses VFP register arguments, /tmp/ccNTGLwS.o does not http://stackoverflow.com/questions/9753749/arm-compilation-error-vpf-registered-used-by-executable-not-object-file triplet indicates that your compiler is configured for the soft-float ABI. but part of your lib or *.o is using soft-float ABI. solved by exporting-mfloat-abi=hard to flags root@ubuntu:~/work/share/mqtt/c-ares-master# ./configure --host=arm-poky-linux-gnueabi --prefix=/root/work/lib_arm/c-ares checking whether to enable maintainer-specific portions of Makefiles... no checking whether make supports nested variables... yes checking whether to enable debug build options... no checking whether to enable compiler optimizer... not specified (assuming yes) checking whether to enable strict compiler warnings... no checking whether to enable compiler warnings as errors... no checking whether to enable curl debug memory tracking... no checking whether to enable hiding of library internal symbols... yes checking whether to expose internal static functions for testing... no checking for path separator... : checking for sed... /bin/sed checking for grep... /bin/grep checking for egrep... /bin/grep -E checking for arm-poky-linux-gnueabi-ar... /opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-ar checking for a sed that does not truncate output... (cached) /bin/sed checking whether to build with code coverage support... no checking build system type... x86_64-pc-linux-gnu checking host system type... arm-poky-linux-gnueabi checking for a BSD-compatible install... /usr/bin/install -c checking for arm-poky-linux-gnueabi-gcc... arm-poky-linux-gnueabi-gcc checking whether the C compiler works... no configure: error: in '/root/work/share/mqtt/c-ares-master': configure: error: C compiler cannot create executables See 'config.log' for more details vi config.log configure:4426: $? = 1 configure:4445: checking whether the C compiler works configure:4467: arm-poky-linux-gnueabi-gcc conftest.c >&5 /opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.1/ ld: error: a.out uses VFP register arguments, /tmp/ccNTGLwS.o does not //重点在这里 /opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.1/ ld: failed to merge target specific data of file /tmp/ccNTGLwS.o collect2: error: ld returned 1 exit status configure:4471: $? = 1 configure:4509: result: no configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "c-ares" | #define PACKAGE_TARNAME "c-ares" | #define PACKAGE_VERSION "-" | #define PACKAGE_STRING "c-ares -" | #define PACKAGE_BUGREPORT "c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares" | #define PACKAGE_URL "" | #define OS "arm-poky-linux-gnueabi" | /* end confdefs.h. */ | | int main (void) | { | | ; | return 0; | } configure:4514: error: in '/root/work/share/mqtt/c-ares-master': configure:4516: error: C compiler cannot create executables 解决办法: CFLAGS加一个-mfloat-abi=hard }