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

[ffigen] Clang/Xcode visionOS issues #1075

Closed
dcharkes opened this issue Apr 4, 2024 · 3 comments
Closed

[ffigen] Clang/Xcode visionOS issues #1075

dcharkes opened this issue Apr 4, 2024 · 3 comments

Comments

@dcharkes
Copy link
Collaborator

dcharkes commented Apr 4, 2024

[SEVERE] : Header ./src/my_plugin.h: Total errors/warnings: 13.
[SEVERE] :     /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc_type.h:48:1: warning: unknown platform 'xros' in availability macro [Semantic Issue]

The origin:

+__attribute__((availability(xros, unavailable))) // visionos-warning {{unknown platform 'xros' in availability macro}}
+void xros_unavail(); // visionos-note {{}}

https://www.mail-archive.com/cfe-commits@lists.llvm.org/msg414442.html

I'm not entirely sure why we are seeing this though.

@liamappelbe have you seen this before?

@dcharkes dcharkes changed the title [ffigen] Xcode visionOS issues [ffigen] Clang/Xcode visionOS issues Apr 4, 2024
@liamappelbe
Copy link
Contributor

No, I haven't seen it before. Probably because I haven't updated xcode since visionos was released. Guess: could be a mismatch between your header version and your clang version?

@liamappelbe
Copy link
Contributor

I just ran into this. I think the issue is that we're using clang installed from brew, which lags behind the version we get in xcode. Then when we parse headers that come from xcode, they contain this attribute that doesn't exist in the brew version yet.

I fixed it by just doing brew uninstall llvm:

liama-macbookpro:ffigen liama$ which clang
/usr/local/opt/llvm/bin/clang
liama-macbookpro:ffigen liama$ brew uninstall llvm
Uninstalling /usr/local/Cellar/llvm/16.0.6... (6,764 files, 1.6GB)
liama-macbookpro:ffigen liama$ which clang
/usr/bin/clang

I think the clang in /usr/bin is installed when we install the Xcode command line tools, xcode-select --install.

So I think we just need to remove that brew install llvm instruction from the readme.

@dcharkes
Copy link
Collaborator Author

dcharkes commented Apr 9, 2024

Thanks @liamappelbe!

Works for me!

I think the clang in /usr/bin is installed when we install the Xcode command line tools, xcode-select --install.

Okay, my machine is probably in the same state as yours.
If anyone runs into issues we can update the documentation.

@dcharkes dcharkes closed this as completed Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants