Skip to contentSkip to conversation

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

PATCH Superseded Yann E. MORIN 2 participants 3 messages Dec 25, 2016 – Dec 26, 2016

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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'

We cant use host-file because it is itself an autotools package and is itself using libtool, so this would be a chicken-n-egg problem. Besides, the libtool script really wants to call /usr/bin/file, so it would not even find our host-file anyway.

So, just require that 'file' is present on the host.

Cc Arnout Vandecappelle <[email protected]>
Cc Baruch Siach <[email protected]>

---
Changs v1 -> v2;
- use better commit log by Arnout (Arnout)
- update manual (Baruch)

---
 docs/manual/prerequisite.txt         | 1 +
 support/dependencies/dependencies.sh | 4 ++++
 2 files changed, 5 insertions(+)
docs/manual/prerequisite.txt +1 -0
index 7edad1f..ce54c9c 100644
@@ -35,6 +35,7 @@ between distributions).
 ** +python+ (version 2.6 or any later)
 ** +unzip+
 ** +rsync+
+** +file+
 
 * Source fetching tools:
 ** +wget+
support/dependencies/dependencies.sh +4 -0
index bfd6596..1ec731d 100755
@@ -69,6 +69,10 @@ check_prog_host "which"
 # Verify that sed is installed
 check_prog_host "sed"
 
+# 'file' must be present, otherwise libtool fails in incomprehensible
+# ways.
+check_prog_host "file"
+
 # Check make
 MAKE=$(which make 2> /dev/null)
 if [ -z "$MAKE" ] ; then
Signature · 1 line
2.7.4
#1 lore raw

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

Quoted 1 line · Yann E. MORIN

Recently, the libtool.m4 autoconf macros that are bundled with the

I'm a little bit confused here... Here, you talk about the libtool.m4 autoconf
macro (which is only used when AUTORECONF = YES)...

Quoted 8 lines

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

... but here you talk about libpng, which isn't autoreconf'ed.

To clarify this, I think the first sentence should be

Recently, the autoconf macros for libtool started using '/usr/bin/file' to determine the type of library that is generated by the toolchain. Packages that use this recent version of the libtool autoconf macros will fail in a rather dramatic way when /usr/bin/file is not present on the host: ...

Quoted 46 lines

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'

We cant use host-file because it is itself an autotools package and is itself using libtool, so this would be a chicken-n-egg problem. Besides, the libtool script really wants to call /usr/bin/file, so it would not even find our host-file anyway.

So, just require that 'file' is present on the host.

Cc Arnout Vandecappelle <[email protected]>
Cc Baruch Siach <[email protected]>

---
Changs v1 -> v2;
- use better commit log by Arnout (Arnout)
- update manual (Baruch)

---
 docs/manual/prerequisite.txt         | 1 +
 support/dependencies/dependencies.sh | 4 ++++
 2 files changed, 5 insertions(+)
docs/manual/prerequisite.txt +1 -0
index 7edad1f..ce54c9c 100644
@@ -35,6 +35,7 @@ between distributions).
 ** +python+ (version 2.6 or any later)
 ** +unzip+
 ** +rsync+
+** +file+
 
 * Source fetching tools:
 ** +wget+
support/dependencies/dependencies.sh +0 -0
index bfd6596..1ec731d 100755

support/dependencies/dependencies.sh check_prog_host "which" · line 74

Quoted 6 lines
support/dependencies/dependencies.sh +3 -0
@@ -69,6 +69,10 @@ check_prog_host "which"
 # Verify that sed is installed
 check_prog_host "sed"
 
+# 'file' must be present, otherwise libtool fails in incomprehensible
+# ways.
+check_prog_host "file"

Maybe we should check explicitly for /usr/bin/file instead.

Regards,
Arnout

Quoted 5 lines
support/dependencies/dependencies.sh +1 -0
+
 # Check make
 MAKE=$(which make 2> /dev/null)
 if [ -z "$MAKE" ] ; then
Signature · 6 lines
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
#2 lore raw

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

Arnout, All,

On 2016-12-26 10:06 +0100, Arnout Vandecappelle spake thusly:

Quoted 13 lines · Yann E. MORIN
Quoted 1 line

Recently, the libtool.m4 autoconf macros that are bundled with the

I'm a little bit confused here... Here, you talk about the libtool.m4 autoconf
macro (which is only used when AUTORECONF = YES)...

Quoted 7 lines

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.

Quoted 3 lines
Quoted 1 line

For example, libpng's configure determines that it is not possible to

... but here you talk about libpng, which isn't autoreconf'ed.

Eh! I copy-pasted your own suggestion for a commit log! ;-)

And we don't need to autoreconf a package for it to use that recent version of libtool, for example if upstream has already upgraded by themselves.

Quoted 56 lines

To clarify this, I think the first sentence should be

Recently, the autoconf macros for libtool started using '/usr/bin/file' to determine the type of library that is generated by the toolchain. Packages that use this recent version of the libtool autoconf macros will fail in a rather dramatic way when /usr/bin/file is not present on the host: ...

Quoted 49 lines

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'

We cant use host-file because it is itself an autotools package and is itself using libtool, so this would be a chicken-n-egg problem. Besides, the libtool script really wants to call /usr/bin/file, so it would not even find our host-file anyway.

So, just require that 'file' is present on the host.

Cc Arnout Vandecappelle <[email protected]>
Cc Baruch Siach <[email protected]>

---
Changs v1 -> v2;
- use better commit log by Arnout (Arnout)
- update manual (Baruch)

---
 docs/manual/prerequisite.txt         | 1 +
 support/dependencies/dependencies.sh | 4 ++++
 2 files changed, 5 insertions(+)
docs/manual/prerequisite.txt +1 -0
index 7edad1f..ce54c9c 100644
@@ -35,6 +35,7 @@ between distributions).
 ** +python+ (version 2.6 or any later)
 ** +unzip+
 ** +rsync+
+** +file+
 
 * Source fetching tools:
 ** +wget+
support/dependencies/dependencies.sh +0 -0
index bfd6596..1ec731d 100755
@@ -69,6 +69,10 @@ check_prog_host "which"
 # Verify that sed is installed
 check_prog_host "sed"
 
Quoted 5 lines

support/dependencies/dependencies.sh check_prog_host "which" · line 74

Quoted 3 lines
support/dependencies/dependencies.sh +3 -0
+# 'file' must be present, otherwise libtool fails in incomprehensible
+# ways.
+check_prog_host "file"

Maybe we should check explicitly for /usr/bin/file instead.

Hmm.. Right.

Regards,
Yann E. MORIN.

Quoted 16 lines

Regards,
Arnout

Quoted 5 lines
support/dependencies/dependencies.sh +1 -0
+
 # Check make
 MAKE=$(which make 2> /dev/null)
 if [ -z "$MAKE" ] ; then
Signature · 6 lines
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
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'