【问题标题】:How to build soft-float newlib in cygwin?如何在 cygwin 中构建软浮点 newlib?
【发布时间】:2015-08-05 17:21:19
【问题描述】:

对于 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

任何帮助表示赞赏!

【问题讨论】:

    标签: floating-point arm embedded elf toolchain


    【解决方案1】:

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

    更改以下行(它们从我拥有的 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的输出

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-09-05
      • 1970-01-01
      • 2018-10-13
      • 1970-01-01
      • 2017-11-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多