FiloSottile / homebrew-musl-cross

Homebrew Formula for static-friendly musl-based GCC macOS-to-Linux cross-compilers
https://blog.filippo.io/easy-windows-and-linux-cross-compilers-for-macos/
ISC License
547 stars 45 forks source link

Apple silicon support? #23

Closed novuscy closed 2 years ago

novuscy commented 3 years ago

It seems that there are some build errors on Apple M1 hardware:

==> /opt/homebrew/opt/make/bin/gmake install TARGET=x86_64-linux-musl
Last 15 lines from /Users/novuscy/Library/Logs/Homebrew/musl-cross/01.gmake:
  "_host_hooks", referenced from:
      gt_pch_save(__sFILE*) in libbackend.a(ggc-common.o)
      gt_pch_restore(__sFILE*) in libbackend.a(ggc-common.o)
      toplev::main(int, char**) in libbackend.a(toplev.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: *** [../../src_gcc/gcc/lto/Make-lang.in:81: lto1] Error 1
gmake[3]: *** Waiting for unfinished jobs....
rm gcc.pod
gmake[3]: Leaving directory '/private/tmp/musl-cross-20201216-52153-xax24d/musl-cross-make-0.9.9/build/local/x86_64-linux-musl/obj_gcc/gcc'
gmake[2]: *** [Makefile:4361: all-gcc] Error 2
gmake[2]: Leaving directory '/private/tmp/musl-cross-20201216-52153-xax24d/musl-cross-make-0.9.9/build/local/x86_64-linux-musl/obj_gcc'
gmake[1]: *** [Makefile:222: obj_gcc/gcc/.lc_built] Error 2
gmake[1]: Leaving directory '/private/tmp/musl-cross-20201216-52153-xax24d/musl-cross-make-0.9.9/build/local/x86_64-linux-musl'
gmake: *** [Makefile:183: install] Error 2
jlricon commented 3 years ago

Upstream gcc is broken, that needs updating

ghost commented 3 years ago

https://doesitarm.com/formula/gcc/ prediction of a stable release seems to be mid 2021 or later. There is a unstable version for the one who dares.

FiloSottile commented 3 years ago

This is blocked upstream https://github.com/richfelker/musl-cross-make/issues/116

messense commented 3 years ago

FYI, you can try https://github.com/messense/homebrew-macos-cross-toolchains , it works on Apple Silicon.

ghost commented 3 years ago

Any update on this issue?