OLD | NEW |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # This script will check out llvm and clang, and then package the results up | 6 # This script will check out llvm and clang, and then package the results up |
7 # to a tgz file. | 7 # to a tgz file. |
8 | 8 |
9 THIS_DIR="$(dirname "${0}")" | 9 THIS_DIR="$(dirname "${0}")" |
10 LLVM_DIR="${THIS_DIR}/../../../third_party/llvm" | 10 LLVM_DIR="${THIS_DIR}/../../../third_party/llvm" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 else | 57 else |
58 cp "${LLVM_LIB_DIR}/libFindBadConstructs.so" $PDIR/lib | 58 cp "${LLVM_LIB_DIR}/libFindBadConstructs.so" $PDIR/lib |
59 fi | 59 fi |
60 | 60 |
61 # Copy built-in headers (lib/clang/3.2/include). | 61 # Copy built-in headers (lib/clang/3.2/include). |
62 # libcompiler-rt puts all kinds of libraries there too, but we want only ASan. | 62 # libcompiler-rt puts all kinds of libraries there too, but we want only ASan. |
63 if [ "$(uname -s)" = "Darwin" ]; then | 63 if [ "$(uname -s)" = "Darwin" ]; then |
64 # Keep only Release+Asserts/lib/clang/3.2/lib/darwin/libclang_rt.asan_osx.a | 64 # Keep only Release+Asserts/lib/clang/3.2/lib/darwin/libclang_rt.asan_osx.a |
65 find "${LLVM_LIB_DIR}/clang" -type f -path '*lib/darwin*' | grep -v asan | \ | 65 find "${LLVM_LIB_DIR}/clang" -type f -path '*lib/darwin*' | grep -v asan | \ |
66 xargs rm | 66 xargs rm |
67 # Fix LC_ID_DYLIB for the ASan dynamic library to be relative to | |
68 # @executable_path. | |
69 ASAN_DYLIB_NAME=libclang_rt.asan_osx_dynamic.dylib | |
70 ASAN_DYLIB=`find "${LLVM_LIB_DIR}/clang" -type f -path *"${ASAN_DYLIB_NAME}"` | |
Nico
2013/01/22 16:13:21
Use $() instead of ``. Doesn't the '*' have to be
| |
71 install_name_tool -id @executable_path/${ASAN_DYLIB} "${ASAN_DYLIB}" | |
Nico
2013/01/22 16:13:21
quotes for the first ${ASAN_DYLIB} too
| |
67 else | 72 else |
68 # Keep only | 73 # Keep only |
69 # Release+Asserts/lib/clang/3.2/lib/linux/libclang_rt.{asan,tsan}-x86_64.a | 74 # Release+Asserts/lib/clang/3.2/lib/linux/libclang_rt.{asan,tsan}-x86_64.a |
70 # TODO(thakis): Make sure the 32bit version of ASan runtime is kept too once | 75 # TODO(thakis): Make sure the 32bit version of ASan runtime is kept too once |
71 # that's built. TSan runtime exists only for 64 bits. | 76 # that's built. TSan runtime exists only for 64 bits. |
72 find "${LLVM_LIB_DIR}/clang" -type f -path '*lib/linux*' | \ | 77 find "${LLVM_LIB_DIR}/clang" -type f -path '*lib/linux*' | \ |
73 grep -v "asan\|tsan" | xargs rm | 78 grep -v "asan\|tsan" | xargs rm |
74 fi | 79 fi |
75 | 80 |
76 cp -R "${LLVM_LIB_DIR}/clang" $PDIR/lib | 81 cp -R "${LLVM_LIB_DIR}/clang" $PDIR/lib |
77 | 82 |
78 tar zcf $PDIR.tgz -C $PDIR bin lib buildlog.txt | 83 tar zcf $PDIR.tgz -C $PDIR bin lib buildlog.txt |
79 | 84 |
80 if [ "$(uname -s)" = "Darwin" ]; then | 85 if [ "$(uname -s)" = "Darwin" ]; then |
81 PLATFORM=Mac | 86 PLATFORM=Mac |
82 else | 87 else |
83 PLATFORM=Linux_x64 | 88 PLATFORM=Linux_x64 |
84 fi | 89 fi |
85 | 90 |
86 echo To upload, run: | 91 echo To upload, run: |
87 echo gsutil cp -a public-read $PDIR.tgz \ | 92 echo gsutil cp -a public-read $PDIR.tgz \ |
88 gs://chromium-browser-clang/$PLATFORM/$PDIR.tgz | 93 gs://chromium-browser-clang/$PLATFORM/$PDIR.tgz |
OLD | NEW |