Skip to contentSkip to conversation

package/libmodsecurity: needs dynamic library with libcurl and mbedtls

PATCH Applied Fabrice Fontaine 3 participants 4 messages Jun 13, 2022 – Jul 19, 2022

lore
Share & tools
lore
#0 lore raw

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

libmodsecurity embeds several mbedtls source files since version 3.0.0 and
https://github.com/SpiderLabs/ModSecurity/commit/a3ae686f2555bdacbfc9e1889ad05065711a165d
resulting in the following static build failure if curl is built with mbedtls support:

/home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/m68k-buildroot-uclinux-uclibc/bin/ld.real: /home/buildroot/autobuild/instance-0/output-1/host/bin/../m68k-buildroot-uclinux-uclibc/sysroot/usr/lib/libmbedcrypto.a(md5.c.o): in function `mbedtls_md5_free':
md5.c:(.text+0x16): multiple definition of `mbedtls_md5_free'; ../../src/.libs/libmodsecurity.a(libmbedtls_la-md5.o):md5.c:(.text+0x16): first defined here

Fixes:
- http://autobuild.buildroot.org/results/98472a3a41cdbcb3d02289a437074a267f4b2e8e

---
 package/libmodsecurity/Config.in    | 5 +++++
 package/nginx-modsecurity/Config.in | 5 +++++
 2 files changed, 10 insertions(+)
package/libmodsecurity/Config.in +5 -0
index 87f7a9c103..f65ab3de93 100644
@@ -2,6 +2,8 @@ config BR2_PACKAGE_LIBMODSECURITY
 	bool "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)
 	select BR2_PACKAGE_PCRE
 	help
 	  Libmodsecurity is one component of the ModSecurity
@@ -17,3 +19,6 @@ config BR2_PACKAGE_LIBMODSECURITY
 
 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
package/nginx-modsecurity/Config.in +5 -0
index b1fcbadd7a..5cbe57a866 100644
@@ -3,6 +3,7 @@ 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
 	select BR2_PACKAGE_LIBMODSECURITY
 	help
 	  The ModSecurity-nginx connector is the connection
@@ -14,3 +15,7 @@ config BR2_PACKAGE_NGINX_MODSECURITY
 comment "nginx-modsecurity needs a toolchain w/ C++, threads"
 	depends on BR2_PACKAGE_NGINX_HTTP
 	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_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
Signature · 6 lines
2.35.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 6 lines · Fabrice Fontaine

libmodsecurity embeds several mbedtls source files since version 3.0.0 and
https://github.com/SpiderLabs/ModSecurity/commit/a3ae686f2555bdacbfc9e1889ad05065711a165d
resulting in the following static build failure if curl is built with mbedtls support:

Quoted 7 lines

/home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/m68k-buildroot-uclinux-uclibc/bin/ld.real: /home/buildroot/autobuild/instance-0/output-1/host/bin/../m68k-buildroot-uclinux-uclibc/sysroot/usr/lib/libmbedcrypto.a(md5.c.o): in function `mbedtls_md5_free':
md5.c:(.text+0x16): multiple definition of `mbedtls_md5_free'; ../../src/.libs/libmodsecurity.a(libmbedtls_la-md5.o):md5.c:(.text+0x16): first defined here

Fixes:
- http://autobuild.buildroot.org/results/98472a3a41cdbcb3d02289a437074a267f4b2e8e

Applied to master, thanks.

Since upstream seemed to risk not accepting the package, I added a comment
that hopefully will tickle them.

Regards,
Arnout

Quoted 38 lines
---
  package/libmodsecurity/Config.in    | 5 +++++
  package/nginx-modsecurity/Config.in | 5 +++++
  2 files changed, 10 insertions(+)
package/libmodsecurity/Config.in +5 -0
index 87f7a9c103..f65ab3de93 100644
@@ -2,6 +2,8 @@ config BR2_PACKAGE_LIBMODSECURITY
  	bool "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)
  	select BR2_PACKAGE_PCRE
  	help
  	  Libmodsecurity is one component of the ModSecurity
@@ -17,3 +19,6 @@ config BR2_PACKAGE_LIBMODSECURITY
 
  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
package/nginx-modsecurity/Config.in +1 -0
index b1fcbadd7a..5cbe57a866 100644
@@ -3,6 +3,7 @@ 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
  	select BR2_PACKAGE_LIBMODSECURITY
  	help
  	  The ModSecurity-nginx connector is the connection

package/nginx-modsecurity/Config.in config BR2_PACKAGE_NGINX_MODSECURITY · line 21

Quoted 7 lines
package/nginx-modsecurity/Config.in +4 -0
@@ -14,3 +15,7 @@ config BR2_PACKAGE_NGINX_MODSECURITY
  comment "nginx-modsecurity needs a toolchain w/ C++, threads"
  	depends on BR2_PACKAGE_NGINX_HTTP
  	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_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

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

