diff --git a/lang/php8-pecl-dio/Makefile b/lang/php8-pecl-dio/Makefile index 06896619..ecf5356d 100644 --- a/lang/php8-pecl-dio/Makefile +++ b/lang/php8-pecl-dio/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PECL_NAME:=dio PECL_LONGNAME:=Direct I/O functions -PKG_VERSION:=0.2.0 -PKG_RELEASE:=2 -PKG_HASH:=062777e948dece374c2d7d9e92106c87d18c11128d2179b50dedb43175c4bd6e +PKG_VERSION:=0.3.0 +PKG_RELEASE:=1 +PKG_HASH:=632a8b5a26b8463b7114f361e48a19aaa016e8a453a9d04877a94d96b59dcc87 PKG_NAME:=php8-pecl-$(PECL_NAME) PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz -PKG_SOURCE_URL:=http://pecl.php.net/get/ +PKG_SOURCE_URL:=https://pecl.php.net/get/ PKG_BUILD_DIR:=$(BUILD_DIR)/pecl-php8/$(PECL_NAME)-$(PKG_VERSION) PKG_BUILD_PARALLEL:=1 diff --git a/lang/php8-pecl-http/Makefile b/lang/php8-pecl-http/Makefile index 1a6543ca..6e48de4e 100644 --- a/lang/php8-pecl-http/Makefile +++ b/lang/php8-pecl-http/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PECL_NAME:=pecl_http PECL_LONGNAME:=Extended HTTP Support -PKG_VERSION:=4.2.3 -PKG_RELEASE:=2 -PKG_HASH:=fa2ab558fc8f0928a10f35c0f566f7c4a1d32e727bd3a96579e4c28482ee9d6a +PKG_VERSION:=4.2.6 +PKG_RELEASE:=1 +PKG_HASH:=cd33230050b3f7c5ddb6f4383ce2a81f0bcdb934432029eec72ebf0f942b876d PKG_NAME:=php8-pecl-http PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz -PKG_SOURCE_URL:=http://pecl.php.net/get/ +PKG_SOURCE_URL:=https://pecl.php.net/get/ PKG_MAINTAINER:=Michael Heimpold diff --git a/lang/php8-pecl-imagick/Makefile b/lang/php8-pecl-imagick/Makefile index d3b39b39..f363024f 100644 --- a/lang/php8-pecl-imagick/Makefile +++ b/lang/php8-pecl-imagick/Makefile @@ -14,12 +14,13 @@ PKG_HASH:=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e PKG_NAME:=php8-pecl-imagick PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz -PKG_SOURCE_URL:=http://pecl.php.net/get/ +PKG_SOURCE_URL:=https://pecl.php.net/get/ PKG_MAINTAINER:=W. Michael Petullo PKG_LICENSE:=PHP-3.01 PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:php:imagick PKG_BUILD_DEPENDS:=php8 PKG_BUILD_DIR:=$(BUILD_DIR)/pecl-php8/$(PECL_NAME)-$(PKG_VERSION) diff --git a/lang/php8-pecl-krb5/Makefile b/lang/php8-pecl-krb5/Makefile index f058d4f4..d53a3841 100644 --- a/lang/php8-pecl-krb5/Makefile +++ b/lang/php8-pecl-krb5/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PECL_NAME:=krb5 PECL_LONGNAME:=Bindings for the Kerberos library -PKG_VERSION:=1.1.4 -PKG_RELEASE:=2 -PKG_HASH:=8aba35bb9f2892be9092e8717d3e13604a817cdfb478dbc3855a226abc6c5979 +PKG_VERSION:=1.2.2 +PKG_RELEASE:=1 +PKG_HASH:=0219c6654baa50a863b1552ebc14a7f3d76a0671e595051074ae59571d7b401c PKG_NAME:=php8-pecl-krb5 PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz -PKG_SOURCE_URL:=http://pecl.php.net/get/ +PKG_SOURCE_URL:=https://pecl.php.net/get/ PKG_MAINTAINER:=W. Michael Petullo diff --git a/lang/php8-pecl-mcrypt/Makefile b/lang/php8-pecl-mcrypt/Makefile index 7e275eca..a5b3bfb5 100644 --- a/lang/php8-pecl-mcrypt/Makefile +++ b/lang/php8-pecl-mcrypt/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PECL_NAME:=mcrypt PECL_LONGNAME:=Bindings for the libmcrypt library -PKG_VERSION:=1.0.5 +PKG_VERSION:=1.0.7 PKG_RELEASE:=1 -PKG_HASH:=c9f51e211640a15d2a983f5d80e26660656351651d6f682d657bdf1cfa07d8a3 +PKG_HASH:=12ea2fbbf2e2efbe790a12121f77bf096c8b84cef81d0216bec00d56e5badef4 PKG_NAME:=php8-pecl-mcrypt PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz -PKG_SOURCE_URL:=http://pecl.php.net/get/ +PKG_SOURCE_URL:=https://pecl.php.net/get/ PKG_MAINTAINER:=W. Michael Petullo diff --git a/lang/php8-pecl-raphf/Makefile b/lang/php8-pecl-raphf/Makefile index 37892856..2f7ba9c8 100644 --- a/lang/php8-pecl-raphf/Makefile +++ b/lang/php8-pecl-raphf/Makefile @@ -14,7 +14,7 @@ PKG_HASH:=da3566db17422e5ef08b7ff144162952aabc14cb22407cc6b1d2a2d095812bd0 PKG_NAME:=php8-pecl-raphf PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz -PKG_SOURCE_URL:=http://pecl.php.net/get/ +PKG_SOURCE_URL:=https://pecl.php.net/get/ PKG_MAINTAINER:=Michael Heimpold diff --git a/lang/php8-pecl-redis/Makefile b/lang/php8-pecl-redis/Makefile index 5fe724dd..9b121f87 100644 --- a/lang/php8-pecl-redis/Makefile +++ b/lang/php8-pecl-redis/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PECL_NAME:=redis PECL_LONGNAME:=PHP extension for interfacing with Redis -PKG_VERSION:=5.3.7 -PKG_RELEASE:=2 -PKG_HASH:=b958166ccda4f40bd17c6998f9e2239021ae644467cd8ad5c15def420aad65b0 +PKG_VERSION:=6.1.0 +PKG_RELEASE:=1 +PKG_HASH:=f10405f639fe415e9ed4ec99538e72c90694d8dbd62868edcfcd6a453466b48c PKG_NAME:=php8-pecl-redis PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz -PKG_SOURCE_URL:=http://pecl.php.net/get/ +PKG_SOURCE_URL:=https://pecl.php.net/get/ PKG_MAINTAINER:=Michael Heimpold diff --git a/lang/php8-pecl-sodium/Makefile b/lang/php8-pecl-sodium/Makefile deleted file mode 100644 index 8f8473f0..00000000 --- a/lang/php8-pecl-sodium/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PECL_NAME:=sodium -PECL_LONGNAME:=Bindings for libsodium - -PKG_VERSION:=2.0.23 -PKG_RELEASE:=$(AUTORELEASE) -PKG_HASH:=f8c04533de8e4b48077f65de61b187e195c0919c41d4543e2263604fa0c50379 - -PKG_NAME:=php8-pecl-sodium -PKG_SOURCE:=lib$(PECL_NAME)-$(PKG_VERSION).tgz -PKG_SOURCE_URL:=http://pecl.php.net/get/ - -PKG_MAINTAINER:=W. Michael Petullo - -PKG_LICENSE:=ISC -PKG_LICENSE_FILES:=LICENSE - -PKG_BUILD_DEPENDS:=php8 -PKG_BUILD_DIR:=$(BUILD_DIR)/pecl-php8/lib$(PECL_NAME)-$(PKG_VERSION) -PKG_BUILD_PARALLEL:=1 - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/nls.mk -include ../php8/pecl.mk - -$(eval $(call PHP8PECLPackage,sodium,$(PECL_LONGNAME),+libsodium,30)) -$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/lang/php8-pecl-swoole/Makefile b/lang/php8-pecl-swoole/Makefile deleted file mode 100644 index 6c36223d..00000000 --- a/lang/php8-pecl-swoole/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PECL_NAME:=swoole -PECL_LONGNAME:=Bindings for the libswoole library - -PKG_VERSION:=4.8.12 -PKG_RELEASE:=1 -PKG_HASH:=0a0b844992d26c974957749ada86a9ff7a88daa512b7255db4fc41afa062f4a4 - -PKG_NAME:=php8-pecl-$(PECL_NAME) -PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz -PKG_SOURCE_URL:=http://pecl.php.net/get/ -PKG_MAINTAINER:=Lean -PKG_LICENSE:=Apache2.0 -PKG_LICENSE_FILES:=LICENSE -PKG_BUILD_DEPENDS:=php8 -PKG_BUILD_DIR:=$(BUILD_DIR)/pecl-php8/$(PECL_NAME)-$(PKG_VERSION) -PKG_BUILD_PARALLEL:=1 - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/nls.mk -include $(TOPDIR)/feeds/packages/lang/php8/pecl.mk - - -# CONFIGURE_ARGS+= \ -# --enable-openssl \ -# --enable-http2 \ -# --enable-sockets \ -# --enable-debug \ -# --enable-debug-log - -$(eval $(call PHP8PECLPackage,$(PECL_NAME),$(PECL_LONGNAME),+libstdcpp,15)) -$(eval $(call BuildPackage,$(PKG_NAME))) \ No newline at end of file diff --git a/lang/php8-pecl-xdebug/Makefile b/lang/php8-pecl-xdebug/Makefile index 32255884..a870a61f 100644 --- a/lang/php8-pecl-xdebug/Makefile +++ b/lang/php8-pecl-xdebug/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PECL_NAME:=xdebug PECL_LONGNAME:=Xdebug extension -PKG_VERSION:=3.2.0 +PKG_VERSION:=3.4.1 PKG_RELEASE:=1 -PKG_HASH:=7769b20eecdadf5fbe9f582512c10b394fb575b6f7a8c3a3a82db6883e0032b7 +PKG_HASH:=4d96bcded78dbd271fb344c119171b625a8597cd67fc6899ec5e019549f1bb87 PKG_NAME:=php8-pecl-xdebug PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz -PKG_SOURCE_URL:=http://pecl.php.net/get/ +PKG_SOURCE_URL:=https://pecl.php.net/get/ PKG_MAINTAINER:=Michael Heimpold diff --git a/lang/php8/Makefile b/lang/php8/Makefile index 7ef300cc..17f42620 100644 --- a/lang/php8/Makefile +++ b/lang/php8/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=php -PKG_VERSION:=8.2.2 +PKG_VERSION:=8.3.14 PKG_RELEASE:=1 PKG_MAINTAINER:=Michael Heimpold @@ -15,11 +15,11 @@ PKG_LICENSE_FILES:=LICENSE PKG_CPE_ID:=cpe:/a:php:php PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=http://www.php.net/distributions/ -PKG_HASH:=bdc4aa38e652bac86039601840bae01c0c3653972eaa6f9f93d5f71953a7ee33 +PKG_SOURCE_URL:=https://www.php.net/distributions/ +PKG_HASH:=58b4cb9019bf70c0cbcdb814c7df79b9065059d14cf7dbf48d971f8e56ae9be7 PKG_BUILD_PARALLEL:=1 -PKG_USE_MIPS16:=0 +PKG_BUILD_FLAGS:=no-mips16 PHP8_MODULES= \ bcmath \ @@ -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 @@ -295,7 +299,6 @@ endif ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-intl),) CONFIGURE_ARGS+= --enable-intl=shared - TARGET_CXXFLAGS+= -std=c++0x else CONFIGURE_ARGS+= --disable-intl endif @@ -603,6 +606,8 @@ define BuildModule define Package/php8-mod-$(1) $(call Package/php8/Default) + DEPENDS+=+riscv64:libatomic + ifneq ($(3),) DEPENDS+=$(3) endif diff --git a/lang/php8/patches/0007-Add-support-for-use-of-the-system-timezone-database.patch b/lang/php8/patches/0007-Add-support-for-use-of-the-system-timezone-database.patch index ce1ab37c..0eaead34 100644 --- a/lang/php8/patches/0007-Add-support-for-use-of-the-system-timezone-database.patch +++ b/lang/php8/patches/0007-Add-support-for-use-of-the-system-timezone-database.patch @@ -62,9 +62,9 @@ r1: initial revision + fi +fi + - PHP_DATE_CFLAGS="-Wno-implicit-fallthrough -I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1" - timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c lib/parse_posix.c - lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c lib/parse_iso_intervals.c lib/interval.c" + AX_CHECK_COMPILE_FLAG([-Wno-implicit-fallthrough], + [PHP_DATE_CFLAGS="$PHP_DATE_CFLAGS -Wno-implicit-fallthrough"],, + [-Werror]) --- a/ext/date/lib/parse_tz.c +++ b/ext/date/lib/parse_tz.c @@ -26,9 +26,22 @@ diff --git a/lang/php8/patches/0022-Use-system-timezone.patch b/lang/php8/patches/0022-Use-system-timezone.patch index 822c55ab..1ac44204 100644 --- a/lang/php8/patches/0022-Use-system-timezone.patch +++ b/lang/php8/patches/0022-Use-system-timezone.patch @@ -15,7 +15,7 @@ To be used in tandem with use_embedded_timezonedb.patch and use_embedded_timezon --- a/ext/date/php_date.c +++ b/ext/date/php_date.c -@@ -549,6 +549,23 @@ static char* guess_timezone(const timeli +@@ -568,6 +568,23 @@ static const char* guess_timezone(const } else if (*DATEG(default_timezone)) { return DATEG(default_timezone); } diff --git a/lang/php8/patches/0025-php-5.4.9-fixheader.patch b/lang/php8/patches/0025-php-5.4.9-fixheader.patch index 8e018162..b423fc10 100644 --- a/lang/php8/patches/0025-php-5.4.9-fixheader.patch +++ b/lang/php8/patches/0025-php-5.4.9-fixheader.patch @@ -9,7 +9,7 @@ Make generated php_config.h constant across rebuilds. --- a/configure.ac +++ b/configure.ac -@@ -1440,7 +1440,7 @@ PHP_REMOVE_USR_LIB(LDFLAGS) +@@ -1501,7 +1501,7 @@ PHP_REMOVE_USR_LIB(LDFLAGS) EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS" EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $PHP_LDFLAGS" diff --git a/lang/php8/patches/1004-disable-phar-command.patch b/lang/php8/patches/1004-disable-phar-command.patch index eddca267..dab5993b 100644 --- a/lang/php8/patches/1004-disable-phar-command.patch +++ b/lang/php8/patches/1004-disable-phar-command.patch @@ -11,7 +11,7 @@ --- a/configure.ac +++ b/configure.ac -@@ -1623,13 +1623,13 @@ CFLAGS_CLEAN="$CFLAGS \$(PROF_FLAGS)" +@@ -1697,13 +1697,13 @@ CFLAGS_CLEAN="$CFLAGS \$(PROF_FLAGS)" CFLAGS="\$(CFLAGS_CLEAN) $standard_libtool_flag" CXXFLAGS="$CXXFLAGS $standard_libtool_flag \$(PROF_FLAGS)" diff --git a/lang/php8/patches/1020_workaround-external-libgd-feature-detection.patch b/lang/php8/patches/1020_workaround-external-libgd-feature-detection.patch new file mode 100644 index 00000000..b22db2a0 --- /dev/null +++ b/lang/php8/patches/1020_workaround-external-libgd-feature-detection.patch @@ -0,0 +1,45 @@ +--- a/ext/gd/config.m4 ++++ b/ext/gd/config.m4 +@@ -152,7 +152,7 @@ AC_DEFUN([PHP_GD_CHECK_FORMAT],[ + LIBS="${LIBS} ${GD_SHARED_LIBADD}" + old_CFLAGS="${CFLAGS}" + CFLAGS="${CFLAGS} ${GDLIB_CFLAGS}" +- AC_MSG_CHECKING([for working gdImageCreateFrom$1 in libgd]) ++ AC_MSG_CHECKING([for gdImageCreateFrom$1 in libgd (OpenWrt build config based)]) + AC_LANG_PUSH([C]) + AC_RUN_IFELSE([AC_LANG_SOURCE([ + #include +@@ -179,7 +179,10 @@ int main(int argc, char** argv) { + ],[ + AC_MSG_RESULT([no]) + ],[ +- AC_MSG_RESULT([no]) ++ AC_MSG_RESULT([$3]) ++ m4_if([$3],[yes],[ ++ AC_DEFINE($2, 1, [Does gdImageCreateFrom$1 work?]) ++ ]) + ]) + AC_LANG_POP([C]) + CFLAGS="${old_CFLAGS}" +@@ -187,13 +190,14 @@ int main(int argc, char** argv) { + ]) + + AC_DEFUN([PHP_GD_CHECK_VERSION],[ +- PHP_GD_CHECK_FORMAT([Png], [HAVE_GD_PNG]) +- PHP_GD_CHECK_FORMAT([Avif], [HAVE_GD_AVIF]) +- PHP_GD_CHECK_FORMAT([Webp], [HAVE_GD_WEBP]) +- PHP_GD_CHECK_FORMAT([Jpeg], [HAVE_GD_JPG]) +- PHP_GD_CHECK_FORMAT([Xpm], [HAVE_GD_XPM]) +- PHP_GD_CHECK_FORMAT([Bmp], [HAVE_GD_BMP]) +- PHP_GD_CHECK_FORMAT([Tga], [HAVE_GD_TGA]) ++ dnl The 3rd parameter is OpenWrt specific default derived from libgd build ++ PHP_GD_CHECK_FORMAT([Png], [HAVE_GD_PNG], [yes]) ++ PHP_GD_CHECK_FORMAT([Avif], [HAVE_GD_AVIF], [no]) ++ PHP_GD_CHECK_FORMAT([Webp], [HAVE_GD_WEBP], [yes]) ++ PHP_GD_CHECK_FORMAT([Jpeg], [HAVE_GD_JPG], [yes]) ++ PHP_GD_CHECK_FORMAT([Xpm], [HAVE_GD_XPM], [no]) ++ PHP_GD_CHECK_FORMAT([Bmp], [HAVE_GD_BMP], [no]) ++ PHP_GD_CHECK_FORMAT([Tga], [HAVE_GD_TGA], [no]) + PHP_CHECK_LIBRARY(gd, gdFontCacheShutdown, [AC_DEFINE(HAVE_GD_FREETYPE, 1, [ ])], [], [ $GD_SHARED_LIBADD ]) + PHP_CHECK_LIBRARY(gd, gdVersionString, [AC_DEFINE(HAVE_GD_LIBVERSION, 1, [ ])], [], [ $GD_SHARED_LIBADD ]) + PHP_CHECK_LIBRARY(gd, gdImageGetInterpolationMethod, [AC_DEFINE(HAVE_GD_GET_INTERPOLATION, 1, [ ])], [], [ $GD_SHARED_LIBADD ]) diff --git a/lang/php8/patches/1030-loongarch64-support-for-fibers.patch b/lang/php8/patches/1030-loongarch64-support-for-fibers.patch new file mode 100644 index 00000000..e6480044 --- /dev/null +++ b/lang/php8/patches/1030-loongarch64-support-for-fibers.patch @@ -0,0 +1,234 @@ +From 49627124928f066320b7c2d2ba7501eac5c4fc63 Mon Sep 17 00:00:00 2001 +From: qiangxuhui +Date: Mon, 1 Apr 2024 07:16:47 +0000 +Subject: [PATCH] loongarch64 support for fibers + +Add loongarch64 assembly files from Boost, needed for fibers support, +and hook up loongarch64 fibers support during configure. + +Close GH-13914 +--- + Zend/asm/jump_loongarch64_sysv_elf_gas.S | 121 +++++++++++++++++++++++ + Zend/asm/make_loongarch64_sysv_elf_gas.S | 72 ++++++++++++++ + configure.ac | 2 + + 3 files changed, 195 insertions(+) + create mode 100644 Zend/asm/jump_loongarch64_sysv_elf_gas.S + create mode 100644 Zend/asm/make_loongarch64_sysv_elf_gas.S + +--- /dev/null ++++ b/Zend/asm/jump_loongarch64_sysv_elf_gas.S +@@ -0,0 +1,121 @@ ++/******************************************************* ++ * * ++ * ------------------------------------------------- * ++ * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * ++ * ------------------------------------------------- * ++ * | 0 | 8 | 16 | 24 | * ++ * ------------------------------------------------- * ++ * | FS0 | FS1 | FS2 | FS3 | * ++ * ------------------------------------------------- * ++ * ------------------------------------------------- * ++ * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | * ++ * ------------------------------------------------- * ++ * | 32 | 40 | 48 | 56 | * ++ * ------------------------------------------------- * ++ * | FS4 | FS5 | FS6 | FS7 | * ++ * ------------------------------------------------- * ++ * ------------------------------------------------- * ++ * | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | * ++ * ------------------------------------------------- * ++ * | 64 | 72 | 80 | 88 | * ++ * ------------------------------------------------- * ++ * | S0 | S1 | S2 | S3 | * ++ * ------------------------------------------------- * ++ * ------------------------------------------------- * ++ * | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | * ++ * ------------------------------------------------- * ++ * | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | * ++ * ------------------------------------------------- * ++ * | S4 | S5 | S6 | S7 | * ++ * ------------------------------------------------- * ++ * ------------------------------------------------- * ++ * | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | * ++ * ------------------------------------------------- * ++ * | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | * ++ * ------------------------------------------------- * ++ * | S8 | FP | RA | PC | * ++ * ------------------------------------------------- * ++ * * ++ * *****************************************************/ ++ ++.file "jump_loongarch64_sysv_elf_gas.S" ++.text ++.globl jump_fcontext ++.align 2 ++.type jump_fcontext,@function ++jump_fcontext: ++ # reserve space on stack ++ addi.d $sp, $sp, -160 ++ ++ # save fs0 - fs7 ++ fst.d $fs0, $sp, 0 ++ fst.d $fs1, $sp, 8 ++ fst.d $fs2, $sp, 16 ++ fst.d $fs3, $sp, 24 ++ fst.d $fs4, $sp, 32 ++ fst.d $fs5, $sp, 40 ++ fst.d $fs6, $sp, 48 ++ fst.d $fs7, $sp, 56 ++ ++ # save s0 - s8, fp, ra ++ st.d $s0, $sp, 64 ++ st.d $s1, $sp, 72 ++ st.d $s2, $sp, 80 ++ st.d $s3, $sp, 88 ++ st.d $s4, $sp, 96 ++ st.d $s5, $sp, 104 ++ st.d $s6, $sp, 112 ++ st.d $s7, $sp, 120 ++ st.d $s8, $sp, 128 ++ st.d $fp, $sp, 136 ++ st.d $ra, $sp, 144 ++ ++ # save RA as PC ++ st.d $ra, $sp, 152 ++ ++ # store SP (pointing to context-data) in A2 ++ move $a2, $sp ++ ++ # restore SP (pointing to context-data) from A0 ++ move $sp, $a0 ++ ++ # load fs0 - fs7 ++ fld.d $fs0, $sp, 0 ++ fld.d $fs1, $sp, 8 ++ fld.d $fs2, $sp, 16 ++ fld.d $fs3, $sp, 24 ++ fld.d $fs4, $sp, 32 ++ fld.d $fs5, $sp, 40 ++ fld.d $fs6, $sp, 48 ++ fld.d $fs7, $sp, 56 ++ ++ #load s0 - s7 ++ ld.d $s0, $sp, 64 ++ ld.d $s1, $sp, 72 ++ ld.d $s2, $sp, 80 ++ ld.d $s3, $sp, 88 ++ ld.d $s4, $sp, 96 ++ ld.d $s5, $sp, 104 ++ ld.d $s6, $sp, 112 ++ ld.d $s7, $sp, 120 ++ ld.d $s8, $sp, 128 ++ ld.d $fp, $sp, 136 ++ ld.d $ra, $sp, 144 ++ ++ # return transfer_t from jump ++ # pass transfer_t as first arg in context function ++ # a0 == FCTX, a1 == DATA ++ move $a0, $a2 ++ ++ # load PC ++ ld.d $a2, $sp, 152 ++ ++ # restore stack ++ addi.d $sp, $sp, 160 ++ ++ # jump to context ++ jr $a2 ++.size jump_fcontext, .-jump_fcontext ++ ++/* Mark that we don't need executable stack. */ ++.section .note.GNU-stack,"",%progbits +--- /dev/null ++++ b/Zend/asm/make_loongarch64_sysv_elf_gas.S +@@ -0,0 +1,72 @@ ++/******************************************************* ++ * * ++ * ------------------------------------------------- * ++ * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * ++ * ------------------------------------------------- * ++ * | 0 | 8 | 16 | 24 | * ++ * ------------------------------------------------- * ++ * | FS0 | FS1 | FS2 | FS3 | * ++ * ------------------------------------------------- * ++ * ------------------------------------------------- * ++ * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | * ++ * ------------------------------------------------- * ++ * | 32 | 40 | 48 | 56 | * ++ * ------------------------------------------------- * ++ * | FS4 | FS5 | FS6 | FS7 | * ++ * ------------------------------------------------- * ++ * ------------------------------------------------- * ++ * | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | * ++ * ------------------------------------------------- * ++ * | 64 | 72 | 80 | 88 | * ++ * ------------------------------------------------- * ++ * | S0 | S1 | S2 | S3 | * ++ * ------------------------------------------------- * ++ * ------------------------------------------------- * ++ * | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | * ++ * ------------------------------------------------- * ++ * | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | * ++ * ------------------------------------------------- * ++ * | S4 | S5 | S6 | S7 | * ++ * ------------------------------------------------- * ++ * ------------------------------------------------- * ++ * | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | * ++ * ------------------------------------------------- * ++ * | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | * ++ * ------------------------------------------------- * ++ * | S8 | FP | RA | PC | * ++ * ------------------------------------------------- * ++ * * ++ * *****************************************************/ ++ ++.file "make_loongarch64_sysv_elf_gas.S" ++.text ++.globl make_fcontext ++.align 2 ++.type make_fcontext,@function ++make_fcontext: ++ # shift address in A0 to lower 16 byte boundary ++ bstrins.d $a0, $zero, 3, 0 ++ ++ # reserve space for context-data on context-stack ++ addi.d $a0, $a0, -160 ++ ++ # third arg of make_fcontext() == address of context-function ++ st.d $a2, $a0, 152 ++ ++ # save address of finish as return-address for context-function ++ # will be entered after context-function returns ++ la.local $a4, finish ++ st.d $a4, $a0, 144 ++ ++ # return pointer to context-data ++ jr $ra ++ ++finish: ++ # exit code is zero ++ li.d $a0, 0 ++ # call _exit(0) ++ b %plt(_exit) ++ ++.size make_fcontext, .-make_fcontext ++/* Mark that we don't need executable stack. */ ++.section .note.GNU-stack,"",%progbits +--- a/configure.ac ++++ b/configure.ac +@@ -1281,6 +1281,7 @@ AS_CASE([$host_cpu], + [ppc*|powerpc*], [fiber_cpu="ppc32"], + [riscv64*], [fiber_cpu="riscv64"], + [s390x*], [fiber_cpu="s390x"], ++ [loongarch64*], [fiber_cpu="loongarch64"], + [mips64*], [fiber_cpu="mips64"], + [mips*], [fiber_cpu="mips32"], + [fiber_cpu="unknown"] +@@ -1302,6 +1303,7 @@ AS_CASE([$fiber_cpu], + [ppc32], [fiber_asm_file_prefix="ppc32_sysv"], + [riscv64], [fiber_asm_file_prefix="riscv64_sysv"], + [s390x], [fiber_asm_file_prefix="s390x_sysv"], ++ [loongarch64], [fiber_asm_file_prefix="loongarch64_sysv"], + [mips64], [fiber_asm_file_prefix="mips64_n64"], + [mips32], [fiber_asm_file_prefix="mips32_o32"], + [fiber_asm_file_prefix="unknown"]