You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to integrate a rust module in my c based project based on this example.
I got a whole lot of multiple definition errors in low level function calls.:
[100%] Linking CXX executable esp32-hello-rust.elf
/home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/rustlib/target/xtensa-esp32-espidf/release/librustlib.a(compiler_builtins-8efe5aa9d251e5ee.compiler_builtins.69fa668e5acca28c-cgu.1.rcgu.o): in function `__adddf3':
/home/peter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.105/src/macros.rs:499: multiple definition of `__adddf3'; /home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/esp32/no-rtti/libgcc.a(_addsubdf3.o):/builds/idf/crosstool-NG/.build/xtensa-esp-elf/src/gcc/libgcc/config/xtensa/ieee754-df.S:100: first defined here
/home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/rustlib/target/xtensa-esp32-espidf/release/librustlib.a(compiler_builtins-8efe5aa9d251e5ee.compiler_builtins.69fa668e5acca28c-cgu.1.rcgu.o): in function `__floatunsidf':
/home/peter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.105/src/macros.rs:499: multiple definition of `__floatunsidf'; /home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/esp32/no-rtti/libgcc.a(_floatsidf.o):/builds/idf/crosstool-NG/.build/xtensa-esp-elf/src/gcc/libgcc/config/xtensa/ieee754-df.S:2143: first defined here
/home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/rustlib/target/xtensa-esp32-espidf/release/librustlib.a(compiler_builtins-8efe5aa9d251e5ee.compiler_builtins.69fa668e5acca28c-cgu.1.rcgu.o): in function `__floatsidf':
/home/peter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.105/src/macros.rs:499: multiple definition of `__floatsidf'; /home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/esp32/no-rtti/libgcc.a(_floatsidf.o):/builds/idf/crosstool-NG/.build/xtensa-esp-elf/src/gcc/libgcc/config/xtensa/ieee754-df.S:2154: first defined here
/home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/rustlib/target/xtensa-esp32-espidf/release/librustlib.a(compiler_builtins-8efe5aa9d251e5ee.compiler_builtins.69fa668e5acca28c-cgu.1.rcgu.o): in function `__fixunsdfsi':
/home/peter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.105/src/macros.rs:499: multiple definition of `__fixunsdfsi'; /home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/esp32/no-rtti/libgcc.a(_fixunsdfsi.o):/builds/idf/crosstool-NG/.build/xtensa-esp-elf/src/gcc/libgcc/config/xtensa/ieee754-df.S:1999: first defined here
/home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/rustlib/target/xtensa-esp32-espidf/release/librustlib.a(compiler_builtins-8efe5aa9d251e5ee.compiler_builtins.69fa668e5acca28c-cgu.1.rcgu.o): in function `__fixdfsi':
/home/peter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.105/src/macros.rs:499: multiple definition of `__fixdfsi'; /home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/esp32/no-rtti/libgcc.a(_fixdfsi.o):/builds/idf/crosstool-NG/.build/xtensa-esp-elf/src/gcc/libgcc/config/xtensa/ieee754-df.S:1872: first defined here
/home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/rustlib/target/xtensa-esp32-espidf/release/librustlib.a(compiler_builtins-8efe5aa9d251e5ee.compiler_builtins.69fa668e5acca28c-cgu.1.rcgu.o): in function `__divsf3':
/home/peter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.105/src/macros.rs:499: multiple definition of `__divsf3'; /home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/esp32/no-rtti/libgcc.a(_divsf3.o):/builds/idf/crosstool-NG/.build/xtensa-esp-elf/src/gcc/libgcc/config/xtensa/ieee754-sf.S:912: first defined here
/home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/rustlib/target/xtensa-esp32-espidf/release/librustlib.a(compiler_builtins-8efe5aa9d251e5ee.compiler_builtins.69fa668e5acca28c-cgu.1.rcgu.o): in function `__divdf3':
/home/peter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.105/src/macros.rs:499: multiple definition of `__divdf3'; /home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/esp32/no-rtti/libgcc.a(_divdf3.o):/builds/idf/crosstool-NG/.build/xtensa-esp-elf/src/gcc/libgcc/config/xtensa/ieee754-df.S:1421: first defined here
/home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/rustlib/target/xtensa-esp32-espidf/release/librustlib.a(compiler_builtins-8efe5aa9d251e5ee.compiler_builtins.69fa668e5acca28c-cgu.1.rcgu.o): in function `__extendsfdf2':
/home/peter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.105/src/macros.rs:499: multiple definition of `__extendsfdf2'; /home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/esp32/no-rtti/libgcc.a(_extendsfdf2.o):/builds/idf/crosstool-NG/.build/xtensa-esp-elf/src/gcc/libgcc/config/xtensa/ieee754-df.S:2402: first defined here
/home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/rustlib/target/xtensa-esp32-espidf/release/librustlib.a(compiler_builtins-8efe5aa9d251e5ee.compiler_builtins.69fa668e5acca28c-cgu.1.rcgu.o): in function `__muldf3':
/home/peter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.105/src/macros.rs:499: multiple definition of `__muldf3'; /home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/esp32/no-rtti/libgcc.a(_muldf3.o):/builds/idf/crosstool-NG/.build/xtensa-esp-elf/src/gcc/libgcc/config/xtensa/ieee754-df.S:763: first defined here
/home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/rustlib/target/xtensa-esp32-espidf/release/librustlib.a(compiler_builtins-8efe5aa9d251e5ee.compiler_builtins.69fa668e5acca28c-cgu.1.rcgu.o): in function `__subdf3':
/home/peter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.105/src/macros.rs:499: multiple definition of `__subdf3'; /home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/esp32/no-rtti/libgcc.a(_addsubdf3.o):/builds/idf/crosstool-NG/.build/xtensa-esp-elf/src/gcc/libgcc/config/xtensa/ieee754-df.S:362: first defined here
/home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/rustlib/target/xtensa-esp32-espidf/release/librustlib.a(compiler_builtins-8efe5aa9d251e5ee.compiler_builtins.69fa668e5acca28c-cgu.1.rcgu.o): in function `__divdi3':
/home/peter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.105/src/macros.rs:499: multiple definition of `__divdi3'; /home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/esp32/no-rtti/libgcc.a(_divdi3.o):/builds/idf/crosstool-NG/.build/xtensa-esp-elf/src/gcc/libgcc/libgcc2.c:1212: first defined here
/home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/rustlib/target/xtensa-esp32-espidf/release/librustlib.a(compiler_builtins-8efe5aa9d251e5ee.compiler_builtins.69fa668e5acca28c-cgu.1.rcgu.o): in function `__moddi3':
/home/peter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.105/src/macros.rs:499: multiple definition of `__moddi3'; /home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/esp32/no-rtti/libgcc.a(_moddi3.o):/builds/idf/crosstool-NG/.build/xtensa-esp-elf/src/gcc/libgcc/libgcc2.c:1236: first defined here
/home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/rustlib/target/xtensa-esp32-espidf/release/librustlib.a(compiler_builtins-8efe5aa9d251e5ee.compiler_builtins.69fa668e5acca28c-cgu.1.rcgu.o): in function `__udivdi3':
/home/peter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.105/src/macros.rs:499: multiple definition of `__udivdi3'; /home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/esp32/no-rtti/libgcc.a(_udivdi3.o):/builds/idf/crosstool-NG/.build/xtensa-esp-elf/src/gcc/libgcc/libgcc2.c:1299: first defined here
/home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/rustlib/target/xtensa-esp32-espidf/release/librustlib.a(compiler_builtins-8efe5aa9d251e5ee.compiler_builtins.69fa668e5acca28c-cgu.1.rcgu.o): in function `__umoddi3':
/home/peter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.105/src/macros.rs:499: multiple definition of `__umoddi3'; /home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/esp32/no-rtti/libgcc.a(_umoddi3.o):/builds/idf/crosstool-NG/.build/xtensa-esp-elf/src/gcc/libgcc/libgcc2.c:1287: first defined here
/home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: warning: /home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/esp32/no-rtti/crtn.o: missing .note.GNU-stack section implies executable stack
/home/peter/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/esp32-hello-rust.elf.dir/build.make:490: esp32-hello-rust.elf] Error 1
make[1]: *** [CMakeFiles/Makefile2:2084: CMakeFiles/esp32-hello-rust.elf.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
make failed with exit code 2, output of the command is in the /home/peter/data/code/rust-esp32-example/build/log/idf_py_stderr_output_3024475 and /home/peter/data/code/rust-esp32-example/build/log/idf_py_stdout_output_3024475
I spend some time debugging and in the end found the combination that made the problems.
removing clib as i do not need to call c from my rust code and enabling bt as i need that in my project. See diff below:
I tried to integrate a rust module in my c based project based on this example.
I got a whole lot of multiple definition errors in low level function calls.:
I spend some time debugging and in the end found the combination that made the problems.
removing clib as i do not need to call c from my rust code and enabling bt as i need that in my project. See diff below:
Can you help me understand if im doing something wrong or if there is a problem in the esp code somewhere
The text was updated successfully, but these errors were encountered: