All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] mtools: do not link to libbsd
@ 2017-11-28 10:48 Carlos Santos
  2017-11-28 12:03 ` Baruch Siach
  0 siblings, 1 reply; 4+ messages in thread
From: Carlos Santos @ 2017-11-28 10:48 UTC (permalink / raw)
  To: buildroot

mtools is unneccessarily linked to libbsd if this library is found by
the configuration script. The same may happen to host-mtools if some
libbsd-devel package is installed on the host machine. Prevent this by
forcing configure to ignore the existence o libbsd.

I stumbled on this when I built host-mtools and removed libbsd-devel to
upgrade to Fedora 27, due to Bug 1504831*. The previously built
host/bin/mtools started to fail due to the missing libbsd.x.y.so

* https://bugzilla.redhat.com/show_bug.cgi?id=1504831

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 package/mtools/mtools.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/mtools/mtools.mk b/package/mtools/mtools.mk
index 5db548fad9..1a6218831e 100644
--- a/package/mtools/mtools.mk
+++ b/package/mtools/mtools.mk
@@ -13,9 +13,13 @@ MTOOLS_CONF_OPTS = --without-x
 # info documentation not needed
 MTOOLS_CONF_ENV = \
 	ac_cv_func_setpgrp_void=yes \
+	ac_cv_lib_bsd_gethostbyname=no \
+	ac_cv_lib_bsd_main=no \
 	ac_cv_path_INSTALL_INFO=
 
 HOST_MTOOLS_CONF_ENV = \
+	ac_cv_lib_bsd_gethostbyname=no \
+	ac_cv_lib_bsd_main=no \
 	ac_cv_path_INSTALL_INFO=
 
 # link with iconv if enabled
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] mtools: do not link to libbsd
  2017-11-28 10:48 [Buildroot] [PATCH] mtools: do not link to libbsd Carlos Santos
@ 2017-11-28 12:03 ` Baruch Siach
  2017-11-28 12:36   ` Carlos Santos
  0 siblings, 1 reply; 4+ messages in thread
From: Baruch Siach @ 2017-11-28 12:03 UTC (permalink / raw)
  To: buildroot

Hi Carlos,

On Tue, Nov 28, 2017 at 08:48:17AM -0200, Carlos Santos wrote:
> mtools is unneccessarily linked to libbsd if this library is found by
> the configuration script. The same may happen to host-mtools if some
> libbsd-devel package is installed on the host machine. Prevent this by
> forcing configure to ignore the existence o libbsd.
> 
> I stumbled on this when I built host-mtools and removed libbsd-devel to
> upgrade to Fedora 27, due to Bug 1504831*. The previously built
> host/bin/mtools started to fail due to the missing libbsd.x.y.so
> 
> * https://bugzilla.redhat.com/show_bug.cgi?id=1504831

This is a valid reason to remove the host-mtools dependency on libbsd ...

> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
>  package/mtools/mtools.mk | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/package/mtools/mtools.mk b/package/mtools/mtools.mk
> index 5db548fad9..1a6218831e 100644
> --- a/package/mtools/mtools.mk
> +++ b/package/mtools/mtools.mk
> @@ -13,9 +13,13 @@ MTOOLS_CONF_OPTS = --without-x
>  # info documentation not needed
>  MTOOLS_CONF_ENV = \
>  	ac_cv_func_setpgrp_void=yes \
> +	ac_cv_lib_bsd_gethostbyname=no \
> +	ac_cv_lib_bsd_main=no \

... but why no add an optional dependency on libbds for the target mtools 
package? In case we build target libbsd anyway, having mtools use libbsd would 
presumably reduce the binary size of mtools somewhat, isn't it?

>  	ac_cv_path_INSTALL_INFO=
>  
>  HOST_MTOOLS_CONF_ENV = \
> +	ac_cv_lib_bsd_gethostbyname=no \
> +	ac_cv_lib_bsd_main=no \
>  	ac_cv_path_INSTALL_INFO=
>  
>  # link with iconv if enabled

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] mtools: do not link to libbsd
  2017-11-28 12:03 ` Baruch Siach
