Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Mar 2012 10:19:36 +0100
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        current@FreeBSD.org
Subject:   Re: ABI/architecture identification for packages
Message-ID:  <20120320091935.GF1692@azathoth.lan>
In-Reply-To: <20120319213508.GA1692@azathoth.lan>
References:  <20120319213508.GA1692@azathoth.lan>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Mon, Mar 19, 2012 at 10:35:08PM +0100, Baptiste Daroussin wrote:
> Hi all,
> 
> In order to identify architectures I need to find a uniq id for every
> possibilities (for pkgng)
> 
> here is the identification I propose:
> 
> arch-class-os-majorversion(-archi_specific_extension)
> 
> arch can be one of the following:
> 
> - x86 for i386 and amd64 (discussed with kib)
> - powerpc for powerpc and powerpc64
> - arm
> - mips
> - sparc
> 
> class may be:
> - 32 bits
> - 64 bits
> 
> os will always be freebsd :) (lower case)
> 
> majorversion the freebsd major version (10 9 8)
> 
> achi_specific_extension currently only mips and arm are concerned,
> for arm could be:
> el_oabi
> eb_oabi
> el_eabi
> eb_eabi
> 
> (I don't know how to get arm version or hardfp/softfp from the elf)
> 
> for mips I don't know much.
> 
> for ia64, I have strictly no idea what I should set.
> 
> Everything is read from the elf file
> 
> for example:
> x86-64-freebsd-10
> x86-32-freebsd-8
> arm-32-freebsd-10-el_oabi
> 
> Please help me to improve this to get the better identification to have the best
> possible to determine which package can be installed where.
> 
> while proposing information please tell me how to get the information
> (dynamically)
> 
> regards,
> Bapt

Another question (by rwatson) that comes here is should we keep the architecture
names that freebsd uses to avoid confusion or should we try to use more accurate
names?

powerpc-64-freebsd-9 -> powerpc64-64-freebsd-9
x86-32-freebsd-9 -> i386-32-freebsd-9
x86-64-freebsd-9 -> amd64-64-freebsd-9
etc.

An example of implementation can be find here:
https://github.com/pkgng/pkgng/blob/master/libpkg/pkg_elf.c#L157

PS: Feel free to submit fixes/improvements to the code :)

regards,
Bapt

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (FreeBSD)

iEYEARECAAYFAk9oS6cACgkQ8kTtMUmk6Ey4BACfeAlqrkyo0Llp+C/zAtHF6NAr
GtsAn3j6ghvoSMzCtwqZqq6V68FiEGcC
=o5y4
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120320091935.GF1692>