LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Architecture confusion (https://www.linuxquestions.org/questions/programming-9/architecture-confusion-232185/)

elyk 09-18-2004 12:37 PM

Architecture confusion
 
:confused: Note how these commands disagree on what architecture I have...

Code:

# cat /proc/cpuinfo | grep Pentium
model name      : Intel(R) Pentium(R) 4 CPU 2.40GHz

# uname -a
Linux slackbox 2.6.8.1 #1 Tue Sep 7 16:27:09 CDT 2004 i686 unknown unknown GNU/Linux

# echo $HOSTTYPE
i486

# echo $MACHTYPE
i486-slackware-linux-gnu

I have been compiling a few programs and noticed that some of them have files called "config.sub" and "config.guess" (for example, with tvtime). So here's more confusion...

Code:

# ./config.guess
i686-pc-linux-gnu

config.sub looks like it tries to standardize these CPU-MANUFACTURER-OS strings, so I give it what I think mine should be...

Code:

# ./config.sub pentium4-slackware-linux-gnu
i786-slackware-linux-gnu

I've set $CHOST="i686-pc-linux-gnu" myself via /etc/profile before, so it looks like config.guess is getting its value from $CHOST. So now I change $CHOST="i786-slackware-linux-gnu" and try config.guess again, but it still gives i686-pc-linux-gnu. It must be getting its value from something else.

Now there's 4 different values for the architecture of my computer, i486, i686, i786, and pentium4. I think they should all be set to i786. Here's my questions:

1. Where does uname get the value for architecture type? What sets $HOSTTYPE and $MACHTYPE?

2. What are $HOSTTYPE and $MACHTYPE used for? Can I change the output from uname? If I change them, will that affect any programs?

3. How does config.guess find a value? What are config.sub and config.guess used for during compilation? (These are only included with some sources.) Does $CHOST override their values when I compile?

I'm really confused and I've done plenty of searching but I can't find a thing... :scratch:
-elyk

XavierP 09-18-2004 12:54 PM

Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.

Proud 09-18-2004 01:15 PM

FWIW I've never heard of i786, but i686 is anything >Pentium2/AMD K7 iirc.

Uname -a reveales what class the kernel was compiled for, so you should be safe to swap everything with i686. If you want even more specific processor optimisation you have to find the correct amd/pentium arch value.

elyk 09-18-2004 01:42 PM

So i686 is P2 and up, in the same way that i386 is just about any Intel processor (386 and up), sort of a least common denominator.

Here's what I've got for my kernel configuration:
Code:

$ grep -i pentium /boot/config
# CONFIG_MPENTIUMII is not set
# CONFIG_MPENTIUMIII is not set
# CONFIG_MPENTIUMM is not set
CONFIG_MPENTIUM4=y

This should give me the pentium4 optimizations for the kernel, so why does uname still give i686 instead of i786 or pentium4? Or did the kernel get the value from $CHOST (i686 when I compiled it)?

-elyk


All times are GMT -5. The time now is 12:55 AM.