Skip to contentSkip to conversation

package/libmodsecurity: needs dynamic library with libcurl, libssh2 and mbedtls

PATCH Superseded Fabrice Fontaine 1 participant 1 message Feb 19, 2023

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/libmodsecurity: needs dynamic library with libcurl, libssh2 and mbedtls

Commit 9fc652a373034118535397fdd4042ab9f8fd7adf was incomplete as mbedtls can be pulled in libcurl through libssh2 resulting in the following build failure:

/home/autobuild/autobuild/instance-4/output-1/host/lib/gcc/powerpc64le-buildroot-linux-musl/11.3.0/../../../../powerpc64le-buildroot-linux-musl/bin/ld: /home/autobuild/autobuild/instance-4/output-1/host/powerpc64le-buildroot-linux-musl/sysroot/usr/lib//libmbedcrypto.a(md5.c.o): in function `mbedtls_md5_init':
md5.c:(.text+0x0): multiple definition of `mbedtls_md5_init'; ../../src/.libs/libmodsecurity.a(libmbedtls_la-md5.o):md5.c:(.text+0x0): first defined here

Fixes:
- http://autobuild.buildroot.org/results/4c235e46188f23d1a48297f4e5942cec7b25959a

---
Changes v1 -> v2:
- Update nginx-modsecurity

 package/libmodsecurity/Config.in    | 6 ++++--
 package/nginx-modsecurity/Config.in | 7 +++++--
 2 files changed, 9 insertions(+), 4 deletions(-)
package/libmodsecurity/Config.in +4 -2
index b15d808759..027c62716c 100644
@@ -3,7 +3,8 @@ config BR2_PACKAGE_LIBMODSECURITY
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	# libmodsecurity embeds several mbedtls source files
-	depends on !(BR2_STATIC_LIBS && BR2_PACKAGE_LIBCURL_MBEDTLS)
+	depends on !(BR2_STATIC_LIBS && (BR2_PACKAGE_LIBCURL_MBEDTLS \
+		|| (BR2_PACKAGE_LIBCURL && BR2_PACKAGE_LIBSSH2_MBEDTLS)))
 	select BR2_PACKAGE_PCRE2
 	help
 	  Libmodsecurity is one component of the ModSecurity
@@ -21,4 +22,5 @@ comment "libmodsecurity needs a toolchain w/ C++, threads"
 	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
 
 comment "libmodsecurity needs a toolchain w/ dynamic library"
-	depends on BR2_STATIC_LIBS && BR2_PACKAGE_LIBCURL_MBEDTLS
+	depends on BR2_STATIC_LIBS && (BR2_PACKAGE_LIBCURL_MBEDTLS \
+		|| (BR2_PACKAGE_LIBCURL && BR2_PACKAGE_LIBSSH2_MBEDTLS))
package/nginx-modsecurity/Config.in +5 -2
index 5cbe57a866..f3f883ab5a 100644
@@ -3,7 +3,9 @@ config BR2_PACKAGE_NGINX_MODSECURITY
 	depends on BR2_PACKAGE_NGINX_HTTP
 	depends on BR2_INSTALL_LIBSTDCPP # libmodsecurity
 	depends on BR2_TOOLCHAIN_HAS_THREADS # libmodsecurity
-	depends on !(BR2_STATIC_LIBS && BR2_PACKAGE_LIBCURL_MBEDTLS) # libmodsecurity
+	# libmodsecurity
+	depends on !(BR2_STATIC_LIBS && BR2_PACKAGE_LIBCURL_MBEDTLS \
+		|| (BR2_PACKAGE_LIBCURL && BR2_PACKAGE_LIBSSH2_MBEDTLS)))
 	select BR2_PACKAGE_LIBMODSECURITY
 	help
 	  The ModSecurity-nginx connector is the connection
@@ -18,4 +20,5 @@ comment "nginx-modsecurity needs a toolchain w/ C++, threads"
 
 comment "nginx-modsecurity needs a toolchain w/ dynamic library"
 	depends on BR2_PACKAGE_NGINX_HTTP
-	depends on BR2_STATIC_LIBS && BR2_PACKAGE_LIBCURL_MBEDTLS
+	depends on BR2_STATIC_LIBS && BR2_PACKAGE_LIBCURL_MBEDTLS \
+		|| (BR2_PACKAGE_LIBCURL && BR2_PACKAGE_LIBSSH2_MBEDTLS))
Signature · 6 lines
2.39.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot