rui314 / mold

Mold: A Modern Linker 🦠
MIT License
13.68k stars 448 forks source link

[arm32] error: duplicate symbol #552

Open lancethepants opened 2 years ago

lancethepants commented 2 years ago

While cross-compiling gcc for armv7 I get the following linking error.

mold: error: duplicate symbol: /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/sysroot/usr/lib/uclibc_nonshared.a(aeabi_unwind_cpp_pr1.o): /opt/tomatoware/arm-soft-mmc/lib/gcc/arm-tomatoware-linux-uclibcgnueabi/12.1.0/libgcc_eh.a(unwind-arm.o): __aeabi_unwind_cpp_pr0

The two libraries (libgcc_eh.a & uclibc_nonshared.a) come from the toolchain. I don't experience this issue with bfd, gold, or lld https://github.com/lancethepants/tomatoware is the project.

I've attached the two libraries if that's helpful at all.

https://github.com/rui314/mold/commit/52943009b7dce4a0ebb5943092d47e6e33625401 fixed all other issues I was experiencing.

libs.zip

rui314 commented 1 year ago

I have difficulty reproducing the issue as your project is huge. I wonder if you could reduce it to a smaller test case, like just cross-compiling gcc on a generic Ubuntu machine.