Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
(Solved)Wrong CHOST variable on a fresh install...?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
jaydoc
n00b
n00b


Joined: 04 Jan 2009
Posts: 61
Location: Miami, FL

PostPosted: Fri Jan 09, 2009 12:50 am    Post subject: (Solved)Wrong CHOST variable on a fresh install...? Reply with quote

the desktop on which I am installing Gentoo has an Intel core 2 duo processor. I am installing 32 bit gentoo on it.

the default CHOST values are set to, CHOST="i386-pc-linux-gnu". Shouldn't it be i686...?

CFLAGS="-O2 -mtune=i686 -pipe"
CXXFLAGS="-O2 -mtune=i686 -pipe"

these are the default CFLAGS.

If so, can I change the CHOST variable...? I saw a post in these forums saying that the CHOST variable could not be altered unless one was installing from a stage 1 tarball. IS that so? I went through the handbook that was written about this and it does caution one about some serious problems that could be anticipated, but I have a fresh install, on which I am yet to emerge anything.


Last edited by jaydoc on Fri Jan 09, 2009 11:56 pm; edited 1 time in total
Back to top
View user's profile Send private message
yabbadabbadont
Advocate
Advocate


Joined: 14 Mar 2003
Posts: 4791
Location: 2 exits past crazy

PostPosted: Fri Jan 09, 2009 1:04 am    Post subject: Reply with quote

I would guess that you downloaded the wrong stage3 tarball when you did your installation.
Back to top
View user's profile Send private message
jaydoc
n00b
n00b


Joined: 04 Jan 2009
Posts: 61
Location: Miami, FL

PostPosted: Fri Jan 09, 2009 1:09 am    Post subject: Reply with quote

stage3-x86-2008.0.bz2

That was the tarball I used. Isn't that the one for 32 bit x86 systems...?
Back to top
View user's profile Send private message
isilia
Apprentice
Apprentice


Joined: 25 Feb 2008
Posts: 177

PostPosted: Fri Jan 09, 2009 1:12 am    Post subject: Reply with quote

jaydoc wrote:
stage3-x86-2008.0.bz2

That was the tarball I used. Isn't that the one for 32 bit x86 systems...?


You want stage3-i686, not stage3-x86.

Gentoo Handbook wrote:
Most PC users should use the stage3-i686-2008.0.tar.bz2 stage3 archive. All modern PCs are considered i686. If you use an old machine, you can check the list of i686-compatible processors on Wikipedia. Old processors such as the Pentium, K5, K6, or Via C3 and similar require the more generic x86 stage3. Processors older than i486 are not supported.
Back to top
View user's profile Send private message
jaydoc
n00b
n00b


Joined: 04 Jan 2009
Posts: 61
Location: Miami, FL

PostPosted: Fri Jan 09, 2009 1:19 am    Post subject: Reply with quote

That was my mistake then...

Thanks for the quick reply.
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2605

PostPosted: Fri Jan 09, 2009 2:00 am    Post subject: Reply with quote

Just so you know for future reference, the x86 tarball is there for much older machines. These machines have processors that are based on the Pentium Pro or older.
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
zyko
l33t
l33t


Joined: 01 Jun 2008
Posts: 620
Location: Munich, Germany

PostPosted: Fri Jan 09, 2009 3:00 am    Post subject: Reply with quote

i386 is a correct identifier for a Core 2 Duo CPU -- i686 would have done as well, but it hopefully won't make a difference.

The CHOST variable in make.conf is passed to the configure script during compilation. Portage uses a wrapper named econf, which is just calling the normal configure script with some Gentoo-specific variables. One of those is --host=${CHOST}. This is mostly needed by the configure script to differentiate between hosts that are actually different, like i386-pc-linux versus sparc-sun-solaris versus mips-*-unknown etc...

On most occasions, configure does not need to differentiate between i386, i486 or higher. Most scripts use something like "i[3456]86-*-linux*" anyway, so they fit for all x86 hosts. There also are other ways to detect the actual host architecture for compile-time configuration.

CHOST should not affect the produced binaries in any significant way. CHOST does not affect optimization, only CFLAGS does that. There is no loss of l33tness because 3 < 6.

Does anybody know of a program that supports i686 but not i386 and that uses the CHOST variable to base this decision on? Does anybody know a program that produces different binaries for i386 versus i686 based on CHOST? I'd guess that >=99% of the Portage tree is not affected by i386 vs i686 in the CHOST variable.
Back to top
View user's profile Send private message
jaydoc
n00b
n00b


Joined: 04 Jan 2009
Posts: 61
Location: Miami, FL

PostPosted: Fri Jan 09, 2009 3:51 am    Post subject: Reply with quote

I did read this on the gentoo docs site, which seems to indicate some difference from the use of 686 vs 386

Quote:
There are certain situations where changing the CHOST is inevitable, e.g. if you want to upgrade to glibc 2.4 which only supports nptl and you find out that your CHOST is i386, which makes it impossible to use nptl. In this case, you don't have a lot of options, and changing CHOST is one of them.


Not that i know anything about Computer architecture, or programming or any such subject, though..! :roll:

Which is also why I would like some help on this as well....

Quote:
If you are using GCC 4.3 or higher, you can use the -march=core2 flag with your Intel Core2 Processor.


Does that mean I cannot use that CFLAG value system-wide...? How can I know what version of gcc I am using?
Back to top
View user's profile Send private message
yabbadabbadont
Advocate
Advocate