@ 2017-11-28 12:36   ` Carlos Santos
  2017-11-28 12:52     ` Baruch Siach
  0 siblings, 1 reply; 4+ messages in thread
From: Carlos Santos @ 2017-11-28 12:36 UTC (permalink / raw)
  To: buildroot

> From: "Baruch Siach" <baruch@tkos.co.il>
> To: "Carlos Santos" <casantos@datacom.ind.br>
> Cc: buildroot at buildroot.org
> Sent: Tuesday, November 28, 2017 10:03:27 AM
> Subject: Re: [Buildroot] [PATCH] mtools: do not link to libbsd

> Hi Carlos,
> 
[...]
>> diff --git a/package/mtools/mtools.mk b/package/mtools/mtools.mk
>> index 5db548fad9..1a6218831e 100644
>> --- a/package/mtools/mtools.mk
>> +++ b/package/mtools/mtools.mk
>> @@ -13,9 +13,13 @@ MTOOLS_CONF_OPTS = --without-x
>>  # info documentation not needed
>>  MTOOLS_CONF_ENV = \
>>  	ac_cv_func_setpgrp_void=yes \
>> +	ac_cv_lib_bsd_gethostbyname=no \
>> +	ac_cv_lib_bsd_main=no \
> 
> ... but why no add an optional dependency on libbds for the target mtools
> package? In case we build target libbsd anyway, having mtools use libbsd would
> presumably reduce the binary size of mtools somewhat, isn't it?

From the configure script:

    # The functions gethostbyname, getservbyname, and inet_addr are
    # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.

On Buildroot gethostbyname is provided by glibc/uClibc/musl.

-- 
Carlos Santos (Casantos) - DATACOM, P&D
?The greatest triumph that modern PR can offer is the transcendent 
success of having your words and actions judged by your reputation, 
rather than the other way about.? ? Christopher Hitchens

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] mtools: do not link to libbsd
  2017-11-28 12:36   ` Carlos Santos
@ 2017-11-28 12:52     ` Baruch Siach
  0 siblings, 0 replies; 4+ messages in thread
From: Baruch Siach @ 2017-11-28 12:52 UTC (permalink / raw)
  To: buildroot

Hi Carlos,

On Tue, Nov 28, 2017 at 10:36:02AM -0200, Carlos Santos wrote:
> > From: "Baruch Siach" <baruch@tkos.co.il>
> > To: "Carlos Santos" <casantos@datacom.ind.br>
> > Cc: buildroot at buildroot.org
> > Sent: Tuesday, November 28, 2017 10:03:27 AM
> > Subject: Re: [Buildroot] [PATCH] mtools: do not link to libbsd
> 
> [...]
> >> diff --git a/package/mtools/mtools.mk b/package/mtools/mtools.mk
> >> index 5db548fad9..1a6218831e 100644
> >> --- a/package/mtools/mtools.mk
> >> +++ b/package/mtools/mtools.mk
> >> @@ -13,9 +13,13 @@ MTOOLS_CONF_OPTS = --without-x
> >>  # info documentation not needed
> >>  MTOOLS_CONF_ENV = \
> >>  	ac_cv_func_setpgrp_void=yes \
> >> +	ac_cv_lib_bsd_gethostbyname=no \
> >> +	ac_cv_lib_bsd_main=no \
> > 
> > ... but why no add an optional dependency on libbds for the target mtools
> > package? In case we build target libbsd anyway, having mtools use libbsd would
> > presumably reduce the binary size of mtools somewhat, isn't it?
> 
> From the configure script:
> 
>     # The functions gethostbyname, getservbyname, and inet_addr are
>     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
> 
> On Buildroot gethostbyname is provided by glibc/uClibc/musl.

So if I understand correctly, mtools unnecessarily adds libbsd in a DT_NEEDED 
filed of its dynamic section, but it does not actually use anything from 
libbsd under Linux. Is that correct?

If so, please add this explanation in the commit log.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-28 12:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-28 10:48 [Buildroot] [PATCH] mtools: do not link to libbsd Carlos Santos
2017-11-28 12:03 ` Baruch Siach
2017-11-28 12:36   ` Carlos Santos
2017-11-28 12:52     ` Baruch Siach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.