1 |
Am Montag, 4. Januar 2021, 13:57:37 EET schrieb Thomas Mueller: |
2 |
> > > That's what I did: I found a 2017 stage3 with a still older glibc and |
3 |
> > > managed to upgrade to a 2020 gentoo while masking the last glibc |
4 |
> > > versions. That was tricky because I had to git-checkout intermediate |
5 |
> > > versions of the portage tree in order to deal with the EAPI changes but |
6 |
> > > I have a working chroot now. Thanks. |
7 |
> > |
8 |
> > That's the easy way to do it, yes. |
9 |
> > |
10 |
> > The hard way is to treat this as a cross-compilation problem and bootstrap |
11 |
> > your own stages from scratch. Instructions would be a bit longer... |
12 |
> > |
13 |
> > Andreas K. Hüttel |
14 |
> |
15 |
> I have looked through crossdev. Is that what it would take to cross-compile |
16 |
> and bootstrap stages from scratch? |
17 |
> |
18 |
> Could that be done from (instead of an old glibc) musl, uClibc, or FreeBSD |
19 |
> or NetBSD? |
20 |
|
21 |
In principle yes, but every experimental piece can add more problems. |
22 |
It's probably best to start with a base that is as boring as possible. |
23 |
|
24 |
What crossdev does is (simplified) |
25 |
* "create" (as symlinks) ebuilds for cross-compiler, cross-binutils, and |
26 |
target glibc |
27 |
* build cross-compiler, cross-binutils, and target glibc |
28 |
* installs a wrapper for emerge that uses these |
29 |
|
30 |
For example, you end up on an amd64 system with an additional directory /usr/ |
31 |
riscv64-unknown-linux-gnu that contains |
32 |
* a gcc that runs on amd64 (CBUILD) but generates code for riscv64 (CTARGET) |
33 |
* a binutils that runs on amd64 but works with files for riscv64 |
34 |
* a glibc for riscv64 |
35 |
|
36 |
Then, using commands like |
37 |
riscv64-unknown-linux-gnu-emerge -av @system |
38 |
you can build in /usr/riscv64-unknown-linux-gnu pieces of the target system. |
39 |
|
40 |
This works only in a very limited way, since many upstream build systems do |
41 |
not support cross-compiling. However, with some patience you can get to the |
42 |
point where the directory can be tarred up and used as a chroot on the target |
43 |
architecture. |
44 |
|
45 |
|
46 |
|
47 |
-- |
48 |
Andreas K. Hüttel |
49 |
dilfridge@g.o |
50 |
Gentoo Linux developer |
51 |
(council, qa, toolchain, base-system, perl, libreoffice) |