Skip to content

Commit

Permalink
bump(gpkg/clang): 18.1.3 (#225)
Browse files Browse the repository at this point in the history
bump(gpkg/lld): 18.1.3
  • Loading branch information
Maxython authored Apr 6, 2024
1 parent 6f84519 commit f4acfed
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 281 deletions.
17 changes: 7 additions & 10 deletions gpkg/clang/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@ TERMUX_PKG_DESCRIPTION="Compiler infrastructure"
TERMUX_PKG_LICENSE="Apache-2.0, NCSA"
TERMUX_PKG_LICENSE_FILE="LICENSE.TXT"
TERMUX_PKG_MAINTAINER="@termux-pacman"
_GCC_PKG_VERSION=$(. $TERMUX_SCRIPTDIR/gpkg/gcc-libs/build.sh; echo $TERMUX_PKG_VERSION)
TERMUX_PKG_VERSION=17.0.6
TERMUX_PKG_VERSION=18.1.3
_SOURCE=https://github.com/llvm/llvm-project/releases/download/llvmorg-$TERMUX_PKG_VERSION
TERMUX_PKG_SRCURL=($_SOURCE/clang-$TERMUX_PKG_VERSION.src.tar.xz
$_SOURCE/clang-tools-extra-$TERMUX_PKG_VERSION.src.tar.xz
$_SOURCE/llvm-$TERMUX_PKG_VERSION.src.tar.xz
$_SOURCE/cmake-$TERMUX_PKG_VERSION.src.tar.xz
$_SOURCE/third-party-$TERMUX_PKG_VERSION.src.tar.xz)
TERMUX_PKG_SHA256=(a78f668a726ae1d3d9a7179996d97b12b90fb76ab9442a43110b972ff7ad9029
aa774642415d338d7b77a66fcbad6fd1f77f382dabcb67422a6230614eff1ab9
b638167da139126ca11917b6880207cc6e8f9d1cbb1a48d87d017f697ef78188
807f069c54dc20cb47b21c1f6acafdd9c649f3ae015609040d6182cab01140f4
3054d0a9c9375dab1a4539cc2cc45ab340341c5d71475f9599ba7752e222947b)
TERMUX_PKG_DEPENDS="libllvm-glibc, gcc-glibc, compiler-rt-glibc"
TERMUX_PKG_SHA256=(e43e1729713ac0241aa026fa2f98bb54e74a196a6fed60ab4819134a428eb6d8
e59a804b95e29fcc0b8e496065b0e7b9c9225efaea48294b31c03f1624dedc4e
fa6db8951f5ef576ac6bad43d5e1ed83962754538c998fbfa0397cd4521abc00
acfecb615d41c5b1a0a31e15324994ca06f7a3f37d8958d719b20de0d217b71b
ba1de46e740133d361c0d5d1387befa309f0b60f81bc2bf003252bebdcf9eada)
TERMUX_PKG_DEPENDS="libllvm-glibc, gcc-glibc, compiler-rt-glibc, lld-glibc"
TERMUX_PKG_BUILD_DEPENDS="llvm-glibc, python-glibc"
TERMUX_PKG_RECOMMENDS="lld-glibc"
TERMUX_PKG_NO_STATICSPLIT=true

termux_step_post_get_source() {
Expand Down Expand Up @@ -65,7 +63,6 @@ termux_step_configure() {
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_ENABLE_SPHINX=ON \
-DLLVM_EXTERNAL_LIT=$TERMUX_PREFIX/bin/lit \
-DGCC_INSTALL_PREFIX=$TERMUX_PREFIX/lib/gcc/$TERMUX_HOST_PLATFORM/${_GCC_PKG_VERSION} \
-DLLVM_INCLUDE_DOCS=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_MAIN_SRC_DIR=$TERMUX_PKG_SRCDIR/llvm-$TERMUX_PKG_VERSION.src \
Expand Down
78 changes: 0 additions & 78 deletions gpkg/clang/clangd-handle-missing-ending-brace.patch

This file was deleted.

72 changes: 0 additions & 72 deletions gpkg/clang/enable-fstack-protector-strong-by-default.patch

This file was deleted.

132 changes: 16 additions & 116 deletions gpkg/clang/setdirs.patch
Original file line number Diff line number Diff line change
@@ -1,126 +1,26 @@
diff --git a/include/clang/Config/config.h.cmake b/include/clang/Config/config.h.cmake
index a54a26cd..cd0fdd28 100644
--- a/include/clang/Config/config.h.cmake
+++ b/include/clang/Config/config.h.cmake
@@ -1,8 +1,6 @@
/* This generated file is for internal use. Do not include it from headers. */

-#ifdef CLANG_CONFIG_H
-#error config.h can only be included once
-#else
+#ifndef CLANG_CONFIG_H
#define CLANG_CONFIG_H

/* Bug report URL. */
diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp
index 40038dce..05d284fe 100644
index e5e1b1d7..3603a129 100644
--- a/lib/Driver/ToolChains/Gnu.cpp
+++ b/lib/Driver/ToolChains/Gnu.cpp
@@ -2107,6 +2107,11 @@ void Generic_GCC::GCCInstallationDetector::init(
return;
}

+ Version = GCCVersion::Parse(llvm::sys::path::filename(GCCInstallPath));
+ GCCTriple.setTriple(llvm::sys::path::filename(llvm::sys::path::parent_path(GCCInstallPath)));
+ IsValid = true;
+ return;
+
// Compute the set of prefixes for our search.
SmallVector<std::string, 8> Prefixes;
StringRef GCCToolchainDir = getGCCToolchainDir(Args, D.SysRoot);
@@ -2295,7 +2300,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
// They are not needed when the user has correct LLVM_DEFAULT_TARGET_TRIPLE
// and always uses the full --target (e.g. --target=aarch64-linux-gnu). The
// lists should shrink over time. Please don't add more elements to *Triples.
- static const char *const AArch64LibDirs[] = {"/lib64", "/lib"};
+ static const char *const AArch64LibDirs[] = {"@TERMUX_PREFIX@/lib"};
static const char *const AArch64Triples[] = {
"aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux",
"aarch64-suse-linux"};
@@ -2303,13 +2308,13 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu",
"aarch64_be-linux-gnu"};

- static const char *const ARMLibDirs[] = {"/lib"};
+ static const char *const ARMLibDirs[] = {"@TERMUX_PREFIX@/lib"};
static const char *const ARMTriples[] = {"arm-linux-gnueabi"};
static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
"armv7hl-redhat-linux-gnueabi",
"armv6hl-suse-linux-gnueabi",
"armv7hl-suse-linux-gnueabi"};
- static const char *const ARMebLibDirs[] = {"/lib"};
+ static const char *const ARMebLibDirs[] = {"@TERMUX_PREFIX@/lib"};
static const char *const ARMebTriples[] = {"armeb-linux-gnueabi"};
static const char *const ARMebHFTriples[] = {
"armeb-linux-gnueabihf", "armebv7hl-redhat-linux-gnueabi"};
@@ -2321,7 +2326,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
static const char *const CSKYTriples[] = {
"csky-linux-gnuabiv2", "csky-linux-uclibcabiv2", "csky-elf-noneabiv2"};

- static const char *const X86_64LibDirs[] = {"/lib64", "/lib"};
+ static const char *const X86_64LibDirs[] = {"@TERMUX_PREFIX@/lib"};
static const char *const X86_64Triples[] = {
"x86_64-linux-gnu", "x86_64-unknown-linux-gnu",
"x86_64-pc-linux-gnu", "x86_64-redhat-linux6E",
@@ -2331,8 +2336,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
"x86_64-amazon-linux"};
static const char *const X32Triples[] = {"x86_64-linux-gnux32",
"x86_64-pc-linux-gnux32"};
- static const char *const X32LibDirs[] = {"/libx32", "/lib"};
- static const char *const X86LibDirs[] = {"/lib32", "/lib"};
+ static const char *const X32LibDirs[] = {"@TERMUX_PREFIX@/lib"};
+ static const char *const X86LibDirs[] = {"@TERMUX_PREFIX@/lib"};
static const char *const X86Triples[] = {
"i586-linux-gnu", "i686-linux-gnu", "i686-pc-linux-gnu",
"i386-redhat-linux6E", "i686-redhat-linux", "i386-redhat-linux",
@@ -2851,7 +2856,7 @@ bool Generic_GCC::GCCInstallationDetector::ScanGentooGccConfig(
}
}
// Test the path based on the version in /etc/env.d/gcc/config-{tuple}.
- std::string basePath = "/usr/lib/gcc/" + ActiveVersion.first.str() + "/"
+ std::string basePath = "@TERMUX_PREFIX@/usr/lib/gcc/" + ActiveVersion.first.str() + "/"
+ ActiveVersion.second.str();
GentooScanPaths.push_back(StringRef(basePath));

@@ -3127,9 +3132,7 @@ Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
@@ -3312,12 +3312,8 @@ Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
// If this is a development, non-installed, clang, libcxx will
// not be found at ../include/c++ but it likely to be found at
// one of the following two locations:
- if (AddIncludePath(concat(SysRoot, "/usr/local/include")))
- SmallString<128> UsrLocalIncludeDir(SysRoot);
- llvm::sys::path::append(UsrLocalIncludeDir, "usr", "local", "include");
- if (AddIncludePath(UsrLocalIncludeDir))
- return;
- if (AddIncludePath(concat(SysRoot, "/usr/include")))
+ if (AddIncludePath(concat(SysRoot, "@TERMUX_PREFIX@/include")))
SmallString<128> UsrIncludeDir(SysRoot);
- llvm::sys::path::append(UsrIncludeDir, "usr", "include");
+ llvm::sys::path::append(UsrIncludeDir, "@TERMUX_PREFIX@", "include");
if (AddIncludePath(UsrIncludeDir))
return;
}

