1 |
Hi, |
2 |
|
3 |
right now I'm having some trouble boostrapping Gentoo Prefix on RHEL4 |
4 |
using amd64. The issues I'm experiencing seem to be in the binutils/gcc |
5 |
area. Both described problems might be related to each other but I'm not |
6 |
really sure. Anyway, here they are: |
7 |
|
8 |
1. Using sys-devel/gcc-4.2.4 the bootstrap process is working but e.g. |
9 |
app-text/poppler-0.10.0 can not be emerged. I traced it down to a |
10 |
$EPREFIX/usr/lib{,64} problem. r29645 removed the usr/lib64->lib |
11 |
"multilib" symlink creation in scripts/bootstrap-prefix.sh. Therefore |
12 |
libtool of poppler can not find $EPREFIX/usr/lib64 and eventually uses |
13 |
/usr/lib64 (having an old and incompatible version of libfreetype.so in |
14 |
this case). The following diff shows a formatted output of the library |
15 |
paths of "gcc -print-search-dirs". The compiler takes $EPREFIX/usr/lib64 |
16 |
only into account which does not exist without the symlink. Therefore |
17 |
the old system library is used during linking. |
18 |
|
19 |
> --- normal.log |
20 |
> +++ with-symlink.log |
21 |
> @@ -1,23 +1,24 @@ |
22 |
> $EPREFIX/usr/bin/gcc |
23 |
> 4.2.4 |
24 |
> Found: $EPREFIX/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/ |
25 |
> Found: /usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/ |
26 |
> Found: $EPREFIX/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/../../../../x86_64-pc-linux-gnu/lib/x86_64-pc-linux-gnu/4.2.4/ |
27 |
> Found: $EPREFIX/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/../../../../x86_64-pc-linux-gnu/lib/../lib64/ |
28 |
> Found: $EPREFIX/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/../../../x86_64-pc-linux-gnu/4.2.4/ |
29 |
> Found: $EPREFIX/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/../../../../lib64/ |
30 |
> Found: /lib/x86_64-pc-linux-gnu/4.2.4/ |
31 |
> Found: /lib/../lib64/ |
32 |
> Found: /usr/lib/x86_64-pc-linux-gnu/4.2.4/ |
33 |
> Found: /usr/lib/../lib64/ |
34 |
> Found: $EPREFIX/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/../../../../x86_64-pc-linux-gnu/lib/ |
35 |
> Found: $EPREFIX/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/../../../ |
36 |
> Found: /lib/ |
37 |
> Found: /usr/lib/ |
38 |
> Existing: $EPREFIX/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4 |
39 |
> +Existing: $EPREFIX/usr/lib64 |
40 |
> Existing: /lib64 |
41 |
> Existing: /usr/lib64 |
42 |
> Existing: $EPREFIX/usr/x86_64-pc-linux-gnu/lib |
43 |
> Existing: $EPREFIX/usr/lib |
44 |
> Existing: /lib |
45 |
> Existing: /usr/lib |
46 |
|
47 |
2. Bootstrapping having gcc-4.3.2 unmasked fails when |
48 |
sys-devel/gcc-4.3.2 is emerged for the first time. Although CPPFLAGS and |
49 |
LDFLAGS are correctly set, the required and of course already emerged |
50 |
libraries gmp and mpfr are not found. |
51 |
binutils-config seems to be the root of this problem. Using |
52 |
$EPREFIX/usr/x86_64-pc-linux-gnu/bin/ld (is this the binutils-config |
53 |
wrapper?) the paths given by $LDFLAGS are not passed in the original |
54 |
order to the "real" |
55 |
$EPREFIX/usr/x86_64-pc-linux-gnu/binutils-bin/2.18.50.0.9/ld. |
56 |
Eventually the gcc conftest.c for gmp/mpfr fails because the outdated |
57 |
system libs /usr/lib64/lib{gmp,mpfr}.so are used for linking instead of |
58 |
the ones from $EPREFIX/usr/lib. The following diff shows how the paths |
59 |
are reordered when using the binutils-config wrapper instead of directly |
60 |
calling the actual ld binary (output generated using some strace magic). |
61 |
Is there a reason why the "-L$EPREFIX/..." parameters are moved to the |
62 |
end of the list when using the ld wrapper? |
63 |
|
64 |
> --- real-ld.log |
65 |
> +++ wrapper-ld.log |
66 |
> @@ -1,22 +1,16 @@ |
67 |
> execve("$EPREFIX/usr/x86_64-pc-linux-gnu/binutils-bin/2.18.50.0.9/ld", |
68 |
> -["$EPREFIX/usr/x86_64-pc-linux-"..., |
69 |
> +["$EPREFIX/usr/bin/ld"..., |
70 |
> "-o"..., |
71 |
> "/tmp/gcc-4.3.2-conftest"..., |
72 |
> "/usr/lib/gcc/x86_64-redhat-linux"..., |
73 |
> "/usr/lib/gcc/x86_64-redhat-linux"..., |
74 |
> "/usr/lib/gcc/x86_64-redhat-linux"..., |
75 |
> -"-L$EPREFIX/usr/lib"..., |
76 |
> -"-L$EPREFIX/lib"..., |
77 |
> "-L/usr/lib/gcc/x86_64-redhat-lin"..., |
78 |
> "-L/usr/lib/gcc/x86_64-redhat-lin"..., |
79 |
> "-L/usr/lib/gcc/x86_64-redhat-lin"..., |
80 |
> "-L/usr/lib/gcc/x86_64-redhat-lin"..., |
81 |
> "-L/lib/../lib64"..., |
82 |
> "-L/usr/lib/../lib64"..., |
83 |
> -"-rpath"..., |
84 |
> -"$EPREFIX/usr/lib"..., |
85 |
> -"-rpath"..., |
86 |
> -"$EPREFIX/lib"..., |
87 |
> "/tmp/gcc-4.3.2-conftest.o"..., |
88 |
> "-lmpfr"..., |
89 |
> "-lgmp"..., |
90 |
> @@ -30,4 +24,10 @@ |
91 |
> "-lgcc_s"..., |
92 |
> "--no-as-needed"..., |
93 |
> "/usr/lib/gcc/x86_64-redhat-linux"..., |
94 |
> -"/usr/lib/gcc/x86_64-redhat-linux"...] |
95 |
> +"/usr/lib/gcc/x86_64-redhat-linux"..., |
96 |
> +"-rpath"..., |
97 |
> +"$EPREFIX/usr/x86_64-pc-linux-"..., |
98 |
> +"-L$EPREFIX/usr/x86_64-pc-linu"..., |
99 |
> +"-L$EPREFIX/usr/x86_64-pc-linu"..., |
100 |
> +"-L$EPREFIX/usr/lib"..., |
101 |
> +"-L$EPREFIX/lib"...] |
102 |
|
103 |
Best regards, |
104 |
Stefan |