#2 lore raw
Quoted 13 lines · Arnout Vandecappelle
Quoted 10 lines · Fabrice Fontaine

libmodsecurity embeds several mbedtls source files since version 3.0.0 and
https://github.com/SpiderLabs/ModSecurity/commit/a3ae686f2555bdacbfc9e1889ad05065711a165d

resulting in the following static build failure if curl is built with mbedtls support:

/home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/m68k-buildroot-uclinux-uclibc/bin/ld.real: /home/buildroot/autobuild/instance-0/output-1/host/bin/../m68k-buildroot-uclinux-uclibc/sysroot/usr/lib/libmbedcrypto.a(md5.c.o): in function `mbedtls_md5_free':
md5.c:(.text+0x16): multiple definition of `mbedtls_md5_free'; ../../src/.libs/libmodsecurity.a(libmbedtls_la-md5.o):md5.c:(.text+0x16): first defined here

Quoted 8 lines
Quoted 4 lines

Fixes:
  - http://autobuild.buildroot.org/results/98472a3a41cdbcb3d02289a437074a267f4b2e8e

 Applied to master, thanks.

 Since upstream seemed to risk not accepting the package, I added a comment that hopefully will tickle them.

 Gah, this was for another patch.

 Regards,
 Arnout

Quoted 41 lines

 Regards,
 Arnout

Quoted 37 lines

---
  package/libmodsecurity/Config.in    | 5 +++++
  package/nginx-modsecurity/Config.in | 5 +++++

  2 files changed, 10 insertions(+)
package/libmodsecurity/Config.in +0 -0
index 87f7a9c103..f65ab3de93 100644
@@ -2,6 +2,8 @@ config BR2_PACKAGE_LIBMODSECURITY

      bool "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) select BR2_PACKAGE_PCRE
      help
        Libmodsecurity is one component of the ModSecurity

package/libmodsecurity/Config.in +0 -0
@@ -17,3 +19,6 @@ config BR2_PACKAGE_LIBMODSECURITY

    comment "libmodsecurity needs a toolchain w/ C++, threads" depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS

package/libmodsecurity/Config.in +3 -0
+
+comment "libmodsecurity needs a toolchain w/ dynamic library"
+    depends on BR2_STATIC_LIBS && BR2_PACKAGE_LIBCURL_MBEDTLS
package/nginx-modsecurity/Config.in +0 -0
index b1fcbadd7a..5cbe57a866 100644
@@ -3,6 +3,7 @@ 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
      select BR2_PACKAGE_LIBMODSECURITY
      help
        The ModSecurity-nginx connector is the connection

Quoted 8 lines

package/nginx-modsecurity/Config.in config BR2_PACKAGE_NGINX_MODSECURITY · line 21

Quoted 8 lines
package/nginx-modsecurity/Config.in +0 -0
@@ -14,3 +15,7 @@ config BR2_PACKAGE_NGINX_MODSECURITY

  comment "nginx-modsecurity needs a toolchain w/ C++, threads" depends on BR2_PACKAGE_NGINX_HTTP
      depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS

package/nginx-modsecurity/Config.in +4 -0
+
+comment "nginx-modsecurity needs a toolchain w/ dynamic library"
+    depends on BR2_PACKAGE_NGINX_HTTP
+    depends on BR2_STATIC_LIBS && BR2_PACKAGE_LIBCURL_MBEDTLS

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

#3 lore raw
In reply to Arnout Vandecappelle
Quoted 18 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle <[email protected]> writes:

Quoted 13 lines · Fabrice Fontaine

libmodsecurity embeds several mbedtls source files since version 3.0.0
and
https://github.com/SpiderLabs/ModSecurity/commit/a3ae686f2555bdacbfc9e1889ad05065711a165d
resulting in the following static build failure if curl is built with
mbedtls support:
/home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/m68k-buildroot-uclinux-uclibc/bin/ld.real:
/home/buildroot/autobuild/instance-0/output-1/host/bin/../m68k-buildroot-uclinux-uclibc/sysroot/usr/lib/libmbedcrypto.a(md5.c.o):
in function `mbedtls_md5_free':
md5.c:(.text+0x16): multiple definition of `mbedtls_md5_free'; ../../src/.libs/libmodsecurity.a(libmbedtls_la-md5.o):md5.c:(.text+0x16):
first defined here
Fixes:
- http://autobuild.buildroot.org/results/98472a3a41cdbcb3d02289a437074a267f4b2e8e

Quoted 1 line
Quoted 1 line

Applied to master, thanks.

Committed to 2022.05.x and 2022.02.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot