NetBSD Problem Report #51925
From www@NetBSD.org Sun Jan 29 21:13:30 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id C2E9F7A16B
for <gnats-bugs@gnats.NetBSD.org>; Sun, 29 Jan 2017 21:13:29 +0000 (UTC)
Message-Id: <20170129211328.C2DEE7A2AB@mollari.NetBSD.org>
Date: Sun, 29 Jan 2017 21:13:28 +0000 (UTC)
From: guillem@debian.org
Reply-To: guillem@debian.org
To: gnats-bugs@NetBSD.org
Subject: The sparc/sparc64 ports consider EM_SPARC32PLUS equivalent to EM_SPARCV9
X-Send-Pr-Version: www-1.0
>Number: 51925
>Category: port-sparc64
>Synopsis: The sparc/sparc64 ports consider EM_SPARC32PLUS equivalent to EM_SPARCV9
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: martin
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Jan 29 21:15:00 +0000 2017
>Closed-Date: Tue Jan 31 16:14:50 +0000 2017
>Last-Modified: Sun Feb 05 14:55:00 +0000 2017
>Originator: Guillem Jover
>Release: HEAD
>Organization:
Debian
>Environment:
>Description:
While implementing ABI matching based on the ELF header data in dpkg-shlibdeps, and checking how various implementations handled mapping the alternative or legacy ELF machine IDs. I noticed that the NetBSD sparc and sparc64 ports consider the EM_SPARC32PLUS to be equivalent to EM_SPARCV9 when the object is ELFCLASS64.
This seems wrong and inconsistent with any of the other implementations I've checked, including Linux, FreeBSD, OpenBSD, GNU binutils and LLVM.
It also does not seem like anything will emit that kind of ELF object? So it would seem safe to drop the equivalence?
The dpkg code, for which I've had to add the special casing is:
<https://anonscm.debian.org/cgit/dpkg/dpkg.git/tree/scripts/Dpkg/Shlibs/Objdump.pm#n216>
The NetBSD code involved is:
<http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/sparc/include/elf_machdep.h?rev=1.6.122.1&content-type=text/x-cvsweb-markup>
<http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/sparc64/include/elf_machdep.h?rev=1.11&content-type=text/x-cvsweb-markup>
in the MACHDEP_ID_CASES macros. In any case I thought I'd drop a bug in case you agree, and I can eventually remove that special case. :)
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: port-sparc64-maintainer->martin
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Tue, 31 Jan 2017 16:14:50 +0000
Responsible-Changed-Why:
Fixed, thanks for the report!
State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Tue, 31 Jan 2017 16:14:50 +0000
State-Changed-Why:
I fixed it
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/51925 CVS commit: src/sys/arch/sparc64/include
Date: Tue, 31 Jan 2017 16:13:56 +0000
Module Name: src
Committed By: martin
Date: Tue Jan 31 16:13:56 UTC 2017
Modified Files:
src/sys/arch/sparc64/include: elf_machdep.h
Log Message:
PR port-sparc64/51925: remove EM_SPARC32PLUS from the 64 bit ELF machine
ids we accept for our executables - that combination makes no sense
at all (probably copy&pasto).
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sparc64/include/elf_machdep.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Guillem Jover <guillem@debian.org>
To: gnats-bugs@NetBSD.org
Cc: martin@NetBSD.org, port-sparc64-maintainer@netbsd.org,
netbsd-bugs@netbsd.org, gnats-admin@netbsd.org
Subject: Re: port-sparc64/51925 (The sparc/sparc64 ports consider
EM_SPARC32PLUS equivalent to EM_SPARCV9)
Date: Thu, 2 Feb 2017 04:47:55 +0100
Hi!
On Tue, 2017-01-31 at 16:14:50 +0000, martin@NetBSD.org wrote:
> Synopsis: The sparc/sparc64 ports consider EM_SPARC32PLUS equivalent to EM_SPARCV9
>
> Responsible-Changed-From-To: port-sparc64-maintainer->martin
> Responsible-Changed-By: martin@NetBSD.org
> Responsible-Changed-When: Tue, 31 Jan 2017 16:14:50 +0000
> Responsible-Changed-Why:
> Fixed, thanks for the report!
>
>
> State-Changed-From-To: open->closed
> State-Changed-By: martin@NetBSD.org
> State-Changed-When: Tue, 31 Jan 2017 16:14:50 +0000
> State-Changed-Why:
> I fixed it
Thanks! But I see you only modified the sparc64 tree. A similar entry
can be found in the sparc port, and although that one will just
fall through to an error case (I assume), it seems confusing given the
comment underneath. Also I think this is what caused the issue in the
sparc64, as the sparc tree was imported as a clone initially? So
fixing this would probably also avoid further confusion. :)
For reference, I'm talking about the following code:
,--- sys/arch/sparc/include/elf_machdep.h ---
#define ELF64_MACHDEP_ENDIANNESS ELFDATA2MSB
#define ELF64_MACHDEP_ID_CASES \
case EM_SPARC32PLUS: \
case EM_SPARCV9: \
/* no 64-bit ELF machine types supported */
`---
Thanks,
Guillem
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/51925 CVS commit: src/sys/arch/sparc/include
Date: Thu, 2 Feb 2017 08:12:08 +0000
Module Name: src
Committed By: martin
Date: Thu Feb 2 08:12:08 UTC 2017
Modified Files:
src/sys/arch/sparc/include: elf_machdep.h
Log Message:
PR port-sparc64/51925: cosmetic cleanup, no functional change
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sparc/include/elf_machdep.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Martin Husemann <martin@duskware.de>
To: Guillem Jover <guillem@debian.org>
Cc: gnats-bugs@NetBSD.org
Subject: Re: port-sparc64/51925 (The sparc/sparc64 ports consider
EM_SPARC32PLUS equivalent to EM_SPARCV9)
Date: Thu, 2 Feb 2017 09:14:03 +0100
On Thu, Feb 02, 2017 at 04:47:55AM +0100, Guillem Jover wrote:
> Thanks! But I see you only modified the sparc64 tree. A similar entry
> can be found in the sparc port, and although that one will just
> fall through to an error case (I assume), it seems confusing given the
> comment underneath.
That was dead code, I just removed it.
It is very unlikely we would ever see a COMPAT_NETBSD64 on 32bit sparc
machines ;-}
Martin
From: matthew green <mrg@eterna.com.au>
To: Guillem Jover <guillem@debian.org>
Cc: martin@NetBSD.org, port-sparc64-maintainer@netbsd.org,
netbsd-bugs@netbsd.org, gnats-admin@netbsd.org,
gnats-bugs@NetBSD.org
Subject: re: port-sparc64/51925 (The sparc/sparc64 ports consider EM_SPARC32PLUS equivalent to EM_SPARCV9)
Date: Mon, 06 Feb 2017 01:53:32 +1100
ideally, the sparc* elf_machdep.h could be shared to avoid
having multiple versions of the mostly same thing.
.mrg.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.