From: "Claude Bing" <cbing@cybernetics.com>
To: openembedded-devel@lists.openembedded.org
Subject: [meta-oe][PATCH] php: fix opcache link error in 7.4
Date: Thu, 7 May 2020 14:28:06 -0400 [thread overview]
Message-ID: <20200507142806.48643a47@cy-rd-cb> (raw)
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
next reply other threads:[~2020-05-07 18:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-07 18:28 Claude Bing [this message]
2020-05-08 10:56 ` [oe] [meta-oe][PATCH] php: fix opcache link error in 7.4 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200507142806.48643a47@cy-rd-cb \
--to=cbing@cybernetics.com \
--cc=openembedded-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.