]> git.lizzy.rs Git - rust.git/blobdiff - configure
Fix UB in test helpers
[rust.git] / configure
index beb0a9d43a0cf4cd87b2a48da157c64e5589cbfc..fa81684fb48e289b2be7a9f46450da295c4b4ef4 100755 (executable)
--- a/configure
+++ b/configure
@@ -541,6 +541,18 @@ case $CFG_CPUTYPE in
         CFG_CPUTYPE=x86_64
         ;;
 
+    mips | mips64)
+        if [ "$CFG_CPUTYPE" = "mips64" ]; then
+            CFG_OSTYPE="${CFG_OSTYPE}abi64"
+        fi
+        ENDIAN=$(printf '\1' | od -dAn)
+        if [ "$ENDIAN" -eq 1 ]; then
+            CFG_CPUTYPE="${CFG_CPUTYPE}el"
+        elif [ "$ENDIAN" -ne 256 ]; then
+            err "unknown endianness: $ENDIAN (expecting 1 for little or 256 for big)"
+        fi
+        ;;
+
     BePC)
         CFG_CPUTYPE=i686
         ;;
@@ -647,6 +659,7 @@ opt_nosave debug-assertions 0 "build with debugging assertions"
 opt_nosave llvm-release-debuginfo 0 "build LLVM with debugger metadata"
 opt_nosave debuginfo 0 "build with debugger metadata"
 opt_nosave debuginfo-lines 0 "build with line number debugger metadata"
+opt_nosave debuginfo-only-std 0 "build only libstd with debugging information"
 opt_nosave debug-jemalloc 0 "build jemalloc with --enable-debug --enable-fill"
 
 valopt localstatedir "/var/lib" "local state directory"
@@ -733,15 +746,17 @@ case "$CFG_RELEASE_CHANNEL" in
     nightly )
        msg "overriding settings for $CFG_RELEASE_CHANNEL"
        CFG_ENABLE_LLVM_ASSERTIONS=1
-
-        # FIXME(#37364) shouldn't have to disable this on windows-gnu
+        # FIXME(stage0) re-enable this on the next stage0 now that #35566 is
+        # fixed
         case "$CFG_BUILD" in
           *-pc-windows-gnu)
             ;;
           *)
-           CFG_ENABLE_DEBUGINFO_LINES=1
+            CFG_ENABLE_DEBUGINFO_LINES=1
+            CFG_ENABLE_DEBUGINFO_ONLY_STD=1
             ;;
         esac
+
        ;;
     beta | stable)
        msg "overriding settings for $CFG_RELEASE_CHANNEL"
@@ -749,7 +764,8 @@ case "$CFG_RELEASE_CHANNEL" in
           *-pc-windows-gnu)
             ;;
           *)
-           CFG_ENABLE_DEBUGINFO_LINES=1
+            CFG_ENABLE_DEBUGINFO_LINES=1
+            CFG_ENABLE_DEBUGINFO_ONLY_STD=1
             ;;
         esac
        ;;
@@ -785,6 +801,7 @@ if [ -n "$CFG_ENABLE_DEBUG_ASSERTIONS" ]; then putvar CFG_ENABLE_DEBUG_ASSERTION
 if [ -n "$CFG_ENABLE_LLVM_RELEASE_DEBUGINFO" ]; then putvar CFG_ENABLE_LLVM_RELEASE_DEBUGINFO; fi
 if [ -n "$CFG_ENABLE_DEBUGINFO" ]; then putvar CFG_ENABLE_DEBUGINFO; fi
 if [ -n "$CFG_ENABLE_DEBUGINFO_LINES" ]; then putvar CFG_ENABLE_DEBUGINFO_LINES; fi
+if [ -n "$CFG_ENABLE_DEBUGINFO_ONLY_STD" ]; then putvar CFG_ENABLE_DEBUGINFO_ONLY_STD; fi
 if [ -n "$CFG_ENABLE_DEBUG_JEMALLOC" ]; then putvar CFG_ENABLE_DEBUG_JEMALLOC; fi
 
 step_msg "looking for build programs"
@@ -1568,7 +1585,7 @@ do
     then
         LLVM_BUILD_DIR=${CFG_BUILD_DIR}$t/llvm
         LLVM_INST_DIR=$LLVM_BUILD_DIR
-        # For some crazy reason the MSVC output dir is different than Unix
+        # For some weird reason the MSVC output dir is different than Unix
         if [ ${is_msvc} -ne 0 ]; then
             if [ -n "$CFG_DISABLE_OPTIMIZE_LLVM" ]
             then