Multiple definition of `__aeabi_dadd'

Hello everyone,

I'm developing on a cortex-M4 STM32. I have a firmware build with arm-none-eabi-gcc and CMake.
I want to add a new static librairy compiled with rust. I use the toolchain thumbv7em-none-eab and declare my crate with: crate-type = ["staticlib"].

When I link the new librairy to the firmware I get this error:
multiple definition of `__aeabi_dadd'

This symbol are present in libgcc.a and my_new_lib_build_with_rust.a.

Is it possible to link a library build with rustc on a firmware build with arm-none-eabi-gcc?

Thanks.

The full error message:
[build] gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mthumb-interwork -u _printf_float ... && :

[build] gcc-arm-none-eabi-7-2018-q2-update/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/libgcc.a(_arm_addsubdf3.o): In function `__aeabi_dadd':

[build] (.text+0xc): multiple definition of `__aeabi_dadd'

[build] my_new_lib_build_with_rust.a(compiler_builtins-e863dc8472f62cb3.compiler_builtins.7tbkidit-cgu.146.rcgu.o):/cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.39/src/macros.rs:226: first defined here

[build] gcc-arm-none-eabi-7-2018-q2-update/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/libgcc.a(_arm_addsubdf3.o): In function `__aeabi_f2d':

[build] (.text+0x2c8): multiple definition of `__aeabi_f2d'

[build] my_new_lib_build_with_rust.a(compiler_builtins-e863dc8472f62cb3.compiler_builtins.7tbkidit-cgu.162.rcgu.o):/rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/core/src/ops/bit.rs:160: first defined here

[build] gcc-arm-none-eabi-7-2018-q2-update/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/libgcc.a(_arm_muldivdf3.o): In function `__aeabi_ddiv':

[build] (.text+0x254): multiple definition of `__aeabi_ddiv'

[build] my_new_lib_build_with_rust.a(compiler_builtins-e863dc8472f62cb3.compiler_builtins.7tbkidit-cgu.158.rcgu.o):/cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.39/src/macros.rs:226: first defined here

[build] collect2: error: ld returned 1 exit status

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.