Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo Alt (http://www.linux-archive.org/gentoo-alt/)
-   -   prefixed gentoo for cross-compile (question) (http://www.linux-archive.org/gentoo-alt/518684-prefixed-gentoo-cross-compile-question.html)

Piergiorgio Beruto 04-26-2011 04:10 PM

prefixed gentoo for cross-compile (question)
 
Hi,
I'm an embedded sw developer already used to gentoo and portage.

I am wondering whether gentoo prefix could help me in the following: I
would like to use portage to cross compile some base linux packages
plus some board specific applications for a different number of boards
each requiring their own patches and packages, with a huge amount of
code to be shared among them.
I was lookong at crossdev but the big problem is that I CAN'T get
administrative priviledges on the development machine, in fact each
user at the moment builds the packages in their own home.

To be more precise I wish I could use portage installed in my home
directory and have it use some cross-toolchain (either pre-built or
built through portage) to actually download, patch, configure, build
and install packages to some directory which will eventually be turned
into a target filesystem someway.
I've tried to use crossdev inside prefixed gentoo but failed to have
it working and I'm not sure it's the correct approach anyway.

Have you guys any suggestion about my problem? That would save a lot
of users to keep developing new build systems and re-inventing the
wheel each time! Also they would never come to something as good and
featured as portage.

Thank you in advance!

Michael Haubenwallner 04-27-2011 09:45 AM

prefixed gentoo for cross-compile (question)
 
Hi Piergiorgio,

On 04/26/11 18:10, Piergiorgio Beruto wrote:
> Hi,
> I'm an embedded sw developer already used to gentoo and portage.

Is your gentoo and portage usage already related to your embedded development?

> I am wondering whether gentoo prefix could help me in the following: I
> would like to use portage to cross compile some base linux packages
> plus some board specific applications for a different number of boards
> each requiring their own patches and packages, with a huge amount of
> code to be shared among them.

Basically yes, ...

> I was lookong at crossdev but

... however I've not seen anyone trying to make crossdev working in Prefix.

But I fail to see a reason for crossdev not to work in Prefix, even if
I've not used crossdev myself. So IMO it just has To Be Done (tm).

> the big problem is that I CAN'T get
> administrative priviledges on the development machine, in fact each
> user at the moment builds the packages in their own home.

This is one of the reasons Gentoo Prefix was born.

> To be more precise I wish I could use portage installed in my home
> directory and have it use some cross-toolchain (either pre-built or
> built through portage) to actually download, patch, configure, build
> and install packages to some directory which will eventually be turned
> into a target filesystem someway.
> I've tried to use crossdev inside prefixed gentoo but failed to have
> it working and I'm not sure it's the correct approach anyway.

The special use case for Prefix here IMO is the combination of
ROOT="/somewhere" with EPREFIX="" and non-Prefix profiles/keywords.

> Have you guys any suggestion about my problem? That would save a lot
> of users to keep developing new build systems and re-inventing the
> wheel each time! Also they would never come to something as good and
> featured as portage.

For what I can say if I were in your situation:

First, I'd try crossdev on some (virtualized) vanilla Gentoo Linux
system, to see if crossdev /is/ the tool doing what I need, and to
see how it works.

Then I'd try to fix crossdev to work within Gentoo Prefix, trying
to get identical output as on the vanilla Gentoo Linux system.

But I also would expect lots of work, resulting in patches for crossdev,
ebuilds/eclasses, as well as (prefix-)portage.

HTH,
/haubi/
--
Michael Haubenwallner
Gentoo on a different level

Piergiorgio Beruto 04-27-2011 11:29 AM

prefixed gentoo for cross-compile (question)
 
Hello Michael,

2011/4/27 Michael Haubenwallner <haubi@gentoo.org>:
> Hi Piergiorgio,
>
> On 04/26/11 18:10, Piergiorgio Beruto wrote:
>> Hi,
>> I'm an embedded sw developer already used to gentoo and portage.
>
> Is your gentoo and portage usage already related to your embedded development?
Actually yes, I've been using Gentoo for several years for a wide
range of applications (both for my company and on my own) like
routers, L2 switches, servers, multimedia and desktop applications. In
fact I love gentoo because of its fexibility, like many other users
:-)

Embedded development used to be a different kind of beast, but at
company level the requirements for "big" embedded projects are the
same as for traditional development and I think it's the time to
enhance our ways of working to speed up our daily work and meet the
requirements.

This is why I think portage might be a good solution: in embedded
development we're really missing a build system which allows you to
pick up traditional open source packages and your own packages
maximizing code reuse among projects. I believe portage has the degree
of modularity required, and since it's open source is much easier to
learn and to maintain.

>
>> I am wondering whether gentoo prefix could help me in the following: I
>> would like to use portage to cross compile some base linux packages
>> plus some board specific applications for a different number of boards
>> each requiring their own patches and packages, with a huge amount of
>> code to be shared among them.
>
> Basically yes, ...
>
>> I was lookong at crossdev but
>
> ... however I've not seen anyone trying to make crossdev working in Prefix.
>
> But I fail to see a reason for crossdev not to work in Prefix, even if
> I've not used crossdev myself. So IMO it just has To Be Done (tm).

Well, I've tried to have crossdev itself working in prefix and I
succeeded, the big problem was to cross-build the glibc, then I didnt
have the time to finish but maybe I could use some help?

>
>> the big problem is that I CAN'T get
>> administrative priviledges on the development machine, in fact each
>> user at the moment builds the packages in their own home.
>
> This is one of the reasons Gentoo Prefix was born.
>
>> To be more precise I wish I could use portage installed in my home
>> directory and have it use some cross-toolchain (either pre-built or
>> built through portage) to actually download, patch, configure, build
>> and install packages to some directory which will eventually be turned
>> into a target filesystem someway.
>> I've tried to use crossdev inside prefixed gentoo but failed to have
>> it working and I'm not sure it's the correct approach anyway.
>
> The special use case for Prefix here IMO is the combination of
> ROOT="/somewhere" with EPREFIX="" and non-Prefix profiles/keywords.
Yes, crossdev already uses the ROOT variable to specify the
installation path, I'm not yet very familiar with prefix related
variables so it might only be a matter of studying...
For instance what you mean exactly by "non-Prefix profiles/keywords"?
>
>> Have you guys any suggestion about my problem? That would save a lot
>> of users to keep developing new build systems and re-inventing the
>> wheel each time! Also they would never come to something as good and
>> featured as portage.
>
> For what I can say if I were in your situation:
>
> First, I'd try crossdev on some (virtualized) vanilla Gentoo Linux
> system, to see if crossdev /is/ the tool doing what I need, and to
> see how it works.
Yes, I'm already a crossdev user and I actually think it could be the
tool I am looking for, possibly with some tweaks.
>
> Then I'd try to fix crossdev to work within Gentoo Prefix, trying
> to get identical output as on the vanilla Gentoo Linux system.
That's the difficult part :)
>
> But I also would expect lots of work, resulting in patches for crossdev,
> ebuilds/eclasses, as well as (prefix-)portage.
That's what I am NOT familiar with, I am an experienced portage user
but not (yet) a good portage developer.
Maybe I could use a little help with this? Do you guys find this kind
of development useful/challenging? In which case, have you got a rough
idea about the effort in making a working prototype (your guess would
be much better then mine)?

Oh, one last thing: one of the big issues is about host machines... it
would be nice if the prefixed Gentoo could be portable across
different development machines / users. Do you think it's possible to
have a prefixed gentoo "relocatable"? I mean, I setup my prefixed
system, then i "tar cvj" the entire system then untar for a different
user / different machine, "change some config files / environment
variables" and have my prefixed system work without bootstrapping
again?

Thank you very much for your time and help,
Regards,

Piergiorgio

>
> HTH,
> /haubi/
> --
> Michael Haubenwallner
> Gentoo on a different level
>
>

Ramon van Alteren 04-27-2011 03:58 PM

prefixed gentoo for cross-compile (question)
 
HI,

On Wed, Apr 27, 2011 at 13:29, Piergiorgio Beruto
<piergiorgio.beruto@gmail.com> wrote:
> Oh, one last thing: one of the big issues is about host machines... it
> would be nice if the prefixed Gentoo could be portable across
> different development machines / users. Do you think it's possible to
> have a prefixed gentoo "relocatable"? I mean, I setup my prefixed
> system, then i "tar cvj" the entire system then untar for a different
> user / different machine, "change some config files / environment
> variables" and have my prefixed system work without bootstrapping
> again?

As long as you do not change the underlying OS, you should be fine(tm)

That means: I just did this moving from mac-osx laptop1 to mac-osx
laptop2 for a different user.
You need to modify the make.globals file (portage users...) and
usr/lib/portage/pym/portage/const_autotool.py

After that my prefix based system worked like a charm again, however
YMMV as usual.

Ramon

Michael Haubenwallner 04-27-2011 05:06 PM

prefixed gentoo for cross-compile (question)
 
On 04/27/11 13:29, Piergiorgio Beruto wrote:
>> But I fail to see a reason for crossdev not to work in Prefix, even if
>> I've not used crossdev myself. So IMO it just has To Be Done (tm).
>
> Well, I've tried to have crossdev itself working in prefix and I
> succeeded, the big problem was to cross-build the glibc, then I didnt
> have the time to finish but maybe I could use some help?

Shouldn't glibc be the very first package crossdev does build?
What exactly is the problem?

>> The special use case for Prefix here IMO is the combination of
>> ROOT="/somewhere" with EPREFIX="" and non-Prefix profiles/keywords.
> Yes, crossdev already uses the ROOT variable to specify the
> installation path, I'm not yet very familiar with prefix related
> variables so it might only be a matter of studying...

Eventually you might try to build your packages within Prefix,
without cross-compiling first.

> For instance what you mean exactly by "non-Prefix profiles/keywords"?

I'm not familiar with crossdev, but I guess you need to set up the
"${ROOT}/etc/make.profile" symlink, pointing to something like
".../usr/portage/profiles/default/linux/...", resulting in
ACCEPT_KEYWORDS like "x86 ~x86"

In Prefix, you set up "${ROOT}${EPREFIX}/etc/make.profile" pointing
to something like ".../usr/portage/profiles/prefix/...", so
ACCEPT_KEYWORDS is something like "~x86-interix".

The special case for your crossdev-usecase within Prefix is that EPREFIX
is empty for $host (as in $ROOT$EPREFIX), while not empty for $build.

> Yes, I'm already a crossdev user and I actually think it could be the
> tool I am looking for, possibly with some tweaks.

Have you also tried using crossdev on vanilla Gentoo Linux to build
your software?

>> Then I'd try to fix crossdev to work within Gentoo Prefix, trying
>> to get identical output as on the vanilla Gentoo Linux system.
> That's the difficult part :)

Show us the error messages, and you might get concrete help.

> Do you guys find this kind
> of development useful/challenging?

Definitively.

> In which case, have you got a rough
> idea about the effort in making a working prototype (your guess would
> be much better then mine)?

Unfortunately, not from me.

/haubi/
--
Michael Haubenwallner
Gentoo on a different level

Piergiorgio Beruto 04-28-2011 11:52 AM

prefixed gentoo for cross-compile (question)
 
Thank you Ramon, I'll try this out.

Regards,
Piergiorgio

On Wednesday 27 April 2011 17:58:26 Ramon van Alteren wrote:
> HI,
>
> On Wed, Apr 27, 2011 at 13:29, Piergiorgio Beruto
>
> <piergiorgio.beruto@gmail.com> wrote:
> > Oh, one last thing: one of the big issues is about host machines... it
> > would be nice if the prefixed Gentoo could be portable across
> > different development machines / users. Do you think it's possible to
> > have a prefixed gentoo "relocatable"? I mean, I setup my prefixed
> > system, then i "tar cvj" the entire system then untar for a different
> > user / different machine, "change some config files / environment
> > variables" and have my prefixed system work without bootstrapping
> > again?
>
> As long as you do not change the underlying OS, you should be fine(tm)
>
> That means: I just did this moving from mac-osx laptop1 to mac-osx
> laptop2 for a different user.
> You need to modify the make.globals file (portage users...) and
> usr/lib/portage/pym/portage/const_autotool.py
>
> After that my prefix based system worked like a charm again, however
> YMMV as usual.
>
> Ramon

Piergiorgio Beruto 04-28-2011 12:03 PM

prefixed gentoo for cross-compile (question)
 
Hello!

On Wednesday 27 April 2011 19:06:29 Michael Haubenwallner wrote:
> On 04/27/11 13:29, Piergiorgio Beruto wrote:
> >> But I fail to see a reason for crossdev not to work in Prefix, even if
> >> I've not used crossdev myself. So IMO it just has To Be Done (tm).
> >
> > Well, I've tried to have crossdev itself working in prefix and I
> > succeeded, the big problem was to cross-build the glibc, then I didnt
> > have the time to finish but maybe I could use some help?
>
> Shouldn't glibc be the very first package crossdev does build?
> What exactly is the problem?
Actually the build order is binutils, kernel headers, glibc headers, gcc stage
1, glibc and gcc stage 2. I encountered problems with glibc not being able to
properly detect the previous installed packages, most probably because of
prefix as on the plain vanilla gentoo everything worked fine... but I've tried
this some time ago, I'd better try again and eventually report the problem
with the full log maybe?
>
> >> The special use case for Prefix here IMO is the combination of
> >> ROOT="/somewhere" with EPREFIX="" and non-Prefix profiles/keywords.
> >
> > Yes, crossdev already uses the ROOT variable to specify the
> > installation path, I'm not yet very familiar with prefix related
> > variables so it might only be a matter of studying...
>
> Eventually you might try to build your packages within Prefix,
> without cross-compiling first.
--> already done, works just fine.
>
> > For instance what you mean exactly by "non-Prefix profiles/keywords"?
>
> I'm not familiar with crossdev, but I guess you need to set up the
> "${ROOT}/etc/make.profile" symlink, pointing to something like
> ".../usr/portage/profiles/default/linux/...", resulting in
> ACCEPT_KEYWORDS like "x86 ~x86"
ah, ok, crossdev already care about this but now I understand what u mean.
>
> In Prefix, you set up "${ROOT}${EPREFIX}/etc/make.profile" pointing
> to something like ".../usr/portage/profiles/prefix/...", so
> ACCEPT_KEYWORDS is something like "~x86-interix".
>
> The special case for your crossdev-usecase within Prefix is that EPREFIX
> is empty for $host (as in $ROOT$EPREFIX), while not empty for $build.
>
> > Yes, I'm already a crossdev user and I actually think it could be the
> > tool I am looking for, possibly with some tweaks.
>
> Have you also tried using crossdev on vanilla Gentoo Linux to build
> your software?
Yes, works like a charm (more or less!)
>
> >> Then I'd try to fix crossdev to work within Gentoo Prefix, trying
> >> to get identical output as on the vanilla Gentoo Linux system.
> >
> > That's the difficult part :)
>
> Show us the error messages, and you might get concrete help.
Thank you, I'll come back to you as soon as I try again.
>
> > Do you guys find this kind
> > of development useful/challenging?
>
> Definitively.
Good, I should be able to spend some time on this then, thank you.
> > In which case, have you got a rough
> > idea about the effort in making a working prototype (your guess would
> > be much better then mine)?
>
> Unfortunately, not from me.
Nevermind, I think it's worth a try anyway :)
>
> /haubi/

Bye,
Piergiorgio

Michael Haubenwallner 04-28-2011 01:02 PM

prefixed gentoo for cross-compile (question)
 
On 04/28/2011 02:03 PM, Piergiorgio Beruto wrote:

>> Eventually you might try to build your packages within Prefix,
>> without cross-compiling first.
> --> already done, works just fine.

>> Have you also tried using crossdev on vanilla Gentoo Linux to build
>> your software?
> Yes, works like a charm (more or less!)

> Nevermind, I think it's worth a try anyway :)

Given that you had success in both scenarios already, ...

> I encountered problems with glibc not being able to
> properly detect the previous installed packages,

... chances are alive that there are just a few bits missing, where this is one of them.

> most probably because of
> prefix as on the plain vanilla gentoo everything worked fine...

Yep.

> but I've tried
> this some time ago, I'd better try again and eventually report the problem
> with the full log maybe?

Yes - however, it might be better to also get crossdev-"upstream"
(another Gentoo dev) involved then.

/haubi/
--
Michael Haubenwallner
Gentoo on a different level

Michael Haubenwallner 04-28-2011 01:02 PM

prefixed gentoo for cross-compile (question)
 
On 04/28/2011 02:03 PM, Piergiorgio Beruto wrote:

>> Eventually you might try to build your packages within Prefix,
>> without cross-compiling first.
> --> already done, works just fine.

>> Have you also tried using crossdev on vanilla Gentoo Linux to build
>> your software?
> Yes, works like a charm (more or less!)

> Nevermind, I think it's worth a try anyway :)

Given that you had success in both scenarios already, ...

> I encountered problems with glibc not being able to
> properly detect the previous installed packages,

... chances are alive that there are just a few bits missing, where this is one of them.

> most probably because of
> prefix as on the plain vanilla gentoo everything worked fine...

Yep.

> but I've tried
> this some time ago, I'd better try again and eventually report the problem
> with the full log maybe?

Yes - however, it might be better to also get crossdev-"upstream"
(another Gentoo dev) involved then.

/haubi/
--
Michael Haubenwallner
Gentoo on a different level

Benda Xu 08-03-2011 02:03 AM

prefixed gentoo for cross-compile (question)
 
Hello Piergiorgio

On Wed, Apr 27, 2011 at 1:10 AM, Piergiorgio Beruto <piergiorgio.beruto@gmail.com> wrote:



I'm an embedded sw developer already used to gentoo and portage.



I am wondering whether gentoo prefix could help me in the following: I

would like to use portage to cross compile some base linux packages

plus some board specific applications for a different number of boards

each requiring their own patches and packages, with a huge amount of

code to be shared among them.



Have you guys any suggestion about my problem? That would save a lot

of users to keep developing new build systems and re-inventing the

wheel each time! Also they would never come to something as good and

featured as portage.


Sorry to bring this up again months later. Did you succeeded finally?

I have came across a solution for building cross compile toolchains in Prefix last year.

It was briefly noted here:


*** http://www.awa.tohoku.ac.jp/~benda/projects/gpCross.html

Hope it helps.

Yours,
--
XU Benda
Research Center for Neutrino Science

Tohoku University
JAPAN

http://www.awa.tohoku.ac.jp/~benda


All times are GMT. The time now is 09:12 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.