Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cross-compiling between an AMD XP2000+ and a PII-450
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
maeldur
n00b
n00b


Joined: 25 Nov 2002
Posts: 14

PostPosted: Tue Dec 31, 2002 8:12 am    Post subject: Cross-compiling between an AMD XP2000+ and a PII-450 Reply with quote

Since my pII 450 compiles quite slowly, and segfaults at times, is there a way I can download packages and optimize them for the pII off my amd, and transfer the packages over? I don't understand quite how thise would work.

TIA
Back to top
View user's profile Send private message
keratos68
Guru
Guru


Joined: 27 Dec 2002
Posts: 561
Location: Blackpool, Lancashire, UK.

PostPosted: Tue Dec 31, 2002 9:36 am    Post subject: Reply with quote

Yep,

edit /etc/make.conf and find the CCFLAGS line, change it to read:

Code:

CCFLAGS="-march=pentium2 -mcpu=pentium2 -Os -fomit-frame-pointer"


"-march" and "-mcpu" instruct the C compiler to optimise for PII
"-Os" tells the C compiler to optimise for space, PII is reasonably okayish for executing binary code however the reduction in space (size of binary) will speed up any loading of the app and run-time linkages - X & KDE wil benefit from this!!!

There are many,many options you can assemble on the CCFLAGS line, check out "man gcc". I find this combination BOTH fast and stable.

[/code]
_________________
Someone told me that "..they only ever made one mistake...."

...and that's when they said they were wrong!!
Back to top
View user's profile Send private message
jukka
Apprentice
Apprentice


Joined: 06 Jun 2002
Posts: 249
Location: Zurich, Switzerland

PostPosted: Tue Dec 31, 2002 10:17 am    Post subject: Re: Cross-compiling between an AMD XP2000+ and a PII-450 Reply with quote

hi,
maeldur wrote:
...is there a way I can download packages and optimize them for the pII off my amd, and transfer the packages over?

on your AMD, try something like '[variables] ebuild <ebuild-file> package', e.g.:
Code:
$ USE="-3dnow mmx" \
CHOST="i686-pc-linux-gnu" \
CFLAGS="-march=i686 -O2 -pipe" \
CXXFLAGS="-march=i686 -O2 -pipe" \
ACCEPT_KEYWORDS="x86" \
/usr/sbin/ebuild /usr/portage/net-mail/maildrop/maildrop-1.5.0-r1.ebuild package
(see ebuild(1) for description of command 'package')
this fetches and compiles the software and builds a package (default location: /usr/portage/packages), but doesn't install it. you can transfer this package now to your P2 (using scp, ftp, ...), and install it by issuing a command like:
Code:
$ /usr/bin/emerge /path/to/package.tbz2

HTH, jukka
Back to top
View user's profile Send private message
maeldur
n00b
n00b


Joined: 25 Nov 2002
Posts: 14

PostPosted: Tue Dec 31, 2002 5:03 pm    Post subject: Reply with quote

That works great, jukka, now, is there a way that it will build packages for all the dependencies as well? Also, are there scripts that will help this process along?

TIA
Back to top
View user's profile Send private message
jukka
Apprentice
Apprentice


Joined: 06 Jun 2002
Posts: 249
Location: Zurich, Switzerland

PostPosted: Tue Dec 31, 2002 5:40 pm    Post subject: Reply with quote

maeldur wrote:
That works great, jukka

uff, i didn't test it... ;-)

Quote:
now, is there a way that it will build packages for all the dependencies as well?

hmm... if you often / always compile for the same machine you could try this (i didn't test it...):
  • on your AMD, move /var/db/pkg to /var/db/pkg-AMD or so
  • copy /var/db/pkg recursively from you P2 machine to your AMD and store it as /var/db/pkg-P2 or so
  • do the same with the file /etc/make.conf, and maybe all the other files you need to have twice...
  • write a script which creates / removes symlinks from those files / dirs to the real names, e.g. /etc/make.conf is a symlink to /etc/make.conf-P2 and so on
now, if you want to compile software for your P2 box, you call your script (which sets up the symlinks so they point to the P2 files), and you can start emerging.

Quote:
Also, are there scripts that will help this process along?
i don't know...

good luck ;-)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum