OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 # Copyright (c) 2009-2010 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2009-2010 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # Script to build ThreadSanitizer binaries for use with chromium | 7 # Script to build ThreadSanitizer binaries for use with chromium |
8 source common.sh | 8 source common.sh |
9 | 9 |
10 POST_BUILD_HOOK_DEFINED=yes | 10 POST_BUILD_HOOK_DEFINED=yes |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 cd "$VG_TSAN_DIR" | 51 cd "$VG_TSAN_DIR" |
52 | 52 |
53 # Apply TSan-specific patches except: | 53 # Apply TSan-specific patches except: |
54 # * limits (buggy on Mac) | 54 # * limits (buggy on Mac) |
55 # * guest_amd64_toIR (already applied in common.sh). | 55 # * guest_amd64_toIR (already applied in common.sh). |
56 rm "$THISDIR"/tsan/valgrind_patches/{limits,guest_amd64_toIR}.patch | 56 rm "$THISDIR"/tsan/valgrind_patches/{limits,guest_amd64_toIR}.patch |
57 for P in "$THISDIR"/tsan/valgrind_patches/*.patch | 57 for P in "$THISDIR"/tsan/valgrind_patches/*.patch |
58 do | 58 do |
59 patch -p0 -i $P | 59 patch -p0 -i $P |
60 echo | |
61 done | 60 done |
62 | 61 |
| 62 if [ `uname -s` == "Darwin" ] |
| 63 then |
| 64 if ls /opt/local/bin/ | grep "^gcc-mp-4\.4" >/dev/null |
| 65 then |
| 66 export GCC_BINARY_MASK="/opt/local/bin/XXX-mp-4.4" |
| 67 export PATH="$THISDIR/macports-gcc-wrapper:$PATH" |
| 68 echo "Using gcc-4.4 from MacPorts to build ThreadSanitizer." |
| 69 elif gcc --version | grep " 4\.[0-3]\.[0-9]\| 3\.[0-9]\.[0-9]" >/dev/null |
| 70 then |
| 71 echo "Your gcc version is older than 4.4." |
| 72 echo "It is recommended to use gcc-4.4 from MacPorts for building" |
| 73 echo "ThreadSanitizer, especially if you plan to commit binaries into SVN." |
| 74 echo "See http://gcc44.darwinports.com/ for getting gcc-4.4" |
| 75 echo "" |
| 76 echo -n "Do you want to continue using old gcc? (y/N)" |
| 77 read CONFIRMATION |
| 78 if [ "$CONFIRMATION" != "y" ] |
| 79 then |
| 80 exit 1 |
| 81 fi |
| 82 fi |
| 83 fi |
| 84 |
63 # Ugly hack! | 85 # Ugly hack! |
64 # We build Valrgind binaries in the $VG_TSAN_DIR/out and then pack | 86 # We build Valrgind binaries in the $VG_TSAN_DIR/out and then pack |
65 # them into self-contained .sh file into $ORIG_BINARIES_DIR/$PLATFORM | 87 # them into self-contained .sh file into $ORIG_BINARIES_DIR/$PLATFORM |
66 ORIG_BINARIES_DIR=$BINARIES_DIR | 88 ORIG_BINARIES_DIR=$BINARIES_DIR |
67 BINARIES_DIR="$VG_TSAN_DIR/out" | 89 BINARIES_DIR="$VG_TSAN_DIR/out" |
68 build_valgrind_for_available_platforms | 90 build_valgrind_for_available_platforms |
OLD | NEW |