build-stage0 fails on fedora
I'm returning to sabotage :), I got fedora 22 to build it. The version of gcc is 5.1.1 (I couldn't get an older), and I installed glibc-static.
It fails to build stage0_musl (in the moment of linking), the error message on the log is:
rm -f lib/libc.a
ar rc lib/libc.a src/aio/aio.o src/aio/aio_suspend.o src/aio/lio_listio.o src/complex/__cexp.o src/complex/__cexpf.o src/complex/cabs.o src/complex/cabsf.o src/comp$
/bin/ld: src/env/__init_tls.lo: relocation R_X86_64_PC32 against symbol `__libc' can not be used when making a shared object; recompile with -fPIC
/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
Makefile:149: recipe for target 'lib/libc.so' failed
make: *** [lib/libc.so] Error 1
make: *** Waiting for unfinished jobs....
I would like to solve this problem before trying to build in another distro, I couldn't figure why its showing up. Could you guys help?
hmm maybe try adding -fPIC to the CFLAGS used by stage0_musl
added 'echo "CFLAGS += -fPIC" >> config.mak' to pkg/stage0_musl, and it still the same error.
Am I doing something wrong?
can you post the build log somewhere ? pastebin oslt
the error is possibly due to a parrallel build issue
as an easy fix you could change the line
make -j$MAKE_THREADS to
Here is the source of the problem:
src/internal/libc.c:10: warning: visibility attribute not supported in this configuration; ignored
For building a shared libc.so, musl requires support for visibility. Originally there were workarounds for the case where the compiler doesn't support it, but they were removed since builds without visibility support would necessarily have ABI-breakage-type bugs anyway.
Sabotage is using gcc 3.4.6 for the bootstrap, right? This versions supports visibility just fine, but probably does something stupid to break it when --disable-shared is used.
Can you recommend me another way to get sabotage compiled and running?
yes, you can use musl-cross to "crosscompile" stage1 like its described in the readme. then you can use enter-chroot as usual to build stuff in the chroot.
(note that your problem is quite weird; build-stage0 builds gcc3.4.6 and then compiles musl with it, so the result should be 100% reproducible. may it be that the binutils version of your system causes the issue ? or did you set A to something else (like i386) when you actually wanted to build for x86_64 ? could be helpful if you paste your config)
I'm sure I didn't messed the config file, I retried the process lots of times.
Any way, I got ubuntu and compiled it without problems, couldn't wait for the solution on fedora. The gcc version here is 4.8.4.
If it was a compiler problem, this problem may appear here again in the future.
Deleting a branch is permanent. It CANNOT be undone. Continue?