Skip to contentSkip to conversation

package/gnutls: disable library search in /usr/lib

PATCH Applied Arnout Vandecappelle (Essensium/Mind) 3 participants 11 messages May 12, 2022 – May 28, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 package/gnutls: disable library search in /usr/lib

gnutls's configure script has a weird approach where it first searches for dependent libraries in the path specified by --prefix, before searching in the default search path. Since we set --prefix to /usr, and it doesn't take into account DESTDIR (which is anyway not set at configure time), that means it will first search /usr/lib before searching $(STAGING_DIR)/usr/lib.

Ideally, this would be fixed in the configure script itself. However, the m4 file that does this is pretty complex, it's not immediately clear where to add $DESTDIR. In addition it comes from gnulib which is a somewhat annoying upstream.

Therefore, instead, bypass the prefix lookup with --without-libfoo-prefix. Note that we could set --with-libfoo-prefix=$(STAGING_DIR)/usr (the latter is already done for librt and libpthread), but that's pretty pointless - --without-libfoo-prefix in fact reverts to what should have been done in the first place, i.e. use the toolchain search path.

Add --without-libfoo-prefix for all options defined in configure (found with ./configure --help | grep without-.*-prefix). Most of these are only used in tests (e.g. libcrypto) or even not at all (e.g. libiconv), but it's fairly hard to discover this and to be sure that they are indeed not needed, so better pass all of them.

Remove the now-redundant arguments for librt and libpthread.

Add a comment to remind people to revisit these when bumping the version.

---
This is for stable, but need to check if the same prefix options exist in 3.7.3.

---
 package/gnutls/gnutls.mk | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
package/gnutls/gnutls.mk +10 -5
index 0e461cd44c..b5503b1fc9 100644
@@ -4,6 +4,7 @@
 #
 ################################################################################
 
+# When bumping, make sure *all* --without-libfoo-prefix options are in GNUTLS_CONF_OPTS
 GNUTLS_VERSION_MAJOR = 3.7
 GNUTLS_VERSION = $(GNUTLS_VERSION_MAJOR).4
 GNUTLS_SOURCE = gnutls-$(GNUTLS_VERSION).tar.xz
@@ -26,7 +27,15 @@ GNUTLS_CONF_OPTS = \
 	--disable-tests \
 	--enable-local-libopts \
 	--enable-openssl-compatibility \
-	--with-librt-prefix=$(STAGING_DIR) \
+	--without-libcrypto-prefix \
+	--without-libdl-prefix \
+	--without-libev-prefix \
+	--without-libiconv-prefix \
+	--without-libintl-prefix \
+	--without-libpthread-prefix \
+	--without-libseccomp-prefix \
+	--without-librt-prefix \
+	--without-libz-prefix \
 	--without-tpm \
 	$(if $(BR2_PACKAGE_GNUTLS_OPENSSL),--enable,--disable)-openssl-compatibility \
 	$(if $(BR2_PACKAGE_GNUTLS_TOOLS),--enable-tools,--disable-tools) \
@@ -39,9 +48,6 @@ GNUTLS_CONF_ENV = gl_cv_socket_ipv6=yes \
 	gl_cv_func_gettimeofday_clobber=no
 GNUTLS_INSTALL_STAGING = YES
 
-# libpthread autodetection poison the linkpath
-GNUTLS_CONF_OPTS += $(if $(BR2_TOOLCHAIN_HAS_THREADS),--with-libpthread-prefix=$(STAGING_DIR)/usr)
-
 # gnutls needs libregex, but pcre can be used too
 # The check isn't cross-compile friendly
 GNUTLS_CONF_ENV += libopts_cv_with_libregex=yes
@@ -70,7 +76,6 @@ GNUTLS_CONF_OPTS += --without-p11-kit
 endif
 
 ifeq ($(BR2_PACKAGE_LIBUNISTRING),y)
-GNUTLS_CONF_OPTS += --with-libunistring-prefix=$(STAGING_DIR)/usr
 GNUTLS_DEPENDENCIES += libunistring
 else
 GNUTLS_CONF_OPTS += --with-included-unistring
