summaryrefslogtreecommitdiff
path: root/user/clang
diff options
context:
space:
mode:
Diffstat (limited to 'user/clang')
-rw-r--r--user/clang/0001-Add-support-for-Ad-lie-Linux.patch46
-rw-r--r--user/clang/APKBUILD22
-rw-r--r--user/clang/cfe-005-ppc64-dynamic-linker-path.patch17
-rw-r--r--user/clang/pmmx-musl.patch12
-rw-r--r--user/clang/ppc64-elfv2.patch38
5 files changed, 107 insertions, 28 deletions
diff --git a/user/clang/0001-Add-support-for-Ad-lie-Linux.patch b/user/clang/0001-Add-support-for-Ad-lie-Linux.patch
index f12adf513..6fdb58542 100644
--- a/user/clang/0001-Add-support-for-Ad-lie-Linux.patch
+++ b/user/clang/0001-Add-support-for-Ad-lie-Linux.patch
@@ -24,8 +24,8 @@ index 7b34a09256..7a3774a4f1 100644
AlpineLinux,
ArchLinux,
DebianLenny,
-@@ -118,6 +119,10 @@ public:
- return DistroVal >= UbuntuHardy && DistroVal <= UbuntuCosmic;
+@@ -120,6 +121,10 @@ public:
+ return DistroVal >= UbuntuHardy && DistroVal <= UbuntuDisco;
}
+ bool IsAdelieLinux() const {
@@ -39,7 +39,7 @@ diff --git a/lib/Driver/Distro.cpp b/lib/Driver/Distro.cpp
index 2c4d44faf8..7ef35ab379 100644
--- a/lib/Driver/Distro.cpp
+++ b/lib/Driver/Distro.cpp
-@@ -130,6 +130,9 @@ static Distro::DistroType DetectDistro(vfs::FileSystem &VFS) {
+@@ -132,6 +132,9 @@ static Distro::DistroType DetectDistro(vfs::FileSystem &VFS) {
if (VFS.exists("/etc/exherbo-release"))
return Distro::Exherbo;
@@ -49,30 +49,34 @@ index 2c4d44faf8..7ef35ab379 100644
if (VFS.exists("/etc/alpine-release"))
return Distro::AlpineLinux;
-diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
-index 2a87cb077c..85bcd8ed47 100644
---- a/lib/Driver/ToolChains/Linux.cpp
-+++ b/lib/Driver/ToolChains/Linux.cpp
-@@ -234,7 +234,8 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+--
+2.18.0
+
+--- cfe-8.0.0.src/lib/Driver/ToolChains/Linux.cpp.old 2018-11-29 18:52:22.000000000 +0000
++++ cfe-8.0.0.src/lib/Driver/ToolChains/Linux.cpp 2019-04-23 23:49:37.786181838 +0000
+@@ -236,13 +236,13 @@
+
+ Distro Distro(D.getVFS());
+
+- if (Distro.IsAlpineLinux() || Triple.isAndroid()) {
++ if (Distro.IsAdelieLinux() || Distro.IsAlpineLinux() || Triple.isAndroid()) {
+ ExtraOpts.push_back("-z");
ExtraOpts.push_back("now");
}
-- if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsAlpineLinux()) {
-+ if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsAlpineLinux() ||
-+ Distro.IsAdelieLinux()) {
+ if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsAlpineLinux() ||
+- Triple.isAndroid()) {
++ Distro.IsAdelieLinux() || Triple.isAndroid()) {
ExtraOpts.push_back("-z");
ExtraOpts.push_back("relro");
}
-@@ -268,7 +269,8 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
- // Hexagon linker/loader does not support .gnu.hash
- if (!IsMips && !IsAndroid && !IsHexagon) {
+@@ -285,7 +285,8 @@
+ if (!IsMips && !IsHexagon) {
if (Distro.IsRedhat() || Distro.IsOpenSUSE() || Distro.IsAlpineLinux() ||
-- (Distro.IsUbuntu() && Distro >= Distro::UbuntuMaverick))
-+ Distro.IsAdelieLinux() ||
-+ (Distro.IsUbuntu() && Distro >= Distro::UbuntuMaverick))
+ (Distro.IsUbuntu() && Distro >= Distro::UbuntuMaverick) ||
+- (IsAndroid && !Triple.isAndroidVersionLT(23)))
++ (IsAndroid && !Triple.isAndroidVersionLT(23)) ||
++ Distro.IsAdelieLinux())
ExtraOpts.push_back("--hash-style=gnu");
- if (Distro.IsDebian() || Distro.IsOpenSUSE() || Distro == Distro::UbuntuLucid ||
---
-2.18.0
-
+ if (Distro.IsDebian() || Distro.IsOpenSUSE() ||
diff --git a/user/clang/APKBUILD b/user/clang/APKBUILD
index a56e16368..e5ed50d06 100644
--- a/user/clang/APKBUILD
+++ b/user/clang/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=clang
# Note: Update together with llvm.
-pkgver=7.0.1
+pkgver=8.0.0
pkgrel=0
_llvmver=${pkgver%%.*}
pkgdesc="A C language family front-end for LLVM"
@@ -12,14 +12,18 @@ url="https://llvm.org/"
license="NCSA"
depends_dev="$pkgname=$pkgver-r$pkgrel"
makedepends="cmake isl-dev libedit-dev libexecinfo-dev libxml2-dev libxml2-utils
- llvm-dev>=$_llvmver llvm-static>=$_llvmver llvm-test-utils>=$_llvmver"
+ llvm-dev>=$_llvmver llvm-static>=$_llvmver llvm-test-utils>=$_llvmver
+ z3 z3-dev"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc $pkgname-libs
$pkgname-analyzer::noarch"
source="https://llvm.org/releases/$pkgver/cfe-$pkgver.src.tar.xz
0001-Add-support-for-Ad-lie-Linux.patch
0008-Fix-ClangConfig-cmake-LLVM-path.patch
- use-llvm-lit.patch
+ cfe-005-ppc64-dynamic-linker-path.patch
+ pmmx-musl.patch
+ ppc64-elfv2.patch
secure-plt.patch
+ use-llvm-lit.patch
"
builddir="$srcdir/cfe-$pkgver.src"
@@ -27,6 +31,7 @@ build() {
mkdir -p "$builddir"/build
cd "$builddir"/build
+ CMAKE_PREFIX_PATH=/usr/lib/llvm$_llvmver/lib/cmake \
cmake .. -Wno-dev \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_INSTALL_PREFIX=/usr \
@@ -103,8 +108,11 @@ analyzer() {
mv usr/share/scan-* "$subpkgdir"/usr/share/
}
-sha512sums="df2f38153ebdc261bcfa6a569567f759bbb1a803192882a9d4eca55a47878166ac9057151a94ad341dc1281136547e4faa783a68070dfde2307b48cacd4b9194 cfe-7.0.1.src.tar.xz
-44aa152d50822a9e1a223b9e07e150ffa830c55deb4c4ca29e6218a0103eb263a00b41fd1ca84390e65fa08005901a0a0f88cf529bff8764220e99d06adef5fc 0001-Add-support-for-Ad-lie-Linux.patch
+sha512sums="98e540222719716985e5d8439116e47469cb01201ea91d1da7e46cb6633da099688d9352c3b65e5c5f660cbbae353b3d79bb803fc66b3be663f2b04b1feed1c3 cfe-8.0.0.src.tar.xz
+c3218a1622f53bb6bef65f844e32e1b048a1ed7d5aa444a7592f9b8e8543d41438a0ac032674adb2c1bf0ef8c6fbd6880c34f8c8e778a8fd31bb542968a3547e 0001-Add-support-for-Ad-lie-Linux.patch
9485fe4fd6182df543735ed8f4ce618693d0faeafa86d3f9574a6c7abf50978e2d56e0a94be3ed94d515cc937c388d66ceff1bbc9bb120d371b6d3e95340da00 0008-Fix-ClangConfig-cmake-LLVM-path.patch
-8a596e7369b5791e7e9c3278320aa5bac30d91f27d9a0df335ea862c359623869353d12145c3b64730f721600522f3acc5abe706428091482e0209e4ff308175 use-llvm-lit.patch
-9dad6dfb0097f79939b743dbe7ed20274c463d9c41f061a957841c60070247a4760b676465652e2e844fc75aab9a5b7f9f4dd7632f2ff5dd5b0a335fcbd29312 secure-plt.patch"
+e24b0eb5f0f2b58f8d18d7d191dccc76510a179738db1f42624bd68c6de92ea57d323e28f9ee1e4df59e44a2c00a23527ba21c1c1fce9ac5858db9b3049914f2 cfe-005-ppc64-dynamic-linker-path.patch
+1a76a74c193ea59b0114b116c5a9a7807b40a449e9c601263379fd7252867adb8ea8d4720f9fc8d801748176976d968990be29323bff9d5f3a03c4cfe80c61c4 pmmx-musl.patch
+26b6cb952a77e15f113c88f2417e510ddd496f5c3c3de2e51c1a7cf14a78d0b25cd881f40c5c7e95dde3b2b63bbd3d485544097eed8673669a755b456a1dcd71 ppc64-elfv2.patch
+9dad6dfb0097f79939b743dbe7ed20274c463d9c41f061a957841c60070247a4760b676465652e2e844fc75aab9a5b7f9f4dd7632f2ff5dd5b0a335fcbd29312 secure-plt.patch
+8a596e7369b5791e7e9c3278320aa5bac30d91f27d9a0df335ea862c359623869353d12145c3b64730f721600522f3acc5abe706428091482e0209e4ff308175 use-llvm-lit.patch"
diff --git a/user/clang/cfe-005-ppc64-dynamic-linker-path.patch b/user/clang/cfe-005-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000..d559d949b
--- /dev/null
+++ b/user/clang/cfe-005-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,17 @@
+--- a/lib/Driver/ToolChains/Linux.cpp
++++ b/lib/Driver/ToolChains/Linux.cpp
+@@ -590,12 +590,12 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+ Loader = "ld.so.1";
+ break;
+ case llvm::Triple::ppc64:
+- LibDir = "lib64";
++ LibDir = "lib";
+ Loader =
+ (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+ break;
+ case llvm::Triple::ppc64le:
+- LibDir = "lib64";
++ LibDir = "lib";
+ Loader =
+ (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2";
+ break;
diff --git a/user/clang/pmmx-musl.patch b/user/clang/pmmx-musl.patch
new file mode 100644
index 000000000..7286c0ab8
--- /dev/null
+++ b/user/clang/pmmx-musl.patch
@@ -0,0 +1,12 @@
+--- cfe-8.0.0.src/lib/Driver/ToolChains/Linux.cpp.old 2018-11-29 18:52:22.000000000 +0000
++++ cfe-8.0.0.src/lib/Driver/ToolChains/Linux.cpp 2019-06-01 23:22:27.015221397 +0000
+@@ -528,6 +528,9 @@
+ ArchName = "armeb";
+ IsArm = true;
+ break;
++ case llvm::Triple::x86:
++ ArchName = "i386";
++ break;
+ default:
+ ArchName = Triple.getArchName().str();
+ }
diff --git a/user/clang/ppc64-elfv2.patch b/user/clang/ppc64-elfv2.patch
new file mode 100644
index 000000000..59f300ebc
--- /dev/null
+++ b/user/clang/ppc64-elfv2.patch
@@ -0,0 +1,38 @@
+--- cfe-8.0.0.src/lib/Basic/Targets/PPC.h.old 2019-02-12 11:19:21.000000000 +0000
++++ cfe-8.0.0.src/lib/Basic/Targets/PPC.h 2019-06-01 23:18:07.613180102 +0000
+@@ -367,7 +367,7 @@
+ ABI = "elfv2";
+ } else {
+ resetDataLayout("E-m:e-i64:64-n32:64");
+- ABI = "elfv1";
++ ABI = (Triple.getEnvironment() == llvm::Triple::Musl) ? "elfv2" : "elfv1";
+ }
+
+ switch (getTriple().getOS()) {
+@@ -375,6 +375,15 @@
+ LongDoubleWidth = LongDoubleAlign = 64;
+ LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+ break;
++ default:
++ break;
++ }
++
++ switch (getTriple().getEnvironment()) {
++ case llvm::Triple::Musl:
++ LongDoubleWidth = LongDoubleAlign = 64;
++ LongDoubleFormat = &llvm::APFloat::IEEEdouble();
++ break;
+ default:
+ break;
+ }
+--- cfe-8.0.0.src/lib/Driver/ToolChains/Clang.cpp.old 2019-01-25 00:15:41.000000000 +0000
++++ cfe-8.0.0.src/lib/Driver/ToolChains/Clang.cpp 2019-06-01 23:19:33.973868618 +0000
+@@ -1745,7 +1745,7 @@
+ break;
+ }
+
+- ABIName = "elfv1";
++ ABIName = (getToolChain().getTriple().isMusl()) ? "elfv2" : "elfv1";
+ break;
+ }
+ case llvm::Triple::ppc64le: