Adding a MACHINE_ARCH note

Warner Losh imp at bsdimp.com
Tue Jul 9 14:19:51 UTC 2013


On Jul 9, 2013, at 2:07 AM, Andrew Turner wrote:

> I have been looking into an issue where it would be useful to know the
> value of MACHINE_ARCH a binary was built with, for example on ARM it
> could be arm or armv6 (or the big endian variants).
> 
> The reason for this is to teach pkg which arch the package is built for
> as there are a few differences between arm and armv6 that mean
> an executable built for one may not run on the other.
> 
> The attached patch stores the value of MACHINE_ARCH in a note so it can
> be read later to get this value. Does anyone have any objections to
> this patch, e.g. there is a better way of doing this?

I thought that the ELF headers gave us all the data we needed to know how things were built...

Warner



More information about the freebsd-arch mailing list