Subject: re: IMPORTANT: MACHINE_ARCH WRONG ON MIPS PLATFORMS
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: Todd Vierling <tv@pobox.com>
List: tech-toolchain
Date: 07/23/1998 13:39:09
On Thu, 23 Jul 1998, Jonathan Stone wrote:

: >${MACHINE_ARCH} defines a set of binary formats that are uniform across that
: >${MACHINE_ARCH}.  For example, all m68k bins are the same format, so they
: >all have the same ${MACHINE_ARCH} - m68k.
: 
: That's _one_ thing it does.

And a _very_ important one.  Read on.

: This comes up every so often.  I understand completely the invariant
: you are trying to keep, and yes, historically that's what
: $MACHINE_ARCH} was introduced to mean.  Unfortunately the meaning of
: ${MACHINE_ARCH} isn't _only_ the things above.  It's also used for
: things like ``what kind of toolchain is this'', ``what CPU
: architecture is this'', etc,. etc.

``what kind of toolchain is this''--isn't that what the original post was
about?  Detecting the proper type of toolchain?  (A little endian default
toolchain is /very/ different from a big endian default toolchain, even if
on the same chip.  Even ``what CPU architecture is this'' is different
between little and big endian.

So I compile a small program dynamically linked against libc on a
little-endian system.  I run it on a system with big-endian ld.elf_so,
kernel, and libraries.  Should it run fine?

If not, how are binary pkgs supposed to be uniquely created for the given
${MACHINE_ARCH}?  How are you supposed to automatically tell the difference
when building a toolchain or toolchain-dependent utility?

Regardless of the chip involved, a little endian system and a big endian
system are _not_ the same architecture.

: There's been opinions both ways on this issue, but IIRC last time it
: came up, the consenus was to leave $MACHINE_ARCH as "mips" for
: mips-cpu but endian-neutral tests, and endian-neutral mips-cpu set
: contents (header files, what else?) but to create "mipsel" and
: "mipseb" portions of the release(7).

Release binaries can be physically separated, but the issues above show that
${MACHINE_ARCH} is used for much more than just ``historical precedent''.

-- 
-- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)