Skip to content

Commit 8a5f81d

Browse files
committed
updpatch: ldc 3:1.40.0-2
Backport upstream libatomic fix.
1 parent 4daa224 commit 8a5f81d

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

ldc/riscv64.patch

+6-13
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
11
--- PKGBUILD
22
+++ PKGBUILD
3-
@@ -14,7 +14,7 @@ pkgdesc="A D Compiler based on the LLVM Compiler Infrastructure including D runt
4-
arch=('x86_64')
5-
url="https://github.com/ldc-developers/ldc"
6-
license=('BSD-3-Clause AND BSL-1.0 AND Apache-2.0 WITH LLVM-exception')
7-
-makedepends=('git' 'cmake' 'llvm' 'lld' 'ldc' 'ninja')
8-
+makedepends=('git' 'cmake' 'llvm' 'lld' 'ldc' 'ninja' 'llvm17-libs')
9-
# Disable lto as linking the ldc2 binary fails
10-
options=(!lto)
11-
12-
@@ -35,6 +35,8 @@ prepare() {
3+
@@ -35,6 +35,11 @@ prepare() {
134

145
# Set version used for path construction in getRelativeClangCompilerRTLibPath()
156
sed -i "s/ldc::llvm_version_base/\"$_clangversion\"/" driver/linker-gcc.cpp
167
+
178
+ patch -Np1 -d runtime/phobos -i "$srcdir/disable-static-NaN-tests.patch"
9+
+
10+
+ # runtime: Link libatomic on 64-bit RISC-V and LoongArch
11+
+ git cherry-pick -n 9296fd6fccbc2a6ade38ded1358923d1a893caab
1812
}
1913

2014
build() {
21-
@@ -50,7 +52,8 @@ build() {
15+
@@ -50,7 +55,7 @@ build() {
2216
-DBUILD_SHARED_LIBS=BOTH \
2317
-DBUILD_LTO_LIBS=ON \
2418
-DLDC_WITH_LLD=OFF \
2519
- -DD_COMPILER_FLAGS="-link-defaultlib-shared=false -linker=lld --flto=thin" \
2620
+ -DD_COMPILER_FLAGS="-link-defaultlib-shared=false -linker=lld" \
27-
+ -DLD_FLAGS="-Wl,--no-as-needed -latomic -Wl,--as-needed" \
2821
-DADDITIONAL_DEFAULT_LDC_SWITCHES="\"-link-defaultlib-shared\"," \
2922
..
3023
ninja
31-
@@ -102,3 +105,6 @@ package_liblphobos() {
24+
@@ -102,3 +107,6 @@ package_liblphobos() {
3225
# licenses
3326
install -D -m644 "$srcdir/ldc/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
3427
}

0 commit comments

Comments
 (0)