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

Add patch to enable building on Apple Silicon #30

Closed richard-vd closed 2 years ago

richard-vd commented 2 years ago

Fixes #23. See also richfelker/musl-cross-make#129.

uwinx commented 2 years ago

@richard-vd, any updates on this?

richard-vd commented 2 years ago

I don't have write access to this repository to merge this PR and update the bottle, but if you want it working now then I suggest to have a look at the README.md and the recent commit history in my fork: https://github.com/richard-vd/homebrew-musl-cross.

FiloSottile commented 2 years ago

Like @richfelker in https://github.com/richfelker/musl-cross-make/pull/129#issuecomment-895635889, I suspect the patches are right, and I believe they build a Hello World fine, but I would feel more confident pulling something with a solid justification or a backport from the GCC tree. Has upstream not fixed this yet?

richfelker commented 2 years ago

I doubt it breaks anything at runtime, but if it's not correct it could break building the toolchain for different hosts. That's why I'd like to see an explanation.

uwinx commented 2 years ago

Can confirm that using formula from this PR works for me.

richard-vd commented 2 years ago

Updated commit to include patch for gcc-10.3.0.

DirectorX commented 2 years ago

Any updates? Can I help somehow?

FiloSottile commented 2 years ago

Have these patches made it into upstream? If not, why? I do believe that they work when tested, but I am trying to understand why we don't have an official upstream patch to backport.

richard-vd commented 2 years ago

Last month this was committed to gcc master: gcc-mirror/gcc@834c8749

I will update the PR to use this patch instead.

FiloSottile commented 2 years ago

Awesome, thank you!

richfelker commented 2 years ago

Thanks! Updating the PR to use the official fix will be much appreciated, and suffices to document that it's a reasonable solution.

FiloSottile commented 2 years ago

@richard-vd friendly ping, do you want to import the new patch or should I go ahead with it?

richard-vd commented 2 years ago

I redid the Apple silicon patches for gcc-6.5.0 .. gcc-10.3.0 using commits from gcc upstream.

The URL of this patch points to today's commit in richfelker/musl-cross-make#129. I hope both PRs can be merged now.

ismail commented 2 years ago

@FiloSottile Friendly ping… https://github.com/richfelker/musl-cross-make/pull/129 looks like it will not be merged soon, could you merge this one?

FiloSottile commented 2 years ago

Ah, yes, thank you for syncing with upstream!

ismail commented 2 years ago

All the glory to @richard-vd , thanks for taking time to fix this!