如何在cygwin中构建soft-float newlib?

时间:2015-08-05 17:21:19

标签: 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

GCC

 ../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

任何帮助表示赞赏!!

1 个答案:

答案 0 :(得分:2)

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

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

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
  • 的输出
相关问题