From 7c6369df8c7fc0e4ba73bf3571296c2dfb684ffd Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 22 Mar 2019 12:10:00 +0000 Subject: main/clang: upse python3, fix ssp patch and license - Fix stackprotector default patch - Use SPDX compatible format for license - Fix build by include libexecinfo-dev makedepends - Use python3 --- ...ack-protector-by-default-for-Alpine-Linux.patch | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'main/clang/20-Enable-stack-protector-by-default-for-Alpine-Linux.patch') diff --git a/main/clang/20-Enable-stack-protector-by-default-for-Alpine-Linux.patch b/main/clang/20-Enable-stack-protector-by-default-for-Alpine-Linux.patch index 795daf35f0..d545a5aff8 100644 --- a/main/clang/20-Enable-stack-protector-by-default-for-Alpine-Linux.patch +++ b/main/clang/20-Enable-stack-protector-by-default-for-Alpine-Linux.patch @@ -1,9 +1,12 @@ Based on original patchset from Jakub Jirutka Updated by Eric Molitor +Updated by Natanael Copa +diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp +index f8f3623..9c8c748 100644 --- a/lib/Driver/ToolChains/Linux.cpp +++ b/lib/Driver/ToolChains/Linux.cpp -@@ -907,6 +907,13 @@ +@@ -907,6 +907,13 @@ bool Linux::isPIEDefault() const { getTriple().isMusl() || getSanitizerArgs().requiresPIE(); } @@ -11,15 +14,17 @@ Updated by Eric Molitor + StringRef VendorName = Linux::getTriple().getVendorName(); + if (VendorName.compare("alpine") == 0) + return 2; -+ return 1; ++ return Generic_ELF::GetDefaultStackProtectorLevel(KernelOrKext); +} + SanitizerMask Linux::getSupportedSanitizers() const { const bool IsX86 = getTriple().getArch() == llvm::Triple::x86; const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64; +diff --git a/lib/Driver/ToolChains/Linux.h b/lib/Driver/ToolChains/Linux.h +index 22dbbec..ba0d558 100644 --- a/lib/Driver/ToolChains/Linux.h +++ b/lib/Driver/ToolChains/Linux.h -@@ -38,6 +38,7 @@ +@@ -38,6 +38,7 @@ public: void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; bool isPIEDefault() const override; @@ -27,9 +32,11 @@ Updated by Eric Molitor SanitizerMask getSupportedSanitizers() const override; void addProfileRTLibs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const override; +diff --git a/test/Driver/fsanitize.c b/test/Driver/fsanitize.c +index 304e759..29ead22 100644 --- a/test/Driver/fsanitize.c +++ b/test/Driver/fsanitize.c -@@ -585,12 +585,12 @@ +@@ -585,18 +585,17 @@ // RUN: %clang -fno-sanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NOSP // NOSP-NOT: "-fsanitize=safe-stack" @@ -45,6 +52,14 @@ Updated by Eric Molitor // RUN: %clang -target i386-contiki-unknown -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP // NO-SP-NOT: stack-protector // NO-SP: "-fsanitize=safe-stack" + // SP-ASAN: error: invalid argument '-fsanitize=safe-stack' not allowed with '-fsanitize=address' + // SP: "-fsanitize=safe-stack" +-// SP: -stack-protector + // NO-SP-NOT: stack-protector + + // RUN: %clang -target powerpc64-unknown-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s -check-prefix=CHECK-SANM +diff --git a/test/Driver/stack-protector.c b/test/Driver/stack-protector.c +index a3e40b5..60ec2a8 100644 --- a/test/Driver/stack-protector.c +++ b/test/Driver/stack-protector.c @@ -24,6 +24,20 @@ -- cgit v1.2.3