arm-none-eabi-g++: error: nano.specs: No such file or directory

最近想使用eclipse+Sourcery对STM32的工程进行编译,使用GNU的新建STM32模板工程,bulid是出现如下错误:

17:00:48 **** Incremental Build of configuration Release for project STM32 ****
cs-make all 
'Building target: STM32.elf'
'Invoking: Cross ARM C++ Linker'
arm-none-eabi-g++ -mcpu=cortex-m3 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -Wextra  -g -T mem.ld -T libs.ld -T sections.ld -nostartfiles -Xlinker --gc-sections -L"../ldscripts" -Wl,-Map,"STM32.map" --specs=nano.specs -o "STM32.elf"  ./system/src/stm32f1-stdperiph/misc.o ./system/src/stm32f1-stdperiph/stm32f10x_gpio.o ./system/src/stm32f1-stdperiph/stm32f10x_rcc.o  ./system/src/newlib/_cxx.o ./system/src/newlib/_exit.o ./system/src/newlib/_sbrk.o ./system/src/newlib/_startup.o ./system/src/newlib/_syscalls.o ./system/src/newlib/assert.o  ./system/src/diag/Trace.o ./system/src/diag/trace_impl.o  ./system/src/cortexm/_initialize_hardware.o ./system/src/cortexm/_reset_hardware.o ./system/src/cortexm/exception_handlers.o  ./system/src/cmsis/system_stm32f10x.o ./system/src/cmsis/vectors_stm32f10x.o  ./src/BlinkLed.o ./src/Timer.o ./src/_write.o ./src/main.o   
arm-none-eabi-g++: error: nano.specs: No such file or directory
cs-make: *** [STM32.elf] Error 1

17:00:54 Build Finished (took 5s.875ms)

搜索这一问题的原因,结果如下:

**** C Libraries usage
+ This toolchain is released with two prebuilt C libraries based on newlib: one is the standard newlib and the other is newlib-nano for code size.
+ To distinguish them, we rename the size optimized libraries as:
  #+BEGIN_EXAMPLE
  libc.a --> libc_s.a
  libg.a --> libg_s.a
  #+END_EXAMPLE  
+ To use newlib-nano, users should provide additional gcc link time option:
  #+BEGIN_EXAMPLE
  --specs=nano.specs
  #+END_EXAMPLE
  + Nano.specs also handles two additional gcc libraries: libstdc++_s.a and libsupc++_s.a, which are optimized for code size.
  + For example:
    #+BEGIN_SRC sh
      arm-none-eabi-gcc src.c --specs=nano.specs $(OTHER_OPTIONS)
    #+END_SRC
  + This option can also work together with other specs options like
    #+BEGIN_EXAMPLE
    --specs=rdimon.specs
    #+END_EXAMPLE
+ Please be noticed that --specs=nano.specs is a linker option. Be sure to include in linker option if compiling and linking are separated.

***** additional newlib-nano libraries usage

Newlib-nano is different from newlib in addition to the libraries' name.
Formatted input/output of floating-point number are implemented as weak symbol.
If you want to use %f, you have to pull in the symbol by explicitly specifying
"-u" command option.
   
  -u _scanf_float
  -u _printf_float

e.g. to output a float, the command line is like: 
$ arm-none-eabi-gcc --specs=nano.specs -u _printf_float $(OTHER_OPTIONS)

For more about the difference and usage, please refer the README.nano in the
source package.

还是没有给出解决的方法,后来发现可在工程设置里面把nano禁止,禁止以后,编译正常。



  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值