[llvm] def9550 - [Hashing] Remove Clang<=11 -fno-pic workaround (#110952)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 3 09:05:48 PDT 2024


Author: Fangrui Song
Date: 2024-10-03T09:05:43-07:00
New Revision: def9550c9b389eaa3adbac3089acf06a61a6fdb5

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

LOG: [Hashing] Remove Clang<=11 -fno-pic workaround (#110952)

If the LLVM build and an API user have different
`(!defined(__clang__) || __clang_major__ > 11)` values, we will have a
non-benign ODR violation and some users prefer a clear error to silent
breakage.

The Clang<=11 -fno-pic x86-64 workaround is likely not useful anyway
because builds are mostly PIC (`POSITION_INDEPENDENT_CODE` or
LLVM_ENABLE_PIC).

Added: 
    

Modified: 
    llvm/include/llvm/ADT/Hashing.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/Hashing.h b/llvm/include/llvm/ADT/Hashing.h
index 109966257b51c0..17dcf31c616aa7 100644
--- a/llvm/include/llvm/ADT/Hashing.h
+++ b/llvm/include/llvm/ADT/Hashing.h
@@ -311,10 +311,7 @@ struct hash_state {
 /// depend on the particular hash values. On platforms without ASLR, this is
 /// still likely non-deterministic per build.
 inline uint64_t get_execution_seed() {
-  // Work around x86-64 negative offset folding for old Clang -fno-pic
-  // https://reviews.llvm.org/D93931
-#if LLVM_ENABLE_ABI_BREAKING_CHECKS &&                                         \
-    (!defined(__clang__) || __clang_major__ > 11)
+#if LLVM_ENABLE_ABI_BREAKING_CHECKS
   return static_cast<uint64_t>(
       reinterpret_cast<uintptr_t>(&install_fatal_error_handler));
 #else


        


More information about the llvm-commits mailing list