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 # This script contains some functions useful to build | 7 # This script contains some functions useful to build |
8 # Valgrind and ThreadSanitizer for use with chromium | 8 # Valgrind and ThreadSanitizer for use with chromium |
9 | 9 |
10 THISDIR=$(dirname "${0}") | 10 THISDIR=$(dirname "${0}") |
(...skipping 16 matching lines...) Expand all Loading... |
27 SVN_URI="http://valgrind-variant.googlecode.com/svn/trunk" | 27 SVN_URI="http://valgrind-variant.googlecode.com/svn/trunk" |
28 | 28 |
29 test -d "$SOURCE_DIR" && rm -rf "$SOURCE_DIR" | 29 test -d "$SOURCE_DIR" && rm -rf "$SOURCE_DIR" |
30 mkdir "$SOURCE_DIR" | 30 mkdir "$SOURCE_DIR" |
31 | 31 |
32 # Check out latest version that following patches known to apply against | 32 # Check out latest version that following patches known to apply against |
33 svn co -r "$VG_REV" "$SVN_URI" "$SOURCE_DIR" | 33 svn co -r "$VG_REV" "$SVN_URI" "$SOURCE_DIR" |
34 cd $SOURCE_DIR/valgrind | 34 cd $SOURCE_DIR/valgrind |
35 } | 35 } |
36 | 36 |
37 checkout_and_patch_valgrind() { | |
38 # $1 = Valgrind revision | |
39 # $2 = VEX revision | |
40 # $3 = source dir | |
41 # Checkout Valgrind, apply our patches to Valgrind. | |
42 # The source will be put in $VG_SRC_DIR/valgrind-source | |
43 mkdir -p "$VG_SRC_DIR" | |
44 cd "$VG_SRC_DIR" | |
45 VG_REV="$1" | |
46 VEX_REV="$2" | |
47 SOURCE_DIR="$3" | |
48 SVN_URI="svn://svn.valgrind.org/valgrind/trunk" | |
49 | |
50 test -d "$SOURCE_DIR" && rm -rf "$SOURCE_DIR" | |
51 mkdir "$SOURCE_DIR" | |
52 | |
53 # Check out latest version that following patches known to apply against | |
54 svn co -r "$VG_REV" "$SVN_URI" "$SOURCE_DIR" | |
55 | |
56 cd "$SOURCE_DIR" | |
57 # Make sure svn gets the right version of the external VEX repo, too | |
58 svn up -r "$VEX_REV" VEX/ | |
59 | |
60 # Apply common patches to Valgrind {{{1 | |
61 # Work around bug https://bugs.kde.org/show_bug.cgi?id=162848 | |
62 # "fork() not handled properly" | |
63 if system_is_snow_leopard | |
64 then | |
65 patch -p0 -i "${THISDIR}/fork.10.6.patch" | |
66 else | |
67 patch -p0 -i "${THISDIR}/fork.patch" | |
68 fi | |
69 | |
70 # Work around bug https://bugs.kde.org/show_bug.cgi?id=164485 | |
71 # "VG_N_SEGNAMES and VG_N_SEGMENTS are (still) too small" | |
72 patch -p0 -i "${THISDIR}/limits.patch" | |
73 | |
74 # Add feature bug https://bugs.kde.org/show_bug.cgi?id=205000 | |
75 # "Need library load address in log files" | |
76 patch -p0 -i "${THISDIR}/xml-loadadr.patch" | |
77 | |
78 # Fix/work around https://bugs.kde.org/show_bug.cgi?id=210481 | |
79 # which prevented valgrind from handling v8 on 64 bits | |
80 patch -p0 -i "${THISDIR}/vbug210481.patch" | |
81 | |
82 # Add intercepts for tcmalloc memory functions. | |
83 # The corresponding feature request for Valgrind is at | |
84 # https://bugs.kde.org/show_bug.cgi?id=219156. | |
85 patch -p0 -i "${THISDIR}/intercept_tcmalloc.patch" | |
86 # }}} | |
87 } | |
88 | |
89 build_valgrind() { | 37 build_valgrind() { |
90 # Build Valgrind from sources in the current directory. | 38 # Build Valgrind from sources in the current directory. |
91 # $1 = output directory name for binaries | 39 # $1 = output directory name for binaries |
92 # $2 = flags to pass to configure | 40 # $2 = flags to pass to configure |
93 # {{{1 | 41 # {{{1 |
94 OUTPUT_DIR="$BINARIES_DIR/$1" | 42 OUTPUT_DIR="$BINARIES_DIR/$1" |
95 CONFIGURE_FLAGS=$2 | 43 CONFIGURE_FLAGS=$2 |
96 | 44 |
97 PREV_DIR=`pwd` | 45 PREV_DIR=`pwd` |
98 | 46 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 # Check that the binaries directory exists. | 173 # Check that the binaries directory exists. |
226 BINARIES_DIR="$THISDIR/../binaries" | 174 BINARIES_DIR="$THISDIR/../binaries" |
227 if ! [ -a "$BINARIES_DIR" ] | 175 if ! [ -a "$BINARIES_DIR" ] |
228 then | 176 then |
229 echo "Error: $BINARIES_DIR doesn't exist!" >&2 | 177 echo "Error: $BINARIES_DIR doesn't exist!" >&2 |
230 exit 1 | 178 exit 1 |
231 fi | 179 fi |
232 | 180 |
233 set -e | 181 set -e |
234 set -x | 182 set -x |
OLD | NEW |