[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fix -R handling
From: |
Martin MOKREJŠ |
Subject: |
Re: fix -R handling |
Date: |
Wed, 2 Apr 2003 00:00:44 +0200 (CEST) |
On Tue, 1 Apr 2003, Albert Chin wrote:
> On Mon, Mar 31, 2003 at 09:43:50AM -0600, Robert Boehne x238 wrote:
> > Approved and checked in to CVS.
>
> Is this the correct solution to the problem? I posted the patch as
> soon as I found the solution without determining if it was really the
> correct fix. Did any peer review happen?
Hi Albert,
I've hit this problem on OSF1 and posted several email to libtool-bugs
list in Jan 2003. Onestly said, I don't understand the internals of
libtool so I haven't studied your patch, but spent some time debugging
the source of my problem with Christian Cornelsen. Please follow this link
to see how to repeat:
http://mail.gnu.org/archive/html/bug-libtool/2003-01/msg00013.html
The $xrpath variable is not empty in ltmain.in below and it's contents get
copied to -R$libdir. Possibly, the trajectory is -rpath -> -R -> -L -> -R.
It seems /usr/local/lib is added just blindly by libtool (see
-R/usr/local/lib at the end). Maybe that's the logic which appended -R
originally? In any case, with current libtool cvs I can compile
successfully.
Watch the example below with my previous version of libtool (1.4.3):
/bin/bash ../libtool --mode=compile cc -DHAVE_CONFIG_H -I. -I. -I..
-DG_LOG_DOMAIN=\"GdkPixbuf\" -I.. -I.. -I../gdk-pixbuf -I../gdk-pixbuf
-DGTK_SYYSCONFDIR=\"/software/@sys/usr/etc\" -DGTK_VERSION=\"2.2.0\"
-DGTK_BINARY_VERSION=\"2.2.0\" -DG_DISABLE_DEPRECATED
-DGDK_PIXBUF_DISABLE_DEPRECATED -DG_DISABLE_CAST_CHECKS -pthread
-I/software/@sys/usr/include/glib-2.0 -I/software/@sys/usr/lib/glib-2.0/include
-I/software/@sys/usr/include/libpng12 -DGDK_PIXBUF_ENABLE_BACKEND
"-DPIXBUF_LIBDIR=\"/software/@sys/usr/lib/gtk-2.0/2.2.0/loaders\""
"-DBUILT_MODULES_DIR=\"./.libs\"" -I/software/@sys/usr/include
-I/usr/local/include -I/usr/local/openssl/include -O2 -arch ev56 -c
gdk-pixbuf-enum-types.c
cc -DHAVE_CONFIG_H -I. -I. -I.. -DG_LOG_DOMAIN=\"GdkPixbuf\" -I.. -I..
-I../gdk-pixbuf -I../gdk-pixbuf -DGTK_SYSCONFDIR=\"/software/@sys/usr/etc\"
-DGTK_VERSION=\"2.2.0\" -DGTK_BINARY_VERSION=\"2.2.0\" -DG_DISABLE_DEPRECATED
-DGDK_PIXBUF_DISABLE_DEPRECATED -DG_DISABLE_CAST_CHECKS -pthread
-I/software/@sys/usr/include/glib-2.0 -I/software/@sys/usr/lib/glib-2.0/include
-I/software/@sys/usr/include/libpng12 -DGDK_PIXBUF_ENABLE_BACKEND
-DPIXBUF_LIBDIR=\"/software/@sys/usr/lib/gtk-2.0/2.2.0/loaders\"
-DBUILT_MODULES_DIR=\"./.libs\" -I/software/@sys/usr/include
-I/usr/local/include -I/usr/local/openssl/include -O2 -arch ev56 -c
gdk-pixbuf-enum-types.c -DPIC -o gdk-pixbuf-enum-types.lo
/bin/bash ../libtool --mode=link cc -O2 -arch ev56 -o libgdk_pixbuf-2.0.la
-rpath /software/@sys/usr/lib -version-info 200:0:200 -export-symbols--regex
"^[^_].*" gdk-pixbuf.lo gdk-pixbuf-animation.lo gdk-pixbuf-data.lo
gdk-pixbuf-io.lo gdk-pixbuf-loader.lo gdk-pixbuf-scale.lo gdk-pixbuf-util.lo
gdk-pixdata.lo gdk-pixbuf-enum-types.lo pixops/libpixops.la
-L/software/@sys/usr/lib -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lintl -liconv
-lm -lm -L/usr/local/lib -L/software/@sys/usr/lib -L/usr/local/openssl/lib
-L/usr/lib -lintl
!!! rpath detected. $rpath was ''
!!!$xrpath set to ' /software/@sys/usr/lib'. Originally was '
/software/@sys/usr/lib'.
$deplibs was: ' pixops/libpixops.la'
$deplibs is: ' pixops/libpixops.la -L/software/@sys/usr/lib'
$deplibs was: ' pixops/libpixops.la -L/software/@sys/usr/lib -lgmodule-2.0
-lgobject-2.0 -lglib-2.0 -lintl -liconv -lm -lm'
$deplibs is: ' pixops/libpixops.la -L/software/@sys/usr/lib -lgmodule-2.0
-lgobject-2.0 -lglib-2.0 -lintl -liconv -lm -lm -L/usr/local/lib'
$deplibs was: ' pixops/libpixops.la -L/software/@sys/usr/lib -lgmodule-2.0
-lgobject-2.0 -lglib-2.0 -lintl -liconv -lm -lm -L/usr/local/lib'
$deplibs is: ' pixops/libpixops.la -L/software/@sys/usr/lib -lgmodule-2.0
-lgobject-2.0 -lglib-2.0 -lintl -liconv -lm -lm -L/usr/local/lib'
$deplibs was: ' pixops/libpixops.la -L/software/@sys/usr/lib -lgmodule-2.0
-lgobject-2.0 -lglib-2.0 -lintl -liconv -lm -lm -L/usr/local/lib'
$deplibs is: ' pixops/libpixops.la -L/software/@sys/usr/lib -lgmodule-2.0
-lgobject-2.0 -lglib-2.0 -lintl -liconv -lm -lm -L/usr/local/lib
-L/usr/local/openssl/lib'
$deplibs was: ' pixops/libpixops.la -L/software/@sys/usr/lib -lgmodule-2.0
-lgobject-2.0 -lglib-2.0 -lintl -liconv -lm -lm -L/usr/local/lib
-L/usr/local/openssl/lib'
$deplibs is: ' pixops/libpixops.la -L/software/@sys/usr/lib -lgmodule-2.0
-lgobject-2.0 -lglib-2.0 -lintl -liconv -lm -lm -L/usr/local/lib
-L/usr/local/openssl/lib -L/usr/lib'
mkdir .libs
$dependency_libs=' -R/usr/local/lib -L/usr/local/lib /usr/local/lib/libiconv.la
-lc'
!!! $pass = 'link'. $xrpath was ''
??? $xrpath is ' /usr/local/lib'
??? $deplib was '-R/usr/local/lib'
??? $deplibs was '/usr/local/lib/libintl.so -L/usr/lib -L/usr/local/openssl/lib
-L/software/@sys/usr/lib -L/usr/local/lib pixops/.libs/libpixops.al '
NO HACK! Comment out deplibs="$deplib $deplibs"
??? $deplibs is '-R/usr/local/lib /usr/local/lib/libintl.so -L/usr/lib
-L/usr/local/openssl/lib -L/software/@sys/usr/lib -L/usr/local/lib
pixops/.libs/libpixops.al '
$dependency_libs=''
$dependency_libs=' /software/@sys/usr/lib/libglib-2.0.la
-L/software/@sys/usr/lib -L/usr/local/lib -L/usr/local/openssl/lib -L/usr/lib
-lm /software/@sys/usr/lib/libintl.la /software/@sys/usr/lib/libintl.la
-R/software/@sys/usr/lib /software/@sys/usr/lib/libiconv.la -lc'
$dependency_libs=' /software/@sys/usr/lib/libglib-2.0.la
-L/software/@sys/usr/lib -L/usr/local/lib -L/usr/local/openssl/lib -L/usr/lib
-lm /software/@sys/usr/lib/libintl.la /software/@sys/usr/lib/libintl.la
-R/software/@sys/usr/lib /software/@sys/usr/lib/libiconv.la -lc'
$dependency_libs=' -L/software/@sys/usr/lib -L/usr/local/lib
-L/usr/local/openssl/lib -L/usr/lib -lm /software/@sys/usr/lib/libintl.la
/software/@sys/usr/lib/libintl.la -R/software/@sys/usr/lib
/software/@sys/usr/lib/libiconv.la -lc'
$dependency_libs=''
$dependency_libs=' -R/usr/local/lib -L/usr/local/lib /usr/local/lib/libiconv.la
-lc'
rm -fr .libs/libgdk_pixbuf-2.0.la .libs/libgdk_pixbuf-2.0.*
.libs/libgdk_pixbuf-2.0.*
$xrpath = ' /usr/local/lib'
(cd . && ln -s gdk-pixbuf.lo gdk-pixbuf.o)
(cd . && ln -s gdk-pixbuf-animation.lo gdk-pixbuf-animation.o)
(cd . && ln -s gdk-pixbuf-data.lo gdk-pixbuf-data.o)
(cd . && ln -s gdk-pixbuf-io.lo gdk-pixbuf-io.o)
(cd . && ln -s gdk-pixbuf-loader.lo gdk-pixbuf-loader.o)
(cd . && ln -s gdk-pixbuf-scale.lo gdk-pixbuf-scale.o)
(cd . && ln -s gdk-pixbuf-util.lo gdk-pixbuf-util.o)
(cd . && ln -s gdk-pixdata.lo gdk-pixdata.o)
(cd . && ln -s gdk-pixbuf-enum-types.lo gdk-pixbuf-enum-types.o)
generating symbol list for `libgdk_pixbuf-2.0.la'
/usr/bin/nm -B gdk-pixbuf.o gdk-pixbuf-animation.o gdk-pixbuf-data.o
gdk-pixbuf-io.o gdk-pixbuf-loader.o gdk-pixbuf-scale.o gdk-pixbuf-util.o
gdk-pixdata.o gdk-pixbuf-enum-types.o pixops/.libs/libpixops.al | sed -n -e
's/^.*[ ]\([BCDEGQRST][BCDEGQRST]*\)[ ][
]*\(\)\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2\3 \3/p' | sed 's/.* //' | sort | uniq >
.libs/libgdk_pixbuf-2.0.exp
egrep -e "^[^_].*" ".libs/libgdk_pixbuf-2.0.exp" >
".libs/libgdk_pixbuf-2.0.expT"
mv -f ".libs/libgdk_pixbuf-2.0.expT" ".libs/libgdk_pixbuf-2.0.exp"
rm -fr .libs/libgdk_pixbuf-2.0.lax
mkdir .libs/libgdk_pixbuf-2.0.lax
rm -fr .libs/libgdk_pixbuf-2.0.lax/libpixops.al
mkdir .libs/libgdk_pixbuf-2.0.lax/libpixops.al
(cd .libs/libgdk_pixbuf-2.0.lax/libpixops.al && ar x
/afs/gsf.de/sources/ev56/gtk+-2.2.0/gdk-pixbuf/pixops/.libs/libpixops.al)
for i in `cat .libs/libgdk_pixbuf-2.0.exp`; do /software/@sys/usr/bin/printf
"-exported_symbol " >> .libs/libgdk_pixbuf-2.0.so.200.200.0.exp; echo "$i" >>
.libs/libgdk_pixbuf-2.0.so.200.200.0.exp; done; echo "-hidden">>
.libs/libgdk_pixbuf-2.0.so.200.200.0.exp
/usr/bin/ld -shared -expect_unresolved \* -input
.libs/libgdk_pixbuf-2.0.so.200.200.0.exp gdk-pixbuf.o gdk-pixbuf-animation.o
gdk-pixbuf-data.o gdk-pixbuf-io.o gdk-pixbuf-loader.o gdk-pixbuf-scale.o
gdk-pixbuf-util.o gdk-pixdata.o gdk-pixbuf-enum-types.o
.libs/libgdk_pixbuf-2.0.lax/libpixops.al/pixops.lo -rpath
/software/@sys/usr/lib:/usr/local/lib pixops/.libs/libpixops.al
-L/usr/local/lib -L/software/@sys/usr/lib -L/usr/local/openssl/lib -L/usr/lib
-R/usr/local/lib -lc /software/@sys/usr/lib/libgmodule-2.0.so
/software/@sys/usr/lib/libgobject-2.0.so /software/@sys/usr/lib/libglib-2.0.so
/usr/local/lib/libiconv.so -lm /usr/local/lib/libintl.so -lc -soname
libgdk_pixbuf-2.0.so.0 `test -n
"200.200.0:0.0:1.0:2.0:3.0:4.0:5.0:6.0:7.0:8.0:9.0:10.0:11.0:12.0:13.0:14.0:15.0:16.0:17.0:18.0:19.0:20.0:21.0:22.0:23.0:24.0:25.0:26.0:27.0:28.0:29.0:30.0:31.0:32.0:33.0:34.0:35.0:36.0:37.0:38.0:39.0:40.0:41.0:42.0:43.0:44.0:45.0:46.0:47.0:48.0:49.0:50.0:51.0:52.0:53.0:54.0:55.0:56.0:57.0:58.0:59.0:60.0:61.0:62.0:63.0:64.0:65.0:66.0:67.0:68.0:69.0:70.0:71.0:72.0:73.0:74.0:75.0:76.0:77.0:78.0:79.0:80.0:81.0:82.0:83.0:84.0:85.0:86.0:87.0:88.0:89.0:90.0:91.0:92.0:93.0:94.0:95.0:96.0:97.0:98.0:99.0:100.0:101.0:102.0:103.0:104.0:105.0:106.0:107.0:108.0:109.0:110.0:111.0:112.0:113.0:114.0:115.0:116.0:117.0:118.0:119.0:120.0:121.0:122.0:123.0:124.0:125.0:126.0:127.0:128.0:129.0:130.0:131.0:132.0:133.0:134.0:135.0:136.0:137.0:138.0:139.0:140.0:141.0:142.0:143.0:144.0:145.0:146.0:147.0:148.0:149.0:150.0:151.0:152.0:153.0:154.0:155.0:156.0:157.0:158.0:159.0:160.0:161.0:162.0:163.0:164.0:165.0:166.0:167.0:168.0:169.0:170.0:171.0:172.0:173.0:174.0:175.0:176.0:177.0:178.0:179.0:180.0:181.0:182.0:183.0:184.0:185.0:186.0:187.0:188.0:189.0:190.0:191.0:192.0:193.0:194.0:195.0:196.0:197.0:198.0:199.0:200.0"
&& echo -set_version
200.200.0:0.0:1.0:2.0:3.0:4.0:5.0:6.0:7.0:8.0:9.0:10.0:11.0:12.0:13.0:14.0:15.0:16.0:17.0:18.0:19.0:20.0:21.0:22.0:23.0:24.0:25.0:26.0:27.0:28.0:29.0:30.0:31.0:32.0:33.0:34.0:35.0:36.0:37.0:38.0:39.0:40.0:41.0:42.0:43.0:44.0:45.0:46.0:47.0:48.0:49.0:50.0:51.0:52.0:53.0:54.0:55.0:56.0:57.0:58.0:59.0:60.0:61.0:62.0:63.0:64.0:65.0:66.0:67.0:68.0:69.0:70.0:71.0:72.0:73.0:74.0:75.0:76.0:77.0:78.0:79.0:80.0:81.0:82.0:83.0:84.0:85.0:86.0:87.0:88.0:89.0:90.0:91.0:92.0:93.0:94.0:95.0:96.0:97.0:98.0:99.0:100.0:101.0:102.0:103.0:104.0:105.0:106.0:107.0:108.0:109.0:110.0:111.0:112.0:113.0:114.0:115.0:116.0:117.0:118.0:119.0:120.0:121.0:122.0:123.0:124.0:125.0:126.0:127.0:128.0:129.0:130.0:131.0:132.0:133.0:134.0:135.0:136.0:137.0:138.0:139.0:140.0:141.0:142.0:143.0:144.0:145.0:146.0:147.0:148.0:149.0:150.0:151.0:152.0:153.0:154.0:155.0:156.0:157.0:158.0:159.0:160.0:161.0:162.0:163.0:164.0:165.0:166.0:167.0:168.0:169.0:170.0:171.0:172.0:173.0:174.0:175.0:176.0:177.0:178.0:179.0:180.0:181.0:182.0:183.0:184.0:185.0:186.0:187.0:188.0:189.0:190.0:191.0:192.0:193.0:194.0:195.0:196.0:197.0:198.0:199.0:200.0`
-update_registry .libs/so_locations -o .libs/libgdk_pixbuf-2.0.so.200.200.0
/usr/bin/ld:
-R/usr/local/lib: Unknown flag
usr/bin/ld: Usage: /usr/bin/ld [options] file [...]
make[3]: *** [libgdk_pixbuf-2.0.la] Error 1
make[3]: Leaving directory `/afs/gsf.de/sources/ev56/gtk+-2.2.0/gdk-pixbuf'
--- libtool.ori 2003-04-01 22:19:13.000000000 +0200
+++ libtool 2003-04-01 23:18:48.000000000 +0200
@@ -1213,11 +1213,13 @@
*" $arg "*) ;;
*) rpath="$rpath $arg" ;;
esac
+ echo "!!!\$xrpath set to '$rpath'. Originally was '$rpath'."
else
case "$xrpath " in
*" $arg "*) ;;
*) xrpath="$xrpath $arg" ;;
esac
+ echo "!!!\$xrpath set to '$xrpath'. Originally was '$xrpath'."
fi
prev=
continue
@@ -1326,6 +1328,7 @@
dir="$absdir"
;;
esac
+ echo "\$deplibs was: '$deplibs'"
case "$deplibs " in
*" -L$dir "*) ;;
*)
@@ -1333,6 +1336,7 @@
lib_search_path="$lib_search_path $dir"
;;
esac
+ echo "\$deplibs is: '$deplibs'"
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
case :$dllsearchpath: in
@@ -1409,16 +1413,19 @@
;;
-rpath)
+ echo "!!! rpath detected. \$rpath was '$rpath'"
prev=rpath
continue
;;
-R)
+ echo "!!! -R detected. \$xrpath was '$xrpath'"
prev=xrpath
continue
;;
-R*)
+ echo "!!! -R* detected."
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
# We need an absolute path.
case $dir in
@@ -1755,6 +1762,7 @@
;; # -L
-R*)
if test $pass = link; then
+ echo "!!! \$pass = '$pass'. \$xrpath was '$xrpath'"
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
# Make sure the xrpath contains only unique directories.
case "$xrpath " in
@@ -1762,7 +1770,12 @@
*) xrpath="$xrpath $dir" ;;
esac
fi
+ echo "??? \$xrpath is '$xrpath'"
+ echo "??? \$deplib was '$deplib'"
+ echo "??? \$deplibs was '$deplibs'"
deplibs="$deplib $deplibs"
+ echo "NO HACK! Comment out deplibs=\"\$deplib \$deplibs\""
+ echo "??? \$deplibs is '$deplibs'"
continue
;;
*.la) lib="$deplib" ;;
@@ -2294,6 +2307,7 @@
fi
fi # link shared/static library?
+ echo "\$dependency_libs='$dependency_libs'"
if test $linkmode = lib; then
if test -n "$dependency_libs" &&
{ test $hardcode_into_libs != yes || test $build_old_libs = yes ||
@@ -2739,6 +2753,7 @@
dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
done
+ echo "\$xrpath = '$xrpath'"
if test -n "$xrpath"; then
# If the user specified any rpath flags, then add them.
temp_xrpath=
To me helps to comment out line with
deplibs="$deplib $deplibs"
(see above line with word HACK).
I'd be glad if someone would explain me why $deplibs variables changes so often
during libtool execution. The above diff is against generated libtool 1.4.3
under gtk+-2.2.0 sources. Tru64Unix 5.1A alias OSF1.
Another case found on the
web: http://bugzilla.gnome.org/show_bug.cgi?id=78302
It happened to me for example with libgnomeprint-2.1.7 sources on OSF1 and I
believe
I've seen this on Irix with cc/ld too.
>
> > Bruno Haible wrote:
> > >
> > > Hi,
> > >
> > > As suggested by Robert Boehne, I'm now submitting the libtool patches
> > > I've made for gettext and libiconv. My patches are relative to
> > > libtool-1.4.3;
> > > I hope it's easy enough for you to apply them to the current CVS
> > > (otherwise
> > > please make an 1.5 release and I'll port them to 1.5 and resubmit).
> > >
> > > This patch was posted on a GNU mailing list by Albert Chin. It is
> > > essential
> > > for use of libtool, libintl etc. on all platforms where the linker doesn't
> > > understand the -R flag directly, like OSF/1. The -R flags from a .la's
> > > dependency_libs are taken into account by a different variable and must be
> > > ignored in this particular pass.
> > >
> > > 2003-01-03 Albert Chin <address@hidden>
> > >
> > > * ltmain.sh: Don't pass -R flags found in a .la's dependency_libs
> > > variable directly down to the linker.
> > > Reported by Tim Mooney <address@hidden>.
> > >
> > > *** libtool-1.4.3/ltmain.sh 2002-10-23 04:26:24.000000000 +0200
> > > --- ltmain.sh 2003-02-18 21:53:41.000000000 +0100
> > > ***************
> > > *** 2084,2089 ****
> > > --- 2092,2098 ----
> > > for deplib in $tmp_libs; do
> > > case $deplib in
> > > -L*) new_libs="$deplib $new_libs" ;;
> > > + -R*) ;;
> > > *)
> > > case " $specialdeplibs " in
> > > *" $deplib "*) new_libs="$deplib $new_libs" ;;
> > >
> > > _______________________________________________
> > > Libtool-patches mailing list
> > > address@hidden
> > > http://mail.gnu.org/mailman/listinfo/libtool-patches
> >
> > --
> > Robert Boehne Software Engineer
> > Ricardo Software Chicago Technical Center
> > TEL: (630)789-0003 x. 238
> > FAX: (630)789-0127
> > email: rboehne AT ricardo-us DOT com
> >
> >
> > _______________________________________________
> > Libtool-patches mailing list
> > address@hidden
> > http://mail.gnu.org/mailman/listinfo/libtool-patches
>
>
--
Martin Mokrejs <address@hidden>, <address@hidden>
PGP5.0i key is at http://www.natur.cuni.cz/~mmokrejs
MIPS / Institute for Bioinformatics <http://mips.gsf.de>
GSF - National Research Center for Environment and Health
Ingolstaedter Landstrasse 1, D-85764 Neuherberg, Germany
tel.: +49-89-3187 3683 , fax: +49-89-3187 3585