Gentoo Archives: gentoo-mips

From: "Anthony G. Basile" <basile@××××××××××××××.edu>
To: gentoo-mips@l.g.o
Subject: Re: [gentoo-mips] multilib problems on mips64 profiles
Date: Mon, 22 Sep 2014 01:11:03
Message-Id: 541F7726.5070305@opensource.dyc.edu
In Reply to: Re: [gentoo-mips] multilib problems on mips64 profiles by Joshua Kinard
1 On 09/21/14 18:53, Joshua Kinard wrote:
2 > On 09/21/2014 17:55, Anthony G. Basile wrote:
3 >> On 09/17/14 16:19, Anthony G. Basile wrote:
4 > [snip]
5 >>
6 >> This isn't going to work. The problem is that the above structure doesn't
7 >> distinguish between mips/o32 and mips64/o32 (and equivalent el versions). Now
8 >> mips64/o32 is funny, but possible: it would be o32 (a 32-bit abi) on 64 bit
9 >> arch/kernel, like ppc64-32ul. The structure is possible at the level of
10 >> profile/arch, but it would mean a deep restructuring of default/linux/mips/13.0.
11 >
12 > Err, I've been using this setup for the last 9+ years? My Octane and O2 both
13 > boot mips64 kernels and run an o32-only userland. It works fine with the
14 > current profile setup. You just use a mips-unknown-linux-gnu CHOST. I may not
15 > be able to fully utilize all of the CPU registers like I would under n32, but
16 > that's never been an issue for me.
17 >
18 > So there should be no need to differentiate at the userland level between
19 > mips/o32 and mips64/o32. As long as the CHOST is set correctly, o32 will work
20 > fine under a mips64 kernel (caveat: make sure CONFIG_MIPS32_O32 is set in the
21 > kernel).
22
23 I agree that there shouldn't be any userland difference, but I'm not
24 100% sure. Anyhow, let's go with that assumption for now.
25
26 >
27 > Correct me if wrong, but it seems the core problem here is that multilib
28 > inherits from the o32 base profile. While I think the proper longterm fix is
29 > to have more discrete, modular/pluggable profile components (like OOP and
30 > multiple base classes), that's not going to happen in Portage for a long time.
31
32 Not exactly. The problem is that everything inherits from
33 profiles/arch/mips and currently that forces o32 with mgorny's multilib
34 stuff. We need to get that out of the way for the other profiles that
35 inherit it.
36
37 >
38 > So I think the solution is to split the profiles into "mips" and "mips64",
39 > i.e., 32/ and 64/ under the 'mips' base profile folder. 32/ contains
40 > everything needed to run pure o32-only under either a mips or mips64 kernel.
41 > I.e., mips-unknown-linux-gnu CHOST. So on my Octane, /etc/portage/make.profile
42 > symlinks to /usr/portage/default/linux/mips/32/<VERSION>/
43
44 That's one approach, but I'm trying to find the least intrusive. I do
45 have the problem fixed with the following:
46
47 [1] default/linux/mips/13.0/o32
48 [2] default/linux/mips/13.0/n32
49 [3] default/linux/mips/13.0/n64
50 [4] default/linux/mips/13.0/multilib/o32
51 [5] default/linux/mips/13.0/multilib/n32
52 [6] default/linux/mips/13.0/multilib/n64
53 [7] default/linux/mips/13.0/mipsel/o32
54 [8] default/linux/mips/13.0/mipsel/n32
55 [9] default/linux/mips/13.0/mipsel/n64
56 [10] default/linux/mips/13.0/mipsel/multilib/o32
57 [11] default/linux/mips/13.0/mipsel/multilib/n32
58 [12] default/linux/mips/13.0/mipsel/multilib/n64
59
60 and would like to push this through as a fix for now. 1 and 4 have
61 CHOST=mips-unknown-linux-gnu and mipsel-unknown-linux-gnu respectively.
62 2,3 and 8,9 have mips64-unknown-linux-gnu and
63 mips64el-unknown-linux-gnu respectively. Only users of profiles 1 and 7
64 need to change their sym link one level down to ../o32. That was
65 necessary to move the o32 stuff out of the way of profiles/arch/mips.
66
67 >
68 > 64/ is where the fun is at. I think the default ABI there should be n32 at the
69 > base, with a subprofile for multilib that itself contains subprofiles to handle
70 > the combinations of ABIs desired. Still have to workout what CHOST you use for
71 > the base (GNU standard for n32 is mips64-unknown-linux-gnueabin32). multilib
72 > would just use mips64-unknown-linux-gnu, and -mabi would be passed to gcc to
73 > pick the ABI to build for.
74 >
75 > Also, if we are going to do any kind of reorganizing of the profiles, let's not
76 > do it under 13.0. Personally, I'd like to get away from datestamps as profile
77 > versions (13.0 refers to 2013) and either pick a fixed version number that we
78 > increment or come up with some other kind of versioning scheme. Or just do
79 > away with it altogether and have something like a "stable" profile where things
80 > work and an "unstable" branch that only exists when we're doing insane changes
81 > to the profiles, which after testing, becomes "stable" (and current "stable"
82 > becomes "oldstable" or such).
83 >
84 > If we have to stick with datestamped versions, then use 15.0. Cause it'll be
85 > 2015 by the time this goes active.
86 >
87 > rough draft of the top-level layout. Doesn't care about chosen libc, ISA, or
88 > <VERSION>, but does reflect endianness.
89 >
90 > default/linux/mips
91 > |
92 > |-32/
93 > | |-be/
94 > | |-le/
95 > |
96 > |-64/
97 > | |-be/
98 > | |-le/
99 > | |
100 > | |-multilib/
101 > | | |-be/
102 > | | |-le/
103 > | |
104 > |
105 >
106
107 I like this, but the problem is disentangling the situation under
108 arch/mips, not under default/linux/mips. Again, the inheritance problem
109 stems from everything under profiles/arch/mips inheriting from
110 profiles/arch/mips. So even if you do implement the above, you still
111 have to address the issue of how the arch/mips stuff is stacking.
112
113 >
114 >> Maybe we just don't want to support mips64/o32? I'm starting to lean towards
115 >> Ian's simple but asymmetric solution of turning off o32 in the inheriting
116 >> profiles.
117 >
118 > NAK
119 >
120
121 I'm leaning back towards the above approach and not Ian's.
122
123 --
124 Anthony G. Basile, Ph. D.
125 Chair of Information Technology
126 D'Youville College
127 Buffalo, NY 14201
128 (716) 829-8197

Replies

Subject Author
Re: [gentoo-mips] multilib problems on mips64 profiles "Anthony G. Basile" <basile@××××××××××××××.edu>
Re: [gentoo-mips] multilib problems on mips64 profiles Joshua Kinard <kumba@g.o>