Signature · 6 lines
2.35.1

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

PATCH 2/5 package/gnutls: remove unused libregex dependency

The pcre/libregex dependency was removed in version 3.7.3 with upstream commit 26578b7d02c269ff1d34ff782d84c7667734d03d, which removed the bundled libopts. Remove the pcre dependency and the relevant CONF_OPTS handling.

---
This is for stable since it's already the case for 3.7.3, the version in 2022.02.x

---
 package/gnutls/Config.in |  1 -
 package/gnutls/gnutls.mk | 11 +----------
 2 files changed, 1 insertion(+), 11 deletions(-)
package/gnutls/Config.in +0 -1
index d57bb8d135..28982b15a1 100644
@@ -7,7 +7,6 @@ config BR2_PACKAGE_GNUTLS
 	depends on BR2_USE_WCHAR
 	select BR2_PACKAGE_LIBTASN1
 	select BR2_PACKAGE_NETTLE
-	select BR2_PACKAGE_PCRE
 	help
 	  GnuTLS is a secure communications library implementing the SSL
 	  and TLS protocols and technologies around them.
package/gnutls/gnutls.mk +1 -10
index b5503b1fc9..79e7d529b1 100644
@@ -17,7 +17,7 @@ GNUTLS_LICENSE += , GPL-3.0+ (gnutls-openssl library)
 GNUTLS_LICENSE_FILES += doc/COPYING
 endif
 
-GNUTLS_DEPENDENCIES = host-pkgconf libtasn1 nettle pcre
+GNUTLS_DEPENDENCIES = host-pkgconf libtasn1 nettle
 GNUTLS_CPE_ID_VENDOR = gnu
 GNUTLS_CONF_OPTS = \
 	--disable-doc \
@@ -25,7 +25,6 @@ GNUTLS_CONF_OPTS = \
 	--disable-libdane \
 	--disable-rpath \
 	--disable-tests \
-	--enable-local-libopts \
 	--enable-openssl-compatibility \
 	--without-libcrypto-prefix \
 	--without-libdl-prefix \
@@ -48,14 +47,6 @@ GNUTLS_CONF_ENV = gl_cv_socket_ipv6=yes \
 	gl_cv_func_gettimeofday_clobber=no
 GNUTLS_INSTALL_STAGING = YES
 
-# gnutls needs libregex, but pcre can be used too
-# The check isn't cross-compile friendly
-GNUTLS_CONF_ENV += libopts_cv_with_libregex=yes
-GNUTLS_CONF_OPTS += \
-	--with-regex-header=pcreposix.h \
-	--with-libregex-cflags="`$(PKG_CONFIG_HOST_BINARY) libpcreposix --cflags`" \
-	--with-libregex-libs="`$(PKG_CONFIG_HOST_BINARY) libpcreposix --libs`"
-
 ifeq ($(BR2_PACKAGE_CRYPTODEV_LINUX),y)
 GNUTLS_CONF_OPTS += --enable-cryptodev
 GNUTLS_DEPENDENCIES += cryptodev-linux
Signature · 6 lines
2.35.1

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

Re: [Buildroot] [PATCH 2/5] package/gnutls: remove unused libregex dependency

Arnout, All,

On 2022-05-12 18:01 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly:

Quoted 6 lines

The pcre/libregex dependency was removed in version 3.7.3 with upstream commit 26578b7d02c269ff1d34ff782d84c7667734d03d, which removed the bundled libopts. Remove the pcre dependency and the relevant CONF_OPTS handling.

Applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 63 lines

---
This is for stable since it's already the case for 3.7.3, the version in 2022.02.x

---
 package/gnutls/Config.in |  1 -
 package/gnutls/gnutls.mk | 11 +----------
 2 files changed, 1 insertion(+), 11 deletions(-)
package/gnutls/Config.in +0 -1
index d57bb8d135..28982b15a1 100644
@@ -7,7 +7,6 @@ config BR2_PACKAGE_GNUTLS
 	depends on BR2_USE_WCHAR
 	select BR2_PACKAGE_LIBTASN1
 	select BR2_PACKAGE_NETTLE