diff --git a/lib/Driver/ToolChains/Gnu.h b/lib/Driver/ToolChains/Gnu.h
index 6d335c9e..e1259081 100644
--- a/lib/Driver/ToolChains/Gnu.h
+++ b/lib/Driver/ToolChains/Gnu.h
@@ -14,6 +14,7 @@
#include "ROCm.h"
#include "clang/Driver/Tool.h"
#include "clang/Driver/ToolChain.h"
+#include "clang/Config/config.h" // for GCC_INSTALL_PREFIX
#include <set>

namespace clang {
@@ -195,8 +196,8 @@ public:
const Driver &D;

// FIXME: These might be better as path objects.
- std::string GCCInstallPath;
- std::string GCCParentLibPath;
+ std::string GCCInstallPath = GCC_INSTALL_PREFIX;
+ std::string GCCParentLibPath = GCCInstallPath + "/../../..";

/// The primary multilib appropriate for the given flags.
Multilib SelectedMultilib;
diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
index 1ba222bf..795cce93 100644
index 4300a2bd..e2ede427 100644
--- a/lib/Driver/ToolChains/Linux.cpp
+++ b/lib/Driver/ToolChains/Linux.cpp
@@ -301,8 +301,8 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
@@ -305,8 +305,8 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
}
Generic_GCC::AddMultilibPaths(D, SysRoot, OSLibDir, MultiarchTriple, Paths);

