From owner-svn-src-all@FreeBSD.ORG Thu Sep 12 19:29:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B77C1123; Thu, 12 Sep 2013 19:29:14 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id 7BB702FD4; Thu, 12 Sep 2013 19:29:14 +0000 (UTC) Received: from bender.Home (97e5e46b.skybroadband.com [151.229.228.107]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 0CC285DFFE; Thu, 12 Sep 2013 19:29:06 +0000 (UTC) Date: Thu, 12 Sep 2013 20:29:00 +0100 From: Andrew Turner To: Nathan Whitehorn Subject: Re: svn commit: r255457 - head/usr.sbin/pkg Message-ID: <20130912202900.4eb17e6f@bender.Home> In-Reply-To: <522FE3A2.2090405@freebsd.org> References: <201309102056.r8AKu1rQ000442@svn.freebsd.org> <522FE3A2.2090405@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/NDatlV/4QluxpO6avFylBzL" Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2013 19:29:14 -0000 --MP_/NDatlV/4QluxpO6avFylBzL Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tue, 10 Sep 2013 22:29:38 -0500 Nathan Whitehorn wrote: > On 09/10/13 15:56, Baptiste Daroussin wrote: > > Author: bapt > > Date: Tue Sep 10 20:56:01 2013 > > New Revision: 255457 > > URL: http://svnweb.freebsd.org/changeset/base/255457 > > > > Log: > > Add support to detect arm vs armv6 > > > > There are two different versions of the ARM ABI depending on the > > TARGET_ARCH. As these are sligntly different a package built for > > one may not work on another. We need to detect which one we are > > on by parsing the .ARM.attributes section. > > > > This will only work on the ARM EABI as this section is part of > > the ABI definition. As armv6 only supports the ARM EABI this is not > > a problem for the oabi. > > > > Older versions of libelf in FreeBSD fail to read the > > .ARM.attributes section needed. As armv6 is unsupported on these > > versions we can assume we are running on arm. > > > > Picking a random commit: I don't suppose we can just use MACHINE_ARCH > for these identifiers? It encapsulates everything needed for > compatibility. -Nathan > > I have the attached patch to add a MACHINE_ARCH elf note. It would remove the need to parse the .ARM.attributes section. NetBSD is doing something similar to the patch where it appears they have a .note.netbsd.march section. Andrew --MP_/NDatlV/4QluxpO6avFylBzL Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=machine_arch_note.diff Index: lib/csu/common/crtbrand.c =================================================================== --- lib/csu/common/crtbrand.c (revision 252514) +++ lib/csu/common/crtbrand.c (working copy) @@ -64,3 +64,17 @@ .name = NOTE_FREEBSD_VENDOR, .desc = __FreeBSD_version }; + +static const struct { + int32_t namesz; + int32_t descsz; + int32_t type; + char name[sizeof(NOTE_FREEBSD_VENDOR)]; + char desc[sizeof(MACHINE_ARCH)]; +} archtag __attribute__ ((section (NOTE_SECTION), aligned(4))) __used = { + .namesz = sizeof(NOTE_FREEBSD_VENDOR), + .descsz = sizeof(MACHINE_ARCH), + .type = ARCH_NOTETYPE, + .name = NOTE_FREEBSD_VENDOR, + .desc = MACHINE_ARCH +}; Index: lib/csu/common/notes.h =================================================================== --- lib/csu/common/notes.h (revision 252514) +++ lib/csu/common/notes.h (working copy) @@ -34,5 +34,6 @@ #define ABI_NOTETYPE 1 #define CRT_NOINIT_NOTETYPE 2 +#define ARCH_NOTETYPE 3 #endif --MP_/NDatlV/4QluxpO6avFylBzL--