工具/软件:
我已经对这个问题做了很多研究、这个问题不时出现、解决办法总是确保你 在所有编译和链接步骤中都有-mfloat-abi=hard -mfpu=fpv4-sp-d16 --我还是得到了这个错误。 我遵循了安装随附的 SLAU688.pdf 中的说明。
最近在 openSUSE Tumbleweed 上遇到 CCS12.8.1.00005 问题后、我决定尝试从命令行进行构建、我在 simplelink_msp432p4_sdk_3_40_01_02.ru 中安装了 msp432-gcc-1.2.0.1-linux-x64-support-package-installer.run。 编译器为 arm-none-eabi-gcc (openSUSE 14.2.0-1.77) 14 20241119。
示例的 Makefile 在/usr/bin 中针对 gcc 正确更新、 msp432p401_blinkingLED 示例构建的目标文件就可以正常运行。 但是、在链接上、链接会失败并显示“output/msp432p401_blinkingLED.o 使用 VFP 寄存器参数、output/msp432p401_blinkingLED.out 不使用“
CFLAGS 和 LDFLAGS 都正确具有-mcpu=cortex-M4 -March=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16、因此浮点 ABI 和 FPU 在编译和链接之间保持一致、但仍然是 VFP 错误。 完整 make 输出为:
使 DEVICE=MSP432P401R
========================================
生成输出/msp432p401_blinkingLED.o
/usr/bin/arm-none-eabi-gcc /opt/ti/arm/include/CMSIS /usr/arm-none-eabi/include -mcpu=cortex-M4 -March=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -D__MSP432P401R__-DTARGET_IS_MSP432P4XX -DGCC -g -gstrict-dwarf -wall -ffunction-sections /opt/ti/arm/include
========================================
生成 output/startup_msp432p401r_gcc.o
/usr/bin/arm-none-eabi-gcc /opt/ti/arm/include/CMSIS /usr/arm-none-eabi/include -mcpu=cortex-M4 -March=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-D16 -mthumb -D__MSP432P401R__-DTARGET_IS_MSP432P4XX -DGCC -g -gstrict-dwarf -wall -ffunction-sections /opt/ti/arm/include
========================================
生成 output/system_msp432p401r.o
/usr/bin/arm-none-eabi-gcc /opt/ti/arm/include/CMSIS /usr/arm-none-eabi/include -mcpu=cortex-M4 -March=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -D__MSP432P401R__-DTARGET_IS_MSP432P4XX -DGCC -g -gstrict-dwarf -wall -ffunction-sections /opt/ti/arm/include
========================================
链接对象并生成输出二进制文件
/usr/bin/arm-none-eabi-gcc /opt/ti/arm/include/CMSIS /usr/arm-none-eabi/include -mcpu=cortex-M4 -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-D16 --specs=nosys.specs -mthumb -D__MSP432P401R__-DTARGET_is_MSP432P4XX /opt/ti/arm/include
/usr/lib64/gcc/arm-none-eabi/14/../../../../arm-none-eabi/bin/ld:/usr/lib64/gcc/arm-none-eabi/14/../../../../arm-none-eabi/lib/libc.a (libc_a-close_r'):在函数`_close_r'中:
/home/abuild/rpmbuild/BUILD/cross-arm-none-eabi-newlib-4.4.0-build/newlib-cygwin/build-newlib/arm-none-eabi/newlib/../../../newlib/libc/reent/closer.c:47:(.text+0x18):警告:_Close 未实现并且始终失败
/usr/lib64/gcc/arm-none-eabi/14/../../../../arm-none-eabi/bin/ld:/usr/lib64/gcc/arm-none-eabi/14/../../../../arm-none-eabi/lib/libc.a (libc_a-lseekr.o):在函数`_lseek_r'中:
/home/abuild/rpmbuild/BUILD/cross-arm-none-eabi-newlib-4.4.0-build/newlib-cygwin/build-newlib/arm-none-eabi/newlib/../../../newlib/libc/reent/lseekr.c:49:(.text+0x24):警告:_lseek 未实现、始终失败
/usr/lib64/gcc/arm-none-eabi/14/../../../../arm-none-eabi/bin/ld:/usr/lib64/gcc/arm-none-eabi/14/../../../../arm-none-eabi/lib/libc.a (libc_a-readr.o):在函数`_read_r'中:
/home/abuild/rpmbuild/BUILD/cross-arm-none-eabi-newlib-4.4.0-build/newlib-cygwin/build-newlib/arm-none-eabi/newlib/../../../newlib/libc/reent/readr.c:49:(.text+0x24):警告:未实现_Read、将始终失败
/usr/lib64/gcc/arm-none-eabi/14/../../../../arm-none-eabi/bin/ld:/usr/lib64/gcc/arm-none-eabi/14/../../../../arm-none-eabi/lib/libc.a (libc_a-writer.o):在函数`_write_r'中:
/home/abuild/rpmbuild/BUILD/cross-arm-none-eabi-newlib-4.4.0-build/newlib-cygwin/build-newlib/arm-none-eabi/newlib/../../../newlib/libc/reent/writer.c:49:(.text+0x24):警告:_write 未实现、始终失败
/usr/lib64/gcc/arm-none-eabi/14/../../../../arm-none-eabi/bin/ld:错误:output/msp432p401_blinkingLED.o 使用 VFP 寄存器参数、output/msp432p401_blinkingLED.out 不使用
/usr/lib64/gcc/arm-none-eabi/14/../../../../arm-none-eabi/bin/ld:无法合并文件输出/msp432p401_blinkingLED.o 的目标特定数据
/usr/lib64/gcc/arm-none-eabi/14/../../../../arm-none-eabi/bin/ld:错误:output/startup_msp432p401r_gcc.o 使用 VFP 寄存器参数、output/msp432p401_blinkingLED.out 不使用
/usr/lib64/gcc/arm-none-eabi/14/../../../../arm-none-eabi/bin/ld:无法合并文件输出/startup_msp432p401r_gcc.o 的目标特定数据
/usr/lib64/gcc/arm-none-eabi/14/../../../../arm-none-eabi/bin/ld:错误:output/system_msp432p401r.o 使用 VFP 寄存器参数、output/msp432p401_blinkingLED.out 不使用
/usr/lib64/gcc/arm-none-eabi/14/../../../../arm-none-eabi/bin/ld:无法合并文件输出/system_msp432p401r.o 的目标特定数据
collect2:错误:LD 返回 1 个退出状态
make:***[Makefile:82:output/msp432p401_blinkingLED.out] Error 1.
在我研究的所有其他链接中、这个问题是编译为 float-abi=soft 的一部分、导致使用 VFP 寄存器导致错误。 (例如 stackoverflow.com/.../3422102 和 dot.o 使用 VFP 寄存器参数、但不使用 dot.out) 、在这里似乎不是这样。 我无法找到解决方案。 如有任何帮助、我们将不胜感激。
============= 更新===============
如果我省略所有浮点选项、只让编译器使用其“auto"默认“默认值、那么编译和链接就可以正常工作、例如
/usr/bin/arm-none-eabi-gcc -mcpu=cortex-M4 -March=armv7e-m -mthumb -D__MSP432P401R__-DTARGET_IS_MSP432P4XX -DGCC -g -gstrict-dwarf -wall -ffunction-sections -Fdata-sections -md -std=c99 -i/opt/ti/arm/include/mspingi/
这是工具链中的一个错误吗 ?当工具链使用--enable-multilib 构建时、为编译和链接指定-mfloat-abi=hard -mfpu=fpv4-sp-d16 会导致编译和链接阶段之间发生冲突? 这一直很令人困惑。
============= 更新===============
配套 GNU Arm 工具链错误字段: bugs.launchpad.net/.../2126618