Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 446554 - Bootstrapping Gentoo Prefix on arm-linux fails
Summary: Bootstrapping Gentoo Prefix on arm-linux fails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords: Bug
Depends on:
Blocks:
 
Reported: 2012-12-09 00:33 UTC by Richard Yao (RETIRED)
Modified: 2017-08-25 02:29 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Yao (RETIRED) gentoo-dev 2012-12-09 00:33:36 UTC
I tried installing Gentoo Prefix on Raspian (Debian for the Raspberry Pi), but it failed because we do not have a correct profile in the tree. The existing arm profile is armv7 specific and doesn't set ACCEPT_KEYWORDS properly. Fixing that locally permits the build to continue (although I have not yet seen how far).

* setting up some guessed defaults
* UNKNOWN ARCH: You need to set up a make.profile symlink to a
* profile in /home/pi/gentoo/usr/portage for your CHOST armv6l-pc-linux-gnu
* prefix-portage successfully bootstrapped
* stage2 successfully finished
* Bootstrapping Gentoo prefixed portage installation using
* host:   armv6l-pc-linux-gnu
* prefix: /home/pi/gentoo
* ready to bootstrap stage3


!!! /home/pi/gentoo/etc/make.profile is not a symlink and will probably prevent most merges.
!!! It should point into a profile within /home/pi/gentoo/usr/portage/profiles/
!!! (You can safely ignore this message when syncing. It's harmless.)


!!! Your current profile is invalid. If you have just changed your profile
!!! configuration, you should revert back to the previous configuration.
!!! Allowed actions are limited to --help, --info, --search, --sync, and
!!! --version.

Hmmmm, I was already afraid of this to happen.  Running
  /bin/bash ./bootstrap-prefix.sh "/home/pi/gentoo" stage3
somewhere failed :(  Details might be found in the build log:
  (no build logs found?!?)
I have no clue, really.  Please find friendly folks in #gentoo-prefix on
irc.gentoo.org, gentoo-alt@lists.gentoo.org mailing list, or file a bug
at bugs.gentoo.org under Gentoo/Alt, Prefix Support.  This is most
inconvenient, and it crushed my ego.  Sorry, I give up.
Comment 1 Richard Yao (RETIRED) gentoo-dev 2012-12-09 01:47:06 UTC
Well, that almost worked. The default Raspbian image ran out of inodes when building sys-devel/binutils-2.22-r1.
Comment 2 Benda Xu gentoo-dev 2012-12-09 05:22:28 UTC
Hey, Yao and ZeroChaos

Welcome to the new world of arm Prefix.

I have bootstrapped one on armv5tel on Marvell Kirkwood[1] back in April. At that time I was lazy, by adding CHOST=armv5tel-softfloat-linux-gnueabi to make.conf, and everything works by manually bootstrap.

I suggest to use keyword arm instead of arm-linux for cleanness. While darkside reminded me this will break prefix (and gentoo in general) keyword convention. I myself don't like the keyword difference between x86 and x86-linux. But we have to treat them separately because we don't have the right to choose libc. Since redlizard's work in around the corner[2], we may rethink about it.

The present situation is,

keyword arm is used to mean a prefix also (no breakage so far with my armv5tel-softfloat-linux-gnueabi system). But the prefix team don't have a unified view on this. And I threw it in, in an "only I am using prefixed arm, who cares" manner.

arm profile is defined as armv7 and for other variants you have to define CHOST in make.conf. In portage/profiles/arch/arm there are profiles we can use for a good reorganize.

Comments?

1. http://www.7-cpu.com/cpu/Kirkwood.html
2. https://github.com/redlizard/gentoo-prefix-libc
Comment 3 Fabian Groffen gentoo-dev 2012-12-09 15:41:21 UTC
The reason for making a distinction between arm and arm-linux (or any other arch) is that you cannot assume every package keyworded arm to also work in a Prefix.  This may be D -> ED work, but also patching left or right.

You're always allowed to use ACCEPT_KEYWORDS="~arm", if that works for you, of course.

Now for this bug, it seems what you want here is a couple of subdirs under the arm profile, e.g. like default/linux/arm/10.0/arm*
Comment 4 Rick Farina (Zero_Chaos) gentoo-dev 2012-12-09 20:13:29 UTC
(In reply to comment #3)
> The reason for making a distinction between arm and arm-linux (or any other
> arch) is that you cannot assume every package keyworded arm to also work in
> a Prefix.  This may be D -> ED work, but also patching left or right.
> 
> You're always allowed to use ACCEPT_KEYWORDS="~arm", if that works for you,
> of course.

I agree, the profiles should all be setting ACCEPT_KEYWORDS="-arm ~arm-linux", the user can override that at their own peril.
> 
> Now for this bug, it seems what you want here is a couple of subdirs under
> the arm profile, e.g. like default/linux/arm/10.0/arm*

Yes, I was planning on breaking the profile up into AT LEAST arm6/arm7soft/arm7hard and the base could remain arm5 if people really care about running prefix on something that old...
Comment 5 Fabian Groffen gentoo-dev 2012-12-09 20:16:13 UTC
I think the -arm is not necessary (and wanted), but for the rest it's fine for me.  Feel free to commit it.  bootstrap-prefix.sh needs a patch then too.  We can handle that after you made a layout for the arm profiles.
Comment 6 Benda Xu gentoo-dev 2012-12-11 02:49:50 UTC
(In reply to comment #4)

> Yes, I was planning on breaking the profile up into AT LEAST
> arm6/arm7soft/arm7hard and the base could remain arm5 if people really care
> about running prefix on something that old...

in portage/profile/arch/arm, there is no armv7a hardfloat profile. Instead,
Comment 7 Benda Xu gentoo-dev 2012-12-11 02:55:10 UTC
Sorry, bad interaction with my browser :(

Instead, in the stage3 pointer in

    http://dev.gentoo.org/~armin76/arm/pandaboard/install.xml

the hardfloat-ness is defined in make.conf as

CFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard"
CXXFLAGS="${CFLAGS}"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="armv7a-hardfloat-linux-gnueabi"

Using the same terminology in prefix profile as arch/arm would be nice.

Raúl, could you please comment on the present status of armv7a hardfloat profile?
Comment 8 Raúl Porcel (RETIRED) gentoo-dev 2013-01-03 07:41:11 UTC
(In reply to comment #7)
> 
> Raúl, could you please comment on the present status of armv7a hardfloat
> profile?

The status is OK :P Does it help? I don't know what kind of information do you want :) The profile is working fine.
Comment 9 Benda Xu gentoo-dev 2013-01-04 04:14:35 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > 
> > Raúl, could you please comment on the present status of armv7a hardfloat
> > profile?
> 
> The status is OK :P Does it help? I don't know what kind of information do
> you want :) The profile is working fine.

We don't have a profile for armv7a hardfloat ABI (profiles/arch/arm/armv7a is not). Is hardfloat ABI planned to be included in profiles or are we suggested to set CFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard" in make.conf?
Comment 10 Rick Farina (Zero_Chaos) gentoo-dev 2013-01-04 04:26:52 UTC
At present hardfloat isn't in any of the profiles. I just got a few new arm devices for xmas, once I feel comfortably up to speed I plan to make a new profile for hardfloat based on the current arm7.  Anyone who wants to beat me to it is welcome to, but I plan to do a lot of fixing up in the normal and prefix arm profiles (current arm prefix profile doesn't even set keywords...)
Comment 11 Richard Yao (RETIRED) gentoo-dev 2013-01-04 10:25:14 UTC
(In reply to comment #10)
> At present hardfloat isn't in any of the profiles. I just got a few new arm
> devices for xmas, once I feel comfortably up to speed I plan to make a new
> profile for hardfloat based on the current arm7.  Anyone who wants to beat
> me to it is welcome to, but I plan to do a lot of fixing up in the normal
> and prefix arm profiles (current arm prefix profile doesn't even set
> keywords...)

Gentoo's GCC uses hardfloat by default on ARM. It also abuses the vendor field of the GCC triplet to signify hardfloat.

As a side note, that caused problems for Clang. I wrote a patch to fix it. I plan to commit it alongside a refresh of the Gentoo FreeBSD patches when I get a chance to do that.
Comment 12 Raúl Porcel (RETIRED) gentoo-dev 2013-01-04 19:02:06 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > (In reply to comment #7)
> > > 
> > > Raúl, could you please comment on the present status of armv7a hardfloat
> > > profile?
> > 
> > The status is OK :P Does it help? I don't know what kind of information do
> > you want :) The profile is working fine.
> 
> We don't have a profile for armv7a hardfloat ABI (profiles/arch/arm/armv7a
> is not). Is hardfloat ABI planned to be included in profiles or are we
> suggested to set CFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16
> -mfloat-abi=hard" in make.conf?

Oops, sorry. I proposed having a hardfloat subprofile some time ago and I thought we added it. Now I remember that meant that it would make sense to have the desktop variants as well. That would only increase the number of profiles since we only use the subprofiles(armv4,armv5te,etc) to mask packages that won't work in said subarchitecture.

At the end we decided that if we found that some package only built in hardfloat, or it didn't built/work in hardfloat, we would create it, but that there wasn't any need right now.

As for the CFLAGS/CHOST, etc, what Richard said on comment #11, on armv6j and armv7a Gentoo defaults to hardfloat unless 'softfp' or 'softfloat' is in the vendor field.
From this:
CFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard"

Both -march and -mfloat-abi get hardcoded in gcc when its built according to the CHOST/CBUILD/CTARGET.

Hope it helps.
Comment 13 Rick Farina (Zero_Chaos) gentoo-dev 2013-01-06 23:46:58 UTC
> As for the CFLAGS/CHOST, etc, what Richard said on comment #11, on armv6j
> and armv7a Gentoo defaults to hardfloat unless 'softfp' or 'softfloat' is in
> the vendor field.
> From this:
> CFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard"
> 
> Both -march and -mfloat-abi get hardcoded in gcc when its built according to
> the CHOST/CBUILD/CTARGET.
Why on earth are we passing -mfloat-abi=hard at all if there is no point due to CHOST?  I can honestly say that confuses me a lot.
> 
> Hope it helps.
More confused now then when I started, I think my false sense of knowledge is fading ;-)
Comment 14 SpanKY gentoo-dev 2013-01-07 00:25:03 UTC
(In reply to comment #13)

we don't anymore.  the profiles have already been updated.
Comment 15 Benda Xu gentoo-dev 2017-08-25 02:29:42 UTC
Now we can bootstrap from arm GNU/Linux.