@@ -29,12 +29,12 @@ RC=""
29
29
Triple=" "
30
30
use_gzip=" no"
31
31
do_checkout=" yes"
32
- do_64bit=" yes"
33
32
do_debug=" no"
34
33
do_asserts=" no"
35
34
do_compare=" yes"
36
35
BuildDir=" ` pwd` "
37
- BuildTriple=" "
36
+ use_autoconf=" no"
37
+ ExtraConfigureFlags=" "
38
38
39
39
function usage() {
40
40
echo " usage: ` basename $0 ` -release X.Y.Z -rc NUM [OPTIONS]"
@@ -46,15 +46,19 @@ function usage() {
46
46
echo " -j NUM Number of compile jobs to run. [default: 3]"
47
47
echo " -build-dir DIR Directory to perform testing in. [default: pwd]"
48
48
echo " -no-checkout Don't checkout the sources from SVN."
49
- echo " -no-64bit Don't test the 64-bit version. [default: yes]"
50
49
echo " -test-debug Test the debug build. [default: no]"
51
50
echo " -test-asserts Test with asserts on. [default: no]"
52
51
echo " -no-compare-files Don't test that phase 2 and 3 files are identical."
53
52
echo " -use-gzip Use gzip instead of xz."
54
- echo " -build-triple TRIPLE The build triple for this machine "
55
- echo " [default: use config.guess] "
53
+ echo " -configure-flags FLAGS Extra flags to pass to the configure step. "
54
+ echo " -use-autoconf Use autoconf instead of cmake "
56
55
}
57
56
57
+ if [ ` uname -s` = " Darwin" ]; then
58
+ # compiler-rt doesn't yet build with CMake on Darwin.
59
+ use_autoconf=" yes"
60
+ fi
61
+
58
62
while [ $# -gt 0 ]; do
59
63
case $1 in
60
64
-release | --release )
@@ -73,9 +77,9 @@ while [ $# -gt 0 ]; do
73
77
shift
74
78
Triple=" $1 "
75
79
;;
76
- -build-triple | --build-triple )
80
+ -configure-flags | --configure-flags )
77
81
shift
78
- BuildTriple =" $1 "
82
+ ExtraConfigureFlags =" $1 "
79
83
;;
80
84
-j* )
81
85
NumJobs=" ` echo $1 | sed -e ' s,-j\([0-9]*\),\1,g' ` "
@@ -91,9 +95,6 @@ while [ $# -gt 0 ]; do
91
95
-no-checkout | --no-checkout )
92
96
do_checkout=" no"
93
97
;;
94
- -no-64bit | --no-64bit )
95
- do_64bit=" no"
96
- ;;
97
98
-test-debug | --test-debug )
98
99
do_debug=" yes"
99
100
;;
@@ -106,6 +107,9 @@ while [ $# -gt 0 ]; do
106
107
-use-gzip | --use-gzip )
107
108
use_gzip=" yes"
108
109
;;
110
+ -use-autoconf | --use-autoconf )
111
+ use_autoconf=" yes"
112
+ ;;
109
113
-help | --help | -h | --h | -\? )
110
114
usage
111
115
exit 0
@@ -233,17 +237,20 @@ function configure_llvmCore() {
233
237
ObjDir=" $3 "
234
238
235
239
case $Flavor in
236
- Release | Release-64 )
237
- Optimized=" yes"
238
- Assertions=" no"
240
+ Release )
241
+ BuildType=" Release"
242
+ Assertions=" OFF"
243
+ ConfigureFlags=" --enable-optimized --disable-assertions"
239
244
;;
240
245
Release+Asserts )
241
- Optimized=" yes"
242
- Assertions=" yes"
246
+ BuildType=" Release"
247
+ Assertions=" ON"
248
+ ConfigureFlags=" --enable-optimized --enable-assertions"
243
249
;;
244
250
Debug )
245
- Optimized=" no"
246
- Assertions=" yes"
251
+ BuildType=" Debug"
252
+ Assertions=" ON"
253
+ ConfigureFlags=" --disable-optimized --enable-assertions"
247
254
;;
248
255
* )
249
256
echo " # Invalid flavor '$Flavor '"
@@ -255,22 +262,33 @@ function configure_llvmCore() {
255
262
echo " # Using C compiler: $c_compiler "
256
263
echo " # Using C++ compiler: $cxx_compiler "
257
264
258
- build_triple_option=" ${BuildTriple: +--build=$BuildTriple } "
259
-
260
265
cd $ObjDir
261
266
echo " # Configuring llvm $Release -$RC $Flavor "
262
- echo " # $BuildDir /llvm.src/configure \
263
- --enable-optimized=$Optimized \
264
- --enable-assertions=$Assertions \
265
- --disable-timestamps \
266
- $build_triple_option "
267
- env CC=" $c_compiler " CXX=" $cxx_compiler " \
268
- $BuildDir /llvm.src/configure \
269
- --enable-optimized=$Optimized \
270
- --enable-assertions=$Assertions \
271
- --disable-timestamps \
272
- $build_triple_option \
273
- 2>&1 | tee $LogDir /llvm.configure-Phase$Phase -$Flavor .log
267
+
268
+ if [ " $use_autoconf " = " yes" ]; then
269
+ echo " #" env CC=" $c_compiler " CXX=" $cxx_compiler " \
270
+ $BuildDir /llvm.src/configure \
271
+ $ConfigureFlags --disable-timestamps $ExtraConfigureFlags \
272
+ 2>&1 | tee $LogDir /llvm.configure-Phase$Phase -$Flavor .log
273
+ env CC=" $c_compiler " CXX=" $cxx_compiler " \
274
+ $BuildDir /llvm.src/configure \
275
+ $ConfigureFlags --disable-timestamps $ExtraConfigureFlags \
276
+ 2>&1 | tee $LogDir /llvm.configure-Phase$Phase -$Flavor .log
277
+ else
278
+ echo " #" env CC=" $c_compiler " CXX=" $cxx_compiler " \
279
+ cmake -G " Unix Makefiles" \
280
+ -DCMAKE_BUILD_TYPE=$BuildType -DLLVM_ENABLE_ASSERTIONS=$Assertions \
281
+ -DLLVM_ENABLE_TIMESTAMPS=OFF -DLLVM_CONFIGTIME=" (timestamp not enabled)" \
282
+ $ExtraConfigureFlags $BuildDir /llvm.src \
283
+ 2>&1 | tee $LogDir /llvm.configure-Phase$Phase -$Flavor .log
284
+ env CC=" $c_compiler " CXX=" $cxx_compiler " \
285
+ cmake -G " Unix Makefiles" \
286
+ -DCMAKE_BUILD_TYPE=$BuildType -DLLVM_ENABLE_ASSERTIONS=$Assertions \
287
+ -DLLVM_ENABLE_TIMESTAMPS=OFF -DLLVM_CONFIGTIME=" (timestamp not enabled)" \
288
+ $ExtraConfigureFlags $BuildDir /llvm.src \
289
+ 2>&1 | tee $LogDir /llvm.configure-Phase$Phase -$Flavor .log
290
+ fi
291
+
274
292
cd $BuildDir
275
293
}
276
294
@@ -279,16 +297,11 @@ function build_llvmCore() {
279
297
Flavor=" $2 "
280
298
ObjDir=" $3 "
281
299
DestDir=" $4 "
282
- ExtraOpts=" "
283
-
284
- if [ " $Flavor " = " Release-64" ]; then
285
- ExtraOpts=" EXTRA_OPTIONS=-m64"
286
- fi
287
300
288
301
cd $ObjDir
289
302
echo " # Compiling llvm $Release -$RC $Flavor "
290
- echo " # ${MAKE} -j $NumJobs VERBOSE=1 $ExtraOpts "
291
- ${MAKE} -j $NumJobs VERBOSE=1 $ExtraOpts \
303
+ echo " # ${MAKE} -j $NumJobs VERBOSE=1"
304
+ ${MAKE} -j $NumJobs VERBOSE=1 \
292
305
2>&1 | tee $LogDir /llvm.make-Phase$Phase -$Flavor .log
293
306
294
307
echo " # Installing llvm $Release -$RC $Flavor "
@@ -305,10 +318,15 @@ function test_llvmCore() {
305
318
ObjDir=" $3 "
306
319
307
320
cd $ObjDir
308
- ${MAKE} -k check-all \
321
+ ${MAKE} -j $NumJobs - k check-all \
309
322
2>&1 | tee $LogDir /llvm.check-Phase$Phase -$Flavor .log
310
- ${MAKE} -k unittests \
311
- 2>&1 | tee $LogDir /llvm.unittests-Phase$Phase -$Flavor .log
323
+
324
+ if [ " $use_autoconf " = " yes" ]; then
325
+ # In the cmake build, unit tests are run as part of check-all.
326
+ ${MAKE} -k unittests \
327
+ 2>&1 | tee $LogDir /llvm.unittests-Phase$Phase -$Flavor .log
328
+ fi
329
+
312
330
cd $BuildDir
313
331
}
314
332
362
380
if [ " $do_asserts " = " yes" ]; then
363
381
Flavors=" $Flavors Release+Asserts"
364
382
fi
365
- if [ " $do_64bit " = " yes" ]; then
366
- Flavors=" $Flavors Release-64"
367
- fi
368
383
369
384
for Flavor in $Flavors ; do
370
385
echo " "
@@ -446,10 +461,13 @@ for Flavor in $Flavors ; do
446
461
if [ " $do_compare " = " yes" ]; then
447
462
echo
448
463
echo " # Comparing Phase 2 and Phase 3 files"
449
- for o in ` find $llvmCore_phase2_objdir -name ' *.o' ` ; do
450
- p3=` echo $o | sed -e ' s,Phase2,Phase3,' `
451
- if ! cmp --ignore-initial=16 $o $p3 > /dev/null 2>&1 ; then
452
- echo " file ` basename $o ` differs between phase 2 and phase 3"
464
+ for p2 in ` find $llvmCore_phase2_objdir -name ' *.o' ` ; do
465
+ p3=` echo $p2 | sed -e ' s,Phase2,Phase3,' `
466
+ # Substitute 'Phase2' for 'Phase3' in the Phase 2 object file in
467
+ # case there are build paths in the debug info.
468
+ if ! cmp --ignore-initial=16 <( sed -e ' s,Phase2,Phase3,g' $p2 ) $p3 \
469
+ > /dev/null 2>&1 ; then
470
+ echo " file ` basename $p2 ` differs between phase 2 and phase 3"
453
471
fi
454
472
done
455
473
fi
0 commit comments