Gentoo Archives: gentoo-alt

From: Francois Bissey <francois.bissey@×××××××××××××.nz>
To: "gentoo-alt@l.g.o" <gentoo-alt@l.g.o>
Subject: Re: [gentoo-alt] RAP on ppc64 (SLES11.1)
Date: Thu, 26 Jan 2017 19:10:46
Message-Id: 5E121F9A-B8FA-4989-AF14-C65983BAF17D@canterbury.ac.nz
In Reply to: Re: [gentoo-alt] RAP on ppc64 (SLES11.1) by X dej
1 I forgot one bit! Keywording of baselayout_prefix. I can fill
2 a bug for that.
3
4 François
5
6 > On 26/01/2017, at 23:29, X dej <dreplaceelettereejbyeletterea@×××××.com> wrote:
7 >
8 > Thanks for reporting all these !
9 >
10 > X dej
11 >
12 > 2017-01-24 23:08 UTC+01:00, François Bissey <francois.bissey@×××××××××××××.nz>:
13 >> Hi all,
14 >>
15 >> I now have a working RAP environment on ppc64.
16 >> So here is a bit of recipe to achieve this:
17 >> * There is no current ppc64 profile, so one has to be
18 >> created during stage 1.
19 >> I copied the ppc64 from prefix/linux to prefix/linux-standalone.
20 >> Replace make.default inside prefix/linux-standalone/ppc64
21 >> by the one in prefix/linux-standalone/amd64.
22 >> Copy the "legacy" folder from prefix/linux-standalone/amd64
23 >> to prefix/linux-standalone/ppc64.
24 >>
25 >> * Make sure help2man is installed on the host system (for bison).
26 >>
27 >> * I would like the following patch to be considered
28 >> for the bootstrap script
29 >> --- bootstrap-rap.sh.orig 2017-01-24 12:20:27.304355158 +1300
30 >>
31 >>
32 >> +++ bootstrap-rap.sh 2017-01-24 12:34:30.325185905 +1300
33 >>
34 >>
35 >> @@ -1382,8 +1382,8 @@
36 >>
37 >>
38 >> sys-libs/ncurses
39 >>
40 >>
41 >> sys-libs/readline
42 >>
43 >>
44 >> app-shells/bash
45 >>
46 >>
47 >> - sys-apps/sed
48 >>
49 >>
50 >> app-arch/xz-utils
51 >>
52 >>
53 >> + sys-apps/sed
54 >>
55 >>
56 >> sys-apps/gentoo-functions
57 >>
58 >>
59 >> sys-apps/baselayout-prefix
60 >>
61 >>
62 >> dev-libs/libffi
63 >>
64 >>
65 >> @@ -1511,10 +1511,12 @@
66 >>
67 >>
68 >>
69 >>
70 >>
71 >> if is-rap ; then
72 >>
73 >>
74 >> # We need ${ROOT}/usr/bin/perl to merge glibc.
75 >>
76 >>
77 >> + PERL_NOT_INSTALLED=0
78 >>
79 >>
80 >> if [[ ! -x "${ROOT}"/usr/bin/perl ]]; then
81 >>
82 >>
83 >> # trick "perl -V:apiversion" check of
84 >> glibc-2.19.
85 >>
86 >> echo -e "#!${ROOT}/bin/sh\necho
87 >> 'apiversion=9999'" > "${ROOT}"/usr/bin/perl
88 >>
89 >> chmod +x "${ROOT}"/usr/bin/perl
90 >>
91 >>
92 >> + PERL_NOT_INSTALLED=1
93 >>
94 >>
95 >> fi
96 >>
97 >>
98 >> # Tell dynamic loader the path of libgcc_s.so of stage2
99 >>
100 >>
101 >> if [[ ! -f "${ROOT}"/etc/ld.so.conf.d/stage2.conf ]];
102 >> then
103 >>
104 >> @@ -1532,11 +1534,12 @@
105 >>
106 >>
107 >>
108 >>
109 >>
110 >> BOOTSTRAP_RAP=yes \
111 >>
112 >>
113 >> emerge_pkgs --nodeps "${pkgs[@]}" || return 1
114 >>
115 >>
116 >> - rm "${ROOT}"/usr/bin/perl
117 >>
118 >>
119 >> + # Do not mindlessly remove perl. Only if it wasnt
120 >> present in the first place.
121 >>
122 >> + [[ ${PERL_NOT_INSTALLED} == 1 ]] && rm
123 >> "${ROOT}"/usr/bin/perl
124 >>
125 >> else
126 >>
127 >>
128 >> pkgs=(
129 >>
130 >>
131 >> - sys-apps/sed
132 >>
133 >>
134 >> app-arch/xz-utils
135 >>
136 >>
137 >> + sys-apps/sed
138 >>
139 >>
140 >> sys-apps/gentoo-functions
141 >> sys-apps/baselayout-prefix
142 >> sys-devel/m4
143 >>
144 >> The latest version of sed is compressed with xz which
145 >> means the bootstrap will fail if xz-utils is not installed
146 >> in /bin or /usr/bin.
147 >> Newer distro probably have it but not older ones.
148 >> So we should move xz-utils before sed.
149 >>
150 >> The other part of the patch is specific to RAP and is
151 >> vexing. RAP adds a fake perl executable before building
152 >> glibc in case perl is not already there - and remove it,
153 >> unconditionally. So you are here you had a failure in stage3
154 >> after glibc has been merged and then perl has been merged.
155 >> You fixed whatever needs fixing and restart the bootstrap
156 >> and it removes your perl binary. And then you spend some
157 >> time wondering why autoconf failed while emerging something.
158 >> So I added a guard - only remove the perl executable if it is
159 >> the fake one. I guess that could be improved by actually
160 >> checking the file itself for the content of the fake perl.
161 >>
162 >> * As per another post the current bits to set the RAP glibc
163 >> to be used by gcc are not sufficient for ppc64. My profile.bashrc
164 >> has the following
165 >> if [[ ${CATEGORY}/${PN} == sys-devel/gcc && ${EBUILD_PHASE} == configure
166 >> ]]; then
167 >> cd "${S}"
168 >> einfo "Prefixifying dynamic linkers..."
169 >> for h in gcc/config/*/*linux*.h; do
170 >> ebegin " Updating $h"
171 >> sed -i -r "/_DYNAMIC_LINKER/s,([\":])(/lib),\1${EPREFIX}\2,g" $h
172 >> eend $?
173 >> done
174 >>
175 >>
176 >> The only change being to the sed line.
177 >>
178 >> Francois
179 >>
180 >>
181 >