2

I'd like to use the -fsanitize=address features of clang.

I'm on:

OS X 10.9.1 with Xcode 5.0.2
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)

I'm running clang from the command line, and I'm getting the error:

clang: error: unsupported argument 'address' to option 'fsanitize='

I'm told this works, but searching around hasn't shown me the way; do I need to bring in a different version of clang?

Thanks!

0

2 Answers 2

2

The out-of-box version of clang on OS X does not implement support of Address Sanitizer. You will have to build your own version of clang from sources.

Sign up to request clarification or add additional context in comments.

Comments

1

You need a different build of clang than the one apple gave you. The simplest way to get one (or more) is to install Homebrew http://brew.sh and then

brew install llvm --with-asan 

You could also try a prebuilt clang from http://llvm.org/releases/download.htm.
It's by no means impossible to build clang 'by hand', but last I checked it did take multiple checkouts to get the source tree. The other options should have you asaning in minutes.

1 Comment

Update: Apple's Xcode is starting to come with builds of clang that have Address-Sanitizer enabled.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.