pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkgsrc RPATH/libtool wrapper issue on Linux



Hello,

trying to build my updated version of sysutils/file (5.17), I
encountered build errors on Linux when an older file package (5.11) was
alread installed.

This is similar to the problem I had with building lang/python27 on
Linux (s.
http://mail-index.netbsd.org/pkgsrc-users/2014/02/16/msg019321.html),
but this time I think libtool is the culprit.

During build, the just compiled "file" program is invoked at src/file to
precompile the magic data under magic/. 

Libtool tries to take care that here the new versions of libraries are
used, not those already present at system locations which may not work
with the new binary. To do so, it replaces "src/file" with a wrapper
script.

  on NetBSD5.1: set LD_LIBRARY_PATH

  on Linux:     re-link the binary into src/.libs/lt-file using several 
                "-Wl,--rpath -Wl,<path>" options, with
                /opt/pkgsrc/work/pkgsrc/sysutils/file/default/file/src/.libs
                listed first.

This might even work on Linux, were it not for the pkgsrc generated gcc
options "-Wl,-R/opt/pkgsrc/lib" (from mk/compiler/gcc.mk) placed
_before_ the libtool-generated RPATH options.

When I move the old libmagic.so.1 out of the way, the build will
succeed. Or if no old version of "file" was installed.


Is that a libtool bug? Or pkgsrc? Any ideas?

Matthias

-----------------------------------------------------------------------

Making all in magic
../src/file -C -m magic
/opt/pkgsrc/work/pkgsrc/sysutils/file/default/file/src/.libs/lt-file: symbol 
lookup error: 
/opt/pkgsrc/work/pkgsrc/sysutils/file/default/file/src/.libs/lt-file: undefined 
symbol: magic_version
*** Error code 127


root@pkgsrc1004-32:/opt/pkgsrc/usr/pkgsrc/sysutils/file# ldd 
/opt/pkgsrc/work/pkgsrc/sysutils/file/default/file/src/.libs/lt-file
        linux-gate.so.1 =>  (0xb76fa000)
        libmagic.so.1 => /opt/pkgsrc/lib/libmagic.so.1 (0xb76da000)
        libz.so.1 => /opt/pkgsrc/lib/libz.so.1 (0xb76c5000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb755d000)
        /lib/ld-linux.so.2 (0xb76fb000)

root@pkgsrc1004-32:/opt/pkgsrc/usr/pkgsrc/sysutils/file# objdump -x 
/opt/pkgsrc/work/pkgsrc/sysutils/file/default/file/src/.libs/lt-file | grep PATH
  RPATH                
/opt/pkgsrc/lib:/opt/pkgsrc/work/pkgsrc/sysutils/file/default/file/src/.libs
  RUNPATH              
/opt/pkgsrc/lib:/opt/pkgsrc/work/pkgsrc/sysutils/file/default/file/src/.libs


root@pkgsrc1004-32:/opt/pkgsrc/usr/pkgsrc/sysutils/file# grep relink_command 
/opt/pkgsrc/work/pkgsrc/sysutils/file/default/file/src/file    
relink_command="(cd /opt/pkgsrc/work/pkgsrc/sysutils/file/default/file/src; { 
test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; 
export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset 
COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z 
\"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; 
export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset 
LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z 
\"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; 
export LD_LIBRARY_PATH; }; }; 
PATH=/opt/pkgsrc/work/pkgsrc/sysutils/file/default/.wrapper/bin:/opt/pkgsrc/work/pkgsrc/sysutils/file/default/.buildlink/bin:/opt/pkgsrc/work/pkgsrc/sysutils/file/default/.tools/bin:/opt/pkgsrc/work/pkgsrc/sysutils/file/default/.gcc/bin:/opt/pkgsrc/bin:/opt/pkgsrc/bin:/opt/pkgsrc/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games;
 export PATH; gcc -std=gnu99 -fvisibility=hidden -Wall -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Wmissing-declarations -Wredundant-decls 
-Wnested-externs -Wsign-compare -Wreturn-type -Wswitch -Wshadow -Wcast-qual 
-Wwrite-strings -Wextra -Wunused-parameter -Wformat=2 -O2 
-I/opt/pkgsrc/work/pkgsrc/sysutils/file/default/.buildlink/include 
-Wl,--enable-new-dtags -Wl,-R/opt/pkgsrc/lib -o \$progdir/\$file file.o  
-L/opt/pkgsrc/work/pkgsrc/sysutils/file/default/.buildlink/lib 
./.libs/libmagic.so 
/opt/pkgsrc/work/pkgsrc/sysutils/file/default/.buildlink/lib/libz.so -Wl,-rpath 
-Wl,/opt/pkgsrc/work/pkgsrc/sysutils/file/default/file/src/.libs -Wl,-rpath 
-Wl,/opt/pkgsrc/work/pkgsrc/sysutils/file/default/.buildlink/lib -Wl,-rpath 
-Wl,/opt/pkgsrc/lib -Wl,-rpath 
-Wl,/opt/pkgsrc/work/pkgsrc/sysutils/file/default/.buildlink/lib)"




Home | Main Index | Thread Index | Old Index