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

baselibc: Fix fflush duplicate error #3121

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

kasjer
Copy link
Contributor

@kasjer kasjer commented Dec 12, 2023

This tries to fix error:
Linking review/bin/targets/nordic_pca10056-auracast_usb/app/@apache-mynewt-nimble/apps/auracast_usb/auracast_usb.elf Error: Arm GNU Toolchain arm-none-eabi/13.2 Rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: Arm GNU Toolchain arm-none-eabi/13.2 Rel1/bin/../lib/gcc/arm-none- eabi/13.2.1/thumb/v7e-m/nofp\libg.a(libc_a-fflush.o): in function fflush': fflush.c:(.text.fflush+0x0): multiple definition of fflush'; review/bin/targets/nordic_pca10056-auracast_usb/app/@apache-mynewt-core/libc/baselibc/@apache-mynewt-core_libc_baselibc.a(mynewt.o):review/repos/apache-mynewt-core/libc/baselibc/src/mynewt.c:54: first defined here

fflush is not used anywhere in the code but for some reason gcc 12 and 13 complains about duplicate. When baselibc version of fflush is removed code compiles and links without problem and final elf does not have fflush from libc_a-fflush.o.

@kasjer kasjer requested a review from sjanc December 12, 2023 13:57
@sjanc sjanc self-requested a review December 12, 2023 14:10
This tries to fix error:
Linking review/bin/targets/nordic_pca10056-auracast_usb/app/@apache-mynewt-nimble/apps/auracast_usb/auracast_usb.elf
Error: Arm GNU Toolchain arm-none-eabi/13.2 Rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: Arm GNU Toolchain arm-none-eabi/13.2 Rel1/bin/../lib/gcc/arm-none-
eabi/13.2.1/thumb/v7e-m/nofp\libg.a(libc_a-fflush.o): in function `fflush':
fflush.c:(.text.fflush+0x0): multiple definition of `fflush'; review/bin/targets/nordic_pca10056-auracast_usb/app/@apache-mynewt-core/libc/baselibc/@apache-mynewt-core_libc_baselibc.a(mynewt.o):review/repos/apache-mynewt-core/libc/baselibc/src/mynewt.c:54: first defined here

fflush is not used anywhere in the code but for some reason gcc 12 and 13 complains about
duplicate. When baselibc version of fflush is removed code compiles and links without
problem and final elf does not have fflush from libc_a-fflush.o.

Now fflush is weak so linker will take other version when needed.
This is workaround till batter solution is found.
@kasjer kasjer merged commit 4cdfda9 into apache:master Jan 4, 2024
15 checks passed
@kasjer kasjer deleted the kasjer/baselibc-fflush-fix branch January 4, 2024 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants