diff options
author | Travis Tilley <ttilley@gmail.com> | 2015-05-27 12:39:40 -0400 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-05-29 13:38:55 +0000 |
commit | 08fdc9700ce1b4e47bebc9c9d08959f5e50bc0c1 (patch) | |
tree | a2be5477ecf414d7932779f755518cb4b74a6c75 /main/llvm/clang-0008-alpine-PIE-by-default.patch | |
parent | 2e13d49d9449cb2fab62471594f3980307bf4cef (diff) | |
download | aports-08fdc9700ce1b4e47bebc9c9d08959f5e50bc0c1.tar.bz2 aports-08fdc9700ce1b4e47bebc9c9d08959f5e50bc0c1.tar.xz |
main/llvm: update to 3.6.1
clean up and update patchset
switch to cmake
perform a two-stage build with a minimal bootstrap compile of clang
add clang extras
update package list to split out clang documentation
enable pulling from the svn release tags
fix making use of abuild CFLAGS/CXXFLAGS during build
don't run check-llvm, as the tests fail when running under PaX
Diffstat (limited to 'main/llvm/clang-0008-alpine-PIE-by-default.patch')
-rw-r--r-- | main/llvm/clang-0008-alpine-PIE-by-default.patch | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/main/llvm/clang-0008-alpine-PIE-by-default.patch b/main/llvm/clang-0008-alpine-PIE-by-default.patch new file mode 100644 index 0000000000..7f46452751 --- /dev/null +++ b/main/llvm/clang-0008-alpine-PIE-by-default.patch @@ -0,0 +1,54 @@ +diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp +index 44e929f..3f25a36 100644 +--- a/lib/Driver/ToolChains.cpp ++++ b/lib/Driver/ToolChains.cpp +@@ -3397,6 +3397,9 @@ void Linux::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs, + } + + bool Linux::isPIEDefault() const { ++ StringRef VendorName = Linux::getTriple().getVendorName(); ++ if (VendorName.compare("alpine") == 0) ++ return true; + return getSanitizerArgs().requiresPIE(); + } + +diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp +index 3e71522..9a0fc84 100644 +--- a/lib/Driver/Tools.cpp ++++ b/lib/Driver/Tools.cpp +@@ -7462,7 +7462,9 @@ void gnutools::Link::ConstructJob(Compilation &C, const JobAction &JA, + if (!D.SysRoot.empty()) + CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot)); + +- if (IsPIE) ++ if (Args.hasArg(options::OPT_nopie)) ++ CmdArgs.push_back("-nopie"); ++ else if (IsPIE) + CmdArgs.push_back("-pie"); + + if (Args.hasArg(options::OPT_rdynamic)) +diff --git a/test/Driver/pic.c b/test/Driver/pic.c +index a3d989c..b1a55ae 100644 +--- a/test/Driver/pic.c ++++ b/test/Driver/pic.c +@@ -225,6 +225,18 @@ + // RUN: %clang %s -target i386-pc-openbsd -nopie -### 2>&1 \ + // RUN: | FileCheck %s --check-prefix=CHECK-NOPIE-LD + // ++// On Alpine Linux, we want similar PIE-by-default behavior ++// RUN: %clang -c %s -target x86_64-alpine-linux-musl -### 2>&1 \ ++// RUN: | FileCheck %s --check-prefix=CHECK-PIE2 ++// RUN: %clang -c %s -target i686-alpine-linux-musl -### 2>&1 \ ++// RUN: | FileCheck %s --check-prefix=CHECK-PIE2 ++// RUN: %clang -c %s -target armv6-alpine-linux-musleabihf -### 2>&1 \ ++// RUN: | FileCheck %s --check-prefix=CHECK-PIE2 ++// RUN: %clang -c %s -target armv7-alpine-linux-musleabihf -### 2>&1 \ ++// RUN: | FileCheck %s --check-prefix=CHECK-PIE2 ++// RUN: %clang %s -target x86_64-alpine-linux-musl -nopie -### 2>&1 \ ++// RUN: | FileCheck %s --check-prefix=CHECK-NOPIE-LD ++// + // On Android PIC is enabled by default + // RUN: %clang -c %s -target i686-linux-android -### 2>&1 \ + // RUN: | FileCheck %s --check-prefix=CHECK-PIC2 +-- +2.1.4 |