musl-cross-make icon indicating copy to clipboard operation
musl-cross-make copied to clipboard

Build failure: x86_64-apple-darwin18.7.0 -> mipsel-linux-muslsf

Open inferiorhumanorgans opened this issue 2 years ago • 8 comments

Checking multilib configuration for libgcc...
# If this is the top-level multilib, build all the other
# multilibs.
Mode = sf\|df
Suffix = si\|2\|3
/Users/alex/musl-cross-make/build/local/mipsel-linux-musl/obj_gcc/./gcc/xgcc -B/Users/alex/musl-cross-make/build/local/mipsel-linux-musl/obj_gcc/./gcc/ -B/mipsel-linux-musl/bin/ -B/mipsel-linux-musl/lib/ -isystem /mipsel-linux-musl/include -isystem /mipsel-linux-musl/sys-include --sysroot=/Users/alex/musl-cross-make/build/local/mipsel-linux-musl/obj_sysroot   -g -O2 -minterlink-mips16 -O2  -g -O2 -minterlink-mips16 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC -DGTHREAD_USE_WEAK=0 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fPIC -DGTHREAD_USE_WEAK=0 -I. -I. -I../.././gcc -I../../../src_gcc/libgcc -I../../../src_gcc/libgcc/. -I../../../src_gcc/libgcc/../gcc -I../../../src_gcc/libgcc/../include  -DHAVE_CC_TLS  -o addsf3.o -MT addsf3.o -MD -MP -MF addsf3.dep addsf3 -c ../../../src_gcc/libgcc/config/hardfp.c -fvisibility=hidden -DHIDE_EXPORTS -Wno-missing-prototypes
xgcc: error: addsf3: No such file or directory
make[3]: *** [addsf3.o] Error 1
make[2]: *** [all-target-libgcc] Error 2
make[1]: *** [obj_gcc/mipsel-linux-musl/libgcc/libgcc.a] Error 2
make: *** [all] Error 2
$ git rev-parse head
fe915821b652a7fa37b34a596f47d8e20bc72338

Note: mips-linux-muslsf builds successfully.

inferiorhumanorgans avatar Jul 26 '22 01:07 inferiorhumanorgans

what's gcc version, etc, you're building? best to paste entire config.

rofl0r avatar Jul 26 '22 12:07 rofl0r

$uname -sr
Darwin 18.7.0

$egrep -v '^#' config.mak



TARGET = mipsel-linux-musl

















So whatever the current defaults are. Looks like gcc 9.4.0.

inferiorhumanorgans avatar Jul 26 '22 13:07 inferiorhumanorgans

i tried default config with TARGET=mipsel-linux-muslsf on linux, and it builds without issue. so it appears to be a mac specific issue.

rofl0r avatar Jul 26 '22 13:07 rofl0r

Okay I'll try again and post the rest of the logs. It looks like this is a longstanding issue with gcc. Sigh.

https://www.spinics.net/lists/gcchelp/msg42102.html

https://devel.rtems.org/ticket/2300?cversion=0&cnum_hist=4

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62097

There's a patch here to use (GNU) awk instead of GNU sed:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66032

The next error is:

true  DO=all multi-do # /Applications/Xcode.app/Contents/Developer/usr/bin/make MULTILIB_OSDIRNAMES= INFO_DEPS= infodir= ac_cv_prog_lex_root=lex.yy MAKEINFO=false
Checking multilib configuration for libatomic...
Makefile:558: .deps/fenv.Plo: No such file or directory
Makefile:559: .deps/flag.Plo: No such file or directory
Makefile:560: .deps/gcas.Plo: No such file or directory
Makefile:561: .deps/gexch.Plo: No such file or directory
Makefile:562: .deps/glfree.Plo: No such file or directory
Makefile:563: .deps/gload.Plo: No such file or directory
Makefile:564: .deps/gstore.Plo: No such file or directory
Makefile:565: .deps/init.Plo: No such file or directory
Makefile:566: .deps/lock.Plo: No such file or directory
Makefile:867: warning: overriding commands for target `all-multi'
Makefile:861: warning: ignoring old commands for target `all-multi'
make[4]: *** No rule to make target `.deps/lock.Plo'.  Stop.
make[3]: *** [all-target-libatomic] Error 2
make[2]: *** [all] Error 2
make[1]: *** [obj_gcc/.lc_built] Error 2
make: *** [all] Error 2

inferiorhumanorgans avatar Jul 27 '22 21:07 inferiorhumanorgans

Correction, with that patch applied it's possible to build a mipsel cross toolchain on OSX so long as you don't try to parallelize the build.

inferiorhumanorgans avatar Jul 29 '22 02:07 inferiorhumanorgans

does the patch require gawk, or does it work with posix awk too ?

so long as you don't try to parallelize the build.

this seems to suggest the patch didn't declare its prerequisites/dependencies in the Makefile right, as the build without works fine with multiple processes.

rofl0r avatar Jul 29 '22 02:07 rofl0r

It works with BSD awk (unsure if it deviates from the POSIX spec) since that's what Apple ships by default. Honestly I think the more elegant solution would be to parameterize sed and just set SED=gsed on OSX and require GNU sed to be installed.

I don't know enough about MIPS to say, but is there anything that could be taken from the big endian targets instead?

inferiorhumanorgans avatar Jul 29 '22 02:07 inferiorhumanorgans

I should also add I'm not 100% sure that the parallel build was the issue, but I can't think of how my build env would've gotten corrupted otherwise. At this point though it should be easy enough to test on a non-Mac.

inferiorhumanorgans avatar Jul 29 '22 02:07 inferiorhumanorgans