523
523
BOOL_OPTIONS=" "
524
524
VAL_OPTIONS=" "
525
525
526
+ opt debug 0 " debug mode"
526
527
opt valgrind 0 " run tests with valgrind (memcheck by default)"
527
528
opt helgrind 0 " run tests with helgrind instead of memcheck"
528
529
opt valgrind-rpass 1 " run rpass-valgrind tests with valgrind"
529
530
opt docs 1 " build standard library documentation"
530
531
opt compiler-docs 0 " build compiler documentation"
531
- opt optimize 1 " build optimized rust code"
532
- opt optimize-cxx 1 " build optimized C++ code"
533
- opt optimize-llvm 1 " build optimized LLVM"
534
532
opt optimize-tests 1 " build tests with optimizations"
535
533
opt libcpp 1 " build with llvm with libc++ instead of libstdc++ when using clang"
536
- opt llvm-assertions 1 " build LLVM with assertions"
537
- opt debug 1 " build with extra debug fun "
534
+ opt llvm-assertions 0 " build LLVM with assertions"
535
+ opt debug-assertions 0 " build with debugging assertions "
538
536
opt fast-make 0 " use .gitmodules as timestamp for submodule deps"
539
537
opt ccache 0 " invoke gcc/clang via ccache to reuse object files between builds"
540
538
opt local-rust 0 " use an installed rustc rather than downloading a snapshot"
541
539
opt llvm-static-stdcpp 0 " statically link to libstdc++ for LLVM"
542
540
opt rpath 0 " build rpaths into rustc itself"
543
- opt nightly 0 " build nightly packages"
544
- opt verify-install 1 " verify installed binaries work"
545
541
# This is used by the automation to produce single-target nightlies
546
542
opt dist-host-only 0 " only install bins for the host architecture"
547
543
opt inject-std-version 1 " inject the current compiler version of libstd into programs"
548
544
opt llvm-version-check 1 " don't check if the LLVM version is supported, build anyway"
549
545
546
+ # Optimization and debugging options. These may be overridden by the release channel, etc.
547
+ opt_nosave optimize 1 " build optimized rust code"
548
+ opt_nosave optimize-cxx 1 " build optimized C++ code"
549
+ opt_nosave optimize-llvm 1 " build optimized LLVM"
550
+ opt_nosave llvm-assertions 0 " build LLVM with assertions"
551
+ opt_nosave debug-assertions 0 " build with debugging assertions"
552
+ opt_nosave debuginfo 0 " build with debugger metadata"
553
+ opt_nosave debug-jemalloc 0 " build jemalloc with --enable-debug --enable-fill"
554
+
550
555
valopt localstatedir " /var/lib" " local state directory"
551
556
valopt sysconfdir " /etc" " install system configuration files"
552
557
@@ -556,6 +561,7 @@ valopt llvm-root "" "set LLVM root"
556
561
valopt jemalloc-root " " " set directory where libjemalloc_pic.a is located"
557
562
valopt build " ${DEFAULT_BUILD} " " GNUs ./configure syntax LLVM build triple"
558
563
valopt android-cross-path " /opt/ndk_standalone" " Android NDK standalone path"
564
+ valopt release-channel " dev" " the name of the release channel to build"
559
565
560
566
# Many of these are saved below during the "writing configuration" step
561
567
# (others are conditionally saved).
@@ -568,7 +574,6 @@ valopt_nosave local-rust-root "/usr/local" "set prefix for local rust binary"
568
574
valopt_nosave host " ${CFG_BUILD} " " GNUs ./configure syntax LLVM host triples"
569
575
valopt_nosave target " ${CFG_HOST} " " GNUs ./configure syntax LLVM target triples"
570
576
valopt_nosave mandir " ${CFG_PREFIX} /share/man" " install man pages in PATH"
571
- valopt_nosave release-channel " dev" " the name of the release channel to build"
572
577
573
578
# Temporarily support old triples until buildbots get updated
574
579
CFG_BUILD=$( to_llvm_triple $CFG_BUILD )
@@ -621,13 +626,24 @@ case "$CFG_RELEASE_CHANNEL" in
621
626
;;
622
627
esac
623
628
624
- # Continue supporting the old --enable-nightly flag to transition the bots
625
- # XXX Remove me
626
- if [ ! -z " $CFG_ENABLE_NIGHTLY " ]
627
- then
628
- CFG_RELEASE_CHANNEL=nightly
629
+ # Adjust perf and debug options for debug mode
630
+ if [ -n " $CFG_ENABLE_DEBUG " ]; then
631
+ msg " debug mode enabled, setting performance options"
632
+ CFG_DISABLE_OPTIMIZE=1
633
+ CFG_DISABLE_OPTIMIZE_CXX=1
634
+ CFG_ENABLE_LLVM_ASSERTIONS=1
635
+ CFG_ENABLE_DEBUG_ASSERTIONS=1
636
+ CFG_ENABLE_DEBUG_JEMALLOC=1
629
637
fi
630
- putvar CFG_RELEASE_CHANNEL
638
+
639
+ # OK, now write the debugging options
640
+ if [ -n " $CFG_DISABLE_OPTIMIZE " ]; then putvar CFG_DISABLE_OPTIMIZE; fi
641
+ if [ -n " $CFG_DISABLE_OPTIMIZE_CXX " ]; then putvar CFG_DISABLE_OPTIMIZE_CXX; fi
642
+ if [ -n " $CFG_DISABLE_OPTIMIZE_LLVM " ]; then putvar CFG_DISABLE_OPTIMIZE_LLVM; fi
643
+ if [ -n " $CFG_ENABLE_LLVM_ASSERTIONS " ]; then putvar CFG_ENABLE_LLVM_ASSERTIONS; fi
644
+ if [ -n " $CFG_ENABLE_DEBUG_ASSERTIONS " ]; then putvar CFG_ENABLE_DEBUG_ASSERTIONS; fi
645
+ if [ -n " $CFG_ENABLE_DEBUGINFO " ]; then putvar CFG_ENABLE_DEBUGINFO; fi
646
+ if [ -n " $CFG_ENABLE_DEBUG_JEMALLOC " ]; then putvar CFG_ENABLE_DEBUG_JEMALLOC; fi
631
647
632
648
# A magic value that allows the compiler to use unstable features
633
649
# during the bootstrap even when doing so would normally be an error
1180
1196
LLVM_DBG_OPTS=" --enable-optimized"
1181
1197
LLVM_INST_DIR=$LLVM_BUILD_DIR /Release
1182
1198
fi
1183
- if [ ! -z " $CFG_DISABLE_LLVM_ASSERTIONS " ]
1199
+ if [ -z " $CFG_ENABLE_LLVM_ASSERTIONS " ]
1184
1200
then
1185
1201
LLVM_ASSERTION_OPTS=" --disable-assertions"
1186
1202
else
@@ -1434,6 +1450,11 @@ move_if_changed config.tmp config.mk
1434
1450
rm -f config.tmp
1435
1451
touch config.stamp
1436
1452
1437
- step_msg " complete"
1453
+ if [ -z " $CFG_ENABLE_DEBUG " ]; then
1454
+ step_msg " configured in release mode. for development consider --enable-debug"
1455
+ else
1456
+ step_msg " complete"
1457
+ fi
1458
+
1438
1459
msg " run \` make help\` "
1439
1460
msg
0 commit comments