LLVM and Terminal Support on Mac Apple Silicon

My question set is fairly broad, but I can't seem to find any answers anywhere. As a fairly low-level developer, the vast majority of my work is done with Sublime Text, terminal-based compilers, IDEs like Coq's (coq.inria.fr), and code that has to be compiled by terminal.
These projects are at the very fabric of what I do, and I fear that Rosetta 2 will be inadequate until LLVM and other systems are updated to run natively on Apple Silicon. Honestly, I can't really afford complex virtualization systems like Parallels or VMWare (not that they help much) and I'd rather not give up MacOS for my Ubuntu desktop. I was raised on MacOS and I can't imagine losing features like scenes or seamless integration with the rest of my electronics.

I want to keep my initial post fairly simple and broad, but if anyone has any questions on what I need supported, feel free to ask. I am sure I'm not alone here.
Answered by Developer Tools Engineer in 613758022
There are two parts of your questions. First of all, Apple will upstream support for Apple Silicon Mac for LLVM, Swift and other compiler tools (see post in swift forum: https://forums.swift.org/t/swift-support-for-apple-silicon-macs/37803). Also announced in Platform of the Union, Apple will contribute to other open source software for a smooth transition to Apple Silicon Mac. Secondly, Rosetta 2 is very capable of running Intel based binaries, and you can totally run Intel based tooling through IDE or terminals. We have been running intel Xcode/clang/swift in Rosetta 2 without problem.
Accepted Answer
There are two parts of your questions. First of all, Apple will upstream support for Apple Silicon Mac for LLVM, Swift and other compiler tools (see post in swift forum: https://forums.swift.org/t/swift-support-for-apple-silicon-macs/37803). Also announced in Platform of the Union, Apple will contribute to other open source software for a smooth transition to Apple Silicon Mac. Secondly, Rosetta 2 is very capable of running Intel based binaries, and you can totally run Intel based tooling through IDE or terminals. We have been running intel Xcode/clang/swift in Rosetta 2 without problem.
Okay, that all seems reasonable. I guess I should just apply to the open beta program and try it for myself haha.
Thank you so much!
Would you happen to know when these patches will be landing upstream?
Open-source support for Apple Silicon is mainly held back by GCC’s (the GNU Compiler Collection) lack of support for the architecture. There are work progressing, but as with all open source, that would be in a “time available” basis.

Likewise Docker support is progressing, but again there is no timeline. Moreover if you’re depending on x86 Docker images, you would likely need to wait longer for it to provide Intel emulation. Since Rosetta 2 does not support virtualizing x86 systems, Parallels and VMWare would also need to come up with their own emulation software to support running Intel operating systems on Apple Silicon hardware.

If you really need to run x86 Docker images, a good alternative would be to buy an Intel Compute stick (a ~$100 USB-powered computer) and install Linux on it. Then you could ssh into the machine to do “Linux stuff” (including testing your server software) and run x86 Docker images. Yet keep most of your tools on the Mac.

You could also set up a Terminal profile to run command-line software in “Intel mode” by default. This include gcc and most of Homebrew – until they natively support Apple Silicon. Search the web for “How to Run Legacy Command Line Apps on Apple Silicon“ to get instructions how to do this.


I was also looking for answers for some of these questions. Specifically, I was trying to compile and use Infer analyzer tool (https://github.com/facebook/infer) - Infer uses some custom clang compiler for C++ analysis. Compiling custom clang plugin on M1 wasn't successful - there was some linking issue with LLVM. So, I tried to run Infer with custom clang compiled on Intel Mac.
I've just run make install on M1.

When actually running Infer executable in Terminal (run in Rosetta 2) it reports "Fails pinning to CPU".

An important thing to mention is that Infer requires some dependencies from Xcode 11.5 (there are issues with more recent versions). As there are quite few dependencies I guess an issue can be anywhere, but I am not sure how to debug this kind of issue. Is there anyone who has similar issue?


I was also looking for answers for some of these questions. Specifically, I was trying to compile and use Infer analyzer tool (https://github.com/facebook/infer) - Infer uses some custom clang compiler for C++ analysis. Compiling custom clang plugin on M1 wasn't successful - there was some linking issue with LLVM.

What does Facebook support say when you submitted the issue for this problem?

An important thing to mention is that Infer requires some dependencies from Xcode 11.5 (there are issues with more recent versions).

What does Facebook support say when you submitted the issue for these issues?

I am not sure how to debug this kind of issue.

Do you work for Facebook? The project is open source, so you are free to say "yes" whether or not you are a Facebook employee. Debugging these issues is straightforward. Install the latest versions of LLVM and other dependencies with Apple Silicon support. Correct any errors. Build infer and correct any errors that you encounter. Test using the (hopefully) supplied testing suite. Note that you may need to use unstable branches for any or all of the above.

Is there anyone who has similar issue? 

All the time. This is how open source works. Most tools are developed for Linux and Windows first. Mac support is hacked in as an afterthought and never touched again until is breaks. Always been this way.

Why is there still no llvm support for apple silicon? It's been over 4 years and swift has had hundreds of changes (the compiler still has basic issues with not being able to complete compilation, so it still needs work), but we have to agree, at some level, that it would be much better for LLVM to support apple hardware, and for apple's tooling to actually build with LLVM as the back end such that all kinds of compatibility for exploring best of class language use on apple silicon would be possible.

we have to agree … that it would be much better … for apple's tooling to actually build with LLVM as the back end

Apple’s tools, both Clang and Swift, are based on LLVM. What am I missing here? Can you be more specific about the actual problem?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

LLVM and Terminal Support on Mac Apple Silicon
 
 
Q