richfelker / musl-cross-make

Simple makefile-based build for musl cross compiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

DubbleClick opened this issue · comments

(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 with CFLAGS="-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.

Did you ever figure it out?

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.

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.