Package: automake1.11
Version: 1:1.11.1-1
When using CC=/path/to/my/cross-compiler/bin/gcc, assuming
link_all_deplibs is set to no (and using a libtool with debian
patches), running ltorder.test inside tests subdirectory will fail due
to linker being unable to find all the symbols during link time [1].
In my example, I used a random compiler from scratchbox, but the test
was run from outside scratchbox. What you see here will happen on a
normal Debian Squeeze host.
This won't happen with a regular (native) toolchain, or if
link_all_deplibs is set to yes. The test can be fixed with adding
-Wl,-rpath-link -Wl,test-subdir to AM_LDFLAGS. Patch attached.
Regards,
Jussi
[1]
/bin/bash ./libtool --tag=CC --mode=link
/scratchbox/compilers/linaro4.5-eglibc2.12-i486/bin/i486-pc-linux-gnu-gcc -g
-O2 -o p p.o liba5.la
libtool: link:
/scratchbox/compilers/linaro4.5-eglibc2.12-i486/bin/i486-pc-linux-gnu-gcc -g
-O2 -o .libs/p p.o ./.libs/liba5.so -Wl,-rpath
-Wl,/home/jhakala/tmp/automake1.11-1.11.1/tests/ltorder.dir/inst/lib/.
/scratchbox/compilers/linaro4.5-eglibc2.12-i486/bin/../lib/gcc/i486-pc-linux-gnu/4.5.4/../../../../i486-pc-linux-gnu/bin/ld: warning: liba4.so.0, needed by ./.libs/liba5.so, not found (try using -rpath or
-rpath-link)
./.libs/liba5.so: undefined reference to `a4'
collect2: ld returned 1 exit status
make: *** [p] Error 1
+ exit_status=2
+ set +e
+ cd /home/jhakala/tmp/automake1.11-1.11.1/tests
+ test 0 != 0
+ echo ltorder: exit 2
ltorder: exit 2
+ exit 2
diff -Nur old/automake1.11-1.11.1/tests/ltorder.test new/automake1.11-1.11.1/tests/ltorder.test
--- old/automake1.11-1.11.1/tests/ltorder.test 2010-01-29 14:48:36.000000000 +0200
+++ new/automake1.11-1.11.1/tests/ltorder.test 2011-05-30 11:41:26.000000000 +0300
@@ -33,6 +33,7 @@
sub_liba3_la_LIBADD = sub/liba2.la
liba4_la_LIBADD = sub/liba3.la
liba5_la_LIBADD = liba4.la
+AM_LDFLAGS = -Wl,-rpath-link -Wl,sub/.libs -Wl,-rpath-link -Wl,.libs
bin_PROGRAMS = p
p_LDADD = liba5.la
END