Commit 7c6369df authored by Natanael Copa's avatar Natanael Copa

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
parent 3c1b4c49
Based on original patchset from Jakub Jirutka <jakub@jirutka.cz>
Updated by Eric Molitor <eric@molitor.org>
Updated by Natanael Copa <ncopa@alpinelinux.org>
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 <eric@molitor.org>
+ 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 <eric@molitor.org>
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 <eric@molitor.org>
// 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 @@
......
......@@ -4,23 +4,24 @@
pkgname=clang
# Note: Update together with llvm.
pkgver=7.0.1
pkgrel=0
pkgrel=1
_llvmver=${pkgver%%.*}
pkgdesc="A C language family front-end for LLVM"
arch="all"
url="http://llvm.org/"
license="UOI-NCSA"
license="NCSA"
makedepends="
cmake
isl-dev
libedit-dev
libexecinfo-dev
libxml2-dev
libxml2-utils
llvm-dev>=$_llvmver
llvm-static>=$_llvmver
llvm-test-utils>=$_llvmver
ninja
python2
python3
"
depends_dev="$pkgname=$pkgver-r$pkgrel"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc $pkgname-libs
......@@ -31,10 +32,6 @@ source="https://llvm.org/releases/$pkgver/cfe-$pkgver.src.tar.xz
builddir="$srcdir/cfe-$pkgver.src"
prepare() {
default_prepare
}
build() {
mkdir -p "$builddir"/build
cd "$builddir"/build
......@@ -95,4 +92,4 @@ analyzer() {
sha512sums="df2f38153ebdc261bcfa6a569567f759bbb1a803192882a9d4eca55a47878166ac9057151a94ad341dc1281136547e4faa783a68070dfde2307b48cacd4b9194 cfe-7.0.1.src.tar.xz
b52cb7d74636d39d12dd6c94a2b2a9c01e4d6a535d151aa8ca49b691eb20e1b4ea08481f1517ef81f4501ebc305a32d7951638cc0385fee134131e827bb0b2f3 10-add-musl-triples.patch
2bb0e356eb8e4c12162f90dd4589e4f35d62f230697ee74dd61fe81fcbe898923721be20a098f4cb547cde5e20dd71de534f18d46d304368446b4718c48a4a2e 20-Enable-stack-protector-by-default-for-Alpine-Linux.patch"
b98f39354adf7cf09de5bcac498cccb5c5dd4b8ba7ea0e6c18f2f2204650288088a12b7a535451e21a451b890b70430d679a09df7161de03dbf30d6b49ee1ec0 20-Enable-stack-protector-by-default-for-Alpine-Linux.patch"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment