Skip to content

Conversation

alexander-shaposhnikov
Copy link
Collaborator

Enable nsan on Linux only.
Adding support for X86_64 MacOS requires minimal efforts
(might need to copy some bits from other sanitizers (in compiler-rt)).
Currently the functionality has been tested on Linux only.

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' labels Jun 19, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 19, 2024

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-driver

Author: Alexander Shaposhnikov (alexander-shaposhnikov)

Changes

Enable nsan on Linux only.
Adding support for X86_64 MacOS requires minimal efforts
(might need to copy some bits from other sanitizers (in compiler-rt)).
Currently the functionality has been tested on Linux only.


Full diff: https://github.com/llvm/llvm-project/pull/96120.diff

2 Files Affected:

  • (modified) clang/lib/Driver/ToolChains/Darwin.cpp (-3)
  • (modified) clang/test/Driver/fsanitize.c (+2-2)
diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp
index 64ab328a6d25f..ec509831bf60c 100644
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -3474,9 +3474,6 @@ SanitizerMask Darwin::getSupportedSanitizers() const {
     Res |= SanitizerKind::Thread;
   }
 
-  if (IsX86_64)
-    Res |= SanitizerKind::NumericalStability;
-
   return Res;
 }
 
diff --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c
index db14f6e195c64..aaea518aa634e 100644
--- a/clang/test/Driver/fsanitize.c
+++ b/clang/test/Driver/fsanitize.c
@@ -468,8 +468,8 @@
 // RUN: not %clang --target=mips-unknown-linux -fsanitize=numerical %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NSAN-MIPS-LINUX
 // CHECK-NSAN-MIPS-LINUX: error: unsupported option '-fsanitize=numerical' for target 'mips-unknown-linux'
 
-// RUN: %clang --target=x86_64-apple-macos -fsanitize=numerical %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NSAN-X86-64-MACOS
-// CHECK-NSAN-X86-64-MACOS: "-fsanitize=numerical"
+// RUN: not %clang --target=x86_64-apple-macos -fsanitize=numerical %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NSAN-X86-64-MACOS
+// CHECK-NSAN-X86-64-MACOS: error: unsupported option '-fsanitize=numerical' for target 'x86_64-apple-macos'
 
 // RUN: not %clang --target=arm64-apple-macos -fsanitize=numerical %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NSAN-ARM64-MACOS
 // CHECK-NSAN-ARM64-MACOS: error: unsupported option '-fsanitize=numerical' for target 'arm64-apple-macos'

Copy link
Collaborator

@vitalybuka vitalybuka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some merge conflicts?

@alexander-shaposhnikov
Copy link
Collaborator Author

Need to rebase & submit, will take a look ~today/tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants