pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

clang-git: Add patches to enable asan in clang/netbsd/amd64



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Sun Jul 2 18:38:09 2017 +0200
Changeset:	8fb5137b3f88f775506cdd4978b472968f05298e

Modified Files:
	clang-git/distinfo
Added Files:
	clang-git/patches/patch-lib_Driver_ToolChains_NetBSD.cpp
	clang-git/patches/patch-lib_Driver_ToolChains_NetBSD.h

Log Message:
clang-git: Add patches to enable asan in clang/netbsd/amd64

Sponsored by <The NetBSD Foundation>

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=8fb5137b3f88f775506cdd4978b472968f05298e

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 clang-git/distinfo                                 |  2 ++
 .../patches/patch-lib_Driver_ToolChains_NetBSD.cpp | 42 ++++++++++++++++++++++
 .../patches/patch-lib_Driver_ToolChains_NetBSD.h   | 12 +++++++
 3 files changed, 56 insertions(+)

diffs:
diff --git a/clang-git/distinfo b/clang-git/distinfo
index 1ca315a1c5..8c62f70c86 100644
--- a/clang-git/distinfo
+++ b/clang-git/distinfo
@@ -12,4 +12,6 @@ Size (libcxx-3.6.2.src.tar.xz) = 944020 bytes
 SHA1 (llvm-3.6.2.src.tar.xz) = 7a00257eb2bc9431e4c77c3a36b033072c54bc7e
 RMD160 (llvm-3.6.2.src.tar.xz) = 521cbc5fe2925ea3c6e90c7a31f752a04045c972
 Size (llvm-3.6.2.src.tar.xz) = 12802380 bytes
+SHA1 (patch-lib_Driver_ToolChains_NetBSD.cpp) = 6ddeadc54bed840bd7654ec602dfbd20b071f2d9
+SHA1 (patch-lib_Driver_ToolChains_NetBSD.h) = 4891098cce9cab17e01924fa7ea3a9b7cff69b26
 SHA1 (patch-tools_clang-format_CMakeLists.txt) = f119d2a94cbfb8c00a285d1aa7789ed26f8309cf
diff --git a/clang-git/patches/patch-lib_Driver_ToolChains_NetBSD.cpp b/clang-git/patches/patch-lib_Driver_ToolChains_NetBSD.cpp
new file mode 100644
index 0000000000..86732b4148
--- /dev/null
+++ b/clang-git/patches/patch-lib_Driver_ToolChains_NetBSD.cpp
@@ -0,0 +1,42 @@
+$NetBSD$
+
+--- lib/Driver/ToolChains/NetBSD.cpp.orig	2017-07-02 16:11:01.139600632 +0000
++++ lib/Driver/ToolChains/NetBSD.cpp
+@@ -15,6 +15,7 @@
+ #include "clang/Driver/Compilation.h"
+ #include "clang/Driver/Driver.h"
+ #include "clang/Driver/Options.h"
++#include "clang/Driver/SanitizerArgs.h"
+ #include "llvm/Option/ArgList.h"
+ 
+ using namespace clang::driver;
+@@ -246,6 +247,7 @@ void netbsd::Linker::ConstructJob(Compil
+   Args.AddAllArgs(CmdArgs, options::OPT_Z_Flag);
+   Args.AddAllArgs(CmdArgs, options::OPT_r);
+ 
++  bool NeedsSanitizerDeps = addSanitizerRuntimes(getToolChain(), Args, CmdArgs);
+   AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA);
+ 
+   unsigned Major, Minor, Micro;
+@@ -279,6 +281,8 @@ void netbsd::Linker::ConstructJob(Compil
+       getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
+       CmdArgs.push_back("-lm");
+     }
++    if (NeedsSanitizerDeps)
++      linkSanitizerRuntimeDeps(getToolChain(), CmdArgs);
+     if (Args.hasArg(options::OPT_pthread))
+       CmdArgs.push_back("-lpthread");
+     CmdArgs.push_back("-lc");
+@@ -410,3 +414,12 @@ void NetBSD::addLibStdCxxIncludePaths(co
+   addLibStdCXXIncludePaths(getDriver().SysRoot, "/usr/include/g++", "", "", "",
+                            "", DriverArgs, CC1Args);
+ }
++
++SanitizerMask NetBSD::getSupportedSanitizers() const {
++  const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64;
++  SanitizerMask Res = ToolChain::getSupportedSanitizers();
++  if (IsX86_64) {
++    Res |= SanitizerKind::Address;
++  }
++  return Res;
++}
diff --git a/clang-git/patches/patch-lib_Driver_ToolChains_NetBSD.h b/clang-git/patches/patch-lib_Driver_ToolChains_NetBSD.h
new file mode 100644
index 0000000000..3c269bb64f
--- /dev/null
+++ b/clang-git/patches/patch-lib_Driver_ToolChains_NetBSD.h
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- lib/Driver/ToolChains/NetBSD.h.orig	2017-07-02 16:11:01.139650639 +0000
++++ lib/Driver/ToolChains/NetBSD.h
+@@ -66,6 +66,7 @@ public:
+       llvm::opt::ArgStringList &CC1Args) const override;
+ 
+   bool IsUnwindTablesDefault() const override { return true; }
++  SanitizerMask getSupportedSanitizers() const override;
+ 
+ protected:
+   Tool *buildAssembler() const override;


Home | Main Index | Thread Index | Old Index