patches for building gcc on Apple Silicon#129
patches for building gcc on Apple Silicon#129richard-vd wants to merge 2 commits intorichfelker:masterfrom
Conversation
dc9bd56 to
271ef22
Compare
|
Can you cite anything justifying these patches? I suspect they're right but I'd like to see some rationale. |
|
Justification for the I have no good justification for the host_hooks change except that seems to be done in every other host-*.c file. I'm puzzled why x86 darwin works without it and I wouldn't be surprised if the patch breaks it. |
|
I have tested the patch and it's looking good: Using a MacBook Air M1 (Apple Silicon) and an iMac (Intel), on both machines I successfully compiled targets x86_64 and aarch64 for all gcc versions that this patch has been applied to. Then I compiled a Hello World C++ program with the resulting gcc-5.3.0 and gcc-9.2.0 and successfully ran the binaries in Linux on a Raspberry Pi 4 (aarch64) and on a Supermicro server (x86_64). Fortunately the patch doesn't seem to break anything! |
|
Thanks for putting this together Richard. I just tested this branch on an M1 machine. I compiled the x86_64 target, compiled my go/cgo/sqlite program using the x86_64 target output, then ran my built program on x86. Everything seems to work. 👍 |
271ef22 to
a558d3a
Compare
|
Added gcc-10.3.0 patch to this branch. |
2882fb9 to
3dd050f
Compare
|
Squashed yesterday's gcc-10.3.0 patch with the initial commit of this PR. |
Sourced from: * gcc-mirror/gcc@53a9065 darwin-aarch64-config (for gcc-6.5.0 .. gcc-10.3.0) * gcc-mirror/gcc@834c874 darwin-aarch64-self-host-driver (for gcc-6.5.0 .. gcc-10.3.0) * gcc-mirror/gcc@590febb darwin-align-pch_address_space-to-16k (for gcc-6.5.0 .. gcc-9.2.0)
3dd050f to
8d34906
Compare
|
Redone Apple silicon patches for gcc-6.5.0 .. gcc-10.3.0 using commits from gcc upstream. |
|
Added GCC 11. |
This adds backports of a couple of patches necessary to support macOS arm64 hosts for gcc. It was ported from richfelker/musl-cross-make#129 with some small fixups to make the patches apply cleanly. Signed-off-by: Steven Fackler <sfackler@gmail.com>
This adds backports of a couple of patches necessary to support macOS arm64 hosts for gcc. It was ported from richfelker/musl-cross-make#129 with some small fixups to make the patches apply cleanly. Signed-off-by: Steven Fackler <sfackler@gmail.com>
The minimal patch by @jannau in #116 enables building gcc and running it natively on Apple Silicon. As I understand and have experienced it, the resulting gcc is not fully functional but for the purpose of cross compiling it is. Therefore I think this patch would be a good addition to this project.
This PR adds patches for all supported gcc versions from 6.5.0 and up.