Skip to content

Commit e07e49e

Browse files
committed
auto merge of #8147 : dotdash/rust/assertion_option, r=pcwalton
Builds are considerably faster without assertions, so when working on e.g. libstd, which doesn't directly interact with LLVM, one might want to disable them.
2 parents 389aba0 + 02f7f72 commit e07e49e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

configure

+11-3
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ opt docs 1 "build documentation"
371371
opt optimize 1 "build optimized rust code"
372372
opt optimize-cxx 1 "build optimized C++ code"
373373
opt optimize-llvm 1 "build optimized LLVM"
374+
opt llvm-assertions 1 "build LLVM with assertions"
374375
opt debug 0 "build with extra debug fun"
375376
opt ratchet-bench 0 "ratchet benchmarks"
376377
opt fast-make 0 "use .gitmodules as timestamp for submodule deps"
@@ -793,10 +794,17 @@ do
793794
LLVM_DBG_OPTS="--enable-debug-symbols --disable-optimized"
794795
# Just use LLVM straight from its build directory to
795796
# avoid 'make install' time
796-
LLVM_INST_DIR=$LLVM_BUILD_DIR/Debug+Asserts
797+
LLVM_INST_DIR=$LLVM_BUILD_DIR/Debug
797798
else
798799
LLVM_DBG_OPTS="--enable-optimized"
799-
LLVM_INST_DIR=$LLVM_BUILD_DIR/Release+Asserts
800+
LLVM_INST_DIR=$LLVM_BUILD_DIR/Release
801+
fi
802+
if [ ! -z "$CFG_DISABLE_LLVM_ASSERTIONS" ]
803+
then
804+
LLVM_ASSERTION_OPTS="--disable-assertions"
805+
else
806+
LLVM_ASSERTION_OPTS="--enable-assertions"
807+
LLVM_INST_DIR=${LLVM_INST_DIR}+Asserts
800808
fi
801809
else
802810
msg "not reconfiguring LLVM, external LLVM root"
@@ -836,7 +844,7 @@ do
836844
LLVM_TARGET="--target=$t"
837845

838846
# Disable unused LLVM features
839-
LLVM_OPTS="$LLVM_DBG_OPTS --disable-docs --enable-bindings=none"
847+
LLVM_OPTS="$LLVM_DBG_OPTS $LLVM_ASSERTION_OPTS --disable-docs --enable-bindings=none"
840848

841849
case "$CFG_C_COMPILER" in
842850
("ccache clang")

0 commit comments

Comments
 (0)