如何打印
的已用/默认选项-march
-mcpu
-mfpu
-mtune
对于特定的交叉编译器(arm-linux-gnueabihf-gcc)?
答案 0 :(得分:1)
您可以使用arm-linux-gnueabihf-gcc -E -v
例如在Raspberry Pi上:
$ arm-linux-gnueabihf-gcc -E -v使用内置规范。 COLLECT_GCC = arm-linux-gnueabihf-gcc目标:arm-linux-gnueabihf 配置为:../src/configure -v --with-pkgversion ='Raspbian 8.3.0-6 + rpi1'--with-bugurl = file:///usr/share/doc/gcc-8/README.Bugs --enable-languages = c,ada,c ++,go,d,fortran, objc,obj-c ++ --prefix = / usr --with-gcc-major-version-only --program-suffix = -8 --program-prefix = arm-linux-gnueabihf- --enable-shared --enable -linker-build-id --libexecdir = / usr / lib --without-included-gettext --enable-threads = posix --libdir = / usr / lib --enable-nls --enable-bootstrap --enable- clocale = gnu --enable-libstdcxx-debug --enable-libstdcxx-time = yes --with-default-libstdcxx-abi = new --enable-gnu-unique-object --disable-libitm --disable-libquadmath- -disable-libquadmath-支持--enable-plugin --with-system-zlib --with-target-system-zlib --enable-objc-gc = auto --enable-multiarch --disable-sjlj-exceptions -with-arch = armv6 --with-fpu = vfp --with-float = hard --disable-werror --enable-checking = release --build = arm-linux-gnueabihf --host = arm-linux-gnueabihf --target = arm-linux-gnueabihf线程模型:posix gcc版本8.3.0(Raspbian 8.3.0-6 + rpi1)
在我的x86笔记本电脑上:
$ arm-linux-gnueabihf-gcc -E -v使用内置规范。 COLLECT_GCC = arm-linux-gnueabihf-gcc目标:arm-linux-gnueabihf 配置为:../src/configure -v --with-pkgversion ='Ubuntu / Linaro 7.4.0-1ubuntu1〜18.04.1'--with-bugurl = file:///usr/share/doc/gcc-7/README.Bugs --enable-languages = c,ada,c ++,go,d, fortran,objc,obj-c ++ --prefix = / usr --with-gcc-major-version-only --program-suffix = -7 --enable-shared --enable-linker-build-id --libexecdir = / usr / lib-不包含-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-libitm --disable-libquadmath --disable-libquadmath-support- enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-multiarch --enable-multilib --disable-sjlj-exceptions -with- arch = armv7-a --with-fpu = vfpv3-d16 --with-float = hard --with-mode = thumb --disable-werror --enable-multilib --enable-checking = release- -build = x86_64-linux-gnu --host = x86_64-linux-gnu --target = arm-linux-gnueabihf --program-prefix = arm-linux-gnueabihf- --includedir = / usr / arm-l inux-gnueabihf / include线程模型:posix gcc版本7.4.0(Ubuntu / Linaro 7.4.0-1ubuntu1〜18.04.1)
您会注意到,默认情况下RaspberryPi使用armv6
构建(RPI0使用基于ARMv6架构的ARM11),而arm-linux-gnueabihf-gcc
随Ubuntu一起使用armv7-a
-可能是分布最广的ARM 32位Linux体系结构。
默认情况下,多处理器GCC不会针对任何处理器进行调整,因为其主要目标是体系结构。
答案 1 :(得分:0)
在构建示例之后,对可执行文件运行readelf -a命令以检查架构。