Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linking trouble #4

Open
anonizmous opened this issue Apr 22, 2020 · 1 comment
Open

linking trouble #4

anonizmous opened this issue Apr 22, 2020 · 1 comment
Assignees

Comments

@anonizmous
Copy link

доброго времени!
не подскажете в чем может быть причина ошибки:

[100%] Linking C executable z.elf
/usr/bin/cmake -E cmake_link_script CMakeFiles/z.elf.dir/link.txt --verbose=1
arm-none-eabi-gcc  -specs=nosys.specs -T/home/valik/t/z/STM32F103C8Tx_FLASH.ld -lc -lm -lnosys -Wl,--gc-sections -u _printf_float -Wl,--print-memory-usage -mcpu=cortex-m3 -mthumb    -O0 -Wall -fdata-sections -ffunction-sections -dM -fno-common -fshort-enums CMakeFiles/z.elf.dir/Src/gpio.c.o CMakeFiles/z.elf.dir/Src/main.c.o CMakeFiles/z.elf.dir/Src/stm32f1xx_hal_msp.c.o CMakeFiles/z.elf.dir/Src/stm32f1xx_it.c.o CMakeFiles/z.elf.dir/Src/syscalls.c.o CMakeFiles/z.elf.dir/Src/system_stm32f1xx.c.o CMakeFiles/z.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c.o CMakeFiles/z.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c.o CMakeFiles/z.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c.o CMakeFiles/z.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c.o CMakeFiles/z.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c.o CMakeFiles/z.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c.o CMakeFiles/z.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c.o CMakeFiles/z.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c.o CMakeFiles/z.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c.o CMakeFiles/z.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c.o CMakeFiles/z.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c.o CMakeFiles/z.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c.o CMakeFiles/z.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c.o CMakeFiles/z.elf.dir/startup_stm32f103xb.s.o -o z.elf 
Memory region         Used Size  Region Size  %age Used
             RAM:        2688 B        20 KB     13.12%
           FLASH:        6640 B        64 KB     10.13%
/usr/lib/gcc/arm-none-eabi/9.3.0/../../../../arm-none-eabi/bin/ld: CMakeFiles/z.elf.dir/Src/syscalls.c.o: in function `_exit':
/home/valik/t/z/Src/syscalls.c:89: multiple definition of `_exit'; /usr/lib/gcc/arm-none-eabi/9.3.0/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libnosys.a(_exit.o):_exit.c:(.text._exit+0x0): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/z.elf.dir/build.make:381: z.elf] Ошибка 1
make[2]: выход из каталога «/home/valik/t/z/build»
make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/z.elf.dir/all] Ошибка 2
make[1]: выход из каталога «/home/valik/t/z/build»
make: *** [Makefile:104: all] Ошибка 2
[valik@valik-nout build]$ 

спасибо!

@SL-RU
Copy link
Owner

SL-RU commented Apr 22, 2020

Добрый вечер, из-за файла syscalls.c, в нём дублируются функции, объявленные в libnosys, которая уже подключена к проекту. Его нужно исключить из проекта удалив или добавив в CMakeIgnore.txt

@SL-RU SL-RU self-assigned this Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants