Alan McKinnon wrote:

> Interestingly, Ubuntu has always built for basic arches, and they seem to
> get away with it.
>
> IIRC they are now on i586 but for the longest time used i386. No
> performance issues. You might want to investigate how they do
> their builds and see if you can use their tricks.

The question is, I guess, if the target host, when of the same arch (i.e.
i[3456]86) does actually have any influence on the code that gets
generated in terms of performance or ability to run on other sub-arches.
This is what I really couldn't find out so far and would find highly
interesting to know.

For example, why not just go (and stay) with CHOST="i386-pc-linux-gnu" and
on an i686 machine, set march or mcpu = i686 via CFLAGS if you want to
optimize for the particular subarch at hand? Why should it be necessary /
what would the (dis)advantages be of of such a setup vs. also having CHOST
set to "i686-pc-linux-gnu"?

Concering the Gentoo doc about changing the CHOST that was mentioned: Yep,
I've read that. If I understood it correctly, problems when changing CHOST
mainly seem to arise because of the way GCC and related basic build utils
install themselves (using the host triplet as part of their path or
executable name), leaving wrong / messed up references when changing the
CHOST.

For example, as I've said previously, the CHOST value gets passed to
./configure as --host for each package that gets build. That would make
configure try to select a compiler called <CHOST>-gcc in order to compile
the package, i.e. when CHOST is i486-pc-linux-gnu, a compiler called
i486-pc-linux-gnu-gcc would be used. Include file directories for glibc
and / or glibc itself sems to be selected by a similiar mechanism. All
right, no problem, so far this only determines how things are called and
where they are located, but are there any other "real" effects of all this
stuff?

The Gentoo CHOST document that was mentioned says something about nptl not
being available on i386. If true, and if the host variable generally
influences the availability of features, things would slowly start to make
sens as to why the CHOST might be important. On the other hand, I've read
through some documentation of the GNU C library (glibc) and didn't even
find anything about nptl not being available on i386, not to mention
anything else about different features on different subarches.

You see, I'm probably not entirely "getting it" yet. ;-)

Greetings,
Nils


Reply via email to