arm-linux-androideabi于arm-linux-gnueabi区别

arm-linux-androideabi于arm-linux-gnueabi区别,第1张

现在android的工程大部分是用clang编译,在之前的android工程主要是使用gcc,也就是arm-linux-androideabi-gcc,但是其他嵌入式系统使用的是arm-linux-gnueabi,那么这两个有什么区别呢? 能不能混用呢?

先说区别,根据linaro给的,主要有三处

1)There are a few differences between the Linux EABI and Android EABI definitions - most notably, Android defines the size of an enum to 32 bits while regular Linux defines it as variable.

2)Android does not currently use the hardfloat ABI conventions that have become common in regular Linux.

3)Android uses the Gold linker by default while the regular Linux builds default to using the BFD linker (this is for upstream compatibility - Android uses gold while most regular Linux distributions use the BFD linker).

翻译后是两者之前区别很少,主要有enum不一样,谷歌定义enum为32为,而其他的都定义为变量。android编译器使用的是softfp,而其他的使用的是hardfloat,如果使用linux-arm-gnueabi编译android工程的话,会出现“unrecognized option '-mfloat-abi=softfp'”就是指的这个,第三个是linker不同,这个应该好理解,android在bionic中定制了linker。

arm linux 就是 linux,只不过不是运行在通常的PC上,而是运行在 ARM 处理器环境,比如各种 arm 处理器的手机平板中运行的 android 系统,其内核就是 arm linux。

添加-v选项举例:arm-linux-gcc -c -v leds.c

 Reading specs from /work/tools/gcc-3.4.5-glibc-2.3.6/lib/gcc/arm-linux/3.4.5/specs 

Configured with: /work/tools/create_crosstools/crosstool-0.43/build/arm-linux/gcc-3.4.5-glibc-2.3.6/gcc-3.4.5/configure --target=arm-linux --host=i686-host_pc-linux-gnu --prefix=/work/tools/gcc-3.4.5-glibc-2.3.6 --with-float=soft --with-headers=/work/tools/gcc-3.4.5-glibc-2.3.6/arm-linux/include --with-local-prefix=/work/tools/gcc-3.4.5-glibc-2.3.6/arm-linux --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++ --enable-shared --enable-c99 --enable-long-long 

Thread model: posix gcc version 3.4.5 /work/tools/gcc-3.4.5-glibc-2.3.6/libexec/gcc/arm-linux/3.4.5/cc1 -quiet -v -D__ARM_ARCH_3__ leds.c -quiet -dumpbase leds.c -msoft-float -auxbase leds -version -o /tmp/cc1As2lm.s #include "..." 

search starts here: #include <...> 

search starts here: /work/tools/gcc-3.4.5-glibc-2.3.6/lib/gcc/arm-linux/3.4.5/include /work/tools/gcc-3.4.5-glibc-2.3.6/lib/gcc/arm-linux/3.4.5/../../../../arm-linux/sys-include /work/tools/gcc-3.4.5-glibc-2.3.6/lib/gcc/arm-linux/3.4.5/../../../../arm-linux/include End of search list. 

GNU C version 3.4.5 (arm-linux) compiled by GNU C version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2). 

GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=63667 /work/tools/gcc-3.4.5-glibc-2.3.6/lib/gcc/arm-linux/3.4.5/../../../../arm-linux/bin/as -mfpu=softfpa -o leds.o /tmp/cc1As2lm.s 

可以看到一些默认的库被连接进去了,还有GCC,GNU C 的版本号等。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/tougao/6068796.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-13
下一篇 2023-03-13

发表评论

登录后才能评论

评论列表(0条)

保存