只考察arm32编译器
版本信息
获取编译器所有的文件,包版本,依赖
获取编译链地址
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
---
$ which arm-linux-gnueabihf-gcc
/usr/bin/arm-linux-gnueabihf-gcc
$ ls -l /usr/bin/arm-linux-gnueabihf-gcc
lrwxrwxrwx 1 root root 25 Mar 20 2020 /usr/bin/arm-linux-gnueabihf-gcc -> arm-linux-gnueabihf-gcc-9
$ ls -l /usr/bin/arm-linux-gnueabihf-gcc-9
-rwxr-xr-x 1 root root 1277136 Mar 10 15:15 /usr/bin/arm-linux-gnueabihf-gcc-9
$ dpkg -S /usr/bin/arm-linux-gnueabihf-gcc-9
gcc-9-arm-linux-gnueabihf: /usr/bin/arm-linux-gnueabihf-gcc-9
$ dpkg -s gcc-9-arm-linux-gnueabihf
Version: 9.4.0-1ubuntu1~20.04.1cross2
Depends: cpp-9-arm-linux-gnueabihf (= 9.4.0-1ubuntu1~20.04.1cross2), gcc-9-arm-linux-gnueabihf-base (= 9.4.0-1ubuntu1~20.04.1cross2), libcc1-0 (>= 8), binutils-arm-linux-gnueabihf (>= 2.34), libgcc-9-dev-armhf-cross (>= 9.4.0-1ubuntu1~20.04.1cross2), libc6 (>= 2.15), libgcc-s1 (>= 3.0), libgmp10 (>= 2:5.0.1~), libisl22 (>= 0.15), libmpc3, libmpfr6 (>= 3.1.3), libstdc++6 (>= 5), zlib1g (>= 1:1.1.4)
$ dpkg -L gcc-9-arm-linux-gnueabihf |grep -w bin
/usr/bin
/usr/bin/arm-linux-gnueabihf-gcc-9
/usr/bin/arm-linux-gnueabihf-gcc-ar-9
/usr/bin/arm-linux-gnueabihf-gcc-nm-9
/usr/bin/arm-linux-gnueabihf-gcc-ranlib-9
/usr/bin/arm-linux-gnueabihf-gcov-9
/usr/bin/arm-linux-gnueabihf-gcov-dump-9
/usr/bin/arm-linux-gnueabihf-gcov-tool-9
注意 : 其他的 arm-linux-gnueabihf-xxx 工具 在 它的依赖包里
$ apt search arm-linux-gnueabihf |grep "^gcc-[0-9]*-arm-linux-gnueabihf/"
gcc-10-arm-linux-gnueabihf/focal-updates,focal-security,now 10.3.0-1ubuntu1~20.04cross1 amd64 [installed]
gcc-8-arm-linux-gnueabihf/focal 8.4.0-3ubuntu1cross1 amd64
gcc-9-arm-linux-gnueabihf/focal-updates,focal-security,now 9.4.0-1ubuntu1~20.04.1cross2 amd64 [installed,automatic]
gcc 的版本
$ arm-linux-gnueabihf-gcc -dumpversion
9
$ arm-linux-gnueabihf-gcc --version
arm-linux-gnueabihf-gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
参数
arm-linux-gnueabihf-gcc --help
反正 help 里面的 东西 你一个一个过就行了
架构相关参数
编译器默认配置
$ arm-linux-gnueabihf-gcc -Q --target-help
$ arm-linux-gnueabihf-gcc -Q --help=common
$ arm-linux-gnueabihf-gcc -Q --help=optimizers
$ arm-linux-gnueabihf-gcc -Q --help=params
$ arm-linux-gnueabihf-gcc -Q --help=target
$ arm-linux-gnueabihf-gcc -Q --help=warnings
$ arm-linux-gnueabihf-gcc -Q --help=joined
$ arm-linux-gnueabihf-gcc -Q --help=separate
$ arm-linux-gnueabihf-gcc -Q --help=undocumented
为什么arm的架构参数这么多
因为arm的实现比较分散,可选择性太大
那么我们就需要根据不同的硬件配不同的的选项,从而产生不同的汇编指令
$ arm-linux-gnueabihf-gcc --target-help
$ arm-linux-gnueabihf-gcc -mabi=help
arm-linux-gnueabihf-gcc: error: unrecognized argument in option ‘-mabi=help’
arm-linux-gnueabihf-gcc: note: valid arguments to ‘-mabi=’ are: aapcs aapcs-linux apcs-gnu atpcs iwmmxt
$ arm-linux-gnueabihf-gcc -march=help
arm-linux-gnueabihf-gcc: error: unrecognized -march target: help
arm-linux-gnueabihf-gcc: note: valid arguments are: armv4 armv4t armv5t armv5te armv5tej armv6 armv6j armv6k armv6z armv6kz armv6zk armv6t2 armv6-m armv6s-m armv7 armv7-a armv7ve armv7-r armv7-m armv7e-m armv8-a armv8.1-a armv8.2-a armv8.3-a armv8.4-a armv8.5-a armv8-m.base armv8-m.main armv8-r iwmmxt iwmmxt2
$ arm-linux-gnueabihf-gcc -mfloat-abi=help
arm-linux-gnueabihf-gcc: error: unrecognized argument in option ‘-mfloat-abi=help’
arm-linux-gnueabihf-gcc: note: valid arguments to ‘-mfloat-abi=’ are: hard soft softfp
$ arm-linux-gnueabihf-gcc -mfpu=help
arm-linux-gnueabihf-gcc: error: unrecognized argument in option ‘-mfpu=help’
arm-linux-gnueabihf-gcc: note: valid arguments to ‘-mfpu=’ are: auto crypto-neon-fp-armv8 fp-armv8 fpv4-sp-d16 fpv5-d16 fpv5-sp-d16 neon neon-fp-armv8 neon-fp16 neon-vfpv3 neon-vfpv4 vfp vfp3 vfpv2 vfpv3 vfpv3-d16 vfpv3-d16-fp16 vfpv3-fp16 vfpv3xd vfpv3xd-fp16 vfpv4 vfpv4-d16
$ arm-linux-gnueabihf-gcc -mtp=help
arm-linux-gnueabihf-gcc: error: unrecognized argument in option ‘-mtp=help’
arm-linux-gnueabihf-gcc: note: valid arguments to ‘-mtp=’ are: auto cp15 soft
架构无关参数
--help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...].
Display specific types of command line options.
|