-
Notifications
You must be signed in to change notification settings - Fork 514
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
Building for mac m1(arm) #1708
Comments
You need to add a new entry here: https://github.com/mono/CppSharp/blob/main/build/Helpers.lua#L12 |
Have you implemented the arm architecture support?i need support arm64, but i do not know how to generate bindings(CppSharp/src/CppParser/Bindings/CSharp/aarch64-linux-gnu-cxx11abi),Can you give me some help |
Bumping this. It'd be a big help for Unity development, of all things, which often depends on bindings to native code. |
Late reply, but better late than never. Support for generating bindings for ARM64 was just implemented in d1307a5. AppleARM64 was already implemented before. For generating the parser bindings for ARM64 check the ParserGen project: https://github.com/mono/CppSharp/blob/main/src/CppParser/ParserGen/ParserGen.cs You will also need to extract the headers package to the build folder IIRC: https://github.com/mono/CppSharp/releases/download/CppSharp/headers.zip |
I don't have an M1 machine so cannot really do this. But remember that you can cross-generate bindings with CppSharp, so you can run it either in a VM or container / remote machine to generate the bindings, which sould be able to run fine with M1. |
Bingo, thanks for that tip on the headers that's what I needed. (I was in the middle of exploring ParserGen as you were typing.) I can generate the bindings for you for M1 if it'll help. |
(Also for future travelers: the |
Just tried to build CppSharp on Ubuntu aarch64 Distributor ID: Ubuntu
got following error, any idea ?
|
Those are part of the aforementioned bindings packages found in for example As an aside, on Mac the Also, the following must be added to LLVM.lua's links definition:
|
Btw, we have LLVM builds on CI here: https://github.com/mono/CppSharp/actions/workflows/llvm.yml Would be nice to add a new configuration here too: https://github.com/mono/CppSharp/blob/main/.github/workflows/llvm.yml#L12 Then we can re-issue new LLVM builds which will give us new packages with the LLVMAArch64 libraries. |
Gotcha let me fork and make a couple changes while I'm in here. |
I was able to build LLVM with AArch64 support, and patched a couple other files to allow generating the bindings. Unfortunately it failed, it seems the headers may be out of date.
Is the headline error for Mac, I think the rest stem from that.
Is the error thrown when generating ARM64 linux bindings. We're close, but not quite it looks like. |
Hmm, I thought that could happen but was hoping to not be the case. That headers zipped package is probably almost a decade old at this point. You should be able to update the headers in the zip with a more recent copy from your local system. Edit: Actually, from the error message, looks like it's fetching the |
Got it. I’ll pull headers in a bit and re run. |
Just retried to build for arm64: ./build.sh build_llvm --platform arm64 run the build: got following error: make: Entering directory '/home/station/repos/CppSharp/build/gmake' I think the ABI for arm64-linux-gnu-cxx11abi is missing in src/CppParser/Bindings/CSharp. How do I obtain or create the ABI ? |
@tritao I don't have a clear understanding of what still needs to be done. Do you have any hints? |
Not sure, but its my understanding there were still failures to fix. @konistehrad, you said in the PR that you might provide some assistance to whoever picks this up, could you provide a summary of what needs to be done? |
It's a little tough for me to say. I was able to build the LLVM instances, I created a new headers package, and built CppSharp against them. Attempting to use the created build artifacts seemingly always results in segfaults, and unfortunately I was never able to run down the source of that error. It doesn't appear to be a problem with the calling convention, but I never got far enough to conclusively determine that. Sorry I couldn't be more help. |
No worries, thanks for all the time you've put into it so far, hopefully someone else can take the mantle and continue from where you've left off. |
Hello. I am trying to build CppSharp for mac m1, I use following commands
the last command failed with:
What is the proper platform keys for each of building steps?
The text was updated successfully, but these errors were encountered: