mold icon indicating copy to clipboard operation
mold copied to clipboard

Linking musl-1.2.3 with mold-1.10.1 produces a non-working binary leading to various errors and segmenation faults

Open ernsteiswuerfel opened this issue 2 years ago • 1 comments

On Gentoo I run some boxes with musl as system C-library instead of glibc. This is profile [32] default/linux/amd64/17.0/musl (dev) * Building almost all of the binaries with mold as system-wide-linker went fine.

However there seems to be a severe problem when building sys-libs/musl-1.2.3-r7 itself with mold. The build itself runs fine (1st log) but as soon as the mold-built libc is in place I get severe runtime errors and segmentation faults all over, e.g. emerging musl a 2nd time does net work, shutdown -r now does not work stating that the binary shutdown cannot be executed, etc...

I needed to copy over a bfd-built libc.so and libc.a from another partition to /usr/lib/ and rebuilt musl with bfd to get things fully working again.

musl-1.2.3-r7:20230210-112323_1st.log musl-1.2.3-r7:20230210-113944_2nd.log mold_libc.tar.gz bfd_libc.tar.gz

ernsteiswuerfel avatar Feb 10 '23 12:02 ernsteiswuerfel

Can't reproduce musl-1.2.5 builds and runs fine inside a chroot

zyxhere avatar May 24 '25 17:05 zyxhere