View previous topic :: View next topic |
Author |
Message |
rgbtxus n00b
Joined: 02 May 2003 Posts: 39
|
Posted: Fri May 02, 2003 3:22 pm Post subject: How 2 build a Gentoo system for a P4 while running Athlon |
|
|
I wanted to build a Gentoo installation on a spare disk so I could pop it into a P4 system as a mostly built system and cut the down time of the P4 system from a few days to a few hours. The system I have to build on is an Athlon based Gentoo. I figured I could just do a stage 2 install setting march=pentium4 -mno-sse2. It seemed that this way the non specialialzed tool chain could do the work. Unfortunately it looks like something triggered a compile of a new gcc and somewhere in the middle of doing that it tried to assemble some P4 assembly code noticed it was on an Athlon and complained loudly.
So, it there some easy way to compile a Gentoo optimized for a P4 while running on an Athlon? (The P4 system is >1000 miles away at the moment
so I can't do the build there)
TIA for any pointers,
Rick |
|
Back to top |
|
|
yabbadabbadont Advocate
Joined: 14 Mar 2003 Posts: 4791 Location: 2 exits past crazy
|
Posted: Fri May 02, 2003 11:31 pm Post subject: |
|
|
I don't have access to my Gentoo system right now, but don't the comments in make.conf say that using -mcpu instead of -march will provide some optimization without breaking compatibility with other processors? |
|
Back to top |
|
|
krusty_ar Guru
Joined: 03 Oct 2002 Posts: 560 Location: Rosario, Argentina
|
Posted: Sat May 03, 2003 1:14 am Post subject: |
|
|
rgbtxus wrote: | The P4 system is >1000 miles away at the moment
so I can't do the build there |
actually, you can, jus boot knoppix into it, ssh to the remote box and do the install normally (there's a howto in the docs an tricks forum but it's almost trivial)
BTW: htere should be no problems compiling a complete system for an arch thats different from the local box, gcc IS a crosscompiler, there's even a tool called distcc that let's you do distributed compilation in any box. so your problem is a human mistake or just a bad package.
anyway, i would go for the remote install just for teh kicks of it _________________ I am Beta, don't expect correct behaviour from me.
Take part of the adopt an unaswered post initiative |
|
Back to top |
|
|
rgbtxus n00b
Joined: 02 May 2003 Posts: 39
|
Posted: Sat May 03, 2003 1:47 am Post subject: |
|
|
krusty_ar wrote: | rgbtxus wrote: | The P4 system is >1000 miles away at the moment
so I can't do the build there |
actually, you can, jus boot knoppix into it, ssh to the remote box and do the install normally (there's a howto in the docs an tricks forum but it's almost trivial)
BTW: htere should be no problems compiling a complete system for an arch thats different from the local box, gcc IS a crosscompiler, there's even a tool called distcc that let's you do distributed compilation in any box. so your problem is a human mistake or just a bad package.
..snip..
|
thanks for the thoughts, but
1) the remote box is off the net so that is out, and
2) sure gcc is happy to do the cross-compile but my problem (i think) is that emerge system caused a new version of gcc to be emerged (optimized for the P4) and then it tried to run on the Athlon |
|
Back to top |
|
|
cyrillic Watchman
Joined: 19 Feb 2003 Posts: 7313 Location: Groton, Massachusetts USA
|
Posted: Sat May 03, 2003 2:24 am Post subject: |
|
|
Installing P4 optimized binaries on your Athlon system won't work, but you can use an Athlon to compile P4 binary packages :
Code: | # nano -w /etc/make.conf <--- setup CFLAGS, etc. for P4 system
# emerge -eB world <--- build entire system without installing it
# nano -w /etc/make.conf <--- change your settings back before you forget ! |
Then copy the packages to your target system and emerge :
Code: | # emerge -k whatever |
Try "emerge --help" for more options. |
|
Back to top |
|
|
rgbtxus n00b
Joined: 02 May 2003 Posts: 39
|
Posted: Sat May 03, 2003 4:05 pm Post subject: Thanks - that got me going |
|
|
cyrillic wrote: | Installing P4 optimized binaries on your Athlon system won't work, but you can use an Athlon to compile P4 binary packages :
Code: | # nano -w /etc/make.conf <--- setup CFLAGS, etc. for P4 system
# emerge -eB world <--- build entire system without installing it
# nano -w /etc/make.conf <--- change your settings back before you forget ! |
Then copy the packages to your target system and emerge :
Code: | # emerge -k whatever |
Try "emerge --help" for more options. |
I'm doing a variant on your theme.
1) emerge -eB world | cut .. | sed .. >package-list on my Athlon system
2) cat package-list | xargs .. emerge -B --nodeps in my chrooted P4 dir
3) then when I copy the chrooted P4 build to the real P4 system i'll do
a cat package-list | xargs .. emerge -k |
|
Back to top |
|
|
Lemma Guru
Joined: 19 Apr 2002 Posts: 416 Location: Uppsala, Sweden
|
Posted: Tue Jul 15, 2003 10:20 am Post subject: |
|
|
Quote: | Installing P4 optimized binaries on your Athlon system won't work, but you can use an Athlon to compile P4 binary packages :
Code:
# nano -w /etc/make.conf <--- setup CFLAGS, etc. for P4 system
# emerge -eB world <--- build entire system without installing it
# nano -w /etc/make.conf <--- change your settings back before you forget !
Then copy the packages to your target system and emerge :
Code:
# emerge -k whatever
| Why not use chroot? You can have as many as you like (all it take is some space); you can nice if you like and you won't have to remember to change/change back any flags - that is how I maintain a few computers (same setup), all I have to do is remember to set the -b flag while emerging. That way I can see if there is anything wrong before I install the binaries with the added benefit of making having a superb system-backup; it's safe and very up to date . _________________ Always make it as simple as possible, but no simpler
/Einstein |
|
Back to top |
|
|
Chris Finch Tux's lil' helper
Joined: 10 Mar 2003 Posts: 106 Location: Darmstadt, Germany
|
Posted: Wed Jul 30, 2003 11:24 am Post subject: |
|
|
There is a problem with your method. Some Makefiles use their own CPU detection code and set optimization for the CPU detected (i.e. Athlon and not P4 in your case). The following is a snippet of the mplayer ebuild
Code: | # Crashes on start when compiled with most optimizations.
# The code have CPU detection code now, with CPU specific
# optimizations, so extra should not be needed and is not
# recommended by the authors
unset CFLAGS CXXFLAGS
./configure --prefix=/usr \
...
|
The thus compiled binary will not run on your P4. I don't know how many more ebuilds/Makefiles do this. You would have to find out and edit the respective ebuilds. Maybe grep for "unset CFLAGS". |
|
Back to top |
|
|
Lemma Guru
Joined: 19 Apr 2002 Posts: 416 Location: Uppsala, Sweden
|
Posted: Wed Jul 30, 2003 12:42 pm Post subject: |
|
|
Hm, I haven't had any problem as of yet, but then I don't use mplayer or other programs like it on those machines - only on my laptop. But, as you say, there may be other programs that use that method, meaning I will run into problem - sooner or later... _________________ Always make it as simple as possible, but no simpler
/Einstein |
|
Back to top |
|
|
Chris Finch Tux's lil' helper
Joined: 10 Mar 2003 Posts: 106 Location: Darmstadt, Germany
|
Posted: Wed Jul 30, 2003 2:10 pm Post subject: |
|
|
Not necessarily. Have a look at the output of
Code: | $cd /usr/portage
$grep -r 'unset CFLAGS' *
|
Those are the ebuilds you definitely want to have an extra look at. I don't know if anything slips through the sieve, but assuming that CFLAGS is unset by the ebuild when a Makefile uses CPU detection, this should catch them.
There surely is a thread in the forum dealing with cross-installing. |
|
Back to top |
|
|
Lemma Guru
Joined: 19 Apr 2002 Posts: 416 Location: Uppsala, Sweden
|
Posted: Wed Jul 30, 2003 2:48 pm Post subject: |
|
|
Ok, thx. I will try that as see what comes up _________________ Always make it as simple as possible, but no simpler
/Einstein |
|
Back to top |
|
|
Lemma Guru
Joined: 19 Apr 2002 Posts: 416 Location: Uppsala, Sweden
|
Posted: Tue Aug 12, 2003 11:35 am Post subject: |
|
|
Ok, done.
What I get is:
app-editors/emacs-cvs/emacs-cvs-21.3.50.ebuild: unset CFLAGS CPPFLAGS
app-editors/emacs-cvs/ChangeLog: leave debugging symbols, unset CFLAGS, CPPFLAGS
app-emulation/wine/wine-20030709.ebuild: unset CFLAGS CXXFLAGS
app-emulation/wine/ChangeLog: use strip-flags and remove unset CFLAGS CXXFLAGS
app-emulation/wine/ChangeLog: Replaced 'export C{XX}FLAGS=""' with 'unset CFLAGS CXXFLAGS'.
app-emulation/wine/wine-20030618-r1.ebuild: unset CFLAGS CXXFLAGS
app-emulation/hercules/hercules-2.17.1-r1.ebuild: unset CFLAGS ; unset CXXFLAGS
app-emulation/hercules/hercules-2.15.ebuild: unset CFLAGS ; unset CXXFLAGS
app-emulation/winex/ChangeLog: Replaced 'export C{XX}FLAGS=""' with 'unset CFLAGS CXXFLAGS'.
app-emulation/winex/ChangeLog: Fixed a typo (unset CFLAGS=""); patched tools/wineshelllink to use "winex"
app-emulation/nwwine/nwwine-20020703.ebuild: unset CFLAGS CXXFLAGS
app-emulation/nwwine/nwwine-20030618.ebuild: unset CFLAGS CXXFLAGS
app-emulation/nwwine/ChangeLog: Replaced 'export C{XX}FLAGS=""' with 'unset CFLAGS CXXFLAGS'.
app-office/lyx/lyx-1.3.2.ebuild: unset CFLAGS
app-office/lyx/lyx-1.3.2-r1.ebuild: unset CFLAGS
app-text/wv/wv-0.7.1.ebuild: unset CFLAGS
app-text/ggv/ggv-1.1.94.ebuild: unset CFLAGS
dev-java/sun-j2sdk/sun-j2sdk-1.4.0-r3.ebuild: unset CFLAGS CXXFLAGS
dev-java/sun-j2sdk/sun-j2sdk-1.4.1.ebuild: unset CFLAGS CXXFLAGS LDFLAGS
dev-java/sun-j2sdk/sun-j2sdk-1.4.1-r1.ebuild: unset CFLAGS CXXFLAGS LDFLAGS
dev-lang/wml/wml-2.0.9.ebuild: unset CFLAGS
dev-lang/swig/swig-1.3.16.ebuild: unset CFLAGS
dev-lang/swig/swig-1.3.10-r2.ebuild: unset CFLAGS
dev-lang/swig/swig-1.3.15.ebuild: unset CFLAGS
dev-lang/swig/swig-1.3.10-r1.ebuild: unset CFLAGS
dev-lang/swig/swig-1.3.19.ebuild: unset CFLAGS
dev-lisp/clisp/clisp-2.28.ebuild: unset CFLAGS
dev-lisp/clisp/clisp-2.29.ebuild: unset CFLAGS
eclass/gnustep.eclass: unset CFLAGS
media-libs/libdv/libdv-0.9.5-r1.ebuild: unset CFLAGS CXXFLAGS
media-libs/libdv/libdv-0.99.ebuild: unset CFLAGS CXXFLAGS
media-libs/libdv/libdv-0.98.ebuild: unset CFLAGS CXXFLAGS
media-libs/xine-lib/xine-lib-1_beta12-r1.ebuild: unset CFLAGS
media-libs/xine-lib/xine-lib-1_beta11.ebuild: unset CFLAGS
media-libs/xine-lib/xine-lib-1_rc0-r1.ebuild: unset CFLAGS
media-libs/xine-lib/xine-lib-1_beta10.ebuild: unset CFLAGS
media-libs/xine-lib/xine-lib-1_beta12.ebuild: unset CFLAGS
media-libs/libdvdcss/libdvdcss-1.2.5.ebuild: unset CFLAGS
media-libs/libdvdcss/libdvdcss-1.2.6.ebuild: unset CFLAGS
media-libs/libdvdcss/libdvdcss-1.2.8.ebuild: unset CFLAGS
media-libs/libdvdcss/libdvdcss-1.2.3.ebuild: unset CFLAGS
media-sound/glame/glame-0.6.3.ebuild: unset CFLAGS
media-sound/glame/ChangeLog: unset CFLAGS to fix possible problems with configure (bug #7587)
media-video/drip/drip-0.9.0_rc1.ebuild: unset CFLAGS CXXFLAGS
media-video/drip/drip-0.9.0_alpha3.ebuild: unset CFLAGS CXXFLAGS
media-video/mplayer/mplayer-0.90_rc4.ebuild: unset CFLAGS CXXFLAGS
media-video/mplayer/mplayer-0.90-r5.ebuild: unset CFLAGS CXXFLAGS
media-video/mplayer/mplayer-0.90-r2.ebuild: unset CFLAGS CXXFLAGS
media-video/avifile/avifile-0.7.32.20030219.ebuild: unset CFLAGS CXXFLAGS LDFLAGS CC CXX
media-video/avifile/avifile-0.7.37.20030522-r2.ebuild: unset CFLAGS CXXFLAGS LDFLAGS CC CXX
media-video/camserv/camserv-0.5.1-r2.ebuild: unset CFLAGS
media-video/camserv/camserv-0.5.1-r1.ebuild: unset CFLAGS
net-news/inn/inn-2.3.5.ebuild: unset CFLAGS CXXFLAGS
net-www/junkbuster/junkbuster-2.0.2.ebuild: unset CFLAGS
net-www/apache/apache-1.3.27-r3.ebuild: unset CFLAGS ; unset CXXFLAGS
net-www/apache/apache-1.3.27-r4.ebuild: unset CFLAGS ; unset CXXFLAGS
net-www/apache/apache-1.3.28.ebuild: unset CFLAGS ; unset CXXFLAGS
sys-apps/grub/grub-0.92-r1.ebuild: unset CFLAGS
sys-apps/grub/ChangeLog: grub-0.91-r1.ebuild: unset CFLAGS to ensure that GRUB code is i486-compatible,
sys-apps/grub/grub-0.93.20030118.ebuild: unset CFLAGS
sys-apps/tinylogin/tinylogin-1.4.ebuild: unset CFLAGS
sys-apps/busybox/busybox-0.60.5-r1.ebuild: unset CFLAGS
sys-apps/busybox/busybox-0.50.ebuild: unset CFLAGS
sys-devel/kgcc/kgcc-2.95.3.ebuild: unset CFLAGS
A few that are important for me but not many ,grub (can't live without ) wine, apache for some configurations. mplayer/xine and the libs that come with is (like decss) are not part of the codebase on my servers so no problem there. Thank's for making me aware of the problem! _________________ Always make it as simple as possible, but no simpler
/Einstein |
|
Back to top |
|
|
|