[PATCH] D55654: [clang] [Driver] [NetBSD] Add -D_REENTRANT when using sanitizers

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 19 09:30:04 PST 2018


This revision was automatically updated to reflect the committed changes.
mgorny marked an inline comment as done.
Closed by commit rL349650: [Driver] [NetBSD] Add -D_REENTRANT when using sanitizers (authored by mgorny, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D55654?vs=178701&id=178902#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55654/new/

https://reviews.llvm.org/D55654

Files:
  cfe/trunk/lib/Driver/ToolChains/NetBSD.cpp
  cfe/trunk/lib/Driver/ToolChains/NetBSD.h


Index: cfe/trunk/lib/Driver/ToolChains/NetBSD.cpp
===================================================================
--- cfe/trunk/lib/Driver/ToolChains/NetBSD.cpp
+++ cfe/trunk/lib/Driver/ToolChains/NetBSD.cpp
@@ -457,3 +457,11 @@
   }
   return Res;
 }
+
+void NetBSD::addClangTargetOptions(const ArgList &,
+                                   ArgStringList &CC1Args,
+                                   Action::OffloadKind) const {
+  const SanitizerArgs &SanArgs = getSanitizerArgs();
+  if (SanArgs.hasAnySanitizer())
+    CC1Args.push_back("-D_REENTRANT");
+}
Index: cfe/trunk/lib/Driver/ToolChains/NetBSD.h
===================================================================
--- cfe/trunk/lib/Driver/ToolChains/NetBSD.h
+++ cfe/trunk/lib/Driver/ToolChains/NetBSD.h
@@ -76,6 +76,10 @@
 
   SanitizerMask getSupportedSanitizers() const override;
 
+  void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
+                             llvm::opt::ArgStringList &CC1Args,
+                             Action::OffloadKind DeviceOffloadKind) const override;
+
 protected:
   Tool *buildAssembler() const override;
   Tool *buildLinker() const override;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55654.178902.patch
Type: text/x-patch
Size: 1167 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181219/bf31eb94/attachment-0001.bin>


More information about the cfe-commits mailing list