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 <[email protected]> --- meta-oe/recipes-devtools/php/php_7.4.4.bb | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 48149304c..68005c0bb 100644 --- a/meta-oe/recipes-devtools/php/php_7.4.4.bb +++ b/meta-oe/recipes-devtools/php/php_7.4.4.bb @@ -111,6 +111,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 = "" -- 2.17.1
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#84249): https://lists.openembedded.org/g/openembedded-devel/message/84249 Mute This Topic: https://lists.openembedded.org/mt/74056955/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
