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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 ${extra_flags} 2>&1 | tee -a buildlog.txt | 88 ${extra_flags} 2>&1 | tee -a buildlog.txt |
89 | 89 |
90 R=$(cat "${STAMP_FILE}") | 90 R=$(cat "${STAMP_FILE}") |
91 | 91 |
92 PDIR=clang-$R | 92 PDIR=clang-$R |
93 rm -rf $PDIR | 93 rm -rf $PDIR |
94 mkdir $PDIR | 94 mkdir $PDIR |
95 mkdir $PDIR/bin | 95 mkdir $PDIR/bin |
96 mkdir $PDIR/lib | 96 mkdir $PDIR/lib |
97 | 97 |
| 98 GOLDDIR=llvmgold-$R |
| 99 if [ "$(uname -s)" = "Linux" ]; then |
| 100 mkdir -p $GOLDDIR/lib |
| 101 fi |
| 102 |
98 if [ "$(uname -s)" = "Darwin" ]; then | 103 if [ "$(uname -s)" = "Darwin" ]; then |
99 SO_EXT="dylib" | 104 SO_EXT="dylib" |
100 else | 105 else |
101 SO_EXT="so" | 106 SO_EXT="so" |
102 fi | 107 fi |
103 | 108 |
104 # Copy buildlog over. | 109 # Copy buildlog over. |
105 cp buildlog.txt $PDIR/ | 110 cp buildlog.txt $PDIR/ |
106 | 111 |
107 # Copy clang into pdir, symlink clang++ to it. | 112 # Copy clang into pdir, symlink clang++ to it. |
108 cp "${LLVM_BIN_DIR}/clang" $PDIR/bin/ | 113 cp "${LLVM_BIN_DIR}/clang" $PDIR/bin/ |
109 (cd $PDIR/bin && ln -sf clang clang++) | 114 (cd $PDIR/bin && ln -sf clang clang++) |
110 cp "${LLVM_BIN_DIR}/llvm-symbolizer" $PDIR/bin/ | 115 cp "${LLVM_BIN_DIR}/llvm-symbolizer" $PDIR/bin/ |
111 if [ "$(uname -s)" = "Darwin" ]; then | 116 if [ "$(uname -s)" = "Darwin" ]; then |
112 cp "${LLVM_BIN_DIR}/libc++.1.${SO_EXT}" $PDIR/bin/ | 117 cp "${LLVM_BIN_DIR}/libc++.1.${SO_EXT}" $PDIR/bin/ |
113 (cd $PDIR/bin && ln -sf libc++.1.dylib libc++.dylib) | 118 (cd $PDIR/bin && ln -sf libc++.1.dylib libc++.dylib) |
114 fi | 119 fi |
115 | 120 |
116 # Copy libc++ headers. | 121 # Copy libc++ headers. |
117 if [ "$(uname -s)" = "Darwin" ]; then | 122 if [ "$(uname -s)" = "Darwin" ]; then |
118 mkdir $PDIR/include | 123 mkdir $PDIR/include |
119 cp -R "${LLVM_BOOTSTRAP_INSTALL_DIR}/include/c++" $PDIR/include | 124 cp -R "${LLVM_BOOTSTRAP_INSTALL_DIR}/include/c++" $PDIR/include |
120 fi | 125 fi |
121 | 126 |
122 # Copy plugins. Some of the dylibs are pretty big, so copy only the ones we | 127 # Copy plugins. Some of the dylibs are pretty big, so copy only the ones we |
123 # care about. | 128 # care about. |
124 cp "${LLVM_LIB_DIR}/libFindBadConstructs.${SO_EXT}" $PDIR/lib | 129 cp "${LLVM_LIB_DIR}/libFindBadConstructs.${SO_EXT}" $PDIR/lib |
125 cp "${LLVM_LIB_DIR}/libBlinkGCPlugin.${SO_EXT}" $PDIR/lib | 130 cp "${LLVM_LIB_DIR}/libBlinkGCPlugin.${SO_EXT}" $PDIR/lib |
126 | 131 |
| 132 # Copy gold plugin on Linux. |
| 133 if [ "$(uname -s)" = "Linux" ]; then |
| 134 cp "${LLVM_LIB_DIR}/LLVMgold.${SO_EXT}" $GOLDDIR/lib |
| 135 fi |
| 136 |
127 if [[ -n "${gcc_toolchain}" ]]; then | 137 if [[ -n "${gcc_toolchain}" ]]; then |
128 # Copy the stdlibc++.so.6 we linked Clang against so it can run. | 138 # Copy the stdlibc++.so.6 we linked Clang against so it can run. |
129 cp "${LLVM_LIB_DIR}/libstdc++.so.6" $PDIR/lib | 139 cp "${LLVM_LIB_DIR}/libstdc++.so.6" $PDIR/lib |
130 fi | 140 fi |
131 | 141 |
132 # Copy built-in headers (lib/clang/3.x.y/include). | 142 # Copy built-in headers (lib/clang/3.x.y/include). |
133 # compiler-rt builds all kinds of libraries, but we want only some. | 143 # compiler-rt builds all kinds of libraries, but we want only some. |
134 if [ "$(uname -s)" = "Darwin" ]; then | 144 if [ "$(uname -s)" = "Darwin" ]; then |
135 # Keep only the OSX (ASan and profile) and iossim (ASan) runtime libraries: | 145 # Keep only the OSX (ASan and profile) and iossim (ASan) runtime libraries: |
136 # Release+Asserts/lib/clang/*/lib/darwin/libclang_rt.{asan,profile}_* | 146 # Release+Asserts/lib/clang/*/lib/darwin/libclang_rt.{asan,profile}_* |
(...skipping 25 matching lines...) Expand all Loading... |
162 fi | 172 fi |
163 | 173 |
164 cp -vR "${LLVM_LIB_DIR}/clang" $PDIR/lib | 174 cp -vR "${LLVM_LIB_DIR}/clang" $PDIR/lib |
165 | 175 |
166 if [ "$(uname -s)" = "Darwin" ]; then | 176 if [ "$(uname -s)" = "Darwin" ]; then |
167 tar zcf $PDIR.tgz -C $PDIR bin include lib buildlog.txt | 177 tar zcf $PDIR.tgz -C $PDIR bin include lib buildlog.txt |
168 else | 178 else |
169 tar zcf $PDIR.tgz -C $PDIR bin lib buildlog.txt | 179 tar zcf $PDIR.tgz -C $PDIR bin lib buildlog.txt |
170 fi | 180 fi |
171 | 181 |
| 182 if [ "$(uname -s)" = "Linux" ]; then |
| 183 tar zcf $GOLDDIR.tgz -C $GOLDDIR lib |
| 184 fi |
| 185 |
172 if [ "$(uname -s)" = "Darwin" ]; then | 186 if [ "$(uname -s)" = "Darwin" ]; then |
173 PLATFORM=Mac | 187 PLATFORM=Mac |
174 else | 188 else |
175 PLATFORM=Linux_x64 | 189 PLATFORM=Linux_x64 |
176 fi | 190 fi |
177 | 191 |
178 echo To upload, run: | 192 echo To upload, run: |
179 echo gsutil cp -a public-read $PDIR.tgz \ | 193 echo gsutil cp -a public-read $PDIR.tgz \ |
180 gs://chromium-browser-clang/$PLATFORM/$PDIR.tgz | 194 gs://chromium-browser-clang/$PLATFORM/$PDIR.tgz |
| 195 if [ "$(uname -s)" = "Linux" ]; then |
| 196 echo gsutil cp -a public-read $GOLDDIR.tgz \ |
| 197 gs://chromium-browser-clang/$PLATFORM/$GOLDDIR.tgz |
| 198 fi |
181 | 199 |
182 # FIXME: Warn if the file already exists on the server. | 200 # FIXME: Warn if the file already exists on the server. |
OLD | NEW |