nano lib problem

Asked by Jonathan Dumaresq

Hi,

I try to use the new 4.7 with spec.nano key work without success.

here the linking command line used.

Invoking: ARM Summon Windows GCC C++ Linker
arm-none-eabi-g++ -T"C:\projects\MT_COMMON\LINKER_FILES\stm32_1024K_192K_PL_BL_CCM.ld" -Xlinker --gc-sections -Wl,-Map,out.map -Xlinker --cref -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g3 -gdwarf-2 -o "test.elf" ./UTILITIES/cruntime_opt.o ./UTILITIES/guid.o ./UTILITIES/printf-stdarg.o ./UTILITIES/serialM4.o ./UTILITIES/syscalls.o ./UTILITIES/system_stm32f0xx.o ./CONF/stm32f4xx_it.o --specs=nano.specs
c:/program files/gnu tools arm embedded/4.7 2012q4/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/armv7e-m/fpu\libc.a(lib_a-mallocr.o): In function `_malloc_r':
mallocr.c:(.text._malloc_r+0x0): multiple definition of `_malloc_r'
c:/program files/gnu tools arm embedded/4.7 2012q4/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/armv7e-m/fpu\libc_s.a(lib_a-mallocr.o):mallocr.c:(.text._malloc_r+0x0): first defined here
collect2.exe: error: ld returned 1 exit status

Should Set something else in my linker command line to not pull both libs ?

Jonathan

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
Jonathan Dumaresq
Solved:
Last query:
Last reply:
Revision history for this message
Jonathan Dumaresq (jdumaresq) said :
#1

Ok, I fond the problem,

I use an internal variable of malloc in my code. This implied the import of the libc. probably because the _s doesn't have the same var name.

I close this one.