Changes between Version 3 and Version 4 of ASanWebKit


Ignore:
Timestamp:
Nov 5, 2014 8:52:27 AM (9 years ago)
Author:
Bem Jones-Bey
Comment:

Update with my learnings

Legend:

Unmodified
Added
Removed
Modified
  • ASanWebKit

    v3 v4  
    1616/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/
    1717}}}
    18  3. Make a copy of the `OSX10.9.xctoolchain` and call it `ASAN.xctoolchain`:
     18 With Xcode 6.1 on 10.9.5, the SDK is in:
     19 {{{
     20/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/
     21}}}
     22 3. Make a copy of the `OSX10.9.xctoolchain`(or `XcodeDefault.xctoolchain`) and call it `ASAN.xctoolchain`:
    1923{{{
    2024sudo ditto /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain /Applications/Xcode.app/Contents/Developer/Toolchains/ASAN.xctoolchain
    2125}}}
    22  4. Edit `ASAN.xctoolchain/ToolchainInfo.plist` to change the `Identifier` string from `com.apple.dt.toolchain.OSX10_9` to `com.apple.dt.toolchain.ASAN`.
     26 4. Edit `ASAN.xctoolchain/ToolchainInfo.plist` to change the `Identifier` string from `com.apple.dt.toolchain.OSX10_9` to `com.apple.dt.toolchain.ASAN`. (with Xcode 6.1 on 10.9.5, the `Identifier` is `com.apple.dt.toolchain.XcodeDefault`)
    2327{{{
    2428sudo vi /Applications/Xcode.app/Contents/Developer/Toolchains/ASAN.xctoolchain/ToolchainInfo.plist
    2529}}}
    2630 5. Build trunk clang/llvm.  The address sanitizer should be built by default for Mac OS X.  See [http://www.llvm.org/docs/ LLVM Docs] for details.  Subversion revision r204316 of clang/llvm is known to build WebKit for Mac OS X.  Newer versions may introduce new warnings or compiler bugs that must be fixed before proceeding. Alternatively, you can download a prebuilt binary from the [http://commondatastorage.googleapis.com/chromium-browser-clang/index.html?path=Mac/ Chromium Browser Clang] page.
    27  6. Ditto the clang/llvm build output into `/Applications/Xcode.app/Contents/Developer/Toolchains/ASAN.xctoolchain` to replace the version of clang/llvm in the original toolchain.
     31 6. Ditto the clang/llvm build output into `/Applications/Xcode.app/Contents/Developer/Toolchains/ASAN.xctoolchain` to replace the version of clang/llvm in the original toolchain. If you downloaded a build from the [http://commondatastorage.googleapis.com/chromium-browser-clang/index.html?path=Mac/ Chromium Browser Clang] page, then it should be as simple as:
    2832{{{
    29 TBD
     33sudo ditto ~/Downloads/clang-218707/ /Applications/Xcode.app/Contents/Developer/Toolchains/ASAN.xctoolchain/usr/   
    3034}}}
     35 Replacing `~/Downloads/clang-218707/` with the location you extracted the clang archive to. Note that the trailing / on the path is important!
    3136 7. Fix the ID of `libclang_rt.asan_osx_dynamic.dylib` to its installation path using the `install_name_tool`:
    3237{{{
    3338sudo xcrun install_name_tool -id /Applications/Xcode.app/Contents/Developer/Toolchains/ASAN.xctoolchain/usr/lib/clang/3.5.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib /Applications/Xcode.app/Contents/Developer/Toolchains/ASAN.xctoolchain/usr/lib/clang/3.5.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib
    3439}}}
     40 You may have to change the `3.5.0` in the paths to match the version of clang you are using, especially if you download a build from the [http://commondatastorage.googleapis.com/chromium-browser-clang/index.html?path=Mac/ Chromium Browser Clang] page..
    3541 8. Copy `libclang_rt.asan_osx_dynamic.dylib` into your `WebKitBuild/Release` directory:
    3642{{{
    3743ditto /Applications/Xcode.app/Contents/Developer/Toolchains/ASAN.xctoolchain/usr/lib/clang/3.5.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib WebKitBuild/Release/
    3844}}}
     45 You may have to change the `3.5.0` in the paths to match the version of clang you are using, especially if you download a build from the [http://commondatastorage.googleapis.com/chromium-browser-clang/index.html?path=Mac/ Chromium Browser Clang] page.
    3946 9. Build WebKit with additional xcodebuild arguments to load `asan.xcconfig`, find the ASan ignore list, and build with the new compiler:
    4047{{{