]> git.99rst.org Git - openwrt-packages.git/commitdiff
php8: drop libatomic dependency
authorDaniel Golle <redacted>
Thu, 10 Sep 2026 12:48:17 +0000 (13:48 +0100)
committerDaniel Golle <redacted>
Wed, 16 Sep 2026 15:35:19 +0000 (16:35 +0100)
PHP's configure script probes __atomic_exchange_1 as an external
function on riscv64, which only resolves against libatomic, and so
links the library although no binary references an atomic symbol.
The riscv64-only dependency and linker flag paper over that. Link
with --as-needed so the unused library is dropped and remove both;
mips and riscv64 builds import no atomic symbols.

Signed-off-by: Daniel Golle <redacted>
lang/php8/Makefile

index 8e109a5c08046eaa459ef5f642c9580c855fb4e0..f104b22034dc824763fe2c49cc1e204212ed6d22 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=php
 PKG_VERSION:=8.4.23
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
 PKG_LICENSE:=PHP-3.01
@@ -86,7 +86,7 @@ endef
 
 define Package/php8-cli
   $(call Package/php8/Default)
-  DEPENDS+= +PHP8_INTL:libstdcpp +riscv64:libatomic
+  DEPENDS+= +PHP8_INTL:libstdcpp
   TITLE+= (CLI)
 endef
 
@@ -97,7 +97,7 @@ endef
 
 define Package/php8-cgi
   $(call Package/php8/Default)
-  DEPENDS+= +PHP8_INTL:libstdcpp +riscv64:libatomic
+  DEPENDS+= +PHP8_INTL:libstdcpp
   TITLE+= (CGI & FastCGI)
 endef
 
@@ -119,7 +119,7 @@ endef
 
 define Package/php8-fpm
   $(call Package/php8/Default)
-  DEPENDS+= +PHP8_INTL:libstdcpp +riscv64:libatomic
+  DEPENDS+= +PHP8_INTL:libstdcpp
   TITLE+= (FPM)
 endef
 
@@ -149,7 +149,6 @@ define Package/apache-mod-php8
   CATEGORY:=Network
   DEPENDS+=PACKAGE_apache-mod-php8:apache \
     +PHP8_INTL:libstdcpp \
-    +riscv64:libatomic \
     +libpcre2 +zlib
   TITLE:=PHP8 module for Apache Web Server
 endef
@@ -189,9 +188,7 @@ endif
 ifeq ($(CONFIG_USE_MUSL),y)
 TARGET_CFLAGS += -D_LARGEFILE64_SOURCE
 endif
-ifneq ($(findstring riscv64,$(CONFIG_ARCH)),)
-TARGET_LDFLAGS += -latomic
-endif
+TARGET_LDFLAGS += -Wl,--as-needed
 
 
 ifeq ($(CONFIG_PHP8_GETTEXT),y)
@@ -605,8 +602,6 @@ define BuildModule
   define Package/php8-mod-$(1)
     $(call Package/php8/Default)
 
-    DEPENDS+=+riscv64:libatomic
-
     ifneq ($(3),)
       DEPENDS+=$(3)
     endif
git clone https://git.99rst.org/PROJECT