All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] php: fix opcache link error in 7.4
@ 2020-05-07 18:28 Claude Bing
  2020-05-08 10:56 ` [oe] " Adrian Bunk
  0 siblings, 1 reply; 7+ messages in thread
From: Claude Bing @ 2020-05-07 18:28 UTC (permalink / raw)
  To: openembedded-devel

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>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-05-11 14:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-07 18:28 [meta-oe][PATCH] php: fix opcache link error in 7.4 Claude Bing
2020-05-08 10:56 ` [oe] " Adrian Bunk
2020-05-08 14:42   ` Claude Bing
2020-05-08 18:41     ` Adrian Bunk
2020-05-08 21:27       ` Claude Bing
2020-05-09 18:54         ` Steve Sakoman
2020-05-11 14:32           ` Claude Bing

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.