-	select BR2_PACKAGE_PCRE
 	help
 	  GnuTLS is a secure communications library implementing the SSL
 	  and TLS protocols and technologies around them.
package/gnutls/gnutls.mk +1 -10
index b5503b1fc9..79e7d529b1 100644
@@ -17,7 +17,7 @@ GNUTLS_LICENSE += , GPL-3.0+ (gnutls-openssl library)
 GNUTLS_LICENSE_FILES += doc/COPYING
 endif
 
-GNUTLS_DEPENDENCIES = host-pkgconf libtasn1 nettle pcre
+GNUTLS_DEPENDENCIES = host-pkgconf libtasn1 nettle
 GNUTLS_CPE_ID_VENDOR = gnu
 GNUTLS_CONF_OPTS = \
 	--disable-doc \
@@ -25,7 +25,6 @@ GNUTLS_CONF_OPTS = \
 	--disable-libdane \
 	--disable-rpath \
 	--disable-tests \
-	--enable-local-libopts \
 	--enable-openssl-compatibility \
 	--without-libcrypto-prefix \
 	--without-libdl-prefix \
@@ -48,14 +47,6 @@ GNUTLS_CONF_ENV = gl_cv_socket_ipv6=yes \
 	gl_cv_func_gettimeofday_clobber=no
 GNUTLS_INSTALL_STAGING = YES
 
-# gnutls needs libregex, but pcre can be used too
-# The check isn't cross-compile friendly
-GNUTLS_CONF_ENV += libopts_cv_with_libregex=yes
-GNUTLS_CONF_OPTS += \
-	--with-regex-header=pcreposix.h \
-	--with-libregex-cflags="`$(PKG_CONFIG_HOST_BINARY) libpcreposix --cflags`" \
-	--with-libregex-libs="`$(PKG_CONFIG_HOST_BINARY) libpcreposix --libs`"
-
 ifeq ($(BR2_PACKAGE_CRYPTODEV_LINUX),y)
 GNUTLS_CONF_OPTS += --enable-cryptodev
 GNUTLS_DEPENDENCIES += cryptodev-linux
Signature · 6 lines
2.35.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

PATCH 3/5 package/gnutls: remove redundant --enable-openssl-compatibility

In reply to Arnout Vandecappelle (Essensium/Mind)

The option is set a few lines below depending on
BR2_PACKAGE_GNUTLS_OPENSSL.

---
 package/gnutls/gnutls.mk | 1 -
 1 file changed, 1 deletion(-)
package/gnutls/gnutls.mk +0 -1
index 79e7d529b1..1d997781b0 100644
@@ -25,7 +25,6 @@ GNUTLS_CONF_OPTS = \
 	--disable-libdane \
 	--disable-rpath \
 	--disable-tests \
-	--enable-openssl-compatibility \
 	--without-libcrypto-prefix \
 	--without-libdl-prefix \
 	--without-libev-prefix \
Signature · 6 lines
2.35.1

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

Re: [Buildroot] [PATCH 3/5] package/gnutls: remove redundant --enable-openssl-compatibility

Arnout, All,

On 2022-05-12 18:01 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly:

Quoted 2 lines

The option is set a few lines below depending on
BR2_PACKAGE_GNUTLS_OPENSSL.

I've moved all the openssl compatibility stuff under a single conditional block.

Quoted 1 line

Applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 23 lines
---
 package/gnutls/gnutls.mk | 1 -
 1 file changed, 1 deletion(-)
package/gnutls/gnutls.mk +0 -1
index 79e7d529b1..1d997781b0 100644
@@ -25,7 +25,6 @@ GNUTLS_CONF_OPTS = \
 	--disable-libdane \
 	--disable-rpath \
 	--disable-tests \
-	--enable-openssl-compatibility \
 	--without-libcrypto-prefix \
 	--without-libdl-prefix \
 	--without-libev-prefix \
Signature · 6 lines
2.35.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

PATCH 4/5 package/gnutls: add optional dependency on brotli, zlib, zstd

In reply to Arnout Vandecappelle (Essensium/Mind)

