]> granicus.if.org Git - clang/commitdiff
Revert "[XRay][Driver] Do not link in XRay runtime in shared libs"
authorDean Michael Berris <dberris@google.com>
Tue, 26 Sep 2017 00:41:08 +0000 (00:41 +0000)
committerDean Michael Berris <dberris@google.com>
Tue, 26 Sep 2017 00:41:08 +0000 (00:41 +0000)
Reverts r314177.

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

lib/Driver/ToolChains/Gnu.cpp
test/Driver/XRay/xray-shared-noxray.cpp [deleted file]

index 757ebda46daaab06ac163de8019dec9609c8b735..aa8276c1fa730f9c41f894b4a0ec6f0bde16582d 100644 (file)
@@ -206,10 +206,6 @@ void tools::gcc::Linker::RenderExtraToolArgs(const JobAction &JA,
 
 static bool addXRayRuntime(const ToolChain &TC, const ArgList &Args,
                            ArgStringList &CmdArgs) {
-  // Do not add the XRay runtime to shared libraries.
-  if (Args.hasArg(options::OPT_shared))
-    return false;
-
   if (Args.hasFlag(options::OPT_fxray_instrument,
                    options::OPT_fnoxray_instrument, false)) {
     CmdArgs.push_back("-whole-archive");
@@ -217,7 +213,6 @@ static bool addXRayRuntime(const ToolChain &TC, const ArgList &Args,
     CmdArgs.push_back("-no-whole-archive");
     return true;
   }
-
   return false;
 }
 
diff --git a/test/Driver/XRay/xray-shared-noxray.cpp b/test/Driver/XRay/xray-shared-noxray.cpp
deleted file mode 100644 (file)
index b997aea..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %clangxx -shared -fPIC -o /dev/null -v -fxray-instrument %s 2>&1 | \
-// RUN:     FileCheck %s --check-prefix=SHARED
-// RUN: %clangxx -static -o /dev/null -v -fxray-instrument %s 2>&1 -DMAIN | \
-// RUN:     FileCheck %s --check-prefix=STATIC
-// RUN: %clangxx -static -fPIE -o /dev/null -v -fxray-instrument %s 2>&1 \
-// RUN:     -DMAIN | FileCheck %s --check-prefix=STATIC
-//
-// SHARED-NOT: {{clang_rt\.xray-}}
-// STATIC: {{clang_rt\.xray-}}
-int foo() { return 42; }
-
-#ifdef MAIN
-int main() { return foo(); }
-#endif