Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 789b63a

Browse files
committed
Merging r242331:
------------------------------------------------------------------------ r242331 | hans | 2015-07-15 14:06:16 -0700 (Wed, 15 Jul 2015) | 17 lines Switch the release script to build with CMake by default (PR21561) It retains the possibility to use the autoconf build with a command-line option ('-use-autoconf'), and uses that by default on Darwin since compiler-rt requires it on that platform. This commit also removes the "Release-64" flavour and related logic. The script would previously do two builds unless the '-no-64bit' flag was passed, but on my machine and from those I asked this always ended up producing two 64-bit builds, causing much confusion. It also removes the -build-triple option, which caused the --build= flag to get passed to ./configure. This was presumably intended for cross-compiling, but none of the release testers use it. If someone does want to pass it, they can use '-configure-flags --build=foo' instead. Differential Revision: http://reviews.llvm.org/D10715 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_37@242360 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent befaca2 commit 789b63a

File tree

1 file changed

+66
-48
lines changed

1 file changed

+66
-48
lines changed

utils/release/test-release.sh

Lines changed: 66 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ RC=""
2929
Triple=""
3030
use_gzip="no"
3131
do_checkout="yes"
32-
do_64bit="yes"
3332
do_debug="no"
3433
do_asserts="no"
3534
do_compare="yes"
3635
BuildDir="`pwd`"
37-
BuildTriple=""
36+
use_autoconf="no"
37+
ExtraConfigureFlags=""
3838

3939
function usage() {
4040
echo "usage: `basename $0` -release X.Y.Z -rc NUM [OPTIONS]"
@@ -46,15 +46,19 @@ function usage() {
4646
echo " -j NUM Number of compile jobs to run. [default: 3]"
4747
echo " -build-dir DIR Directory to perform testing in. [default: pwd]"
4848
echo " -no-checkout Don't checkout the sources from SVN."
49-
echo " -no-64bit Don't test the 64-bit version. [default: yes]"
5049
echo " -test-debug Test the debug build. [default: no]"
5150
echo " -test-asserts Test with asserts on. [default: no]"
5251
echo " -no-compare-files Don't test that phase 2 and 3 files are identical."
5352
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"
5655
}
5756

57+
if [ `uname -s` = "Darwin" ]; then
58+
# compiler-rt doesn't yet build with CMake on Darwin.
59+
use_autoconf="yes"
60+
fi
61+
5862
while [ $# -gt 0 ]; do
5963
case $1 in
6064
-release | --release )
@@ -73,9 +77,9 @@ while [ $# -gt 0 ]; do
7377
shift
7478
Triple="$1"
7579
;;
76-
-build-triple | --build-triple )
80+
-configure-flags | --configure-flags )
7781
shift
78-
BuildTriple="$1"
82+
ExtraConfigureFlags="$1"
7983
;;
8084
-j* )
8185
NumJobs="`echo $1 | sed -e 's,-j\([0-9]*\),\1,g'`"
@@ -91,9 +95,6 @@ while [ $# -gt 0 ]; do
9195
-no-checkout | --no-checkout )
9296
do_checkout="no"
9397
;;
94-
-no-64bit | --no-64bit )
95-
do_64bit="no"
96-
;;
9798
-test-debug | --test-debug )
9899
do_debug="yes"
99100
;;
@@ -106,6 +107,9 @@ while [ $# -gt 0 ]; do
106107
-use-gzip | --use-gzip )
107108
use_gzip="yes"
108109
;;
110+
-use-autoconf | --use-autoconf )
111+
use_autoconf="yes"
112+
;;
109113
-help | --help | -h | --h | -\? )
110114
usage
111115
exit 0
@@ -233,17 +237,20 @@ function configure_llvmCore() {
233237
ObjDir="$3"
234238

235239
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"
239244
;;
240245
Release+Asserts )
241-
Optimized="yes"
242-
Assertions="yes"
246+
BuildType="Release"
247+
Assertions="ON"
248+
ConfigureFlags="--enable-optimized --enable-assertions"
243249
;;
244250
Debug )
245-
Optimized="no"
246-
Assertions="yes"
251+
BuildType="Debug"
252+
Assertions="ON"
253+
ConfigureFlags="--disable-optimized --enable-assertions"
247254
;;
248255
* )
249256
echo "# Invalid flavor '$Flavor'"
@@ -255,22 +262,33 @@ function configure_llvmCore() {
255262
echo "# Using C compiler: $c_compiler"
256263
echo "# Using C++ compiler: $cxx_compiler"
257264

258-
build_triple_option="${BuildTriple:+--build=$BuildTriple}"
259-
260265
cd $ObjDir
261266
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+
274292
cd $BuildDir
275293
}
276294

@@ -279,16 +297,11 @@ function build_llvmCore() {
279297
Flavor="$2"
280298
ObjDir="$3"
281299
DestDir="$4"
282-
ExtraOpts=""
283-
284-
if [ "$Flavor" = "Release-64" ]; then
285-
ExtraOpts="EXTRA_OPTIONS=-m64"
286-
fi
287300

288301
cd $ObjDir
289302
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 \
292305
2>&1 | tee $LogDir/llvm.make-Phase$Phase-$Flavor.log
293306

294307
echo "# Installing llvm $Release-$RC $Flavor"
@@ -305,10 +318,15 @@ function test_llvmCore() {
305318
ObjDir="$3"
306319

307320
cd $ObjDir
308-
${MAKE} -k check-all \
321+
${MAKE} -j $NumJobs -k check-all \
309322
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+
312330
cd $BuildDir
313331
}
314332

@@ -362,9 +380,6 @@ fi
362380
if [ "$do_asserts" = "yes" ]; then
363381
Flavors="$Flavors Release+Asserts"
364382
fi
365-
if [ "$do_64bit" = "yes" ]; then
366-
Flavors="$Flavors Release-64"
367-
fi
368383

369384
for Flavor in $Flavors ; do
370385
echo ""
@@ -446,10 +461,13 @@ for Flavor in $Flavors ; do
446461
if [ "$do_compare" = "yes" ]; then
447462
echo
448463
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"
453471
fi
454472
done
455473
fi

0 commit comments

Comments
 (0)