bedrocklinux / bedrocklinux-userland

This tracks development for the things such as scripts and (defaults for) config files for Bedrock Linux
https://bedrocklinux.org
GNU General Public License v2.0
611 stars 66 forks source link

Build fails on Fedora 29 due to unusable compiler output #112

Open Skirmisher opened 5 years ago

Skirmisher commented 5 years ago

I'm trying to compile Bedrock Linux 0.7.3 on Fedora 29 to test a minor patch, running make SKIPSIGN=true off of the 0.7 branch. However, nothing that I build with the musl-gcc setup in Bedrock's build environment will execute—all binaries produced simply segfault immediately after execveing.

I tried to investigate, but I'm not familiar with the components involved and I'm a bit out of my depth here. I'd appreciate some pointers on things to check. I'm happy to test possible solutions!

(As a side note, the build failure was a bit confusing at first, as the make recipe continued to build other components even after meson/configure/etc. complained of compiler issues. Some, like busybox, didn't even test at all and finished producing binaries that were completely unusable.)

paradigm commented 5 years ago

Looks like other people on Fedora 29 are running into the same exact problem:

https://www.openwall.com/lists/musl/2019/04/15/3

I was able to reproduce the issue, but a naive attempt to apply the work around specified in the above link with Bedrock's build system failed when trying to build a dependency due to an interaction between the work around and the dependency's build system.

I can try to look into it when I have the time, but my backlog is filled with more pressing issues and I suspect by the time I get around to it Fedora will have updated its binutils to have fixed the issue.

While it's certainly not ideal, in the mean time, the easiest solution is probably to build with another distro. Maybe a chroot or VM.

Skirmisher commented 5 years ago

Aha, that'll do it. Not the first I've heard of a Fedora package breaking...

I can definitely build on something else in the meantime. Thanks for tracking it down!

Skirmisher commented 5 years ago

Tried to apply the patches described in that report today, but I still end up with broken executables in the Bedrock build. binutils 2.32 doesn't fix the issue either.

Mucking around with the linker isn't my specialty, but the only interesting error I saw (besides autotools complaining) was a series of lines like this one: /usr/bin/ld: /home/skirmisher/buildzone/bedrocklinux-userland/build/x86_64/support/lib/libc.a(lite_malloc.o): relocation R_X86_64_32 against '.bss.lock.1878' can not be used when making a shared object; recompile with -fPIC

This one's unrelated, but I'm not sure why it's trying to do this: ln: failed to create symbolic link '/lib/ld-musl-x86_64.so.1.tmp.20472': Permission denied