* [Buildroot] [PATCH v3, 1/1] package/libmodsecurity: needs dynamic library with libcurl, libssh2 and mbedtls
@ 2023-02-19 17:24 Fabrice Fontaine
2023-02-20 20:55 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Fontaine @ 2023-02-19 17:24 UTC (permalink / raw)
To: buildroot; +Cc: Fabrice Fontaine, Frank Vanbever
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
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Changes v2 -> v3:
- Fix syntax
Changes v1 -> v2:
- Update nginx-modsecurity
package/libmodsecurity/Config.in | 6 ++++--
package/nginx-modsecurity/Config.in | 7 +++++--
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/package/libmodsecurity/Config.in b/package/libmodsecurity/Config.in
index b15d808759..027c62716c 100644
--- a/package/libmodsecurity/Config.in
+++ b/package/libmodsecurity/Config.in
@@ -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))
diff --git a/package/nginx-modsecurity/Config.in b/package/nginx-modsecurity/Config.in
index 5cbe57a866..96ef7e88d5 100644
--- a/package/nginx-modsecurity/Config.in
+++ b/package/nginx-modsecurity/Config.in
@@ -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))
--
2.39.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH v3, 1/1] package/libmodsecurity: needs dynamic library with libcurl, libssh2 and mbedtls
2023-02-19 17:24 [Buildroot] [PATCH v3, 1/1] package/libmodsecurity: needs dynamic library with libcurl, libssh2 and mbedtls Fabrice Fontaine
@ 2023-02-20 20:55 ` Thomas Petazzoni via buildroot
2023-02-20 22:31 ` Fabrice Fontaine
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-02-20 20:55 UTC (permalink / raw)
To: Fabrice Fontaine; +Cc: Frank Vanbever, buildroot
Hello Fabrice,
On Sun, 19 Feb 2023 18:24:40 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> 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
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> Changes v2 -> v3:
> - Fix syntax
> Changes v1 -> v2:
> - Update nginx-modsecurity
Isn't that a bit madness? If libmodsecurity has its copy of parts of
mbedtls, but didn't take care of renaming the symbols, then ultimately
what we should conclude is that using libmodsecurity in a statically
linked configuration is not supported.
So I would advocate for simplifying the whole thing and just make
libmodsecurity and its reverse dependencies depends on !BR2_STATIC_LIBS
and be done with it.
What do you think?
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH v3, 1/1] package/libmodsecurity: needs dynamic library with libcurl, libssh2 and mbedtls
2023-02-20 20:55 ` Thomas Petazzoni via buildroot
@ 2023-02-20 22:31 ` Fabrice Fontaine
0 siblings, 0 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2023-02-20 22:31 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Frank Vanbever, buildroot
[-- Attachment #1.1: Type: text/plain, Size: 1834 bytes --]
Hello,
Le lun. 20 févr. 2023 à 21:55, Thomas Petazzoni <
thomas.petazzoni@bootlin.com> a écrit :
> Hello Fabrice,
>
> On Sun, 19 Feb 2023 18:24:40 +0100
> Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
>
> > 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
> >
> > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> > ---
> > Changes v2 -> v3:
> > - Fix syntax
> > Changes v1 -> v2:
> > - Update nginx-modsecurity
>
> Isn't that a bit madness? If libmodsecurity has its copy of parts of
> mbedtls, but didn't take care of renaming the symbols, then ultimately
> what we should conclude is that using libmodsecurity in a statically
> linked configuration is not supported.
>
> So I would advocate for simplifying the whole thing and just make
> libmodsecurity and its reverse dependencies depends on !BR2_STATIC_LIBS
> and be done with it.
>
> What do you think?
>
OK, I'll send a v4
>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
Best Regards,
Fabrice
[-- Attachment #1.2: Type: text/html, Size: 2845 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-02-21 2:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-19 17:24 [Buildroot] [PATCH v3, 1/1] package/libmodsecurity: needs dynamic library with libcurl, libssh2 and mbedtls Fabrice Fontaine
2023-02-20 20:55 ` Thomas Petazzoni via buildroot
2023-02-20 22:31 ` Fabrice Fontaine
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox