floating-point - 如何在cygwin中构建软浮点newlib?

标签 floating-point arm embedded elf toolchain

我无法将 newlib-mfloat-abi 默认值从 hard 更改为 soft

这是我如何配置bintutils

 ../configure --target=$ARMTARGET --prefix=$TOOLPATH 
 --enable-interwork --enable-multilib --with-gnu-as 
 --with-gnu-ld --disable-nls --disable-werror --with-float=soft
 --enable-soft-float

海湾合作委员会

 ../configure --target=$ARMTARGET --prefix=$TOOLPATH
 --enable-interwork --enable-multilib --enable-languages="c,c++"
 --with-newlib --without-headers --disable-shared
 --with-gnu-as --with-gnu-ld --with-float=soft  --enable-soft-float 
 --disable-nls --with-gmp=$TOOLPATH --with-mpfr=$TOOLPATH
 --with-mpc=$TOOLPATH --enable-obsolete

newlib

 ../configure --target=$ARMTARGET --prefix=$TOOLPATH 
  --enable-interwork --disable-newlib-supplied-syscalls
  --with-gnu-ld --with-gnu-as --disable-shared
  --with-float=soft --enable-soft-float --disable-nls 
  --enable-newlib-io-long-long --enable-newlib-io-long-double 
  --enable-newlib-io-c99-formats

错误日志

 ..........
arm-softfloat-elf-gcc -B/home/Shadmanov_D/newlib-1.20.0/build/arm-softfloat-      elf/fpu/newlib/ 
-isystem /home/Shadmanov_D/newlib-1.20.0/build/arm-softfloat-elf/fpu/newlib/targ-include -isystem /home/Shadmanov_D/newlib-1.20.0/newlib/libc/include
-B/home/Shadmanov_D/newlib-1.20.0/build/arm-softfloat-elf/fpu/libgloss/arm
-L/home/Shadmanov_D/newlib-1.20.0/build/arm-softfloat-elf/fpu/libgloss/libnosys -L/home/Shadmanov_D/newlib-1.20.0/libgloss/arm 
-mfloat-abi=hard -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"1.20.0\" -DPACKAGE_STRING=\"newlib\ 1.20.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. 
-I../../../../../../newlib/libc/argz -D__NO_SYSCALLS__ 
-fno-builtin      -g -O2  -mfloat-abi=hard -c -o lib_a-dummy.o 
`test -f 'dummy.c' || echo '../../../../../../newlib/libc/argz/'`dummy.c    

Assembler messages:

Error: hard-float conflicts with specified fpu

感谢任何帮助!!

最佳答案

检查arm-elf目标的multilib配置文件,该文件位于${GCC_SRC_DIR}/gcc/config/arm/t-arm-elf

更改以下行(在我的 GCC 版本 4.6.4 上,它们从第 56 行开始):

MULTILIB_OPTIONS       += mfloat-abi=hard
MULTILIB_DIRNAMES      += fpu
MULTILIB_EXCEPTIONS    += *mthumb/*mfloat-abi=hard*

至:

MULTILIB_OPTIONS       += mfloat-abi=soft
MULTILIB_DIRNAMES      += soft

更改后,重新配置并重新编译gcc。

如果此过程不能解决问题,请提供

  • 您使用的 GCC 版本
  • 您的 t-arm-elf 文件
  • 命令的输出arm-softfloat-elf-gcc -print-multi-lib

关于floating-point - 如何在cygwin中构建软浮点newlib?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31838960/

相关文章:

c - 跳转到stm32f4上的第二个固件

c++ - 任何人都知道一个好的地址簿实现?

c - 处理单精度和 double 浮点的 C 代码的正确设计?

c++ - "POR"在嵌入式开发中是什么意思?

java - 使用 Jackson 将 float 格式化为定点

python - 有没有办法在 amd64 架构中安装 Python for ARM?

c - 嵌入式系统 : static or dynamic linking

c - STM32 HAL库RTC闹钟

asp.net - 在 .NET 中检查两个 double 的相等性时出现问题——这个方法有什么问题?

c++ - 几乎均等地拆分 float 而没有损失