Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
inferiorhumanorgans opened this issue Jul 26, 2022 · 8 comments
Open

Comments

@inferiorhumanorgans
Copy link

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.

@rofl0r
Copy link
Contributor

rofl0r commented Jul 26, 2022

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

@inferiorhumanorgans
Copy link
Author

$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.

@rofl0r
Copy link
Contributor

rofl0r commented Jul 26, 2022

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.

@inferiorhumanorgans
Copy link
Author

inferiorhumanorgans commented Jul 27, 2022

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
Copy link
Author

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.

@rofl0r
Copy link
Contributor

rofl0r commented Jul 29, 2022

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.

@inferiorhumanorgans
Copy link
Author

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
Copy link
Author

inferiorhumanorgans commented Jul 29, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants