-
Notifications
You must be signed in to change notification settings - Fork 81
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
M1 Mac Support #220
Comments
Looks like removing the "x86_x64" platform requirement works up until this point: ===> make install The part that actually fails is this: Undefined symbols for architecture arm64: Looks like an issue with the linker right? |
GCC is not supported on M1 Mac, see:
So for the moment it's not possible to run avr-gcc on Apple M1. From what I read, even Rosetta 2 doesn't seem to do the tricK. |
riscv-software-src/homebrew-riscv#47 (comment) It does look like others have gotten RISCV-GCC to work without PCH. |
Please open à PR and I'll be happy to review |
I am confused by the comment that gcc is not supported on the M1: If I do the following:
In addition, I just installed gcc using brew:
I must be missing something.. |
The first one is not gcc, it's clang. I have zero way of testing if avr-gcc would work and currently day job is taking a lot of space. As you own an M1 Mac, try the different solutions and if it works submit a PR that I'll gladly review. |
You can look at the gcc.rb formula in brew/core to see how they do it. They use a different url, a fork for the M1. But there is absolutely no guarantee that it will work, work with avr or create good binaries. |
In
I removed all dependencies to x86_64. The build ends with:
Getting closer.. (I think) |
"checking build system type... configure: error: /bin/sh ./config.sub -apple-darwin20.3.0 failed" Got architecture build flag is usually something like "aarch64-apple-darwin" or "arm64-apple-darwin". I'm stuck with day-job things for a bit but I'd look at what ./config.sub it downloads in that first line. (just an idea, and see what the diff is with something like the homebrew-riscv guys are doing) |
@jknotzke @Grippy98 any news? |
avr-gcc works great under Rosetta (it still compiles binaries significantly faster than my Windows desktop somehow) but I haven't had time to try native, was going to try to forge ahead over the weekend. Not sure if @jknotzke has had any progress. |
I am stuck building libelf. I placed a comment Homebrew/homebrew-core#68762 and so far no replies. Someone did post a patch, which did not work. I think the bottleneck is there (no pun). How can I locate the source code for libelf that is being used to build for brew ? Also, how can I find the configure flags that are being passed ? If I can get libelf to build, I think we are almost there. |
Here is the config.log for libelf if that helps.. |
I found the source code being used for libelf in brew. I downloaded it, and if I do the following: echo 'echo arm-apple-darwin' > config.sub and then run: ./configure --prefix=/opt/homebrew/Cellar/libelf/0.8.13_1 --disable-compat It configures and I can run make with no errors.. But I haven't been able to locate where brew installs the source code for libelf.. If I could, I could test to see if this gets me any further.. |
@Grippy98 well that should be sufficient then! GCC is not officially supported for the M1, so I don't think it's a good idea to waste time hacking things when rosetta can do the trick. Did you do anything to make it work with rosetta? @jknotzke why not use rosetta? |
I have it working with Rosetta.. But I suspect this solution is only viable for a while. It would obviously be better to get it working natively. |
Rosetta 2 is here to stay for some time. GCC will bring native support for the M1. That being said, avr will be removed from GCC 11, so we're kind of stuck here :( |
What will be next? clang? (not that I think we couldn't compile gcc natively for ARM if we had to) |
Oh, I see, thanks - the avr backend needs porting for gcc 11. That's a whole different kettle of fish :( |
I feel sorry for the guy working on it, the gcc-patch submission process seems like hell on earth... |
In case someone finds this thread and wants to be able to install qmk using Rosetta here are the steps I followed: First, install brew but as X86: Then install qmk Then for qmk setup: |
As there's not much we can do about it now and this is all too experimental to actually be merged into master, I'll close the issue for now. We can discuss it again when GCC 11 comes out with hopefully avr support. |
If I'm reading this correctly, avr-gcc added support for M1 in June, and avr-gcc@11 is out. Edit: looks like all avr versions have been patched and it installs now without any changes needed! Thanks @ladislas and @DavidEGrayson |
* arm-none-eabi-gcc8: new port Latest 8.x version of arm-non-eabi-gcc. arm-none-eabi-gcc 9 dropped support for targets such as armv3. * Add a comment expliciting the need for gcc8 as per @mojca suggestion.
If I try to build from source I get:
avr-gcc: The x86_64 architecture is required for this software.
Any idea if this will/can be easily ported to Apple Silicon? (It's ARM64 after all)
Any tips would be great, would love to help with it if you can give me some pointers. Thanks!
The text was updated successfully, but these errors were encountered: