Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] support/dependencies: ensure we have 'file' on the host
Date: Sun, 29 Nov 2015 23:04:52 +0100	[thread overview]
Message-ID: <565B7684.9070308@mind.be> (raw)
In-Reply-To: <1448654529-27021-1-git-send-email-yann.morin.1998@free.fr>

On 27-11-15 21:02, Yann E. MORIN wrote:
> When 'file' is missing on the host, libtool fails miserably. Packages
> that use libtool will suddenly FTBFS, with cryptic error messages, like
> missing libraries on the linker invocation.
> 
> We could ensure that autotools based packages now all depend on
> host-file. But It itself is an autotools package, so it's again a
> chicken-n-egg issue. And even non-autotools package may use libtool.
> 
> So, just require that 'file' is present on the host.

 Improved commit message:

support/dependencies: ensure we have 'file' on the host

Recently, the libtool.m4 autoconf macros that are bundled with the libtool
package started using '/usr/bin/file' to determine the type of library that
is generated by the toolchain. Packages that use this macro will fail in a
rather dramatic way when /usr/bin/file is not present on the host: the
package will still build but no shared library is generated, which in turn
may cause build failures in other packages that link with it.

For example, libpng's configure determines that it is not possible to build
a shared library on MIPS64 because the expected output from 'file' is not
present. Therefore, only a static libpng.a is built. Later, bandwithd links
with -lpng but it doesn't use the pkg-config's Private-Libs (because it's
not linking statically) and it doesn't have access to the NEEDED reference
from the shared library. Therefore, it doesn't link with zlib and fails with

pngrutil.c:(.text+0x55c): undefined reference to `inflate'

Since we can expect more packages to behave like this in the future, just
require that '/usr/bin/file' is present on the host unconditionally.



> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
>  support/dependencies/dependencies.sh | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/support/dependencies/dependencies.sh b/support/dependencies/dependencies.sh
> index 3146401..f14fb79 100755
> --- a/support/dependencies/dependencies.sh
> +++ b/support/dependencies/dependencies.sh
> @@ -69,6 +69,12 @@ check_prog_host "which"
>  # Verify that sed is installed
>  check_prog_host "sed"
>  
> +# 'file' must be present, otherwise libtool fails in incomprehensible
> +# ways. For example, bandwidthd would fail to link with -lz, even
> +# though the library is there (and it's not a static/shared issue).
> +# Adding the 'file' program on the system miraculously fixes the issue.
> +check_prog_host "file"

 This is actually not good enough: it really has to be /usr/bin/file (so adding
host-file would in fact not help at all).


> +
>  # Check make
>  MAKE=$(which make 2> /dev/null)
>  if [ -z "$MAKE" ] ; then
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

      parent reply	other threads:[~2015-11-29 22:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27 20:02 [Buildroot] [PATCH] support/dependencies: ensure we have 'file' on the host Yann E. MORIN
2015-11-27 21:19 ` Arnout Vandecappelle
2015-11-27 23:04   ` Yann E. MORIN
2015-11-27 23:34     ` Arnout Vandecappelle
2015-11-28 22:30       ` Yann E. MORIN
2015-11-28 20:30 ` Baruch Siach
2015-11-28 22:11   ` Yann E. MORIN
2015-11-29 22:04 ` Arnout Vandecappelle [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=565B7684.9070308@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox