[clang] 7d2dddc - [PS5] Enable dead-stripping globals in ASan

Paul Robinson via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 27 15:44:51 PDT 2022


Author: Paul Robinson
Date: 2022-04-27T15:44:42-07:00
New Revision: 7d2dddce8f0d3ed896f1437b01a097cb7fd1bfe9

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

LOG: [PS5] Enable dead-stripping globals in ASan

Added: 
    

Modified: 
    clang/lib/Driver/SanitizerArgs.cpp
    clang/test/Driver/fsanitize.c

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/SanitizerArgs.cpp b/clang/lib/Driver/SanitizerArgs.cpp
index a8227f1f8285..b63c6e463706 100644
--- a/clang/lib/Driver/SanitizerArgs.cpp
+++ b/clang/lib/Driver/SanitizerArgs.cpp
@@ -857,13 +857,13 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC,
                      AsanOutlineInstrumentation);
 
     // As a workaround for a bug in gold 2.26 and earlier, dead stripping of
-    // globals in ASan is disabled by default on ELF targets.
+    // globals in ASan is disabled by default on most ELF targets.
     // See https://sourceware.org/bugzilla/show_bug.cgi?id=19002
     AsanGlobalsDeadStripping = Args.hasFlag(
         options::OPT_fsanitize_address_globals_dead_stripping,
         options::OPT_fno_sanitize_address_globals_dead_stripping,
         !TC.getTriple().isOSBinFormatELF() || TC.getTriple().isOSFuchsia() ||
-            TC.getTriple().isPS4());
+            TC.getTriple().isPS());
 
     AsanUseOdrIndicator =
         Args.hasFlag(options::OPT_fsanitize_address_use_odr_indicator,

diff  --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c
index c6135f88541b..4b03bfc9dcb7 100644
--- a/clang/test/Driver/fsanitize.c
+++ b/clang/test/Driver/fsanitize.c
@@ -245,6 +245,7 @@
 // RUN: %clang_cl --target=x86_64-windows-msvc -fsanitize=address -fsanitize-address-globals-dead-stripping -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-GLOBALS
 // RUN: %clang_cl --target=x86_64-windows-msvc -fsanitize=address -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-GLOBALS
 // RUN: %clang -target x86_64-scei-ps4  -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-GLOBALS
+// RUN: %clang -target x86_64-sie-ps5  -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-GLOBALS
 // CHECK-ASAN-GLOBALS: -cc1{{.*}}-fsanitize-address-globals-dead-stripping
 // CHECK-NO-ASAN-GLOBALS-NOT: -cc1{{.*}}-fsanitize-address-globals-dead-stripping
 


        


More information about the cfe-commits mailing list