aboutsummaryrefslogtreecommitdiffstats
path: root/main/clang/0006-Link-with-z-now-by-default-for-Alpine-Linux.patch
blob: a2bb49a6a694e57fbad24c9fbfed2642dee84812 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From 2c6ae087cddd8a53e264814e404db8f3c29e4e53 Mon Sep 17 00:00:00 2001
From: Jakub Jirutka <jakub@jirutka.cz>
Date: Sun, 16 Apr 2017 16:49:00 +0100
Subject: [PATCH 6/7] Link with -z now by default for Alpine Linux

---
 lib/Driver/ToolChains/Linux.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
index ce9cf35..1583c9d 100644
--- a/lib/Driver/ToolChains/Linux.cpp
+++ b/lib/Driver/ToolChains/Linux.cpp
@@ -212,6 +212,11 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
 
   Distro Distro(D.getVFS());
 
+  if (Distro.IsAlpineLinux()) {
+    ExtraOpts.push_back("-z");
+    ExtraOpts.push_back("now");
+  }
+
   if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsAlpineLinux()) {
     ExtraOpts.push_back("-z");
     ExtraOpts.push_back("relro");
-- 
2.14.1