Joined: 14 Mar 2003
Posts: 4791
Location: 2 exits past crazy

PostPosted: Fri Jan 09, 2009 4:25 am    Post subject: Reply with quote

Just download the i686 stage file and reinstall your system. Then you won't have to worry about it.
Back to top
View user's profile Send private message
zyko
l33t
l33t


Joined: 01 Jun 2008
Posts: 620
Location: Munich, Germany

PostPosted: Fri Jan 09, 2009 4:30 am    Post subject: Reply with quote

You're right, glibc will produce the following message on CHOST="i386-*":

Quote:
i386 CHOSTs are no longer supported.
Chances are you don't actually want/need i386.
Please read http://www.gentoo.org/doc/en/change-chost.xml


I guess there's no way around it then.

Quote:
Does that mean I cannot use that CFLAG value system-wide...? How can I know what version of gcc I am using?


If you don't have gcc-4.3, you can't use -march=core2. Use -march=prescott or just leave it unchanged and upgrade to gcc-4.3.2.

You can check "gcc-config -l" or the first lines of "emerge --info" to find out which gcc you have.
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Fri Jan 09, 2009 3:08 pm    Post subject: Reply with quote

Hi, and if you want to use your Core 2 duo in 64 bits mode, then download the AMD64 Stage 3.

Since you have a Core 2 duo, you should go with a 64 bits installation, only to unleash the power of your processor :P
Back to top
View user's profile Send private message
jaydoc
n00b
n00b


Joined: 04 Jan 2009
Posts: 61
Location: Miami, FL

PostPosted: Fri Jan 09, 2009 3:52 pm    Post subject: Reply with quote

I would like to do that, but I was reading about it, and there still seems to be very little difference in speed for my usual uses of the computer, and also, from what I read, there still seems to be a wee bit less support for 64 bit linux, especially in Flash and such multimedia support. I had a bad experience with Ubuntu Ibex 64 bit, in which I could not get flash working at all, even though I tried all I could, which given my lack of computer expertise, was admittedly not much.

I have a more immediate problem... I did an emerge =sys-devel/gcc-4.3.2, to upgrade gcc, so that i could use the march=core2 option instead pf prescott. I did an env-update after that and then I did gcc-config -l
Quote:
gcc-config -l
[1] i686-pc-linux-gnu-4.1.2 *
[2] i686-pc-linux-gnu-4.3.2


emerge --info says,

Quote:
emerge --info
Portage 2.1.4.4 (default/linux/x86/2008.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.27-ARCH i686)
=================================================================
System uname: 2.6.27-ARCH i686 Intel(R) Core(TM)2 Duo CPU T5550 @ 1.83GHz
Timestamp of tree: Thu, 08 Jan 2009 02:20:01 +0000
app-shells/bash: 3.2_p17-r1
dev-lang/python: 2.4.4-r13
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox: 1.2.18.1-r2
sys-devel/autoconf: 2.61-r1
sys-devel/automake: 1.10.1
sys-devel/binutils: 2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool: 1.5.24
virtual/os-headers: 2.6.23-r3
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=core2 -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="candy distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.cites.uiuc.edu/pub/gentoo/ http://gentoo.osuosl.org/ http://gentoo.chem.wisc.edu/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1"
LINGUAS="en_US"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"


Is my version of gcc updated...? Can I safely use march=core2...?
Back to top
View user's profile Send private message
Raniz
l33t
l33t


Joined: 13 Sep 2003
Posts: 967
Location: Varberg, Sweden

PostPosted: Fri Jan 09, 2009 4:27 pm    Post subject: Reply with quote

I'm running a 64bit multilib system and I've had no troubles at all with flash and other 32bit only stuff (like wine and zsnes).
The multilib profile takes care of everything for you, no need to worry and it just works :)
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Fri Jan 09, 2009 6:25 pm    Post subject: Reply with quote

jaydoc wrote:
I did an emerge =sys-devel/gcc-4.3.2, to upgrade gcc, so that i could use the march=core2 option instead pf prescott. I did an env-update after that and then I did gcc-config -l
...
Is my version of gcc updated...? Can I safely use march=core2...?

No, not yet.

You should switch to the new gcc like this.
Code:
# gcc-config -f 2
# source /etc/profile

Now -march=core2 will work properly, and "emerge --info" will show the right thing.

Once you are comfortable with that, you can remove the old compiler like this.
Code:
# emerge --prune --ask sys-devel/gcc
Back to top
View user's profile Send private message
jaydoc
n00b
n00b


Joined: 04 Jan 2009
Posts: 61
Location: Miami, FL

PostPosted: Fri Jan 09, 2009 6:41 pm    Post subject: Reply with quote

Yes cyrillic...!

I got direct proof of that..! I tried emerging some packages, and the repeated error was that it could not be compiled... I searched around a bit, and got the idea that this sort of error was due to improper CFLAGS, so I went ahead and changed CFlags back to prescott and they worked.

Saw your post and tried doing what you said, and changed to core2 and there is no error this time when I am (rather, gcc is :wink:)compiling something. Thanks so much. I get the jitters when I see code running on the screen like it does on The Matrix.. More comfortable with those gaping wounds that I repair sometimes...! :)


@raniz... I am too much a novice at all this, to be able to troubleshoot something if it turns out wrong, so I prefer to stay with the tried and tested, but one day I will take the plunge into AMD64 :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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