FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Alt

 
 
LinkBack Thread Tools
 
Old 05-27-2011, 03:42 PM
Christopher Friedt
 
Default portable EPREFIX? ... crossdev toolchains, anyone?

Hi list,

I recently switched to a Mac after over a decade of various machines
running Linux (Gentoo for the most part), and think that the EPREFIX
install is great.

One of the first things I did was hack together a couple of crossdev
toolchains after installing Gentoo-Prefix (it was a bit of a battle,
but it does work).

I thought, "yay! now I can share these binaries and save others their
time", but then I realized there was a big problem.

The EPREFIX suggested on the bootstrap page[1] (at least for Mac) is
completely non-portable, since EPREFIX=${HOME}/Gentoo will change with
every single username. This prevents people like me from sharing
useful things like crossdev toolchains that might not be so easy for
others to put together.

Wouldn't a better solution for the guide be to _strongly_emphasize_ a
common-ish EPREFIX such as '/opt/gentoo' or '/Users/Gentoo' ?

I chose to use EPREFIX=/Users/Gentoo, since that is a fairly open spot
on most Macs, and it likely wouldn't collide with any unix-y paths
that might be used for some other purpose. Incidentally, I'd love to
post my cross-toolchains for anyone to download - can someone from the
gentoo-alt project host them?

Currently, I have

x86_64-apple-darwin10 => i686-pc-linux-gnu
x86_64-apple-darwin10 => armv7a-softfloat-linux-gnueabi

The softfloat toolchain can easily be used to build 'softfp' binaries
(i.e. binaries that use e.g. neon or vfp, but still work with a
softfloat userspace) simply by using e.g. CFLAGS="-march=armv7a
-mfloat-abi=softfp -fpu=neon".

They can be installed with 'emerge -Kav
cross-i686-pc-linux/{binutils,linux-headers,gcc,glibc}'.

Cheers,

C

[1] http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml
 
Old 05-27-2011, 03:59 PM
Jeremy Olexa
 
Default portable EPREFIX? ... crossdev toolchains, anyone?

On Fri, 27 May 2011 11:42:21 -0400, Christopher Friedt wrote:

Hi list,

The EPREFIX suggested on the bootstrap page[1] (at least for Mac) is
completely non-portable, since EPREFIX=${HOME}/Gentoo will change
with

every single username. This prevents people like me from sharing
useful things like crossdev toolchains that might not be so easy for
others to put together.


<snip a bunch of crossdev stuff, good stuff by the way>

So, you are providing binaries that you would like to share? There
isn't a graceful solution, but there is chpathtool[1] that is
automatically used when emerging binpkgs if "build EPREFIX" != "your
EPREFIX" - the catch? The build prefix must be longer than then new
prefix. I build binaries in a prefix that is 97 characters long,
assuming that the average user will pick a shorter location This
greatly reduces the time for a new prefix installation (down to as quick
as 5-7 minutes). In my opinion, changing the docs is even less of a
solution.


Anyway, maybe that bit of info will help your mission.

-Jeremy

[1]:
http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=blob;f=src/chpathtool.c;h=c4e481bbb26ffe9ea52db6ecccfebf30736 86704;hb=refs/heads/prefix

[1]: http://goo.gl/w8VKH (shortened link)
 
Old 05-27-2011, 04:33 PM
Christopher Friedt
 
Default portable EPREFIX? ... crossdev toolchains, anyone?

On Fri, May 27, 2011 at 11:59 AM, Jeremy Olexa <darkside@gentoo.org> wrote:
> when emerging binpkgs if "build EPREFIX" != "your EPREFIX" - the catch? The
> build prefix must be longer than then new prefix. I build binaries in a
> prefix that is 97 characters long, assuming that the average user will pick
> a shorter location This greatly reduces the time for a new prefix
> installation (down to as quick as 5-7 minutes). In my opinion, changing the
> docs is even less of a solution.

Good call - there's always a catch though isn't there ;-) Just
overwriting strings in the binaries sounds like a good idea. Then
there's also random regular text files too.

Crossdev can be easily patched to work 'properly', and glibc / gcc
have a bit of spots that need to be massaged, but otherwise it's
doable (I can say that now that I've had to do it a couple of times).

So is there any momentum for eprefixed binaries? I.e. something of a
stage3? It seems like it will always be an ongoing battle, but string
substitution probably eliminates a large part of that.

Cheers,

C
 
Old 05-27-2011, 04:52 PM
Fabian Groffen
 
Default portable EPREFIX? ... crossdev toolchains, anyone?

On 27-05-2011 12:33:56 -0400, Christopher Friedt wrote:
> On Fri, May 27, 2011 at 11:59 AM, Jeremy Olexa <darkside@gentoo.org> wrote:
> > when emerging binpkgs if "build EPREFIX" != "your EPREFIX" - the catch? The
> > build prefix must be longer than then new prefix. I build binaries in a
> > prefix that is 97 characters long, assuming that the average user will pick
> > a shorter location This greatly reduces the time for a new prefix
> > installation (down to as quick as 5-7 minutes). In my opinion, changing the
> > docs is even less of a solution.
>
> Good call - there's always a catch though isn't there ;-) Just
> overwriting strings in the binaries sounds like a good idea. Then
> there's also random regular text files too.

It's not too "just overwriting strings" here. See man chpathtool. I
just noticed this manpage is quite out of date, since it uses different
strategies for binary and text files these days.

> Crossdev can be easily patched to work 'properly', and glibc / gcc
> have a bit of spots that need to be massaged, but otherwise it's
> doable (I can say that now that I've had to do it a couple of times).
>
> So is there any momentum for eprefixed binaries? I.e. something of a
> stage3? It seems like it will always be an ongoing battle, but string
> substitution probably eliminates a large part of that.

We have the default-prefix dir on
http://tinderbox.dev.gentoo.org/

Have you considered trying to do cross-prefix stuff (if you need it?)
E.g. building cross target for a different target EPREFIX? You don't
really need it if you're happy with chpathtool, but technically (at one
point at least) you could emerge for a different EPREFIX than the one
portage was built with/for. I'm not sure if this path is tested much
lately though.


--
Fabian Groffen
Gentoo on a different level
 
Old 05-27-2011, 04:55 PM
Fabian Groffen
 
Default portable EPREFIX? ... crossdev toolchains, anyone?

On 27-05-2011 11:42:21 -0400, Christopher Friedt wrote:
> The EPREFIX suggested on the bootstrap page[1] (at least for Mac) is
> completely non-portable, since EPREFIX=${HOME}/Gentoo will change with
> every single username. This prevents people like me from sharing
> useful things like crossdev toolchains that might not be so easy for
> others to put together.

We do this on (big) purpose. We don't assume a user to have
administrative permissions at all. One of the places that are always
writable for a user is his/her $HOME. Using any of the /opt or /Users
like you suggest would generate many questions and bugs by people that
get errors because they can't write there.

You're doing stuff now that's beyond what Prefix was originally intended
for, or what we would suggest people to do on a daily basis. I like it
a lot (like Jeremy), but I guess you can just chose an offset now that
is much smarter than $HOME/Gentoo


--
Fabian Groffen
Gentoo on a different level
 

Thread Tools




All times are GMT. The time now is 03:19 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org