Version 3.7.4 added compression options with brotli, zlib and zstd. These are automatically discovered, which makes their inclusion depend on the build order. Therefore, explicitly enable/disable them.

Note that the configure help text says "--without-brotli" and "--without-zstd", but the options are actually --without-libbrotli and --without-libzstd. --without-zlib is correct in the help text.

---
NOT for stable since 3.7.3 didn't have these yet.

---
 package/gnutls/gnutls.mk | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
package/gnutls/gnutls.mk +21 -0
index 1d997781b0..0210d18597 100644
@@ -46,6 +46,13 @@ GNUTLS_CONF_ENV = gl_cv_socket_ipv6=yes \
 	gl_cv_func_gettimeofday_clobber=no
 GNUTLS_INSTALL_STAGING = YES
 
+ifeq ($(BR2_PACKAGE_BROTLI),y)
+GNUTLS_CONF_OPTS += --with-libbrotli
+GNUTLS_DEPENDENCIES += brotli
+else
+GNUTLS_CONF_OPTS += --without-libbrotli
+endif
+
 ifeq ($(BR2_PACKAGE_CRYPTODEV_LINUX),y)
 GNUTLS_CONF_OPTS += --enable-cryptodev
 GNUTLS_DEPENDENCIES += cryptodev-linux
@@ -71,6 +78,20 @@ else
 GNUTLS_CONF_OPTS += --with-included-unistring
 endif
 
+ifeq ($(BR2_PACKAGE_ZLIB),y)
+GNUTLS_CONF_OPTS += --with-zlib
+GNUTLS_DEPENDENCIES += zlib
+else
+GNUTLS_CONF_OPTS += --without-zlib
+endif
+
+ifeq ($(BR2_PACKAGE_ZSTD),y)
+GNUTLS_CONF_OPTS += --with-libzstd
+GNUTLS_DEPENDENCIES += zstd
+else
+GNUTLS_CONF_OPTS += --without-libzstd
+endif
+
 # Provide a default CA cert location
 ifeq ($(BR2_PACKAGE_P11_KIT),y)
 GNUTLS_CONF_OPTS += --with-default-trust-store-pkcs11=pkcs11:model=p11-kit-trust
Signature · 6 lines
2.35.1

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

Re: [Buildroot] [PATCH 4/5] package/gnutls: add optional dependency on brotli, zlib, zstd

Arnout, All,

On 2022-05-12 18:01 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly:

Quoted 9 lines

Version 3.7.4 added compression options with brotli, zlib and zstd. These are automatically discovered, which makes their inclusion depend on the build order. Therefore, explicitly enable/disable them.

Note that the configure help text says "--without-brotli" and "--without-zstd", but the options are actually --without-libbrotli and --without-libzstd. --without-zlib is correct in the help text.

Applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 52 lines

---
NOT for stable since 3.7.3 didn't have these yet.

---
 package/gnutls/gnutls.mk | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
package/gnutls/gnutls.mk +21 -0
index 1d997781b0..0210d18597 100644
@@ -46,6 +46,13 @@ GNUTLS_CONF_ENV = gl_cv_socket_ipv6=yes \
 	gl_cv_func_gettimeofday_clobber=no
 GNUTLS_INSTALL_STAGING = YES
 
+ifeq ($(BR2_PACKAGE_BROTLI),y)
+GNUTLS_CONF_OPTS += --with-libbrotli
+GNUTLS_DEPENDENCIES += brotli
+else
+GNUTLS_CONF_OPTS += --without-libbrotli
+endif
+
 ifeq ($(BR2_PACKAGE_CRYPTODEV_LINUX),y)
 GNUTLS_CONF_OPTS += --enable-cryptodev
 GNUTLS_DEPENDENCIES += cryptodev-linux
@@ -71,6 +78,20 @@ else
 GNUTLS_CONF_OPTS += --with-included-unistring
 endif
 
