Skip to content

Commit 48a1f1b

Browse files
committed
Auto merge of #27139 - pnkfelix:allow-disable-debuginfo, r=dotdash
fix `configure`: allow both `--enable-debug` and `--disable-debuginfo` in one invocation. This is my very local fix to allow one to be able to (1.) build `rustc` and (2.) run `make check` with internal debug-mode *assertions* turned on in the presence of bugs like #26447 and #26484 (both of which are solely caused by debuginfo and thus can be sidestepped via `--disable-debuginfo`). This partially addresses #24416 (namely, it addresses the papercut outlined in the description of that ticket). But there are other issues mentioned in the comment thread that are not addressed here, so they should be separately addressed before closing that ticket, or separate bugs should be opened for them.
2 parents 238765e + ac33f15 commit 48a1f1b

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

configure

+17-4
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,17 @@ envopt() {
323323
fi
324324
}
325325

326+
enable_if_not_disabled() {
327+
local OP=$1
328+
local UOP=$(echo $OP | tr '[:lower:]' '[:upper:]' | tr '\-' '\_')
329+
local ENAB_V="CFG_ENABLE_$UOP"
330+
local EXPLICITLY_DISABLED="CFG_DISABLE_${UOP}_PROVIDED"
331+
eval VV=\$$EXPLICITLY_DISABLED
332+
if [ -z "$VV" ]; then
333+
eval $ENAB_V=1
334+
fi
335+
}
336+
326337
to_llvm_triple() {
327338
case $1 in
328339
i686-w64-mingw32) echo i686-pc-windows-gnu ;;
@@ -671,10 +682,12 @@ if [ -n "$CFG_ENABLE_DEBUG" ]; then
671682
CFG_DISABLE_OPTIMIZE=1
672683
CFG_DISABLE_OPTIMIZE_CXX=1
673684
fi
674-
CFG_ENABLE_DEBUG_ASSERTIONS=1
675-
CFG_ENABLE_DEBUG_JEMALLOC=1
676-
CFG_ENABLE_DEBUGINFO=1
677-
CFG_ENABLE_LLVM_ASSERTIONS=1
685+
686+
# Set following variables to 1 unless setting already provided
687+
enable_if_not_disabled debug-assertions
688+
enable_if_not_disabled debug-jemalloc
689+
enable_if_not_disabled debuginfo
690+
enable_if_not_disabled llvm-assertions
678691
fi
679692

680693
# OK, now write the debugging options

0 commit comments

Comments
 (0)