summaryrefslogtreecommitdiffhomepage
path: root/patches/clang_host/clang-0006-Link-with-z-now-by-default-for-Alpine-Linux.patch
blob: a7ad2d8c3ab9802cc2558d8051514605bd474392 (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 e089ab63916eada060fdfffbf7422c9b20bafe84 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue, 23 Feb 2016 10:08:17 +0000
Subject: [PATCH 6/7] Link with -z now by default for Alpine Linux

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

diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index 82449bf..1a8ebf5 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -3671,6 +3671,11 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
 
   Distro Distro = DetectDistro(D, Arch);
 
+  if (Distro == AlpineLinux) {
+    ExtraOpts.push_back("-z");
+    ExtraOpts.push_back("now");
+  }
+
   if (IsOpenSUSE(Distro) || IsUbuntu(Distro) || Distro == AlpineLinux) {
     ExtraOpts.push_back("-z");
     ExtraOpts.push_back("relro");
-- 
2.7.3