From owner-svn-src-all@FreeBSD.ORG Sun Jul 28 20:11:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C5389F37; Sun, 28 Jul 2013 20:11:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B223D28BF; Sun, 28 Jul 2013 20:11:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6SKBVhF084820; Sun, 28 Jul 2013 20:11:31 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6SKBVLA084819; Sun, 28 Jul 2013 20:11:31 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201307282011.r6SKBVLA084819@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 28 Jul 2013 20:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253755 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Sun, 28 Jul 2013 20:11:31 -0000 Author: bapt Date: Sun Jul 28 20:11:31 2013 New Revision: 253755 URL: http://svnweb.freebsd.org/changeset/base/253755 Log: Fix detection of arm ABIs Submitted by: andrew Obtained from: pkg git Modified: head/usr.sbin/pkg/config.c Modified: head/usr.sbin/pkg/config.c ============================================================================== --- head/usr.sbin/pkg/config.c Sun Jul 28 20:07:34 2013 (r253754) +++ head/usr.sbin/pkg/config.c Sun Jul 28 20:11:31 2013 (r253755) @@ -108,7 +108,7 @@ pkg_get_myabi(char *dest, size_t sz) Elf_Note note; Elf_Scn *scn; char *src, *osname; - const char *abi; + const char *abi, *fpu; GElf_Ehdr elfhdr; GElf_Shdr shdr; int fd, i, ret; @@ -187,13 +187,25 @@ pkg_get_myabi(char *dest, size_t sz) switch (elfhdr.e_machine) { case EM_ARM: + /* FreeBSD doesn't support the hard-float ABI yet */ + fpu = "softfp"; + if ((elfhdr.e_flags & 0xFF000000) != 0) { + /* This is an EABI file, the conformance level is set */ + abi = "eabi"; + } else if (elfhdr.e_ident[EI_OSABI] != ELFOSABI_NONE) { + /* + * EABI executables all have this field set to + * ELFOSABI_NONE, therefore it must be an oabi file. + */ + abi = "oabi"; + } else { + ret = 1; + goto cleanup; + } snprintf(dest + strlen(dest), sz - strlen(dest), ":%s:%s:%s", elf_corres_to_string(endian_corres, (int)elfhdr.e_ident[EI_DATA]), - (elfhdr.e_flags & EF_ARM_NEW_ABI) > 0 ? - "eabi" : "oabi", - (elfhdr.e_flags & EF_ARM_VFP_FLOAT) > 0 ? - "softfp" : "vfp"); + abi, fpu); break; case EM_MIPS: /*