]> granicus.if.org Git - clang/commitdiff
Revert r337635 "[Driver] Sanitizer support based on runtime library presence"
authorReid Kleckner <rnk@google.com>
Tue, 31 Jul 2018 21:57:35 +0000 (21:57 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 31 Jul 2018 21:57:35 +0000 (21:57 +0000)
This change causes issues with distributed build systems, which may only
have compiler binaries without any runtime libraries. See discussion
about this on https://reviews.llvm.org/D15225.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338444 91177308-0d34-0410-b5e6-96231b3b80d8

22 files changed:
lib/Driver/ToolChains/Darwin.cpp
lib/Driver/ToolChains/Darwin.h
test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_ios_dynamic.dylib [deleted file]
test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib [deleted file]
test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_osx_dynamic.dylib [deleted file]
test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_tvos_dynamic.dylib [deleted file]
test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_tvossim_dynamic.dylib [deleted file]
test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_watchos_dynamic.dylib [deleted file]
test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_watchossim_dynamic.dylib [deleted file]
test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.fuzzer_osx.a [deleted file]
test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_ios_dynamic.dylib [deleted file]
test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_iossim_dynamic.dylib [deleted file]
test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_osx_dynamic.dylib [deleted file]
test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_tvossim_dynamic.dylib [deleted file]
test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tsan_iossim_dynamic.dylib [deleted file]
test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib [deleted file]
test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tsan_tvossim_dynamic.dylib [deleted file]
test/Driver/darwin-asan-nofortify.c
test/Driver/darwin-sanitizer-ld.c
test/Driver/fsanitize.c
test/Driver/fuzzer.c
test/Driver/sanitizer-ld.c

index 95ec8d64c2c73aff5b6b85ed2d9777a63047dbd9..9205dd52de0bbec7838a32b13b4a6db76911289a 100644 (file)
@@ -916,26 +916,13 @@ unsigned DarwinClang::GetDefaultDwarfVersion() const {
   return 4;
 }
 
-SmallString<128> MachO::runtimeLibDir(bool IsEmbedded) const {
-  SmallString<128> Dir(getDriver().ResourceDir);
-  llvm::sys::path::append(
-      Dir, "lib", IsEmbedded ? "macho_embedded" : "darwin");
-  return Dir;
-}
-
-std::string Darwin::getFileNameForSanitizerLib(StringRef SanitizerName,
-                                              bool Shared) const {
-  return (Twine("libclang_rt.") + SanitizerName + "_" +
-                      getOSLibraryNameSuffix() +
-                      (Shared ? "_dynamic.dylib" : ".a")).str();
-
-}
-
 void MachO::AddLinkRuntimeLib(const ArgList &Args, ArgStringList &CmdArgs,
                               StringRef DarwinLibName,
                               RuntimeLinkOptions Opts) const {
+  SmallString<128> Dir(getDriver().ResourceDir);
+  llvm::sys::path::append(
+      Dir, "lib", (Opts & RLO_IsEmbedded) ? "macho_embedded" : "darwin");
 
-  SmallString<128> Dir = runtimeLibDir(Opts & RLO_IsEmbedded);
   SmallString<128> P(Dir);
   llvm::sys::path::append(P, DarwinLibName);
 
@@ -1055,9 +1042,12 @@ void DarwinClang::AddLinkSanitizerLibArgs(const ArgList &Args,
                                           StringRef Sanitizer,
                                           bool Shared) const {
   auto RLO = RuntimeLinkOptions(RLO_AlwaysLink | (Shared ? RLO_AddRPath : 0U));
-  std::string SanitizerRelFilename =
-      getFileNameForSanitizerLib(Sanitizer, Shared);
-  AddLinkRuntimeLib(Args, CmdArgs, SanitizerRelFilename, RLO);
+  AddLinkRuntimeLib(Args, CmdArgs,
+                    (Twine("libclang_rt.") + Sanitizer + "_" +
+                     getOSLibraryNameSuffix() +
+                     (Shared ? "_dynamic.dylib" : ".a"))
+                        .str(),
+                    RLO);
 }
 
 ToolChain::RuntimeLibType DarwinClang::GetRuntimeLibType(
@@ -2295,43 +2285,24 @@ void Darwin::CheckObjCARC() const {
 SanitizerMask Darwin::getSupportedSanitizers() const {
   const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64;
   SanitizerMask Res = ToolChain::getSupportedSanitizers();
-
-  {
-    using namespace SanitizerKind;
-    assert(!(Res & (Address | Leak | Fuzzer | FuzzerNoLink | Thread)) &&
-           "Sanitizer is already registered as supported");
-  }
-
-  if (sanitizerRuntimeExists("asan"))
-    Res |= SanitizerKind::Address;
-  if (sanitizerRuntimeExists("lsan"))
-    Res |= SanitizerKind::Leak;
-  if (sanitizerRuntimeExists("fuzzer", /*Shared=*/false)) {
-    Res |= SanitizerKind::Fuzzer;
-    Res |= SanitizerKind::FuzzerNoLink;
-  }
+  Res |= SanitizerKind::Address;
+  Res |= SanitizerKind::Leak;
+  Res |= SanitizerKind::Fuzzer;
+  Res |= SanitizerKind::FuzzerNoLink;
   Res |= SanitizerKind::Function;
-  if (isTargetMacOS() && !isMacosxVersionLT(10, 9))
-    Res |= SanitizerKind::Vptr;
-  if (isTargetMacOS())
+  if (isTargetMacOS()) {
+    if (!isMacosxVersionLT(10, 9))
+      Res |= SanitizerKind::Vptr;
     Res |= SanitizerKind::SafeStack;
-
-  if (sanitizerRuntimeExists("tsan") && IsX86_64 &&
-      (isTargetMacOS() || isTargetIOSSimulator() || isTargetTvOSSimulator()))
-    Res |= SanitizerKind::Thread;
-
+    if (IsX86_64)
+      Res |= SanitizerKind::Thread;
+  } else if (isTargetIOSSimulator() || isTargetTvOSSimulator()) {
+    if (IsX86_64)
+      Res |= SanitizerKind::Thread;
+  }
   return Res;
 }
 
 void Darwin::printVerboseInfo(raw_ostream &OS) const {
   CudaInstallation.print(OS);
 }
-
-bool Darwin::sanitizerRuntimeExists(StringRef SanitizerName,
-                                    bool Shared) const {
-    std::string RelName = getFileNameForSanitizerLib(SanitizerName, Shared);
-    SmallString<128> Dir = runtimeLibDir();
-    SmallString<128> AbsName(Dir);
-    llvm::sys::path::append(AbsName, RelName);
-    return getVFS().exists(AbsName);
-}
index eee6e966718b577428f2c44a07fb3b06293c9a96..87d553bd7e0b208c56e77f7e8b8bcdb33bc5bca8 100644 (file)
@@ -130,9 +130,6 @@ protected:
   Tool *buildLinker() const override;
   Tool *getTool(Action::ActionClass AC) const override;
 
-  /// \return Directory to find the runtime library in.
-  SmallString<128> runtimeLibDir(bool IsEmbedded=false) const;
-
 private:
   mutable std::unique_ptr<tools::darwin::Lipo> Lipo;
   mutable std::unique_ptr<tools::darwin::Dsymutil> Dsymutil;
@@ -254,6 +251,7 @@ public:
   GetExceptionModel(const llvm::opt::ArgList &Args) const override {
     return llvm::ExceptionHandling::None;
   }
+
   /// }
 };
 
@@ -422,11 +420,6 @@ protected:
   StringRef getPlatformFamily() const;
   StringRef getOSLibraryNameSuffix() const;
 
-  /// \return Relative path to the filename for the library
-  /// containing the sanitizer {@code SanitizerName}.
-  std::string getFileNameForSanitizerLib(StringRef SanitizerName,
-                                         bool Shared = true) const;
-
 public:
   static StringRef getSDKName(StringRef isysroot);
 
@@ -480,12 +473,6 @@ public:
   SanitizerMask getSupportedSanitizers() const override;
 
   void printVerboseInfo(raw_ostream &OS) const override;
-
-private:
-  /// \return Whether the runtime corresponding to the given
-  /// sanitizer exists in the toolchain.
-  bool sanitizerRuntimeExists(StringRef SanitizerName,
-                              bool Shared = true) const;
 };
 
 /// DarwinClang - The Darwin toolchain used by Clang.
diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_ios_dynamic.dylib b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_ios_dynamic.dylib
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_osx_dynamic.dylib b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_osx_dynamic.dylib
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_tvos_dynamic.dylib b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_tvos_dynamic.dylib
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_tvossim_dynamic.dylib b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_tvossim_dynamic.dylib
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_watchos_dynamic.dylib b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_watchos_dynamic.dylib
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_watchossim_dynamic.dylib b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_watchossim_dynamic.dylib
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.fuzzer_osx.a b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.fuzzer_osx.a
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_ios_dynamic.dylib b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_ios_dynamic.dylib
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_iossim_dynamic.dylib b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_iossim_dynamic.dylib
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_osx_dynamic.dylib b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_osx_dynamic.dylib
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_tvossim_dynamic.dylib b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_tvossim_dynamic.dylib
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tsan_iossim_dynamic.dylib b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tsan_iossim_dynamic.dylib
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tsan_tvossim_dynamic.dylib b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tsan_tvossim_dynamic.dylib
deleted file mode 100644 (file)
index e69de29..0000000
index 7d6da6d05798444f127ea53ac9808bc70fb36686..58b5be9fcbb765bdb1aebd05988b09562823cc8c 100644 (file)
@@ -1,5 +1,5 @@
 // Make sure AddressSanitizer disables _FORTIFY_SOURCE on Darwin.
 
-// RUN: %clang -fsanitize=address  %s -E -dM -target x86_64-darwin -resource-dir %S/Inputs/resource_dir | FileCheck %s
+// RUN: %clang -fsanitize=address  %s -E -dM -target x86_64-darwin | FileCheck %s
 
 // CHECK: #define _FORTIFY_SOURCE 0
index f7dfb157b44e815f16a3c1734282f16f202fde4a..53c7fce115e71517b0c802bee709af7ac0c62163 100644 (file)
@@ -1,7 +1,6 @@
 // Test sanitizer link flags on Darwin.
 
 // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
-// RUN:   -resource-dir %S/Inputs/resource_dir \
 // RUN:   -stdlib=platform -fsanitize=address %s -o %t.o 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-ASAN %s
 
 // CHECK-ASAN: "-rpath" "{{.*}}lib{{.*}}darwin"
 
 // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
-// RUN:   -resource-dir %S/Inputs/fake_resource_dir \
-// RUN:   -stdlib=platform -fsanitize=address %s -o %t.o 2>&1 \
-// RUN:   | FileCheck --check-prefix=CHECK-LOAD-FAIL %s
-
-// CHECK-LOAD-FAIL: error: unsupported option '-fsanitize=address' for target 'x86_64--darwin'
-
-// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
-// RUN:   -resource-dir %S/Inputs/resource_dir \
 // RUN:   -fPIC -shared -fsanitize=address %s -o %t.so 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-DYN-ASAN %s
 
@@ -31,7 +22,6 @@
 // CHECK-DYN-ASAN: "-rpath" "{{.*}}lib{{.*}}darwin"
 
 // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
-// RUN:   -resource-dir %S/Inputs/resource_dir \
 // RUN:   -stdlib=platform -fsanitize=undefined %s -o %t.o 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-UBSAN %s
 
@@ -44,7 +34,6 @@
 
 // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
 // RUN:   -fsanitize=bounds -fsanitize-undefined-trap-on-error \
-// RUN:   -resource-dir %S/Inputs/resource_dir \
 // RUN:   %s -o %t.o 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-BOUNDS %s
 
@@ -53,7 +42,6 @@
 
 // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
 // RUN:   -fPIC -shared -fsanitize=undefined %s -o %t.so 2>&1 \
-// RUN:   -resource-dir %S/Inputs/resource_dir \
 // RUN:   | FileCheck --check-prefix=CHECK-DYN-UBSAN %s
 
 // CHECK-DYN-UBSAN: "{{.*}}ld{{(.exe)?}}"
@@ -64,7 +52,6 @@
 
 // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
 // RUN:   -fsanitize=bounds -fsanitize-undefined-trap-on-error \
-// RUN:   -resource-dir %S/Inputs/resource_dir \
 // RUN:   %s -o %t.so -fPIC -shared 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-DYN-BOUNDS %s
 
@@ -73,7 +60,6 @@
 
 // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
 // RUN:   -stdlib=platform -fsanitize=address -mios-simulator-version-min=7.0 \
-// RUN:   -resource-dir %S/Inputs/resource_dir \
 // RUN:   %s -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-ASAN-IOSSIM %s
 
 // CHECK-ASAN-IOSSIM: "{{.*}}ld{{(.exe)?}}"
@@ -84,7 +70,6 @@
 // CHECK-ASAN-IOSSIM: "-rpath" "{{.*}}lib{{.*}}darwin"
 
 // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
-// RUN:   -resource-dir %S/Inputs/resource_dir \
 // RUN:   -stdlib=platform -fsanitize=address \
 // RUN:   -mtvos-simulator-version-min=8.3.0 %s -o %t.o 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-ASAN-TVOSSIM %s
@@ -98,7 +83,6 @@
 
 // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
 // RUN:   -stdlib=platform -fsanitize=address \
-// RUN:   -resource-dir %S/Inputs/resource_dir \
 // RUN:   -mwatchos-simulator-version-min=2.0.0 %s -o %t.o 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-ASAN-WATCHOSSIM %s
 
 // CHECK-ASAN-WATCHOSSIM: "-rpath" "{{.*}}lib{{.*}}darwin"
 
 // RUN: %clang -no-canonical-prefixes -### -target armv7-apple-ios  \
-// RUN:   -resource-dir %S/Inputs/resource_dir \
 // RUN:   -stdlib=platform -fsanitize=address -miphoneos-version-min=7 \
 // RUN:   %s -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-ASAN-IOS %s
 
 
 // RUN: %clang -no-canonical-prefixes -### -target arm64-apple-tvos \
 // RUN:   -stdlib=platform -fsanitize=address -mtvos-version-min=8.3 \
-// RUN:   -resource-dir %S/Inputs/resource_dir \
 // RUN:   %s -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-ASAN-TVOS %s
 
 // CHECK-ASAN-TVOS: "{{.*}}ld{{(.exe)?}}"
 
 // RUN: %clang -no-canonical-prefixes -### -target armv7k-apple-watchos \
 // RUN:   -stdlib=platform -fsanitize=address -mwatchos-version-min=2.0 \
-// RUN:   -resource-dir %S/Inputs/resource_dir \
 // RUN:   %s -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-ASAN-WATCHOS %s
 
 // CHECK-ASAN-WATCHOS: "{{.*}}ld{{(.exe)?}}"
index 458bbf96e211c604495ffb4a76962950164fa876..304e759302452c39e67e8a1adac3e27c17f52d10 100644 (file)
 // RUN: %clang -target x86_64-apple-darwin10 -fsanitize=memory -fno-sanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-NOMSAN-DARWIN
 // CHECK-MSAN-NOMSAN-DARWIN-NOT: unsupported option
 
-// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=memory -fsanitize=thread,memory -resource-dir %S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-TSAN-MSAN-DARWIN
+// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=memory -fsanitize=thread,memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-TSAN-MSAN-DARWIN
 // CHECK-MSAN-TSAN-MSAN-DARWIN: unsupported option '-fsanitize=memory' for target 'x86_64-apple-darwin10'
 // CHECK-MSAN-TSAN-MSAN-DARWIN-NOT: unsupported option
 
-// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=thread,memory -fsanitize=memory -resource-dir %S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-MSAN-MSAN-DARWIN
+// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=thread,memory -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-MSAN-MSAN-DARWIN
 // CHECK-TSAN-MSAN-MSAN-DARWIN: unsupported option '-fsanitize=memory' for target 'x86_64-apple-darwin10'
 // CHECK-TSAN-MSAN-MSAN-DARWIN-NOT: unsupported option
 
-// RUN: %clang -target x86_64-apple-darwin -fsanitize=thread -resource-dir %S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-DARWIN
+// RUN: %clang -target x86_64-apple-darwin -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-DARWIN
 // CHECK-TSAN-X86-64-DARWIN-NOT: unsupported option
 
-// RUN: %clang -target x86_64-apple-iossimulator -fsanitize=thread -resource-dir %S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-IOSSIMULATOR
+// RUN: %clang -target x86_64-apple-iossimulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-IOSSIMULATOR
 // CHECK-TSAN-X86-64-IOSSIMULATOR-NOT: unsupported option
 
-// RUN: %clang -target x86_64-apple-tvossimulator -fsanitize=thread -resource-dir %S/Inputs/resource_dir  %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-TVOSSIMULATOR
+// RUN: %clang -target x86_64-apple-tvossimulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-TVOSSIMULATOR
 // CHECK-TSAN-X86-64-TVOSSIMULATOR-NOT: unsupported option
 
-// RUN: %clang -target i386-apple-darwin -fsanitize=thread -resource-dir %S/Inputs/resource_dir  %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-I386-DARWIN
+// RUN: %clang -target i386-apple-darwin -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-I386-DARWIN
 // CHECK-TSAN-I386-DARWIN: unsupported option '-fsanitize=thread' for target 'i386-apple-darwin'
 
 // RUN: %clang -target arm-apple-ios -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-ARM-IOS
 // RUN: %clang -target i386-pc-openbsd -fsanitize=efficiency-working-set %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-OPENBSD
 // CHECK-ESAN-OPENBSD: error: unsupported option '-fsanitize=efficiency-{{.*}}' for target 'i386-pc-openbsd'
 
-// RUN: %clang -target x86_64-apple-darwin -fsanitize=leak -resource-dir %S/Inputs/resource_dir  %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-X86-64-DARWIN
+// RUN: %clang -target x86_64-apple-darwin -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-X86-64-DARWIN
 // CHECK-LSAN-X86-64-DARWIN-NOT: unsupported option
 
-// RUN: %clang -target x86_64-apple-iossimulator -fsanitize=leak -resource-dir %S/Inputs/resource_dir  %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-X86-64-IOSSIMULATOR
+// RUN: %clang -target x86_64-apple-iossimulator -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-X86-64-IOSSIMULATOR
 // CHECK-LSAN-X86-64-IOSSIMULATOR-NOT: unsupported option
 
-// RUN: %clang -target x86_64-apple-tvossimulator -fsanitize=leak -resource-dir %S/Inputs/resource_dir  %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-X86-64-TVOSSIMULATOR
+// RUN: %clang -target x86_64-apple-tvossimulator -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-X86-64-TVOSSIMULATOR
 // CHECK-LSAN-X86-64-TVOSSIMULATOR-NOT: unsupported option
 
-// RUN: %clang -target i386-apple-darwin -fsanitize=leak -resource-dir %S/Inputs/resource_dir  %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-I386-DARWIN
+// RUN: %clang -target i386-apple-darwin -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-I386-DARWIN
 // CHECK-LSAN-I386-DARWIN-NOT: unsupported option
 
-// RUN: %clang -target arm-apple-ios -fsanitize=leak -resource-dir %S/Inputs/resource_dir  %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-ARM-IOS
+// RUN: %clang -target arm-apple-ios -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-ARM-IOS
 // CHECK-LSAN-ARM-IOS-NOT: unsupported option
 
-// RUN: %clang -target i386-apple-iossimulator -fsanitize=leak -resource-dir %S/Inputs/resource_dir  %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-I386-IOSSIMULATOR
+// RUN: %clang -target i386-apple-iossimulator -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-I386-IOSSIMULATOR
 // CHECK-LSAN-I386-IOSSIMULATOR-NOT: unsupported option
 
-// RUN: %clang -target i386-apple-tvossimulator -fsanitize=leak -resource-dir %S/Inputs/resource_dir  %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-I386-TVOSSIMULATOR
+// RUN: %clang -target i386-apple-tvossimulator -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-I386-TVOSSIMULATOR
 // CHECK-LSAN-I386-TVOSSIMULATOR-NOT: unsupported option
 
 // RUN: %clang -target i686-linux-gnu -fsanitize=efficiency-cache-frag %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-X86
index 5a371e260c601bd12eb6599dbc3fff383e9be682..3fdf5ab9c9b983275512a707268334b0270b08ba 100644 (file)
@@ -1,6 +1,6 @@
 // Test flags inserted by -fsanitize=fuzzer.
 
-// RUN: %clang -fsanitize=fuzzer %s -target x86_64-apple-darwin14 -resource-dir %S/Inputs/resource_dir -### 2>&1 | FileCheck --check-prefixes=CHECK-FUZZER-LIB,CHECK-COVERAGE-FLAGS %s
+// RUN: %clang -fsanitize=fuzzer %s -target x86_64-apple-darwin14 -### 2>&1 | FileCheck --check-prefixes=CHECK-FUZZER-LIB,CHECK-COVERAGE-FLAGS %s
 //
 // CHECK-FUZZER-LIB: libclang_rt.fuzzer
 // CHECK-COVERAGE: -fsanitize-coverage-inline-8bit-counters
@@ -8,21 +8,21 @@
 // CHECK-COVERAGE-SAME: -fsanitize-coverage-trace-cmp
 // CHECK-COVERAGE-SAME: -fsanitize-coverage-pc-table
 
-// RUN: %clang -fsanitize=fuzzer -target i386-unknown-linux -stdlib=platform -resource-dir %S/Inputs/resource_dir %s -### 2>&1 | FileCheck --check-prefixes=CHECK-LIBCXX-LINUX %s
+// RUN: %clang -fsanitize=fuzzer -target i386-unknown-linux -stdlib=platform %s -### 2>&1 | FileCheck --check-prefixes=CHECK-LIBCXX-LINUX %s
 //
 // CHECK-LIBCXX-LINUX: -lstdc++
 
-// RUN: %clang -target x86_64-apple-darwin14 -fsanitize=fuzzer -resource-dir %S/Inputs/resource_dir %s -### 2>&1 | FileCheck --check-prefixes=CHECK-LIBCXX-DARWIN %s
+// RUN: %clang -target x86_64-apple-darwin14 -fsanitize=fuzzer %s -### 2>&1 | FileCheck --check-prefixes=CHECK-LIBCXX-DARWIN %s
 //
 // CHECK-LIBCXX-DARWIN: -lc++
 
 
 // Check that we don't link in libFuzzer.a when producing a shared object.
-// RUN: %clang -fsanitize=fuzzer %s -shared -o %t.so -resource-dir %S/Inputs/resource_dir -### 2>&1 | FileCheck --check-prefixes=CHECK-NOLIB-SO %s
+// RUN: %clang -fsanitize=fuzzer %s -shared -o %t.so -### 2>&1 | FileCheck --check-prefixes=CHECK-NOLIB-SO %s
 // CHECK-NOLIB-SO-NOT: libclang_rt.libfuzzer
 
 // Check that we don't link in libFuzzer when compiling with -fsanitize=fuzzer-no-link.
-// RUN: %clang -fsanitize=fuzzer-no-link %s -target x86_64-apple-darwin14 -resource-dir %S/Inputs/resource_dir -### 2>&1 | FileCheck --check-prefixes=CHECK-NOLIB,CHECK-COV %s
+// RUN: %clang -fsanitize=fuzzer-no-link %s -target x86_64-apple-darwin14 -### 2>&1 | FileCheck --check-prefixes=CHECK-NOLIB,CHECK-COV %s
 // CHECK-NOLIB-NOT: libclang_rt.libfuzzer
 // CHECK-COV: -fsanitize-coverage-inline-8bit-counters
 
index f07fe922eccaef2f792934f9da4772728d162faf..483c87a6242f0b7481121312f88379d72823c1d6 100644 (file)
 
 // RUN: %clangxx -fsanitize=address %s -### -o %t.o 2>&1 \
 // RUN:     -mmacosx-version-min=10.6 \
-// RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     -target x86_64-apple-darwin13.4.0 -fuse-ld=ld -stdlib=platform \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | FileCheck --check-prefix=CHECK-ASAN-DARWIN106-CXX %s
 
 // RUN: %clangxx -fsanitize=leak %s -### -o %t.o 2>&1 \
 // RUN:     -mmacosx-version-min=10.6 \
-// RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     -target x86_64-apple-darwin13.4.0 -fuse-ld=ld -stdlib=platform \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | FileCheck --check-prefix=CHECK-LSAN-DARWIN106-CXX %s
 
 // RUN: %clang -fsanitize=cfi -fsanitize-stats %s -### -o %t.o 2>&1 \
 // RUN:     -target x86_64-apple-darwin -fuse-ld=ld \
-// RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | FileCheck --check-prefix=CHECK-CFI-STATS-DARWIN %s
 // CHECK-CFI-STATS-DARWIN: "{{.*}}ld{{(.exe)?}}"