Adding a MACHINE_ARCH note

Peter Wemm peter at wemm.org
Wed Jul 10 00:54:03 UTC 2013


On Tue, Jul 9, 2013 at 5:40 PM, Adrian Chadd <adrian at freebsd.org> wrote:
> Someone pointed out there's dirty people running 32-bit binaries using
> the 64-bit intel/amd instruction set.
>
> Is this also able to represent that?

That would be "X32", so there's 3 x86 ABI variants:
i386 - 32 bit
amd64 - 32 bit
amd64 - 64 bit

Incidentally, pkgng has a issues with this.  For some reason it lumps
both i386 and amd64 into a single pseudo-arch called "x86" with a 32
and 64 bit variant.  It doesn't leave room for distinguishing the two
incompatible 32 bit architectures.

"x32" is where the compiler generates code where "long" and "pointer"
are 32 bit, but the instruction set is otherwise amd64 and has all 16
general purpose registers available.   "long long" is a 64 bit
register instead of a pair of 32 bit registers like on i386.

> -adrian
>
> On 9 July 2013 15:48, Andrew Turner <andrew at fubar.geek.nz> wrote:
>> On Tue, 9 Jul 2013 08:19:46 -0600
>> Warner Losh <imp at bsdimp.com> wrote:
>>> I thought that the ELF headers gave us all the data we needed to know
>>> how things were built...
>>
>> It will tell us if it was for e.g. an ARM or MIPS ELF file, but I'm not
>> sure how we can tell the difference between an arm and an armv6 ELF.
>>
>> With armv6 there are a few changes in the userland/kernel
>> interface, e.g. reading the thread local storage pointer is different
>> such that an armv6 static binary would not run on an ARMv5 core as it
>> uses newer instructions.
>>
>> Andrew
>> _______________________________________________
>> freebsd-arch at freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-arch
>> To unsubscribe, send any mail to "freebsd-arch-unsubscribe at freebsd.org"
> _______________________________________________
> freebsd-arch at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arch
> To unsubscribe, send any mail to "freebsd-arch-unsubscribe at freebsd.org"



-- 
Peter Wemm - peter at wemm.org; peter at FreeBSD.org; peter at yahoo-inc.com; KI6FJV
UTF-8: So you can \342\200\231 .. for when a ' just won't do
<brueffer> ZFS must be the bacon of file systems. "everything's better with ZFS"


More information about the freebsd-arch mailing list