aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools
diff options
context:
space:
mode:
authorClaude Bing <cbing@cybernetics.com>2020-05-07 14:28:06 -0400
committerArmin Kuster <akuster808@gmail.com>2020-05-17 14:36:56 -0700
commita009197ef469f9bfb2fd341329e9a2fa38667e61 (patch)
tree8d589465657d106e43295670d7361e1b3aa80211 /meta-oe/recipes-devtools
parent6740bf60955638d7e0ddf39c17184e342c1f9da7 (diff)
downloadmeta-openembedded-a009197ef469f9bfb2fd341329e9a2fa38667e61.tar.gz
php: fix opcache link error in 7.4
Explicitly specifying -lrt is required for opcache to be linked against the proper dependencies. Additionally, PHP disables libdl when it detects a cross-compilation environment for some reason. In order to load any type of extension, re-enabling libdl is required. Signed-off-by: Claude Bing <cbing@cybernetics.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> (cherry picked from commit 0145cb4645b720efc36e4a034bb9e1077c191e5e) Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools')
-rw-r--r--meta-oe/recipes-devtools/php/php_7.4.4.bb11
1 files changed, 11 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/php/php_7.4.4.bb b/meta-oe/recipes-devtools/php/php_7.4.4.bb
index a76dcaad37..07c3115060 100644
--- a/meta-oe/recipes-devtools/php/php_7.4.4.bb
+++ b/meta-oe/recipes-devtools/php/php_7.4.4.bb
@@ -110,6 +110,17 @@ export PHP_NATIVE_DIR = "${STAGING_BINDIR_NATIVE}"
export PHP_PEAR_PHP_BIN = "${STAGING_BINDIR_NATIVE}/php"
CFLAGS += " -D_GNU_SOURCE -g -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED -I${STAGING_INCDIR}/apache2"
+# link against librt (libc) if opcache is specified in order to avoid the
+# following error:
+# Failed loading /usr/lib/php7/extensions/no-debug-non-zts-20190902/opcache.so: /usr/lib/php7/extensions/no-debug-non-zts-20190902/opcache.so: undefined symbol: shm_unlink
+LDFLAGS += "${@ " -lrt " if bb.utils.contains('PACKAGECONFIG', 'opcache', 'true', 'false', d) else "" }"
+
+# Adding these flags enables dynamic library support, which is disabled by
+# default when cross compiling
+# See https://bugs.php.net/bug.php?id=60109
+CFLAGS += " -DHAVE_LIBDL "
+LDFLAGS += " -ldl "
+
EXTRA_OEMAKE = "INSTALL_ROOT=${D}"
acpaths = ""