I'm building a native musl compiler (GCC 8.3.0) with a cross musl compiler (same version) and I'm getting this error:
In file included from /usr/local/x86_64-cros-linux-musl/include/pthread.h:30,
from /usr/local/x86_64-cros-linux-musl/lib/gcc/x86_64-cros-linux-musl/8.3.0/include/c++/x86_64-cros-linux-musl/bits/gthr-default.h:35,
from /usr/local/x86_64-cros-linux-musl/lib/gcc/x86_64-cros-linux-musl/8.3.0/include/c++/x86_64-cros-linux-musl/bits/gthr.h:148,
from /usr/local/x86_64-cros-linux-musl/lib/gcc/x86_64-cros-linux-musl/8.3.0/include/c++/ext/atomicity.h:35,
from /usr/local/x86_64-cros-linux-musl/lib/gcc/x86_64-cros-linux-musl/8.3.0/include/c++/bits/basic_string.h:39,
from /usr/local/x86_64-cros-linux-musl/lib/gcc/x86_64-cros-linux-musl/8.3.0/include/c++/string:52,
from ../../gcc-8.3.0/gcc/brig/brigfrontend/brig-to-generic.h:25,
from ../../gcc-8.3.0/gcc/brig/brig-lang.c:46:
/usr/local/x86_64-cros-linux-musl/include/sched.h:76:7: error: attempt to use poisoned "calloc"
void *calloc(size_t, size_t);
^
/usr/local/x86_64-cros-linux-musl/include/sched.h:116:36: error: attempt to use poisoned "calloc"
#define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
^
Any ideas on how to circumvent this?
Details:
target/host triple: x86_64-linux-musl
musl version: 1.1.21
I've applied the musl patches here: http://port70.net/~nsz/musl/gcc-8.2.0/
And I've run this command while in the source directory:
sed -e '/m64=/s/lib64/lib/' -i gcc/config/i386/t-linux64
So I'm going to just go ahead and assume that #pragma poison calloc
is in your header files rather than in system header files.
Recommended general solution: include all system headers before using #pragma poison
; this can get tricky when multiple program headers but it really needs to be done.
The alternative is to just up and remove #pragma poison
from the source code and the safeguard with it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With