Skip to content
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

Support for Modern OS X and "apple silicon" hardware #135

Open
ryanobjc opened this issue Jun 5, 2024 · 0 comments
Open

Support for Modern OS X and "apple silicon" hardware #135

ryanobjc opened this issue Jun 5, 2024 · 0 comments

Comments

@ryanobjc
Copy link

ryanobjc commented Jun 5, 2024

Hi all,

I've been doing some work on cl-autowrap, and c2ffi. I have a MacBookPro18,4 that identifies itself as an "Apple M1 Max" chip in the system information. In terms of c2ffi, I got it building using homebrew llvm 18.1.5.

As I understand it, c2ffi get it's triples from llvm. And on this machine, LLVM/clang says I have:

/Library/Developer/CommandLineTools/usr/bin/clang --version
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

And using the homebrew variant:

/opt/homebrew/Cellar/llvm/18.1.5/bin/clang --version
Homebrew clang version 18.1.5
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /opt/homebrew/Cellar/llvm/18.1.5/bin

Furthermore the 'arch' CLI says we are on "arm64".

I'm using SBCL 2.4.1 and inside the cl-autowrap code it identifies the feature #+arm64 as "aarch64", and #+darwin as "darwin9". Seems like these don't line up with modern OSX.

I'm thinking we should be extending the supported versions to cover "arm64-apple-darwin23.4.0" (or possibly just darwin?) and jury rig (local-arch) to return the appropriate string when on the appropriate machine.

Furthermore, the alloc.lisp needs a branch for #+arm64 to define 'size-t (as uint64 as per the c2ffi output) otherwise the c-malloc, etc, functions aren't defined.

I'm not 100% sure how wise just straight up changing #+arm64 from aarch64 -> arm64 is, given other platforms, but local architecture definitively is now called arm64!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant