From b9d83ff84983c8ff1f3f3a11d9d9b3fc06dbc573 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 23 Sep 2022 20:20:57 +0200 Subject: [PATCH] llvm: Update the emulated tls fix to the now upstreamed patch as pointed out at https://github.com/msys2/MINGW-packages/pull/12852#issuecomment-1245042931 --- mingw-w64-clang/0102-fix-emulated-tls.patch | 30 --------------------- mingw-w64-clang/PKGBUILD | 14 +++++----- 2 files changed, 7 insertions(+), 37 deletions(-) delete mode 100644 mingw-w64-clang/0102-fix-emulated-tls.patch diff --git a/mingw-w64-clang/0102-fix-emulated-tls.patch b/mingw-w64-clang/0102-fix-emulated-tls.patch deleted file mode 100644 index 5f558369fe..0000000000 --- a/mingw-w64-clang/0102-fix-emulated-tls.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp -index 74c14fed6575..44ffd22b921f 100644 ---- a/lib/CodeGen/CodeGenModule.cpp -+++ b/lib/CodeGen/CodeGenModule.cpp -@@ -1143,7 +1143,7 @@ static bool shouldAssumeDSOLocal(const CodeGenModule &CGM, - // such variables can't be marked as DSO local. (Native TLS variables - // can't be dllimported at all, though.) - if (GV->isDeclarationForLinker() && isa(GV) && -- (!GV->isThreadLocal() || CGM.getCodeGenOpts().EmulatedTLS)) -+ (!GV->isThreadLocal() || CGM.useEmulatedTLS())) - return false; - } - -diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h -index f57afdca4942..b10c392dc1bb 100644 ---- a/lib/CodeGen/CodeGenModule.h -+++ b/lib/CodeGen/CodeGenModule.h -@@ -746,6 +746,12 @@ public: - - const TargetCodeGenInfo &getTargetCodeGenInfo(); - -+ bool useEmulatedTLS() const { -+ if (CodeGenOpts.ExplicitEmulatedTLS) -+ return CodeGenOpts.EmulatedTLS; -+ return getTriple().hasDefaultEmulatedTLS(); -+ } -+ - CodeGenTypes &getTypes() { return Types; } - - CodeGenVTables &getVTables() { return VTables; } diff --git a/mingw-w64-clang/PKGBUILD b/mingw-w64-clang/PKGBUILD index 089dcbc2ab..0f5187374b 100644 --- a/mingw-w64-clang/PKGBUILD +++ b/mingw-w64-clang/PKGBUILD @@ -26,7 +26,7 @@ _version=15.0.1 _rc="" _tag=llvmorg-${_version}${_rc} pkgver=${_version}${_rc/-/} -pkgrel=2 +pkgrel=3 pkgdesc="C language family frontend for LLVM (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') @@ -69,9 +69,9 @@ source=("${_url}/llvm-${pkgver}.src.tar.xz"{,.sig} "0010-fix-system-libs-zstd.patch" "0011-List-memrchr-as-unavailable-on-Windows.patch" "0101-link-pthread-with-mingw.patch" - "0102-fix-emulated-tls.patch" "0303-ignore-new-bfd-options.patch" - "https://github.com/llvm/llvm-project/commit/623c4a7a55f7.patch") + "https://github.com/llvm/llvm-project/commit/623c4a7a55f7.patch" + "https://github.com/llvm/llvm-project/commit/fbfe1db4a95a.patch") # Some patch notes :) #0001-0099 -> llvm #0101-0199 -> clang @@ -102,9 +102,9 @@ sha256sums=('0222beed0080fd07f1ee93c5bbeb2e05420b555b9cda725e3a0c299d8cea7cfa' 'bd53c6ad00e369cd6cb938e6ecd20b5952765987cd97807083e671d4192ced48' 'cc6aeca56693070de910670f546d2ec50a056d5356540dbd7b5aa74ced45980b' '715cb8862753854b2d9256e0b70003e2d1f57083d83eaeaf5a095fc72b8a4e26' - '3a58bd5243fb082df64c90bd9a4f00c698317f20365d11bbe30fac5dfccd215e' '778e0db0a5b0657ab05e2a81d83241347a4a41af2b0f9903422f651fa58e8d40' - 'e3e6ef4f189b27076cc6209477c1603bcd2301ea49043f33a69d320f744fbf5d') + 'e3e6ef4f189b27076cc6209477c1603bcd2301ea49043f33a69d320f744fbf5d' + 'd5654bffcb86daf4ed32c42a057b5d27ca56564fe9166a3288d6f15702668360') validpgpkeys=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D' # Hans Wennborg, Google. '474E22316ABF4785A88C6E8EA2C794A986419D8A' # Tom Stellard 'D574BD5D1D0E98895E3BF90044F2485E45D59042') # Tobias Hieta @@ -170,8 +170,8 @@ prepare() { fi # https://github.com/msys2/MINGW-packages/pull/12550#issuecomment-1228506687 - apply_patch_with_msg \ - "0102-fix-emulated-tls.patch" + # https://github.com/msys2/MINGW-packages/pull/12852#issuecomment-1245042931 + patch -Nbp2 -i "${srcdir}/fbfe1db4a95a.patch" # Patch lld cd "${srcdir}/lld"