This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

multiple definition of `__stack_chk_fail'

Hi,
I am trying to migrate GCC from 7.2.1 to 8.3.
To do so, I took the prebuilt binaries from your website
developer.arm.com/.../downloads

I used to take the packages from Linaro in the past.
I am using the bare metal binaries for AArch64.
I have the following link error:
gcc-arm-8.3-2019.03-x86_64-aarch64-elf/bin/../lib/gcc/aarch64-elf/8.3.0/../../../../aarch64-elf/bin/ld: gcc-arm-8.3-2019.03-x86_64-aarch64-elf/bin/../lib/gcc/aarch64-elf/8.3.0/../../../../aarch64-elf/lib/libc.a(lib_a-stack_protector.o): in function `__stack_chk_fail':
/tmp/dgboter/bbs/rhev-vm2--rhe6x86_64/buildbot/rhe6x86_64--aarch64-elf/build/src/newlib-cygwin/newlib/libc/ssp/stack_protector.c:32: multiple definition of `__stack_chk_fail'; /tlCrt0Init.S.o:(.text.__stack_chk_fail+0x0): first defined here

In our code, it is true that we define __stack_chk_fail() because it is a bare metal implementation and we need to do something really specific to our environment.
In the libc.a provided by Linaro in 7.2.1, this function for the stack protection was not defined.
I guess that the developers had to link with libssp.a.
I have to link with the libc because I need memcmp, memcpy but I don't want the default implementation of the SSP hooks.
Do you have any advice? Is it intended?

Thank you,
Alexandre.