Subject: bin/30379: file(1) database cannot be shared
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: Matthias Scheler <tron@colwyn.zhadum.de>
List: netbsd-bugs
Date: 05/30/2005 18:45:00
>Number:         30379
>Category:       bin
>Synopsis:       file(1) database cannot be shared
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 30 18:45:00 +0000 2005
>Originator:     tron@colwyn.zhadum.de
>Release:        NetBSD 3.0_BETA
>Organization:
Matthias Scheler                                  http://scheler.de/~matthias/
>Environment:
System: NetBSD newyn.zhadum.de 3.0_BETA NetBSD 3.0_BETA (GENERIC) #0: Sun May 29 03:11:35 BST 2005 tron@colwyn.zhadum.de:/export/scratch/tron/build.25678a/obj/sys/arch/macppc/compile/GENERIC macppc
Architecture: powerpc
Machine: macppc
>Description:
When trying to build "emacs" from "pkgsrc" the build died in
"pkgsrc/graphics/tiff":

libtool: install: warning: relinking `libtiffxx.la'
 (cd /src/NetBSD-current/pkgsrc/graphics/tiff/work/tiff-3.7.2/libtiff; /bin/sh /usr/pkg/bin/libtool --tag=CXX --mode=relink c++ -O2 -L/src/NetBSD-current/pkgsrc/graphics/tiff/work/.buildlink/lib -Wl,-R/usr/pkg/lib -o libtiffxx.la -rpath /usr/pkg/lib -no-undefined -version-number 3:7:2 tif_stream.lo -L../libtiff/.libs ../libtiff/libtiff.la -ljpeg -lz -lm -lc )

*** Warning: linker path does not have real file for library -ljpeg.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libjpeg and none of the candidates passed a file format test
*** using a regex pattern. Last file checked: /src/NetBSD-current/pkgsrc/graphics/tiff/work/.buildlink/lib/libjpeg.so.62.0.0
*** The inter-library dependencies that have been dropped here will be
*** automatically added whenever a program is linked with this library
*** or is declared to -dlopen it.

I turned out that "libtool" got confused because file(1) didn't recognize
binary files correctly:

tron@newyn:~>file /bin/ls /usr/lib/libssl.so.3.0
/bin/ls:                data, for NetBSD 3.0, dynamically linked (uses shared libs), not stripped
/usr/lib/libssl.so.3.0: data, not stripped

Using "make dependall install" in "src/usr.bin/file" on the NetBSD-macppc
system fixed the problem.

tron@newyn:~>file /bin/ls /usr/lib/libssl.so.3.0
/bin/ls:                ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), for NetBSD 3.0, dynamically linked (uses shared libs), not stripped
/usr/lib/libssl.so.3.0: ELF 32-bit MSB shared object, PowerPC or cisco 4500, version 1 (SYSV), not stripped

Installing the "tiff" package worked fine afterwards.

>How-To-Repeat:
1.) Install NetBSD-macppc or NetBSD-sparc64 binary sets which were built on
    a NetBSD-i386 system.
2.) Try to build "pkgsrc/graphics/tiff".

>Fix:
None provided.