+ifeq ($(BR2_PACKAGE_ZLIB),y)
+GNUTLS_CONF_OPTS += --with-zlib
+GNUTLS_DEPENDENCIES += zlib
+else
+GNUTLS_CONF_OPTS += --without-zlib
+endif
+
+ifeq ($(BR2_PACKAGE_ZSTD),y)
+GNUTLS_CONF_OPTS += --with-libzstd
+GNUTLS_DEPENDENCIES += zstd
+else
+GNUTLS_CONF_OPTS += --without-libzstd
+endif
+
 # Provide a default CA cert location
 ifeq ($(BR2_PACKAGE_P11_KIT),y)
 GNUTLS_CONF_OPTS += --with-default-trust-store-pkcs11=pkcs11:model=p11-kit-trust
Signature · 6 lines
2.35.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#7 lore raw

PATCH 5/5 package/gnutls: libunistring is not optional

In reply to Arnout Vandecappelle (Essensium/Mind)

Since the very beginning, libunistring was a mandatory dependency of gnutls. However, it would use its internal copy if libunistring was not selected. We never want that, so make libunistring an actual mandatory dependency.

---
 package/gnutls/Config.in | 5 ++---
 package/gnutls/gnutls.mk | 9 ++-------
 2 files changed, 4 insertions(+), 10 deletions(-)
package/gnutls/Config.in +2 -3
index 28982b15a1..b3f9f5420b 100644
@@ -2,10 +2,9 @@ config BR2_PACKAGE_GNUTLS
 	bool "gnutls"
 	# https://gitlab.com/gnutls/gnutls/issues/203
 	depends on !BR2_STATIC_LIBS
-	# gnulib requires a library that implements wctomb().
-	# This is noticed only when linking with libgnutls.so.
-	depends on BR2_USE_WCHAR
+	depends on BR2_USE_WCHAR # libunistring
 	select BR2_PACKAGE_LIBTASN1
+	select BR2_PACKAGE_LIBUNISTRING
 	select BR2_PACKAGE_NETTLE
 	help
 	  GnuTLS is a secure communications library implementing the SSL
package/gnutls/gnutls.mk +2 -7
index 0210d18597..89ab9b9476 100644
@@ -17,7 +17,7 @@ GNUTLS_LICENSE += , GPL-3.0+ (gnutls-openssl library)
 GNUTLS_LICENSE_FILES += doc/COPYING
 endif
 
-GNUTLS_DEPENDENCIES = host-pkgconf libtasn1 nettle
+GNUTLS_DEPENDENCIES = host-pkgconf libtasn1 libunistring nettle
 GNUTLS_CPE_ID_VENDOR = gnu
 GNUTLS_CONF_OPTS = \
 	--disable-doc \
@@ -25,6 +25,7 @@ GNUTLS_CONF_OPTS = \
 	--disable-libdane \
 	--disable-rpath \
 	--disable-tests \
+	--without-included-unistring \
 	--without-libcrypto-prefix \
 	--without-libdl-prefix \
 	--without-libev-prefix \
@@ -72,12 +73,6 @@ else
 GNUTLS_CONF_OPTS += --without-p11-kit
 endif
 
-ifeq ($(BR2_PACKAGE_LIBUNISTRING),y)
-GNUTLS_DEPENDENCIES += libunistring
-else
-GNUTLS_CONF_OPTS += --with-included-unistring
-endif
-
 ifeq ($(BR2_PACKAGE_ZLIB),y)
 GNUTLS_CONF_OPTS += --with-zlib
 GNUTLS_DEPENDENCIES += zlib
Signature · 6 lines
2.35.1

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

Re: [Buildroot] [PATCH 5/5] package/gnutls: libunistring is not optional

Arnout, All,

On 2022-05-12 18:01 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly:

Quoted 16 lines

Since the very beginning, libunistring was a mandatory dependency of gnutls. However, it would use its internal copy if libunistring was not selected. We never want that, so make libunistring an actual mandatory dependency.

---
 package/gnutls/Config.in | 5 ++---
 package/gnutls/gnutls.mk | 9 ++-------
 2 files changed, 4 insertions(+), 10 deletions(-)
package/gnutls/Config.in +0 -0
index 28982b15a1..b3f9f5420b 100644

package/gnutls/Config.in config BR2_PACKAGE_GNUTLS · line 5

