Gentoo Archives: gentoo-alt

From: Steven Trogdon <strogdon@×××××.edu>
To: gentoo-alt@l.g.o
Subject: Re: [gentoo-alt] Prefix hijacking
Date: Fri, 26 Feb 2016 02:18:08
Message-Id: 20160225201800.7d94a287.strogdon@d.umn.edu
In Reply to: Re: [gentoo-alt] Prefix hijacking by Benda Xu
1 On Fri, 19 Feb 2016 14:47:43 +0900
2 Benda Xu <heroxbd@g.o> wrote:
3
4 >
5 > Here is what I usually do to migrate from $EPREFIX/usr/lib to
6 > $EPREFIX/usr/lib64:
7 >
8 > $ mv $EPREFIX/usr/lib/* $EPREFIX/usr/lib64/
9 > $ rmdir $EPREFIX/usr/lib
10 > $ ln -s $EPREFIX/usr/lib64 $EPREFIX/usr/lib
11 > $ emerge @system
12 > $ ....
13 >
14 > After all the ELF pointing to $EPREFIX/usr/lib were upgraded to
15 > $EPREFIX/usr/lib64, you can remove $EPREFIX/usr/lib safely.
16 >
17 > Hope that works.
18 > Benda
19 >
20 > 1. https://wiki.gentoo.org/wiki/Multilib
21 >
22
23 OK, making progress here. Finally I got gcc rebuilt but I had to modify the
24 toolchain.eclass
25
26 ---
27 @@ -845,7 +845,14 @@
28 --mandir="${EPREFIX}${DATAPATH}/man"
29 --infodir="${EPREFIX}${DATAPATH}/info"
30 --with-gxx-include-dir="${EPREFIX}${STDCXX_INCDIR}"
31 + --with-gmp-lib="${EPREFIX}/usr/lib"
32 + --with-mpfr-lib="${EPREFIX}/usr/lib"
33 + --with-mpc-lib="${EPREFIX}/usr/lib"
34 + --with-boot-ldflags="-Wl,--dynamic-linker=${EPREFIX}/lib/ld-linux-x86-64.so.2"
35 )
36
37 # Stick the python scripts in their own slotted directory (bug #279252)
38 #
39 ---
40
41 The gmp, mprf and mpc lib locations were needed to even configure gcc. The
42 dynamic linking was needed so that building >=stage1 used the prefix-provided
43 linker and not the host-provided one. Most things build but my fortran compiler
44 is broken.
45
46 gfortran -o eps eps.f
47 Warning: Nonexistent include directory
48 "/storage/strogdon/gentoo-prefix/usr/x86_64-pc-linux-gnu/storage/strogdon/gentoo-prefix/usr/include"
49 /storage/strogdon/gentoo-prefix/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.4/../../../../lib64/crt1.o:
50 In function `_start':
51 /storage/strogdon/gentoo-prefix/var/tmp/portage/sys-libs/glibc-2.19-r1/work/glibc-2.19/csu/../sysdeps/x86_64/start.S:118:
52 undefined reference to `main'
53 /storage/strogdon/gentoo-prefix/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.4/libgfortran.so:
54 undefined reference to `__secure_getenv'
55 collect2: error: ld returned 1 exit status
56
57 The include path is odd but I don't think that's the stopper. Both gcc and
58 glibc were rebuilt and were the ones use before the switch to the standalone
59 profile. The secure_getenv did appear as a QA when installing gcc
60
61 /storage/strogdon/gentoo-prefix/var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/libgfortran/runtime/main.c:175:3:
62 warning: implicit declaration of function ‘__secure_getenv’ [-Wimplicit-function-declaration]
63 /storage/strogdon/gentoo-prefix/var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/libgfortran/io/unix.c:1156:3:
64 warning: implicit declaration of function
65 ‘__secure_getenv’ [-Wimplicit-function-declaration]
66
67 Steven

Replies

Subject Author
Re: [gentoo-alt] Prefix hijacking Steven Trogdon <strogdon@×××××.edu>
[gentoo-alt] Standalone toolchain (Was: Prefix hijacking) Benda Xu <heroxbd@g.o>