Subject: hw.machine in compat mode
To: None <tech-kern@NetBSD.org>
From: Quentin Garnier <cube@NetBSD.org>
List: tech-kern
Date: 07/09/2004 22:18:59
--Signature=_Fri__9_Jul_2004_22_18_59_+0200_rOaQC1lWCllAapca
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Hi folks,

This morning I asked around about how we should handle hw.machine and
hw.machine_arch for compat modules, most notably for netbsd32.

Currently we only override hw.machine_arch, but I think it is wrong.

For example, on an i386, both uname -m and -p return 'i386', while on
amd64/compat_netbsd32, uname -m still returns 'amd64' and uname -p returns
'i386'.

It confuses packages and lead some (well, at least Mozilla Firefox's, the
one I tried today) configure scripts to try and build amd64 code, which is
not possible in a compat_netbsd32 environment (the i386 gcc doesn't allow
it).

First I thought that using 64 bits extensions in 32 bits mode was possible
on x86_64, so it would actually have made sense to have uname -a returning
'i386' and uname -p returning 'x86_64', so that application could even
know they can use 64 bits extensions (just like 16 bits applications can
use 32 bits registers and operands on ia32).

Unfortunately this is not possible so 'i386' for uname -p is ok.

I believe this is the same issue for sparc64, while sh5 is not really
affected since the emulated arch is still called sh5.

Adding an override for hw.machine is a piece of cake work, but are there
any objections about it?

[Just for the notice:  once hw.machine changed, firefox compiles but does
not install correctly because of missing POSIX timer support in
compat_netbsd32.]

-- 
Quentin Garnier - cube@NetBSD.org
The NetBSD Project - http://www.NetBSD.org/

--Signature=_Fri__9_Jul_2004_22_18_59_+0200_rOaQC1lWCllAapca
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (NetBSD)

iQEVAwUBQO79wtgoQloHrPnoAQJPyAf+PnSuVRcwCDXD0tUGIfeaq8ScGNE2ui2z
hbyqg/Gxs8UPyuYCZgc7pxBcfBq7eylPxrdHijpRlyrTN84N5UgpWswazmysKiL8
CJ4lcmBe5jrT9LXnLawpwBj1jbLuJ7Afy526U9uoEwSJwLITWQ4u480NcElygbwv
IfRhbhLqUHGIfWo+Tq60ulTxUPRuZA4W8EXAfjzSt+p4kfUkvtcJ7tzPoAnkCD8g
KykToJITdTUX4StPpfXMMDhyuaivimpsu80Bpoerpk78sWC1lNN/U5Z8K+r8MgyI
IJ6lz+fUNs1L6rXfjJks0e4UNCsYpYrKMnMNOTR1Vqi5BdkoLADt7w==
=Ypn4
-----END PGP SIGNATURE-----

--Signature=_Fri__9_Jul_2004_22_18_59_+0200_rOaQC1lWCllAapca--