Quoted 7 lines
package/gnutls/Config.in +1 -3
@@ -2,10 +2,9 @@ config BR2_PACKAGE_GNUTLS
 	bool "gnutls"
 	# https://gitlab.com/gnutls/gnutls/issues/203
 	depends on !BR2_STATIC_LIBS
-	# gnulib requires a library that implements wctomb().
-	# This is noticed only when linking with libgnutls.so.
-	depends on BR2_USE_WCHAR
+	depends on BR2_USE_WCHAR # libunistring

In fact, the wchar dependency is for gnutls itself; the source code is littered with wchar_t everywhere, so I jsut dropped the comment.

Applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 46 lines
package/gnutls/Config.in +1 -0
 	select BR2_PACKAGE_LIBTASN1
+	select BR2_PACKAGE_LIBUNISTRING
 	select BR2_PACKAGE_NETTLE
 	help
 	  GnuTLS is a secure communications library implementing the SSL
package/gnutls/gnutls.mk +2 -7
index 0210d18597..89ab9b9476 100644
@@ -17,7 +17,7 @@ GNUTLS_LICENSE += , GPL-3.0+ (gnutls-openssl library)
 GNUTLS_LICENSE_FILES += doc/COPYING
 endif
 
-GNUTLS_DEPENDENCIES = host-pkgconf libtasn1 nettle
+GNUTLS_DEPENDENCIES = host-pkgconf libtasn1 libunistring nettle
 GNUTLS_CPE_ID_VENDOR = gnu
 GNUTLS_CONF_OPTS = \
 	--disable-doc \
@@ -25,6 +25,7 @@ GNUTLS_CONF_OPTS = \
 	--disable-libdane \
 	--disable-rpath \
 	--disable-tests \
+	--without-included-unistring \
 	--without-libcrypto-prefix \
 	--without-libdl-prefix \
 	--without-libev-prefix \
@@ -72,12 +73,6 @@ else
 GNUTLS_CONF_OPTS += --without-p11-kit
 endif
 
-ifeq ($(BR2_PACKAGE_LIBUNISTRING),y)
-GNUTLS_DEPENDENCIES += libunistring
-else
-GNUTLS_CONF_OPTS += --with-included-unistring
-endif
-
 ifeq ($(BR2_PACKAGE_ZLIB),y)
 GNUTLS_CONF_OPTS += --with-zlib
 GNUTLS_DEPENDENCIES += zlib
Signature · 6 lines
2.35.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#9 lore raw
In reply to Arnout Vandecappelle (Essensium/Mind)

Arnout, All,

On 2022-05-12 18:01 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly:

Quoted 25 lines

gnutls's configure script has a weird approach where it first searches for dependent libraries in the path specified by --prefix, before searching in the default search path. Since we set --prefix to /usr, and it doesn't take into account DESTDIR (which is anyway not set at configure time), that means it will first search /usr/lib before searching $(STAGING_DIR)/usr/lib.

Ideally, this would be fixed in the configure script itself. However, the m4 file that does this is pretty complex, it's not immediately clear where to add $DESTDIR. In addition it comes from gnulib which is a somewhat annoying upstream.

Therefore, instead, bypass the prefix lookup with --without-libfoo-prefix. Note that we could set --with-libfoo-prefix=$(STAGING_DIR)/usr (the latter is already done for librt and libpthread), but that's pretty pointless - --without-libfoo-prefix in fact reverts to what should have been done in the first place, i.e. use the toolchain search path.

Add --without-libfoo-prefix for all options defined in configure (found with ./configure --help | grep without-.*-prefix). Most of these are only used in tests (e.g. libcrypto) or even not at all (e.g. libiconv), but it's fairly hard to discover this and to be sure that they are indeed not needed, so better pass all of them.

Quoted 7 lines

Remove the now-redundant arguments for librt and libpthread.

Add a comment to remind people to revisit these when bumping the version.

Applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 61 lines

---
This is for stable, but need to check if the same prefix options exist in 3.7.3.

---
 package/gnutls/gnutls.mk | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
