-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Cannot build on Mac (aarch64) #1577
Comments
Do you actually need to build the toolchain yourself or could you use an existing binary distribution like @ilg-ul's xPack version perhaps? If you do really need to build your own toolchain and are having problems then the first step is to provide the complete steps that you are taking (from a clean However, bear in mind that most active participants on this repo do not have access to the necessary hardware in order to reproduce/investigate macOS build problems and unfortunately no macOS users have stepped up to help here in this regard to date. |
Also, if you search all open and closed issues here using appropriate terms like "macOS", "Brew", "XCode" etc. you may find some useful information about issues and workarounds when building on Apple hardware. |
And, another option is to use the xPack build mechanism: |
@TommyMurphyTM1234 thanks for sharing useful information. I'm using the toolchain you liked, but I'm getting a linker error: xpack-dev-tools/riscv-none-elf-gcc-xpack#37 Do you think is something about the toolchain itself or a gcc problem or something else ? |
Did this help at all @MarcoBonino? |
Closing due to lack of activity. |
Hello! I just want to update the ticket with more info. https://github.com/riscv-software-src/homebrew-riscv was ok to use, but is not simply providing a zip with the toolchain. Since I would like to build applications running on linux (and using things like threads) I would like to get a linux toolchain to run on macos. If there is a prebuilt binary I can use it, otherwise would be good to understand how to compile it on macos. |
That's not a limitation of the toolchain per se but of whatever board/target support package being used. The bare-metal toolchain can't a priori assume the existence of any specific resources/devices so stuff like this has to be supported on a custom basis using an appropriate board support package/libraries.
I don't understand what this means.
You might need to ask about this on a macOS specific forum - as I mentioned before, unfortunately non of the regular contributors here have access to macOS hardware in order to reproduce, diagnose and address macOS build issues and no macOS user has so far stepped up to help here in that respect. |
It would be ideal if somebody with macOS hardware access (all relevant types - e.g. x86 and Arm based?) and experience were able to volunteer instructions on how to use the different (?) macOS development environments/tools to build the RISC-V toolchains. It would certainly eliminate a lot of the repeated questions about build issues on macOS which usually cannot be answered clearly/authoritatively due to lack of such hardware and experience. But unfortunately nobody has volunteered to do this so these questions will presumably persist... :-| |
Apple switched from gcc to clang several years ago, and since then the macOS support in upstream gcc is more and more problematic, to the point where the official sources no longer pass the builds for native gcc on recent macOS. :-( Iain Sandoe maintains a gcc fork that fixes this (for example https://github.com/iains/gcc-14-branch), and he recommends using it even for cross-builds on macOS. If someone volunteers to make this gcc fork build on macOS, probably must check Iain's fork. |
Thanks @ilg-ul, that's useful info. I also wonder if crosstool-NG might be another practical option? I've had good experiences with it for building cross toolchains to run on Linux and also on Windows but I have no experience with it in relation to macOS. |
@TommyMurphyTM1234 I have both aarch64 and x86 mac. If someone from this repo wants, we can setup a video call with screen sharing in about 2 weeks... |
Thanks, but I wouldn't be able to do that myself. I don't know if anyone else might be able to do so?
This repo is capable of building an LLVM/Clang based toolchain:
Did you look at the previous posts from @ilg-ul and me above in case they help at all? |
I checked them... right now the limitation is that under macos I cannot find a suitable linux toolchain. |
Unfortunately, so far I cannot find either instructions on how to build the
See here:
Yes - the problem seems to be that the instructions for building stuff like this on macOS are simply not clear and documented. |
Hello!
I'm trying to build on MacOS aarch64 (M3 chip).
However some tools like riscv64-unknown-elf-gcc and riscv64-unknown-elf-g++ are missing.
I'm from a case sensitive filesystem. And I installed the required tools:
This is my configure:
And I get:
Then I simply run
make
.Could you provide support on this ?
If possible would be also nice to have the MacOS toolchain already built as it was done for the Ubuntu builds.
Thanks!
The text was updated successfully, but these errors were encountered: