Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/php: fix OpenSSL detection for SNMP extension
@ 2026-08-08  6:05 Bernd Kuhls
  2026-08-21  8:42 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Bernd Kuhls @ 2026-08-08  6:05 UTC (permalink / raw)
  To: buildroot

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/

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
Gitlab pipelines passed:
https://gitlab.com/bkuhls/buildroot/-/commits/3f95ee27031eb6f7bbe082f3a65e398f6882e77a

 package/php/php.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/php/php.mk b/package/php/php.mk
index 05eb4b9092..5e2ff442cb 100644
--- a/package/php/php.mk
+++ b/package/php/php.mk
@@ -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)
-- 
2.47.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/php: fix OpenSSL detection for SNMP extension
  2026-08-08  6:05 [Buildroot] [PATCH 1/1] package/php: fix OpenSSL detection for SNMP extension Bernd Kuhls
@ 2026-08-21  8:42 ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-08-21  8:42 UTC (permalink / raw)
  To: Bernd Kuhls; +Cc: buildroot

Hello Bernd,

On Sat, Aug 08, 2026 at 08:05:56AM +0200, Bernd Kuhls wrote:
> 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.

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?

> +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
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2026-08-21  8:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-08  6:05 [Buildroot] [PATCH 1/1] package/php: fix OpenSSL detection for SNMP extension Bernd Kuhls
2026-08-21  8:42 ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox