summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorrjs <rjs@pkgsrc.org>2019-10-21 11:14:44 +0000
committerrjs <rjs@pkgsrc.org>2019-10-21 11:14:44 +0000
commita3c0ad68cf9640e9d913188fac2edff1e96ff027 (patch)
treea24981156f31df35fd32f7ff61cabebdd25d0881 /lang
parenta8dbddf50db8a37e3c521b6cc8cf9aaca0a9d06a (diff)
downloadpkgsrc-a3c0ad68cf9640e9d913188fac2edff1e96ff027.tar.gz
Make C++ constructors work for aarch64.
Discussed here: <http://mail-index.netbsd.org/tech-toolchain/2019/08/29/msg003611.html>
Diffstat (limited to 'lang')
-rw-r--r--lang/clang/patches/patch-lib_Driver_ToolChains_NetBSD.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/lang/clang/patches/patch-lib_Driver_ToolChains_NetBSD.cpp b/lang/clang/patches/patch-lib_Driver_ToolChains_NetBSD.cpp
new file mode 100644
index 00000000000..6d69529c2db
--- /dev/null
+++ b/lang/clang/patches/patch-lib_Driver_ToolChains_NetBSD.cpp
@@ -0,0 +1,26 @@
+$NetBSD: patch-lib_Driver_ToolChains_NetBSD.cpp,v 1.1 2019/10/21 11:14:44 rjs Exp $
+
+--- lib/Driver/ToolChains/NetBSD.cpp.orig 2019-01-30 19:13:49.000000000 +0000
++++ lib/Driver/ToolChains/NetBSD.cpp
+@@ -469,10 +469,20 @@ SanitizerMask NetBSD::getSupportedSaniti
+ return Res;
+ }
+
+-void NetBSD::addClangTargetOptions(const ArgList &,
++void NetBSD::addClangTargetOptions(const ArgList &DriverArgs,
+ ArgStringList &CC1Args,
+ Action::OffloadKind) const {
+ const SanitizerArgs &SanArgs = getSanitizerArgs();
++ bool UseInitArrayDefault =
++ getTriple().getArch() == llvm::Triple::aarch64 ||
++ getTriple().getArch() == llvm::Triple::aarch64_be ||
++ getTriple().getArch() == llvm::Triple::riscv32 ||
++ getTriple().getArch() == llvm::Triple::riscv64;
++
++ if (DriverArgs.hasFlag(options::OPT_fuse_init_array,
++ options::OPT_fno_use_init_array, UseInitArrayDefault))
++ CC1Args.push_back("-fuse-init-array");
++
+ if (SanArgs.hasAnySanitizer())
+ CC1Args.push_back("-D_REENTRANT");
+ }