[compiler-rt] 5684a61 - [HWASan] Remove -Wa, -mrelax-relocations=no flag.

Matt Morehouse via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 22 11:21:55 PST 2021


Author: Matt Morehouse
Date: 2021-11-22T11:21:27-08:00
New Revision: 5684a614dd1c1912feda712be0b14923b7c92c00

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

LOG: [HWASan] Remove -Wa,-mrelax-relocations=no flag.

We no longer need it after https://reviews.llvm.org/D113220.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D113221

Added: 
    

Modified: 
    compiler-rt/test/hwasan/TestCases/global.c
    compiler-rt/test/hwasan/lit.cfg.py

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/hwasan/TestCases/global.c b/compiler-rt/test/hwasan/TestCases/global.c
index 23fefd0ecceb..45413fe48c5b 100644
--- a/compiler-rt/test/hwasan/TestCases/global.c
+++ b/compiler-rt/test/hwasan/TestCases/global.c
@@ -5,6 +5,10 @@
 // RUN: not %run %t -1 2>&1 | FileCheck --check-prefixes=CHECK,LSYM %s
 // RUN: not %env_hwasan_opts=symbolize=0 %run %t -1 2>&1 | FileCheck --check-prefixes=CHECK,LNOSYM %s
 
+// Test with LTO, since it invokes the integrated assembler separately.
+// RUN: %clang_hwasan -flto %s -o %t
+// RUN: not %run %t 1 2>&1 | FileCheck --check-prefixes=CHECK,RSYM %s
+
 // Test with and without optimizations, with and without PIC, since 
diff erent
 // backend passes run depending on these flags.
 // RUN: %clang_hwasan -fno-pic %s -o %t

diff  --git a/compiler-rt/test/hwasan/lit.cfg.py b/compiler-rt/test/hwasan/lit.cfg.py
index 2cd6d641f2cf..85fda0c70324 100644
--- a/compiler-rt/test/hwasan/lit.cfg.py
+++ b/compiler-rt/test/hwasan/lit.cfg.py
@@ -18,13 +18,6 @@
 else:
   config.available_features.add('pointer-tagging')
 if config.target_arch == 'x86_64':
-  # By default the assembler uses R_X86_64_REX_GOTPCRELX relocations, which can
-  # be relaxed to direct references.  When tagged globals are enabled, these
-  # references fail to link since they have more than a 32-bit offset from RIP.
-  # As a workaround, we disable the relaxation.
-  # TODO: Implement a way to disable for the affected relocations only.
-  clang_hwasan_common_cflags += ["-Wa,-mrelax-relocations=no"]
-
   # The callback instrumentation used on x86_64 has a 1/64 chance of choosing a
   # stack tag of 0.  This causes stack tests to become flaky, so we force tags
   # to be generated via calls to __hwasan_generate_tag, which never returns 0.


        


More information about the llvm-commits mailing list