aboutsummaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorMichael Heimpold <mhei@heimpold.de>2023-06-03 17:57:18 +0200
committerMichael Heimpold <mhei@heimpold.de>2023-06-04 22:02:23 +0200
commita2e76e49787e97253c02d72d27e3d304d68ff488 (patch)
treee29e31187d9c7f9f79d8db4d7c46b1d6d9e080b0 /lang
parent97bc19b49cca44991569de41d73a864bdc723190 (diff)
php8: fix linking on riscv64 platform
The buildbots failed for the mentioned platform with the following error: (I shortened the pathnames and broke long lines a little bit for readability) .../lib/gcc/riscv64-openwrt-linux-musl/12.3.0/../../../../ riscv64-openwrt-linux-musl/bin/ld: Zend/zend_execute_API.o: in function `.L533': zend_execute_API.c:(.text+0x1b1c): undefined reference to `__atomic_exchange_1' .../riscv64-openwrt-linux-musl/bin/ld: Zend/zend_atomic.o: in function `zend_atomic_bool_exchange': zend_atomic.c:(.text+0xc): undefined reference to `__atomic_exchange_1' collect2: error: ld returned 1 exit status make[4]: *** [Makefile:350: sapi/cli/php] Error 1 Inspired by the blog post[1], linking to libatomic explicitly seems to do the trick. [1] A RISC-V gcc pitfall revealed by a glibc update https://blog.jiejiss.com/A-RISC-V-gcc-pitfall-revealed-by-a-glibc-update Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Diffstat (limited to 'lang')
-rw-r--r--lang/php8/Makefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/lang/php8/Makefile b/lang/php8/Makefile
index fbe33886c..1a32d9aa1 100644
--- a/lang/php8/Makefile
+++ b/lang/php8/Makefile
@@ -94,7 +94,7 @@ endef
define Package/php8-cli
$(call Package/php8/Default)
- DEPENDS+= +PACKAGE_php8-mod-intl:libstdcpp
+ DEPENDS+= +PACKAGE_php8-mod-intl:libstdcpp +riscv64:libatomic
TITLE+= (CLI)
endef
@@ -105,7 +105,7 @@ endef
define Package/php8-cgi
$(call Package/php8/Default)
- DEPENDS+= +PACKAGE_php8-mod-intl:libstdcpp
+ DEPENDS+= +PACKAGE_php8-mod-intl:libstdcpp +riscv64:libatomic
TITLE+= (CGI & FastCGI)
endef
@@ -127,7 +127,7 @@ endef
define Package/php8-fpm
$(call Package/php8/Default)
- DEPENDS+= +PACKAGE_php8-mod-intl:libstdcpp
+ DEPENDS+= +PACKAGE_php8-mod-intl:libstdcpp +riscv64:libatomic
TITLE+= (FPM)
endef
@@ -159,6 +159,7 @@ define Package/apache-mod-php8
CATEGORY:=Network
DEPENDS+=PACKAGE_apache-mod-php8:apache \
+PACKAGE_php8-mod-intl:libstdcpp \
+ +riscv64:libatomic \
+libpcre2 +zlib
TITLE:=PHP8 module for Apache Web Server
endef
@@ -197,6 +198,9 @@ endif
ifeq ($(CONFIG_USE_MUSL),y)
TARGET_CFLAGS += -D_LARGEFILE64_SOURCE
endif
+ifneq ($(findstring riscv64,$(CONFIG_ARCH)),)
+TARGET_LDFLAGS += -latomic
+endif
ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-bcmath),)
CONFIGURE_ARGS+= --enable-bcmath=shared
@@ -603,6 +607,8 @@ define BuildModule
define Package/php8-mod-$(1)
$(call Package/php8/Default)
+ DEPENDS+=+riscv64:libatomic
+
ifneq ($(3),)
DEPENDS+=$(3)
endif