BergP
BergP

Reputation: 3545

How can I check out clang sources by clang version?

With latest XCode clang compiler version 4.2.1 is supplied.

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -dumpversion

And I need to check out exactly that version of clang source code, what I am using in XCode. (Needed for building clang plugin on sources and load it to clang that used by Xcode)

But when I do:

svn ls http://llvm.org/svn/llvm-project/cfe/tags/

there are only relese numbers (I have tried to look versions in other files):

RELEASE_26/
RELEASE_27/
RELEASE_28/
RELEASE_29/
RELEASE_30/
RELEASE_31/
RELEASE_32/
RELEASE_33/
RELEASE_34/

How can I check out sources of clang and llvm that are used in 4.2.1 version?

Update:

I downloaded those sources (XCode clang version):

http://llvm.org/releases/download.html#3.3

But there is unexpected error with building command:

llvm-3.3.src/projects/compiler-rt/lib/asan/asan_mac.cc:26:10: fatal error: ‘crt_externs.h’ file not found
#include // for _NSGetArgv
^
1 error generated.

Can I set other instance of clang in XCode instead of

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang ?

Upvotes: 1

Views: 2268

Answers (1)

Marshall Clow
Marshall Clow

Reputation: 16670

Apple's release schedule rarely corresponds with LLVM's.

So what they do (I am inferring here), is to branch the LLVM repo, add any "proprietary" bits that that they have developed and are not yet in the open source version (For example, the ARM64 backend that they used for the iPhone 5). Then they test (and fix bugs) until they're happy. They give this an Apple version #, and ship it.

For example, on my system, with Xcode 5.0.1 installed, I get:

$ clang --version
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)

You can download the sources to the version of clang that Apple ships with Xcode from http://opensource.apple.com

However, it doesn't look like they've put up the sources for the 5.0 tools yet.

Upvotes: 4

Related Questions