Skip to content

Commit bcc8ae1

Browse files
committed
[pacman] 7.0.0-9: Remove -fno-plt on unsupported architectures
LLVM doesn't support -fno-plt on RISC-V and LoongArch and starts emitting a warning if it's supplied on unsupported targets since LLVM 20, causing various errors when configuring packages. Let's remove the flag on riscv64 and loongarch64. As we have started moving to LLVM 20, the problem must be mitigated by stripping -fno-plt away from CFLAGS/LDFLAGS on riscv64 and loongarch64. Link: llvm/llvm-project#124081 Reference: #3594 (comment)
1 parent 08539e9 commit bcc8ae1

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

PKGBUILD

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
pkgbase=pacman
66
pkgname=(libalpm pacman repo-tools)
77
pkgver=7.0.0
8-
pkgrel=8
8+
pkgrel=9
99
arch=(x86_64 aarch64 riscv64 loongarch64)
1010
url=https://www.archlinux.org/pacman/
1111
license=(GPL)
@@ -78,11 +78,19 @@ prepare(){
7878

7979
build()
8080
{
81-
makepkg_cflags="-Os -pipe -fno-plt"
81+
# Temporarily workaround LLVM behaviour changes on -fno-plt
82+
# https://github.com/eweOS/packages/issues/3594#issuecomment-2863596036
83+
case $CARCH in
84+
riscv64|loongarch64)
85+
export CFLAGS="${CFLAGS/-fno-plt/}"
86+
export LDFLAGS="${LDFLAGS/-fno-plt/}" ;;
87+
esac
88+
89+
makepkg_cflags="-Os -pipe"
8290
# TODO: riscv64
8391
case $CARCH in
84-
x86_64) makepkg_cflags+=" -march=x86-64 -fstack-clash-protection -fcf-protection" ;;
85-
aarch64) makepkg_cflags+=" -march=armv8-a" ;;
92+
x86_64) makepkg_cflags+=" -fno-plt -march=x86-64 -fstack-clash-protection -fcf-protection" ;;
93+
aarch64) makepkg_cflags+=" -fno-plt -march=armv8-a" ;;
8694
riscv64) makepkg_cflags+=" -march=rv64gc" ;;
8795
loongarch64) makepkg_cflags+=" -march=la464" ;;
8896
esac

0 commit comments

Comments
 (0)