[compiler-rt] 484b664 - scudo: Only static_assert for compressed LSB format with clang.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 22 16:12:09 PDT 2021


Author: Peter Collingbourne
Date: 2021-04-22T16:11:52-07:00
New Revision: 484b6648fdd4b104eaf7a2504dd07b60af2c9f8d

URL: https://github.com/llvm/llvm-project/commit/484b6648fdd4b104eaf7a2504dd07b60af2c9f8d
DIFF: https://github.com/llvm/llvm-project/commit/484b6648fdd4b104eaf7a2504dd07b60af2c9f8d.diff

LOG: scudo: Only static_assert for compressed LSB format with clang.

It looks like there's some old version of gcc that doesn't like this
static_assert (I couldn't reproduce the issue with gcc 8, 9 or 10).
Work around the issue by only checking the static_assert under clang,
which should provide sufficient coverage.

Should hopefully fix this buildbot:
https://lab.llvm.org/buildbot/#/builders/112/builds/5356

Added: 
    

Modified: 
    compiler-rt/lib/scudo/standalone/size_class_map.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/scudo/standalone/size_class_map.h b/compiler-rt/lib/scudo/standalone/size_class_map.h
index 37a3efd7e8e6..1948802df0ba 100644
--- a/compiler-rt/lib/scudo/standalone/size_class_map.h
+++ b/compiler-rt/lib/scudo/standalone/size_class_map.h
@@ -273,7 +273,7 @@ struct AndroidSizeClassConfig {
 
 typedef TableSizeClassMap<AndroidSizeClassConfig> AndroidSizeClassMap;
 
-#if SCUDO_WORDSIZE == 64U
+#if SCUDO_WORDSIZE == 64U && defined(__clang__)
 static_assert(AndroidSizeClassMap::usesCompressedLSBFormat(), "");
 #endif
 


        


More information about the llvm-commits mailing list