summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/php/php_8.0.12.bb
diff options
context:
space:
mode:
authorClaude Bing <cbing@cybernetics.com>2021-11-10 00:25:53 -0500
committerKhem Raj <raj.khem@gmail.com>2021-11-11 08:31:56 -0800
commit7175f8b66980cad3299a2ff9001691af0015e5c0 (patch)
tree0c86ada4b827aba10a60fae94eb2fdfe0a4d2152 /meta-oe/recipes-devtools/php/php_8.0.12.bb
parent8e816f6fd17ae4142e67b2224ef88dae97435a1c (diff)
downloadmeta-openembedded-7175f8b66980cad3299a2ff9001691af0015e5c0.tar.gz
php: update from 7.4.21 to 8.0.12
Various security and bug fixes; adds support for the JIT compiler. * Fixed bug #81026 (PHP-FPM oob R/W in root process leading to privilege escalation) (CVE-2021-21703). https://www.php.net/ChangeLog-8.php#8.0.0 Signed-off-by: Claude Bing <cbing@cybernetics.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools/php/php_8.0.12.bb')
-rw-r--r--meta-oe/recipes-devtools/php/php_8.0.12.bb275
1 files changed, 275 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/php/php_8.0.12.bb b/meta-oe/recipes-devtools/php/php_8.0.12.bb
new file mode 100644
index 000000000..300499de5
--- /dev/null
+++ b/meta-oe/recipes-devtools/php/php_8.0.12.bb
@@ -0,0 +1,275 @@
1SUMMARY = "A server-side, HTML-embedded scripting language"
2HOMEPAGE = "http://www.php.net"
3SECTION = "console/network"
4
5LICENSE = "PHP-3.0"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=99532e0f6620bc9bca34f12fadaee33c"
7
8BBCLASSEXTEND = "native"
9DEPENDS = "zlib bzip2 libxml2 virtual/libiconv php-native lemon-native"
10DEPENDS:class-native = "zlib-native libxml2-native"
11
12PHP_MAJOR_VERSION = "${@d.getVar('PV').split('.')[0]}"
13
14SRC_URI = "http://php.net/distributions/php-${PV}.tar.bz2 \
15 file://0002-build-php.m4-don-t-unset-cache-variables.patch \
16 file://0003-php-remove-host-specific-info-from-header-file.patch \
17 file://0004-configure.ac-don-t-include-build-libtool.m4.patch \
18 file://0009-php-don-t-use-broken-wrapper-for-mkdir.patch \
19 file://0010-iconv-fix-detection.patch \
20 "
21
22SRC_URI:append:class-target = " \
23 file://0001-ext-opcache-config.m4-enable-opcache.patch \
24 file://0005-pear-fix-Makefile.frag-for-Yocto.patch \
25 file://0006-ext-phar-Makefile.frag-Fix-phar-packaging.patch \
26 file://0007-sapi-cli-config.m4-fix-build-directory.patch \
27 file://0008-ext-imap-config.m4-fix-include-paths.patch \
28 file://0011-opcache-jit-use-minilua-in-sysroot.patch \
29 file://php-fpm.conf \
30 file://php-fpm-apache.conf \
31 file://70_mod_php${PHP_MAJOR_VERSION}.conf \
32 file://php-fpm.service \
33 "
34
35S = "${WORKDIR}/php-${PV}"
36SRC_URI[sha256sum] = "b4886db1df322dc8fb128d8b34ae7e94f6fc682ecb29ff4f5a591d4de9feadbf"
37
38
39inherit autotools pkgconfig python3native gettext
40
41# phpize is not scanned for absolute paths by default (but php-config is).
42#
43SSTATE_SCAN_FILES += "phpize"
44SSTATE_SCAN_FILES += "build-defs.h"
45
46PHP_LIBDIR = "${libdir}/php${PHP_MAJOR_VERSION}"
47
48# Common EXTRA_OECONF
49COMMON_EXTRA_OECONF = "--enable-sockets \
50 --enable-pcntl \
51 --enable-shared \
52 --disable-rpath \
53 --with-pic \
54 --libdir=${PHP_LIBDIR} \
55"
56EXTRA_OECONF = "--enable-mbstring \
57 --enable-fpm \
58 --with-libdir=${baselib} \
59 --with-gettext=${STAGING_LIBDIR}/.. \
60 --with-zlib=${STAGING_LIBDIR}/.. \
61 --with-iconv=${STAGING_LIBDIR}/.. \
62 --with-bz2=${STAGING_DIR_TARGET}${exec_prefix} \
63 --with-config-file-path=${sysconfdir}/php/apache2-php${PHP_MAJOR_VERSION} \
64 ${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 'ac_cv_c_bigendian_php=no', 'ac_cv_c_bigendian_php=yes', d)} \
65 ${@bb.utils.contains('PACKAGECONFIG', 'pam', '', 'ac_cv_lib_pam_pam_start=no', d)} \
66 ${COMMON_EXTRA_OECONF} \
67"
68
69EXTRA_OECONF:append:riscv64 = " --with-pcre-jit=no"
70EXTRA_OECONF:append:riscv32 = " --with-pcre-jit=no"
71
72CACHED_CONFIGUREVARS += "ac_cv_func_dlopen=no ac_cv_lib_dl_dlopen=yes"
73
74EXTRA_OECONF:class-native = " \
75 --with-zlib=${STAGING_LIBDIR_NATIVE}/.. \
76 --without-iconv \
77 ${COMMON_EXTRA_OECONF} \
78"
79
80PACKAGECONFIG ??= "mysql sqlite3 imap opcache \
81 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 pam', d)} \
82"
83PACKAGECONFIG:class-native = ""
84
85PACKAGECONFIG[zip] = "--with-zip --with-zlib-dir=${STAGING_EXECPREFIXDIR},,libzip"
86
87PACKAGECONFIG[mysql] = "--with-mysqli=mysqlnd \
88 --with-pdo-mysql=mysqlnd \
89 ,--without-mysqli --without-pdo-mysql \
90 ,mysql5"
91
92PACKAGECONFIG[sqlite3] = "--with-sqlite3=${STAGING_LIBDIR}/.. \
93 --with-pdo-sqlite=${STAGING_LIBDIR}/.. \
94 ,--without-sqlite3 --without-pdo-sqlite \
95 ,sqlite3"
96PACKAGECONFIG[pgsql] = "--with-pgsql=${STAGING_DIR_TARGET}${exec_prefix},--without-pgsql,postgresql"
97PACKAGECONFIG[soap] = "--enable-soap, --disable-soap, libxml2"
98PACKAGECONFIG[apache2] = "--with-apxs2=${STAGING_BINDIR_CROSS}/apxs,,apache2-native apache2"
99PACKAGECONFIG[pam] = ",,libpam"
100PACKAGECONFIG[imap] = "--with-imap=${STAGING_DIR_HOST} \
101 --with-imap-ssl=${STAGING_DIR_HOST} \
102 ,--without-imap --without-imap-ssl \
103 ,uw-imap"
104PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
105PACKAGECONFIG[opcache] = "--enable-opcache,--disable-opcache"
106PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl"
107PACKAGECONFIG[valgrind] = "--with-valgrind=${STAGING_DIR_TARGET}/usr,--with-valgrind=no,valgrind"
108PACKAGECONFIG[mbregex] = "--enable-mbregex, --disable-mbregex, oniguruma"
109PACKAGECONFIG[mbstring] = "--enable-mbstring,,"
110
111export PHP_NATIVE_DIR = "${STAGING_BINDIR_NATIVE}"
112export PHP_PEAR_PHP_BIN = "${STAGING_BINDIR_NATIVE}/php"
113CFLAGS += " -D_GNU_SOURCE -g -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED -I${STAGING_INCDIR}/apache2"
114
115# Adding these flags enables dynamic library support, which is disabled by
116# default when cross compiling
117# See https://bugs.php.net/bug.php?id=60109
118CFLAGS += " -DHAVE_LIBDL "
119LDFLAGS += " -ldl "
120
121EXTRA_OEMAKE = "INSTALL_ROOT=${D}"
122
123acpaths = ""
124
125do_configure:prepend () {
126 rm -f ${S}/build/libtool.m4 ${S}/ltmain.sh ${S}/aclocal.m4
127 find ${S} -name config.m4 | xargs -n1 sed -i 's!APXS_HTTPD=.*!APXS_HTTPD=${STAGING_SBINDIR_NATIVE}/httpd!'
128}
129
130do_configure:append() {
131 # No, libtool, we really don't want rpath set...
132 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' ${HOST_SYS}-libtool
133 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' ${HOST_SYS}-libtool
134}
135
136do_install:append:class-native() {
137 rm -rf ${D}/${PHP_LIBDIR}/php/.registry
138 rm -rf ${D}/${PHP_LIBDIR}/php/.channels
139 rm -rf ${D}/${PHP_LIBDIR}/php/.[a-z]*
140}
141
142do_install:prepend() {
143 cat ${ACLOCALDIR}/libtool.m4 ${ACLOCALDIR}/lt~obsolete.m4 ${ACLOCALDIR}/ltoptions.m4 \
144 ${ACLOCALDIR}/ltsugar.m4 ${ACLOCALDIR}/ltversion.m4 > ${S}/build/libtool.m4
145}
146
147do_install:prepend:class-target() {
148 if ${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'true', 'false', d)}; then
149 # Install dummy config file so apxs doesn't fail
150 install -d ${D}${sysconfdir}/apache2
151 printf "\nLoadModule dummy_module modules/mod_dummy.so\n" > ${D}${sysconfdir}/apache2/httpd.conf
152 fi
153}
154
155# fixme
156do_install:append:class-target() {
157 install -d ${D}${sysconfdir}/
158 rm -rf ${D}/.registry
159 rm -rf ${D}/.channels
160 rm -rf ${D}/.[a-z]*
161 rm -rf ${D}/var
162 rm -f ${D}/${sysconfdir}/php-fpm.conf.default
163 install -m 0644 ${WORKDIR}/php-fpm.conf ${D}/${sysconfdir}/php-fpm.conf
164 install -d ${D}/${sysconfdir}/apache2/conf.d
165 install -m 0644 ${WORKDIR}/php-fpm-apache.conf ${D}/${sysconfdir}/apache2/conf.d/php-fpm.conf
166 install -d ${D}${sysconfdir}/init.d
167 sed -i 's:=/usr/sbin:=${sbindir}:g' ${B}/sapi/fpm/init.d.php-fpm
168 sed -i 's:=/etc:=${sysconfdir}:g' ${B}/sapi/fpm/init.d.php-fpm
169 sed -i 's:=/var:=${localstatedir}:g' ${B}/sapi/fpm/init.d.php-fpm
170 install -m 0755 ${B}/sapi/fpm/init.d.php-fpm ${D}${sysconfdir}/init.d/php-fpm
171 install -m 0644 ${WORKDIR}/php-fpm-apache.conf ${D}/${sysconfdir}/apache2/conf.d/php-fpm.conf
172
173 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then
174 install -d ${D}${systemd_unitdir}/system
175 install -m 0644 ${WORKDIR}/php-fpm.service ${D}${systemd_unitdir}/system/
176 sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
177 -e 's,@LOCALSTATEDIR@,${localstatedir},g' \
178 ${D}${systemd_unitdir}/system/php-fpm.service
179 fi
180
181 if ${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'true', 'false', d)}; then
182 install -d ${D}${sysconfdir}/apache2/modules.d
183 install -d ${D}${sysconfdir}/php/apache2-php${PHP_MAJOR_VERSION}
184 install -m 644 ${WORKDIR}/70_mod_php${PHP_MAJOR_VERSION}.conf ${D}${sysconfdir}/apache2/modules.d
185 sed -i s,lib/,${libexecdir}/, ${D}${sysconfdir}/apache2/modules.d/70_mod_php${PHP_MAJOR_VERSION}.conf
186 cat ${S}/php.ini-production | \
187 sed -e 's,extension_dir = \"\./\",extension_dir = \"/usr/lib/extensions\",' \
188 > ${D}${sysconfdir}/php/apache2-php${PHP_MAJOR_VERSION}/php.ini
189 rm -f ${D}${sysconfdir}/apache2/httpd.conf*
190 fi
191}
192
193SYSROOT_PREPROCESS_FUNCS += "php_sysroot_preprocess"
194
195php_sysroot_preprocess () {
196 install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
197 install -m 755 ${D}${bindir}/phpize ${SYSROOT_DESTDIR}${bindir_crossscripts}/
198 install -m 755 ${D}${bindir}/php-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/
199
200 sed -i 's!eval echo /!eval echo ${STAGING_DIR_HOST}/!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/phpize
201 sed -i 's!^include_dir=.*!include_dir=${STAGING_INCDIR}/php!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/php-config
202}
203
204MODPHP_PACKAGE = "${@bb.utils.contains('PACKAGECONFIG', 'apache2', '${PN}-modphp', '', d)}"
205
206PACKAGES = "${PN}-dbg ${PN}-cli ${PN}-phpdbg ${PN}-cgi ${PN}-fpm ${PN}-fpm-apache2 ${PN}-pear ${PN}-phar ${MODPHP_PACKAGE} ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}-opcache ${PN}"
207
208RDEPENDS:${PN} += "libgcc"
209RDEPENDS:${PN}-pear = "${PN}"
210RDEPENDS:${PN}-phar = "${PN}-cli"
211RDEPENDS:${PN}-cli = "${PN}"
212RDEPENDS:${PN}-modphp = "${PN} apache2"
213RDEPENDS:${PN}-opcache = "${PN}"
214
215ALLOW_EMPTY:${PN} = "1"
216
217INITSCRIPT_PACKAGES = "${PN}-fpm"
218inherit update-rc.d
219
220FILES:${PN}-dbg =+ "${bindir}/.debug \
221 ${libexecdir}/apache2/modules/.debug"
222FILES:${PN}-doc += "${PHP_LIBDIR}/php/doc"
223FILES:${PN}-cli = "${bindir}/php"
224FILES:${PN}-phpdbg = "${bindir}/phpdbg"
225FILES:${PN}-phar = "${bindir}/phar*"
226FILES:${PN}-cgi = "${bindir}/php-cgi"
227FILES:${PN}-fpm = "${sbindir}/php-fpm ${sysconfdir}/php-fpm.conf ${datadir}/fpm ${sysconfdir}/init.d/php-fpm ${systemd_unitdir}/system/php-fpm.service ${sysconfdir}/php-fpm.d/www.conf.default"
228FILES:${PN}-fpm-apache2 = "${sysconfdir}/apache2/conf.d/php-fpm.conf"
229CONFFILES:${PN}-fpm = "${sysconfdir}/php-fpm.conf"
230CONFFILES:${PN}-fpm-apache2 = "${sysconfdir}/apache2/conf.d/php-fpm.conf"
231INITSCRIPT_NAME:${PN}-fpm = "php-fpm"
232INITSCRIPT_PARAMS:${PN}-fpm = "defaults 60"
233FILES:${PN}-pear = "${bindir}/pear* ${bindir}/pecl ${PHP_LIBDIR}/php/PEAR \
234 ${PHP_LIBDIR}/php/PEAR*.php ${PHP_LIBDIR}/php/System.php \
235 ${PHP_LIBDIR}/php/peclcmd.php ${PHP_LIBDIR}/php/pearcmd.php \
236 ${PHP_LIBDIR}/php/.channels ${PHP_LIBDIR}/php/.channels/.alias \
237 ${PHP_LIBDIR}/php/.registry ${PHP_LIBDIR}/php/Archive/Tar.php \
238 ${PHP_LIBDIR}/php/Console/Getopt.php ${PHP_LIBDIR}/php/OS/Guess.php \
239 ${PHP_LIBDIR}/php/data/PEAR \
240 ${sysconfdir}/pear.conf"
241FILES:${PN}-dev = "${includedir}/php ${PHP_LIBDIR}/build ${bindir}/phpize \
242 ${bindir}/php-config ${PHP_LIBDIR}/php/.depdb \
243 ${PHP_LIBDIR}/php/.depdblock ${PHP_LIBDIR}/php/.filemap \
244 ${PHP_LIBDIR}/php/.lock ${PHP_LIBDIR}/php/test"
245FILES:${PN}-staticdev += "${PHP_LIBDIR}/extensions/*/*.a"
246FILES:${PN}-opcache = "${PHP_LIBDIR}/extensions/*/opcache${SOLIBSDEV}"
247FILES:${PN} = "${PHP_LIBDIR}/php"
248FILES:${PN} += "${bindir} ${libexecdir}/apache2"
249
250SUMMARY:${PN}-modphp = "PHP module for the Apache HTTP server"
251FILES:${PN}-modphp = "${libdir}/apache2 ${sysconfdir}"
252
253MODPHP_OLDPACKAGE = "${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'modphp', '', d)}"
254RPROVIDES:${PN}-modphp = "${MODPHP_OLDPACKAGE}"
255RREPLACES:${PN}-modphp = "${MODPHP_OLDPACKAGE}"
256RCONFLICTS:${PN}-modphp = "${MODPHP_OLDPACKAGE}"
257
258do_install:append:class-native() {
259 create_wrapper ${D}${bindir}/php \
260 PHP_PEAR_SYSCONF_DIR=${sysconfdir}/
261
262 if [ "$MACHINE_ARCH" == "x86" || "$MACHINE_ARCH" == "x86-64" ]; then
263 install -m 0755 ${WORKDIR}/build/ext/opcache/minilua ${D}${bindir}/
264 fi
265}
266
267
268# Fails to build with thumb-1 (qemuarm)
269# | {standard input}: Assembler messages:
270# | {standard input}:3719: Error: selected processor does not support Thumb mode `smull r0,r2,r9,r3'
271# | {standard input}:3720: Error: unshifted register required -- `sub r2,r2,r0,asr#31'
272# | {standard input}:3796: Error: selected processor does not support Thumb mode `smull r0,r2,r3,r3'
273# | {standard input}:3797: Error: unshifted register required -- `sub r2,r2,r0,asr#31'
274# | make: *** [ext/standard/math.lo] Error 1
275ARM_INSTRUCTION_SET = "arm"