Gentoo Archives: gentoo-embedded

From: servantes.REMOVE.SPAM@×××××××××.com
To: gentoo-embedded@l.g.o
Subject: [gentoo-embedded] cross-linker cannot find file redirected to from linker script
Date: Sat, 18 Jul 2009 18:35:44
Message-Id: op.uw90lmt52izcce@spencer.aistleitner.info
1 Hello,
2
3 I came across some difficulties when cross-compiling and I am unsure
4 against which package to file a bug report.
5
6 On an x86_64-pc-linux-gnu system, I set up cross compiling for
7 i686-elvis-linux-gnu using crossdev.
8 Using the emerge-wrapper scripts from sys-devel/crossdev-wrappers, I was
9 trying to “emerge-i686-elvis-linux-gnu system” but after merging some
10 packages, compiling fails at sys-apps/shadow for i686-elvis-linux-gnu
11 (i.e.:
12
13 i686-elvis-linux-gnu-gcc -O2 -pipe -Wl,-O1 -o passwd passwd.o
14 ../libmisc/libmisc.a ../lib/.libs/libshadow.a -lpam -lpam_misc
15 /usr/i686-elvis-linux-gnu/usr/lib/libcrack.so -lz -Wl,-rpath
16 -Wl,/usr/i686-elvis-linux-gnu/usr/lib -Wl,-rpath
17 -Wl,/usr/i686-elvis-linux-gnu/usr/lib
18
19 fails) with the following error:
20
21 /usr/libexec/gcc/i686-elvis-linux-gnu/ld: skipping incompatible
22 /lib/libcrack.so.2 when searching for /lib/libcrack.so.2
23 /usr/libexec/gcc/i686-elvis-linux-gnu/ld: cannot find /lib/libcrack.so.2
24
25 Hunting down the problem, I came across the linker script
26 /usr/i686-elvis-linux-gnu/usr/lib/libcrack.so, a linker script containing
27 OUTPUT_FORMAT ( elf32-i386 )
28 GROUP ( /lib/libcrack.so.2 )
29 and belonging to sys-libs/cracklib. As far as I understand it, it should
30 point the linker to the real shared object, which is
31 /usr/i686-elvis-linux-gnu/lib/libcrack.so.2
32 .
33
34 The missing sysroot /usr/i686-elvis-linux-gnu in the linker script looks
35 sane, as there is no „/usr/i686-elvis-linux-gnu”, once the system gets
36 deployed on a real machine. Furthermore, the preamble of
37 /usr/i686-elvis-linux-gnu/usr/lib/libcrack.so tells me:
38 And yes, this works in the cross-compiling scenario as the sysroot-ed
39 linker will prepend the real path.
40
41 It fails to work for my cross-compile setup, because replacing
42 /usr/i686-elvis-linux-gnu/usr/lib/libcrack.so
43 in the above call to gcc by
44 /usr/i686-elvis-linux-gnu/lib/libcrack.so.2
45 (the file the linker script should redirect the linker to) succeeds. So
46 does replacing
47 /lib/libcrack.so.2
48 by
49 /usr/i686-elvis-linux-gnu/lib/libcrack.so.2
50 within
51 /usr/i686-elvis-linux-gnu/usr/lib/libcrack.so
52 )
53
54 The above gcc call results in
55 /usr/bin/i686-elvis-linux-gnu-ld --sysroot=/usr/i686-elvis-linux-gnu
56 [...]
57 so a missing --sysroot paramenter is not the problem.
58
59 Originally, I wanted to file a bug about this problem, but I am unsure to
60 what package the bug belongs. Should this bug be filed against
61 sys-libs/cracklib (it installs the linker script) or against
62 sys-devel/binutils?
63
64 Or is the above problem a sign for a wrongly setup cross-compile
65 environment (I am just beginnig to toy around with cross-compiling)?
66
67 Kind regards,
68 servantes
69
70 --
71 Do _not_ remove the ".REMOVE.SPAM" in the address.
72 It's a catch for too smart address harvesters

Replies