How to update LLVM & Clang on Mac OSX?

前端 未结 6 1088
滥情空心
滥情空心 2020-12-05 19:17

On my version of Mac OSX (Lion 10.7.1, XCode 4.1), there is LLVM 3.0svn and Clang 2.1. The current versions are LLVM 3.0 and Clang 3.0.

From the XCode web site, it s

6条回答
  •  情书的邮戳
    2020-12-05 19:48

    I highly recommend against replacing the system compiler on macOS:

    Many build processes you will see (e.g. Xcode) rely on Apple-specific extensions. For example, last I checked Apple have their own linker.

    Also, Linuxes do not enforce binary compatibility -- generally, people build software from source, or download specific binaries for each operating system version. As an end-user (as opposed to developer/professional user) operating system, macOS goes to great effort to maintain compatibility with binaries built on older macOS versions.

    Replacing the compiler, or worse, system libraries, will break these compatibility guarantees. It may also break your system in subtle, non-obvious ways.

    But feel free to install a second copy of clang in /usr/local or so and explore new features, but leave the system compiler alone.

    Also note that Apple do not support submitting software to the app stores that aren't built with Xcode and the compiler it includes. While you may go unnoticed if you do that, you may get rejected during app store review if your compiler fails to do anything that Apple's compiler does.

提交回复
热议问题