Message ID | 20220512160116.2011627-1-arnout@mind.be |
---|---|
State | Accepted |
Headers | show |
Series | [1/5] package/gnutls: disable library search in /usr/lib | expand |
Arnout, All, On 2022-05-12 18:01 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly: > 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. > > Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> > Cc: Peter Korsgaard <peter@korsgaard.com> Applied to master, thanks. Regards, Yann E. MORIN. > --- > 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(-) > > diff --git a/package/gnutls/gnutls.mk b/package/gnutls/gnutls.mk > index 0e461cd44c..b5503b1fc9 100644 > --- a/package/gnutls/gnutls.mk > +++ b/package/gnutls/gnutls.mk > @@ -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 > -- > 2.35.1 > > _______________________________________________ > buildroot mailing list > buildroot@buildroot.org > https://lists.buildroot.org/mailman/listinfo/buildroot
>>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> 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. > Add a comment to remind people to revisit these when bumping the > version. > Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> > Cc: Peter Korsgaard <peter@korsgaard.com> > --- > 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.
diff --git a/package/gnutls/gnutls.mk b/package/gnutls/gnutls.mk index 0e461cd44c..b5503b1fc9 100644 --- a/package/gnutls/gnutls.mk +++ b/package/gnutls/gnutls.mk @@ -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
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. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Cc: Peter Korsgaard <peter@korsgaard.com> --- 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(-)