package/gnutls/gnutls.mk +10 -5
index 0e461cd44c..b5503b1fc9 100644
@@ -4,6 +4,7 @@
 #
 ################################################################################
 
+# When bumping, make sure *all* --without-libfoo-prefix options are in GNUTLS_CONF_OPTS
 GNUTLS_VERSION_MAJOR = 3.7
 GNUTLS_VERSION = $(GNUTLS_VERSION_MAJOR).4
 GNUTLS_SOURCE = gnutls-$(GNUTLS_VERSION).tar.xz
@@ -26,7 +27,15 @@ GNUTLS_CONF_OPTS = \
 	--disable-tests \
 	--enable-local-libopts \
 	--enable-openssl-compatibility \
-	--with-librt-prefix=$(STAGING_DIR) \
+	--without-libcrypto-prefix \
+	--without-libdl-prefix \
+	--without-libev-prefix \
+	--without-libiconv-prefix \
+	--without-libintl-prefix \
+	--without-libpthread-prefix \
+	--without-libseccomp-prefix \
+	--without-librt-prefix \
+	--without-libz-prefix \
 	--without-tpm \
 	$(if $(BR2_PACKAGE_GNUTLS_OPENSSL),--enable,--disable)-openssl-compatibility \
 	$(if $(BR2_PACKAGE_GNUTLS_TOOLS),--enable-tools,--disable-tools) \
@@ -39,9 +48,6 @@ GNUTLS_CONF_ENV = gl_cv_socket_ipv6=yes \
 	gl_cv_func_gettimeofday_clobber=no
 GNUTLS_INSTALL_STAGING = YES
 
-# libpthread autodetection poison the linkpath
-GNUTLS_CONF_OPTS += $(if $(BR2_TOOLCHAIN_HAS_THREADS),--with-libpthread-prefix=$(STAGING_DIR)/usr)
-
 # gnutls needs libregex, but pcre can be used too
 # The check isn't cross-compile friendly
 GNUTLS_CONF_ENV += libopts_cv_with_libregex=yes
@@ -70,7 +76,6 @@ GNUTLS_CONF_OPTS += --without-p11-kit
 endif
 
 ifeq ($(BR2_PACKAGE_LIBUNISTRING),y)
-GNUTLS_CONF_OPTS += --with-libunistring-prefix=$(STAGING_DIR)/usr
 GNUTLS_DEPENDENCIES += libunistring
 else
 GNUTLS_CONF_OPTS += --with-included-unistring
Signature · 6 lines
2.35.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#10 lore raw
In reply to Arnout Vandecappelle (Essensium/Mind)
Quoted 29 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle (Essensium/Mind) <[email protected]> writes:

gnutls's configure script has a weird approach where it first searches for dependent libraries in the path specified by --prefix, before searching in the default search path. Since we set --prefix to /usr, and it doesn't take into account DESTDIR (which is anyway not set at configure time), that means it will first search /usr/lib before searching $(STAGING_DIR)/usr/lib.

Ideally, this would be fixed in the configure script itself. However, the m4 file that does this is pretty complex, it's not immediately clear where to add $DESTDIR. In addition it comes from gnulib which is a somewhat annoying upstream.

Therefore, instead, bypass the prefix lookup with --without-libfoo-prefix. Note that we could set --with-libfoo-prefix=$(STAGING_DIR)/usr (the latter is already done for librt and libpthread), but that's pretty pointless - --without-libfoo-prefix in fact reverts to what should have been done in the first place, i.e. use the toolchain search path.

Add --without-libfoo-prefix for all options defined in configure (found with ./configure --help | grep without-.*-prefix). Most of these are only used in tests (e.g. libcrypto) or even not at all (e.g. libiconv), but it's fairly hard to discover this and to be sure that they are indeed not needed, so better pass all of them.

Remove the now-redundant arguments for librt and libpthread.

Quoted 8 lines

Add a comment to remind people to revisit these when bumping the version.

---
This is for stable, but need to check if the same prefix options exist in 3.7.3.

I instead bumped 2022.02.x to 3.7.4 as it contains fixes and applied the entire series to 2022.02.x, thanks.

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