package/php: fix OpenSSL detection for SNMP extension
PATCH 1/1 package/php: fix OpenSSL detection for SNMP extension
Buildroot commit a9e5cf6ac2cb7ba62d23c842899b3f7816eca14c bumped the package to version 8.4.13 which added upstream commit:
https://github.com/php/php-src/commit/dbdc79df954a22495d0939eceb3ab4e09ced1c1e
introducing changes for netsnmp detection.
Since this bump building php with its SNMP extension enabled and openssl globally disabled is broken:
/home/autobuild/autobuild/instance-12/output-1/host/lib/gcc/i686-buildroot-linux-gnu/15.3.0/../../../../i686-buildroot-linux-gnu/bin/ld:
ext/snmp/snmp.o: in function `snmp_session_set_security':
snmp.c:(.text+0x677): undefined reference to `usmHMAC384SHA512AuthProtocol' /home/autobuild/autobuild/instance-12/output-1/host/lib/gcc/i686-buildroot-linux-gnu/15.3.0/../../../../i686-buildroot-linux-gnu/bin/ld:
snmp.c:(.text+0x9c2): undefined reference to `usmHMAC192SHA256AuthProtocol'
because php configure misdetects the presence of openssl support in netsnmp although it is not present.
To fix the problem we add some autoconf variables to forcefully disable OpenSSL support in the SNMP extension when OpenSSL is disabled.
The build error could be reproduced with php 8.4.17 but could not be reproduced with php 8.3.24 so a backport to LTS branches should be considered.
To reproduce the build error this minimal defconfig can be used:
BR2_TOOLCHAIN_EXTERNAL=y
BR2_PACKAGE_PHP=y
BR2_PACKAGE_PHP_EXT_SNMP=y
Fixes:
https://autobuild.buildroot.org/results/45c9271bf504c8f241544806ad52b82d6efb711a/
---
Gitlab pipelines passed:
https://gitlab.com/bkuhls/buildroot/-/commits/3f95ee27031eb6f7bbe082f3a65e398f6882e77a
package/php/php.mk | 5 +++++ 1 file changed, 5 insertions(+)
package/php/php.mk +5 -0
@@ -294,6 +294,11 @@ endif ifeq ($(BR2_PACKAGE_PHP_EXT_SNMP),y) PHP_CONF_OPTS += --with-snmp=$(STAGING_DIR)/usr PHP_DEPENDENCIES += netsnmp +ifeq ($(BR2_PACKAGE_OPENSSL),) +PHP_CONF_ENV += \ + ac_cv_have_decl_usmHMAC192SHA256AuthProtocol=no \ + ac_cv_have_decl_usmHMAC384SHA512AuthProtocol=no +endif endif ifeq ($(BR2_PACKAGE_PHP_EXT_GD),y)
Signature · 6 lines
2.47.3 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hello Bernd,
Quoted 17 lines · Bernd Kuhls
Buildroot commit
a9e5cf6ac2cb7ba62d23c842899b3f7816eca14cbumped the package to version 8.4.13 which added upstream commit:
https://github.com/php/php-src/commit/dbdc79df954a22495d0939eceb3ab4e09ced1c1e
introducing changes for netsnmp detection.Since this bump building php with its SNMP extension enabled and openssl globally disabled is broken:
/home/autobuild/autobuild/instance-12/output-1/host/lib/gcc/i686-buildroot-linux-gnu/15.3.0/../../../../i686-buildroot-linux-gnu/bin/ld:
ext/snmp/snmp.o: in function `snmp_session_set_security':
snmp.c:(.text+0x677): undefined reference to `usmHMAC384SHA512AuthProtocol'/home/autobuild/autobuild/instance-12/output-1/host/lib/gcc/i686-buildroot-linux-gnu/15.3.0/../../../../i686-buildroot-linux-gnu/bin/ld:
snmp.c:(.text+0x9c2): undefined reference to `usmHMAC192SHA256AuthProtocol'because php configure misdetects the presence of openssl support in netsnmp although it is not present.
Quoted 6 lines
To fix the problem we add some autoconf variables to forcefully disable OpenSSL support in the SNMP extension when OpenSSL is disabled.
The build error could be reproduced with php 8.4.17 but could not be reproduced with php 8.3.24 so a backport to LTS branches should be considered.
I don't really understand this paragraph. If the issue does NOT happen with php 8.3.x that is in 2025.02.x, then why should the backport be considered?
package/php/php.mk endif · line 301
Quoted 5 lines
package/php/php.mk +5
-0+ifeq ($(BR2_PACKAGE_OPENSSL),) +PHP_CONF_ENV += \ + ac_cv_have_decl_usmHMAC192SHA256AuthProtocol=no \ + ac_cv_have_decl_usmHMAC384SHA512AuthProtocol=no +endif
As usual, I don't like this approach. If the detection of NetSNMP by the PHP configure.ac is broken, then it should be fixed rather than worked around. Could you have a look at doing a proper fix, that can be submitted upstream?
Thanks a lot!
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot