且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用单个GCC(交叉)编译器(交叉)编译为ARM硬浮点和软浮点(softfp)?

更新时间:2022-04-16 01:08:29

您需要另一个具有相应multilib支持的编译器. 您可以使用下一条命令检查对multilib的支持.

You need another compiler with corresponding multilib support. You can check multilib support with next command.

arm-none-eabi-gcc -print-multi-lib
.;
thumb;@mthumb
fpu;@mfloat-abi=hard
armv6-m;@mthumb@march=armv6s-m
armv7-m;@mthumb@march=armv7-m
armv7e-m;@mthumb@march=armv7e-m
armv7-ar/thumb;@mthumb@march=armv7
cortex-m7;@mthumb@mcpu=cortex-m7
armv7e-m/softfp;@mthumb@march=armv7e-m@mfloat-abi=softfp@mfpu=fpv4-sp-d16
armv7e-m/fpu;@mthumb@march=armv7e-m@mfloat-abi=hard@mfpu=fpv4-sp-d16
armv7-ar/thumb/softfp;@mthumb@march=armv7@mfloat-abi=softfp@mfpu=vfpv3-d16
armv7-ar/thumb/fpu;@mthumb@march=armv7@mfloat-abi=hard@mfpu=vfpv3-d16
cortex-m7/softfp/fpv5-sp-d16;@mthumb@mcpu=cortex-m7@mfloat-abi=softfp@mfpu=fpv5-sp-d16
cortex-m7/softfp/fpv5-d16;@mthumb@mcpu=cortex-m7@mfloat-abi=softfp@mfpu=fpv5-d16
cortex-m7/fpu/fpv5-sp-d16;@mthumb@mcpu=cortex-m7@mfloat-abi=hard@mfpu=fpv5-sp-d16
cortex-m7/fpu/fpv5-d16;@mthumb@mcpu=cortex-m7@mfloat-abi=hard@mfpu=fpv5-d16
https://***.com/questions/37418986/how-to-interpret-the-output-of-gcc-print-multi-lib

如何解释gcc 通过这种配置,gcc -mfloat-abi=hard不仅将使用FPU指令来构建文件,而且还会将它们与相应的库链接,从而避免错误.

How to interpret the output of gcc -print-multi-lib With this configuration gcc -mfloat-abi=hard not only will build your files using FPU instructions but also link them with corresponding libs, avoiding "X uses VFP register arguments, Y does not" error.

gcc使用-print-multi-lib输出>此补丁程序--with-multilib-list=armv6-m,armv7,armv7-m,armv7e-m,armv7-r,armv7-a,cortex-m7配置选项. 如果您有兴趣使用Cortex-A系列multilib支持构建自己的gcc,只需对没有任何补丁的任何arm*-*-*目标使用--with-multilib-list=aprofile配置选项(

The above-mentioned -print-multi-lib output produced by gcc with this patch and --with-multilib-list=armv6-m,armv7,armv7-m,armv7e-m,armv7-r,armv7-a,cortex-m7 configuration option. If you are interested in building your own gcc with Cortex-A series multilib support, just use --with-multilib-list=aprofile configuration option for any arm*-*-* target without any patches (at list with gcc-6.2.0).