Skip to content

GCC cross-compilation from M1 to Intel for macOS #2499

Discussion options

You must be logged in to vote

x86_64-elf-gcc compiles ELF executables. macOS uses Mach-O, not ELF.

If you need to compile for Intel on M1, use Clang. If you need to use GCC specifically, you might be able to build your own cross-compiler, but that's not something Homebrew provides.

Using a Rosetta installation of Homebrew to install an Intel GCC will probably work too.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kornelski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants