のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

STM32CubeIde "--specs=rdimon.specs"を追加したら、”multiple definition”のエラーになった。

"--specs=rdimon.specs"を追加したら、multiple definitionのエラーになった。

arm-none-eabi-gcc -o "Nucleo-F429ZI.elf" @"objects.list"  -lrdimon -mcpu=cortex-m4 -T"C:\Users\m_fujii\Documents\0500_BitBucket\0600_STM32CubeIde\ws_1.0.1\Nucleo-F429ZI\STM32F429ZITX_FLASH.ld"
 --specs=nosys.specs -Wl,-Map="Nucleo-F429ZI.map" 
-Wl,--gc-sections -static 
--specs=rdimon.specs --specs=nano.specs 
-mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
c:/st/stm32cubeide_1.0.1/stm32cubeide/plugins/
com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610
/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../
arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\
librdimon_nano.a(rdimon-syscalls.o): In function `_lseek':
librdimon_nano.a(rdimon-syscalls.o): In function `_lseek':
syscalls.c:(.text._lseek+0x0): multiple definition of `_lseek'
Nucleo-F429ZI/Debug/../Src/syscalls.c:135: first defined here

librdimon_nano.a(rdimon-syscalls.o): In function `_close':
syscalls.c:(.text._close+0x0): multiple definition of `_close'
Nucleo-F429ZI/Debug/../Src/syscalls.c:118: first defined here

librdimon_nano.a(rdimon-syscalls.o): In function `_open':
syscalls.c:(.text._open+0x0): multiple definition of `_open'
Nucleo-F429ZI/Debug/../Src/syscalls.c:140: first defined here

librdimon_nano.a(rdimon-syscalls.o): In function `initialise_monitor_handles':
syscalls.c:(.text.initialise_monitor_handles+0x0): multiple definition of `initialise_monitor_handles'
Nucleo-F429ZI/Debug/../Src/syscalls.c:74: first defined here

librdimon_nano.a(rdimon-syscalls.o): In function `_unlink':
syscalls.c:(.text._unlink+0x0): multiple definition of `_unlink'
Nucleo-F429ZI/Debug/../Src/syscalls.c:152: first defined here

librdimon_nano.a(rdimon-syscalls.o): In function `_times':
syscalls.c:(.text._times+0x0): multiple definition of `_times'
Nucleo-F429ZI/Debug/../Src/syscalls.c:158: first defined here

librdimon_nano.a(rdimon-syscalls.o): In function `_isatty':
syscalls.c:(.text._isatty+0x0): multiple definition of `_isatty'
Nucleo-F429ZI/Debug/../Src/syscalls.c:130: first defined here

collect2.exe: error: ld returned 1 exit status
make: *** [makefile:48: Nucleo-F429ZI.elf] Error 1
"make -j4 all" terminated with exit code 2. Build might be incomplete.

src/syscall.cをフィルタしたら、エラーが出なくなった。

f:id:none53:20190711075158p:plain
src/syscall.c

https://yukblog.net/stm32cubeide-printf-semihosting/