richfelker / musl-cross-make

Simple makefile-based build for musl cross compiler
MIT License
1.27k stars 258 forks source link

Creating native compiler fails (x86-64 RHEL 9.2, x86-64 Alpine) #175

Closed DubbleClick closed 5 months ago

DubbleClick commented 11 months ago

(GCC version set to 11.2.0)

I can create a cross compiler for x86_64 using CFLAGS="-fPIE" make install TARGET=x86_64-linux-musl -j. I then move the output folder to /usr/local/musl and export PATH=/usr/local/musl/bin:$PATH". Attempting to compile a native compiler withCFLAGS="-fPIE" make install TARGET=x86_64-linux-musl NATIVE=y -j` fails however, with various errors.

I just want a gcc/g++ toolchain targeting musl libraries. I do not plan on cross-compiling. I would use the pre-compiled ones on https://musl.cc, but when compiling php with intl, it causes a segmentation fault somewhere in the musl libraries. This problem does not exist when building this repo myself.

casimcdaniels commented 5 months ago

Did you ever figure it out?

DubbleClick commented 5 months ago

Yes, after it fails you can find error messages in a gcc config.log. Something about calloc being poisoned. Removing that from gcc source makes compilation run through.

Wasn't an issue when using GCC 13 anymore, by the way, but you'll have to patch the repo with the new checksum.

DubbleClick commented 5 months ago

Oh wait, this was the runtime issue after it successfully built: no, never figured it out. Rebuilding with newer versions and installing musl libraries fixed that.