Expand All @@ -131,7 +31,7 @@ index 1ba222bf..795cce93 100644

if (IsAndroid) {
// Android sysroots contain a library directory for each supported OS
@@ -315,25 +315,23 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
@@ -319,25 +319,23 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
Paths);
}

Expand Down Expand Up @@ -162,7 +62,7 @@ index 1ba222bf..795cce93 100644
}

ToolChain::RuntimeLibType Linux::GetDefaultRuntimeLibType() const {
@@ -605,7 +603,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
@@ -609,7 +607,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
(Triple.getVendor() == llvm::Triple::UnknownVendor ||
Triple.getVendor() == llvm::Triple::PC))
return "/usr/" + Triple.str() + "/lib/" + Loader;
Expand All @@ -171,7 +71,7 @@ index 1ba222bf..795cce93 100644
}

void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
@@ -630,7 +628,7 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
@@ -634,7 +632,7 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
return;

// LOCAL_INCLUDE_DIR
Expand All @@ -180,7 +80,7 @@ index 1ba222bf..795cce93 100644
// TOOL_INCLUDE_DIR
AddMultilibIncludeArgs(DriverArgs, CC1Args);

@@ -651,10 +649,10 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
@@ -655,10 +653,10 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
// /usr/include.
std::string MultiarchIncludeDir = getMultiarchTriple(D, getTriple(), SysRoot);
if (!MultiarchIncludeDir.empty() &&
Expand All @@ -193,7 +93,7 @@ index 1ba222bf..795cce93 100644

if (getTriple().getOS() == llvm::Triple::RTEMS)
return;
@@ -662,9 +660,7 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
@@ -666,9 +664,7 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
// Add an include of '/include' directly. This isn't provided by default by
// system GCCs, but is often used with cross-compiling GCCs, and harmless to
// add even when Clang is acting as-if it were a system compiler.
Expand Down
10 changes: 5 additions & 5 deletions gpkg/lld/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ TERMUX_PKG_DESCRIPTION="Linker from the LLVM project"
TERMUX_PKG_LICENSE="Apache-2.0, NCSA"
TERMUX_PKG_LICENSE_FILE="LICENSE.TXT"
TERMUX_PKG_MAINTAINER="@termux-pacman"
TERMUX_PKG_VERSION=17.0.6
TERMUX_PKG_VERSION=18.1.3
_SOURCE=https://github.com/llvm/llvm-project/releases/download/llvmorg-$TERMUX_PKG_VERSION
TERMUX_PKG_SRCURL=($_SOURCE/lld-$TERMUX_PKG_VERSION.src.tar.xz
$_SOURCE/llvm-$TERMUX_PKG_VERSION.src.tar.xz
$_SOURCE/libunwind-$TERMUX_PKG_VERSION.src.tar.xz
$_SOURCE/cmake-$TERMUX_PKG_VERSION.src.tar.xz)
TERMUX_PKG_SHA256=(4ac13125616dc44905b85820aa403d27ec1226329b7f674daeb5f5584c6f0b22
b638167da139126ca11917b6880207cc6e8f9d1cbb1a48d87d017f697ef78188
9e7535a353aa862730b4ba38df42e06f6856b40c4cc51b57f27b5046dc21d70d
807f069c54dc20cb47b21c1f6acafdd9c649f3ae015609040d6182cab01140f4)
TERMUX_PKG_SHA256=(ea4c325c272ef1022c6517335e0c55d6331cbb00c3b67634b9df1bce011d486e
fa6db8951f5ef576ac6bad43d5e1ed83962754538c998fbfa0397cd4521abc00
1a7eb28b289accc65a8fcd280a03a7ef75a927d2f1a2fa7c9c2839824469ee89
acfecb615d41c5b1a0a31e15324994ca06f7a3f37d8958d719b20de0d217b71b)
TERMUX_PKG_DEPENDS="libllvm-glibc, gcc-libs-glibc, zlib-glibc, zstd-glibc"
TERMUX_PKG_BUILD_DEPENDS="llvm-glibc"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
Expand Down

0 comments on commit f4acfed

Please sign in to comment.