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 gcc_toolchain= | 9 gcc_toolchain= |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 BLINKGCPLUGIN_LIBNAME=\ | 118 BLINKGCPLUGIN_LIBNAME=\ |
119 $(grep LIBRARYNAME "$THIS_DIR"/../blink_gc_plugin/Makefile \ | 119 $(grep LIBRARYNAME "$THIS_DIR"/../blink_gc_plugin/Makefile \ |
120 | cut -d ' ' -f 3) | 120 | cut -d ' ' -f 3) |
121 cp "${LLVM_LIB_DIR}/lib${BLINKGCPLUGIN_LIBNAME}.${SO_EXT}" $PDIR/lib | 121 cp "${LLVM_LIB_DIR}/lib${BLINKGCPLUGIN_LIBNAME}.${SO_EXT}" $PDIR/lib |
122 | 122 |
123 if [[ -n "${gcc_toolchain}" ]]; then | 123 if [[ -n "${gcc_toolchain}" ]]; then |
124 # Copy the stdlibc++.so.6 we linked Clang against so it can run. | 124 # Copy the stdlibc++.so.6 we linked Clang against so it can run. |
125 cp "${LLVM_LIB_DIR}/libstdc++.so.6" $PDIR/lib | 125 cp "${LLVM_LIB_DIR}/libstdc++.so.6" $PDIR/lib |
126 fi | 126 fi |
127 | 127 |
128 # Copy built-in headers (lib/clang/3.2/include). | 128 # Copy built-in headers (lib/clang/3.x.y/include). |
129 # libcompiler-rt puts all kinds of libraries there too, but we want only some. | 129 # libcompiler-rt puts all kinds of libraries there too, but we want only some. |
130 if [ "$(uname -s)" = "Darwin" ]; then | 130 if [ "$(uname -s)" = "Darwin" ]; then |
131 # Keep only the OSX (ASan and profile) and iossim (ASan) runtime libraries: | 131 # Keep only the OSX (ASan and profile) and iossim (ASan) runtime libraries: |
132 # Release+Asserts/lib/clang/*/lib/darwin/libclang_rt.{asan,profile}_* | 132 # Release+Asserts/lib/clang/*/lib/darwin/libclang_rt.{asan,profile}_* |
133 find "${LLVM_LIB_DIR}/clang" -type f -path '*lib/darwin*' \ | 133 find "${LLVM_LIB_DIR}/clang" -type f -path '*lib/darwin*' \ |
134 ! -name '*asan_osx*' ! -name '*asan_iossim*' ! -name '*profile_osx*' | \ | 134 ! -name '*asan_osx*' ! -name '*asan_iossim*' ! -name '*profile_osx*' | \ |
135 xargs rm | 135 xargs rm |
136 # Fix LC_ID_DYLIB for the ASan dynamic libraries to be relative to | 136 # Fix LC_ID_DYLIB for the ASan dynamic libraries to be relative to |
137 # @executable_path. | 137 # @executable_path. |
138 # TODO(glider): this is transitional. We'll need to fix the dylib name | 138 # TODO(glider): this is transitional. We'll need to fix the dylib name |
139 # either in our build system, or in Clang. See also http://crbug.com/344836. | 139 # either in our build system, or in Clang. See also http://crbug.com/344836. |
140 ASAN_DYLIB_NAMES="libclang_rt.asan_osx_dynamic.dylib | 140 ASAN_DYLIB_NAMES="libclang_rt.asan_osx_dynamic.dylib |
141 libclang_rt.asan_iossim_dynamic.dylib" | 141 libclang_rt.asan_iossim_dynamic.dylib" |
142 for ASAN_DYLIB_NAME in $ASAN_DYLIB_NAMES | 142 for ASAN_DYLIB_NAME in $ASAN_DYLIB_NAMES |
143 do | 143 do |
144 ASAN_DYLIB=$(find "${LLVM_LIB_DIR}/clang" \ | 144 ASAN_DYLIB=$(find "${LLVM_LIB_DIR}/clang" \ |
145 -type f -path "*${ASAN_DYLIB_NAME}") | 145 -type f -path "*${ASAN_DYLIB_NAME}") |
146 install_name_tool -id @executable_path/${ASAN_DYLIB_NAME} "${ASAN_DYLIB}" | 146 install_name_tool -id @executable_path/${ASAN_DYLIB_NAME} "${ASAN_DYLIB}" |
147 done | 147 done |
148 else | 148 else |
149 # Keep only | 149 # Keep only |
150 # Release+Asserts/lib/clang/*/lib/linux/libclang_rt.{[atm]san,profile,ubsan}-*
.a | 150 # Release+Asserts/lib/clang/*/lib/linux/libclang_rt.{[atm]san,san,ubsan,profil
e}-*.a |
| 151 # , but not dfsan. |
151 find "${LLVM_LIB_DIR}/clang" -type f -path '*lib/linux*' \ | 152 find "${LLVM_LIB_DIR}/clang" -type f -path '*lib/linux*' \ |
152 ! -name '*[atm]san*' ! -name '*profile*' ! -name '*ubsan*' | xargs rm | 153 ! -name '*[atm]san*' ! -name '*ubsan*' ! -name '*libclang_rt.san*' \ |
| 154 ! -name '*profile*' | xargs rm |
| 155 # Strip the debug info from the runtime libraries. |
| 156 find "${LLVM_LIB_DIR}/clang" -type f -path '*lib/linux*' | xargs strip -g |
153 fi | 157 fi |
154 | 158 |
155 cp -R "${LLVM_LIB_DIR}/clang" $PDIR/lib | 159 cp -R "${LLVM_LIB_DIR}/clang" $PDIR/lib |
156 | 160 |
157 tar zcf $PDIR.tgz -C $PDIR bin lib buildlog.txt | 161 tar zcf $PDIR.tgz -C $PDIR bin lib buildlog.txt |
158 | 162 |
159 if [ "$(uname -s)" = "Darwin" ]; then | 163 if [ "$(uname -s)" = "Darwin" ]; then |
160 PLATFORM=Mac | 164 PLATFORM=Mac |
161 else | 165 else |
162 PLATFORM=Linux_x64 | 166 PLATFORM=Linux_x64 |
163 fi | 167 fi |
164 | 168 |
165 echo To upload, run: | 169 echo To upload, run: |
166 echo gsutil cp -a public-read $PDIR.tgz \ | 170 echo gsutil cp -a public-read $PDIR.tgz \ |
167 gs://chromium-browser-clang/$PLATFORM/$PDIR.tgz | 171 gs://chromium-browser-clang/$PLATFORM/$PDIR.tgz |
OLD | NEW |