NetBSD Problem Report #40199
From jmcneill@black.invisible.ca Tue Dec 16 12:59:53 2008
Return-Path: <jmcneill@black.invisible.ca>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by narn.NetBSD.org (Postfix) with ESMTP id 50B5E63BA1C
for <gnats-bugs@gnats.NetBSD.org>; Tue, 16 Dec 2008 12:59:53 +0000 (UTC)
Message-Id: <20081216125946.ABE987D806C@black.invisible.ca>
Date: Tue, 16 Dec 2008 07:59:46 -0500 (EST)
From: jmcneill@invisible.ca
Reply-To: jmcneill@invisible.ca
To: gnats-bugs@gnats.NetBSD.org
Subject: no 32-bit ldd on amd64 or sparc64
X-Send-Pr-Version: 3.95
>Number: 40199
>Category: toolchain
>Synopsis: no 32-bit ldd on amd64 or sparc64
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: mrg
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Dec 16 13:00:00 +0000 2008
>Closed-Date: Sun Jan 18 09:03:38 +0000 2009
>Last-Modified: Sun Jan 18 09:03:38 +0000 2009
>Originator: Jared D. McNeill
>Release: NetBSD 5.99.5
>Organization:
>Environment:
System: NetBSD black.invisible.ca 5.99.5 NetBSD 5.99.5 (GENERIC) #39: Mon Dec 15 20:56:04 EST 2008 jmcneill@black.invisible.ca:/export/home/jmcneill/branches/HEAD/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
/usr/bin/ldd on amd64 and sparc64 does not handle 32-bit binaries.
Some 3rd party software requires a functional ldd to build.
>How-To-Repeat:
$ uname -srm
NetBSD 5.99.5 amd64
$ ldd /usr/pkg32/bin/wine
ldd: /usr/pkg32/bin/wine: unrecognized file format
>Fix:
Workaround: Copy ldd from a 32-bit machine and install as
/usr/pkg32/bin/ldd.i386:
$ file /usr/pkg32/bin/ldd.i386
/usr/pkg32/bin/ldd.i386: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for NetBSD 4.0, not stripped
$ /usr/pkg32/bin/ldd.i386 /usr/pkg32/bin/wine
/usr/pkg32/bin/wine:
-lc.12 => /usr/lib/i386/libc.so.12
-lossaudio.0 => /usr/lib/i386/libossaudio.so.0
-li386.1 => /usr/lib/i386/libi386.so.1
-lwine.1 => /usr/pkg32/lib/libwine.so.1
-lpthread.0 => /usr/lib/i386/libpthread.so.0
Then fix any packages that call ldd to honour ${LDD} and set
LDD=/usr/pkg32/bin/ldd.i386 in mk.conf
>Release-Note:
>Audit-Trail:
From: Andrew Doran <ad@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: toolchain/40199: no 32-bit ldd on amd64 or sparc64
Date: Tue, 16 Dec 2008 13:14:57 +0000
> Then fix any packages that call ldd to honour ${LDD} and set
> LDD=/usr/pkg32/bin/ldd.i386 in mk.conf
Wouldn't it be easier to provide /usr/bin/i386/ldd and have the 64-bit ldd
call that?
Andrew
From: "Jared D. McNeill" <jmcneill@invisible.ca>
To: gnats-bugs@NetBSD.org
Cc: toolchain-manager@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: toolchain/40199: no 32-bit ldd on amd64 or sparc64
Date: Tue, 16 Dec 2008 08:17:33 -0500
Andrew Doran wrote:
> The following reply was made to PR toolchain/40199; it has been noted by GNATS.
>
> From: Andrew Doran <ad@netbsd.org>
> To: gnats-bugs@NetBSD.org
> Cc:
> Subject: Re: toolchain/40199: no 32-bit ldd on amd64 or sparc64
> Date: Tue, 16 Dec 2008 13:14:57 +0000
>
> > Then fix any packages that call ldd to honour ${LDD} and set
> > LDD=/usr/pkg32/bin/ldd.i386 in mk.conf
>
> Wouldn't it be easier to provide /usr/bin/i386/ldd and have the 64-bit ldd
> call that?
Yes, that's why this note is in the Workarounds: section.
From: Andrew Doran <ad@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: toolchain/40199: no 32-bit ldd on amd64 or sparc64
Date: Tue, 16 Dec 2008 13:32:40 +0000
Doh!
Responsible-Changed-From-To: toolchain-manager->mrg
Responsible-Changed-By: mrg@NetBSD.org
Responsible-Changed-When: Wed, 17 Dec 2008 18:14:45 +0000
Responsible-Changed-Why:
i'll take this one on, i've almost got 64 bit ldd working on 32/64 bit
objects at the same time.
From: matthew green <mrg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/40199 CVS commit: src/usr.bin/ldd
Date: Tue, 6 Jan 2009 03:59:57 +0000 (UTC)
Module Name: src
Committed By: mrg
Date: Tue Jan 6 03:59:57 UTC 2009
Modified Files:
src/usr.bin/ldd: Makefile
Added Files:
src/usr.bin/ldd: Makefile.common Makefile.elf ldd.c ldd.h ldd_aout.c
ldd_elfxx.c
src/usr.bin/ldd/aout: Makefile
src/usr.bin/ldd/elf32: Makefile
src/usr.bin/ldd/elf64: Makefile
Removed Files:
src/usr.bin/ldd/ldd_aout: Makefile ldd.c
src/usr.bin/ldd/ldd_elf: Makefile README ldd.c
Log Message:
- get rid of building an a.out-happy ldd (but keep supporting a.out
binaries for the ELF version.)
- convert a.out, elf32 and elf64 support into convience libraries and
link them right ones in. if elf_ldd() fails on 64 bit platforms,
try elf32_ldd() before aout_ldd().
now ldd on 64 bit platforms works for 32 bit binaries, aka PR#40199,
and it seems that all the issues from README are gone too.
To generate a diff of this commit:
cvs rdiff -r1.7 -r1.8 src/usr.bin/ldd/Makefile
cvs rdiff -r0 -r1.1 src/usr.bin/ldd/Makefile.common \
src/usr.bin/ldd/Makefile.elf src/usr.bin/ldd/ldd.h \
src/usr.bin/ldd/ldd_aout.c src/usr.bin/ldd/ldd_elfxx.c
cvs rdiff -r0 -r1.3 src/usr.bin/ldd/ldd.c
cvs rdiff -r0 -r1.1 src/usr.bin/ldd/aout/Makefile
cvs rdiff -r0 -r1.1 src/usr.bin/ldd/elf32/Makefile
cvs rdiff -r0 -r1.1 src/usr.bin/ldd/elf64/Makefile
cvs rdiff -r1.8 -r0 src/usr.bin/ldd/ldd_aout/Makefile
cvs rdiff -r1.20 -r0 src/usr.bin/ldd/ldd_aout/ldd.c
cvs rdiff -r1.17 -r0 src/usr.bin/ldd/ldd_elf/Makefile
cvs rdiff -r1.4 -r0 src/usr.bin/ldd/ldd_elf/README
cvs rdiff -r1.32 -r0 src/usr.bin/ldd/ldd_elf/ldd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->feedback
State-Changed-By: mrg@NetBSD.org
State-Changed-When: Tue, 06 Jan 2009 04:16:10 +0000
State-Changed-Why:
this should be fixed; please confirm.
From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/40199 CVS commit: [netbsd-5] src
Date: Fri, 16 Jan 2009 22:21:31 +0000 (UTC)
Module Name: src
Committed By: bouyer
Date: Fri Jan 16 22:21:31 UTC 2009
Modified Files:
src/gnu/usr.bin/binutils/ld [netbsd-5]: Makefile
src/libexec/ld.elf_so [netbsd-5]: headers.c map_object.c
src/libexec/ld.elf_so/arch/i386 [netbsd-5]: Makefile.inc
src/libexec/ld.elf_so/arch/sparc [netbsd-5]: Makefile.inc
src/rescue [netbsd-5]: Makefile list
src/usr.bin/ldd [netbsd-5]: Makefile
Added Files:
src/libexec/ld.elf_so/arch/i386 [netbsd-5]: Makefile.ld32
src/libexec/ld.elf_so/arch/sparc [netbsd-5]: Makefile.ld32
src/rescue [netbsd-5]: list.ldd
src/usr.bin/ldd [netbsd-5]: Makefile.common Makefile.elf dummy.c ldd.c
ldd.h ldd_aout.c ldd_elfxx.c
src/usr.bin/ldd/aout [netbsd-5]: Makefile
src/usr.bin/ldd/elf32 [netbsd-5]: Makefile
src/usr.bin/ldd/elf64 [netbsd-5]: Makefile
Removed Files:
src/usr.bin/ldd/ldd_aout [netbsd-5]: Makefile ldd.c
src/usr.bin/ldd/ldd_elf [netbsd-5]: Makefile README ldd.c
Log Message:
Pull up following revision(s) (requested by mrg in ticket #265):
libexec/ld.elf_so/headers.c: revision 1.27
rescue/list: revision 1.35
libexec/ld.elf_so/arch/sparc/Makefile.ld32: revision 1.1
usr.bin/ldd/Makefile.elf: revision 1.1
usr.bin/ldd/Makefile.elf: revision 1.2
usr.bin/ldd/ldd_aout/ldd.c: file removal
usr.bin/ldd/Makefile.elf: revision 1.3
libexec/ld.elf_so/arch/sparc/Makefile.inc: revision 1.12
usr.bin/ldd/dummy.c: revision 1.1
gnu/usr.bin/binutils/ld/Makefile: revision 1.28
usr.bin/ldd/elf32/Makefile: revision 1.1
usr.bin/ldd/elf32/Makefile: revision 1.2
usr.bin/ldd/ldd.c: revision 1.3
usr.bin/ldd/elf32/Makefile: revision 1.3
usr.bin/ldd/ldd_elf/Makefile: file removal
usr.bin/ldd/ldd.h: revision 1.1
usr.bin/ldd/ldd.c: revision 1.4
usr.bin/ldd/ldd_aout.c: revision 1.1
usr.bin/ldd/Makefile: revision 1.8
usr.bin/ldd/Makefile: revision 1.9
usr.bin/ldd/ldd_elfxx.c: revision 1.1
libexec/ld.elf_so/map_object.c: revision 1.37
usr.bin/ldd/ldd_aout/Makefile: file removal
usr.bin/ldd/elf64/Makefile: revision 1.1
rescue/Makefile: revision 1.22
libexec/ld.elf_so/arch/i386/Makefile.ld32: revision 1.1
usr.bin/ldd/ldd_elf/ldd.c: file removal
usr.bin/ldd/elf64/Makefile: revision 1.2
usr.bin/ldd/elf64/Makefile: revision 1.3
usr.bin/ldd/aout/Makefile: revision 1.1
libexec/ld.elf_so/arch/i386/Makefile.inc: revision 1.12
rescue/list.ldd: revision 1.1
usr.bin/ldd/ldd_elf/README: file removal
usr.bin/ldd/Makefile.common: revision 1.1
move the defines for RTLD_ARCH_SUBDIR into a sub-sub-makefile so we can
grab these values via reach-over more easily.
some fixes for PR#40170:
- set NATIVE=yes in the environment for genscripts.sh
- set LIB_PATH to /usr/lib/{sparc,i386} for those scripts
- set use_sysroot to "yes", to enable LIB_PATH to work in genscripts.sh
- get rid of building an a.out-happy ldd (but keep supporting a.out
binaries for the ELF version.)
- convert a.out, elf32 and elf64 support into convience libraries and
link them right ones in. if elf_ldd() fails on 64 bit platforms,
try elf32_ldd() before aout_ldd().
now ldd on 64 bit platforms works for 32 bit binaries, aka PR#40199,
and it seems that all the issues from README are gone too.
add some (uintptr_t) to some casts, so these compile with ELFSIZE=32
*and _LP64. necessary for 32/64 bit combo ldd support.
- rework this a bunch to make it work inside /rescue/ldd.
- fix alpha build.
make sure we set LIBISPRIVATE.
fixes build issues reported by moof.
make sure we set LIBISPRIVATE.
fixes build issues reported by moof.
To generate a diff of this commit:
cvs rdiff -r1.27 -r1.27.2.1 src/gnu/usr.bin/binutils/ld/Makefile
cvs rdiff -r1.26 -r1.26.10.1 src/libexec/ld.elf_so/headers.c
cvs rdiff -r1.36 -r1.36.4.1 src/libexec/ld.elf_so/map_object.c
cvs rdiff -r1.11 -r1.11.2.1 src/libexec/ld.elf_so/arch/i386/Makefile.inc
cvs rdiff -r0 -r1.1.2.2 src/libexec/ld.elf_so/arch/i386/Makefile.ld32
cvs rdiff -r1.11 -r1.11.2.1 src/libexec/ld.elf_so/arch/sparc/Makefile.inc
cvs rdiff -r0 -r1.1.2.2 src/libexec/ld.elf_so/arch/sparc/Makefile.ld32
cvs rdiff -r1.21 -r1.21.10.1 src/rescue/Makefile
cvs rdiff -r1.33 -r1.33.2.1 src/rescue/list
cvs rdiff -r0 -r1.1.2.2 src/rescue/list.ldd
cvs rdiff -r1.7 -r1.7.52.1 src/usr.bin/ldd/Makefile
cvs rdiff -r0 -r1.1.2.2 src/usr.bin/ldd/Makefile.common \
src/usr.bin/ldd/dummy.c src/usr.bin/ldd/ldd.h src/usr.bin/ldd/ldd_elfxx.c
cvs rdiff -r0 -r1.3.2.2 src/usr.bin/ldd/Makefile.elf
cvs rdiff -r0 -r1.2.12.1 src/usr.bin/ldd/ldd.c
cvs rdiff -r0 -r1.2.2.2 src/usr.bin/ldd/ldd_aout.c
cvs rdiff -r0 -r1.1.2.2 src/usr.bin/ldd/aout/Makefile
cvs rdiff -r0 -r1.4.2.2 src/usr.bin/ldd/elf32/Makefile
cvs rdiff -r0 -r1.4.2.2 src/usr.bin/ldd/elf64/Makefile
cvs rdiff -r1.8 -r0 src/usr.bin/ldd/ldd_aout/Makefile
cvs rdiff -r1.20 -r0 src/usr.bin/ldd/ldd_aout/ldd.c
cvs rdiff -r1.17 -r0 src/usr.bin/ldd/ldd_elf/Makefile
cvs rdiff -r1.4 -r0 src/usr.bin/ldd/ldd_elf/README
cvs rdiff -r1.32 -r0 src/usr.bin/ldd/ldd_elf/ldd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: feedback->closed
State-Changed-By: mrg@NetBSD.org
State-Changed-When: Sun, 18 Jan 2009 09:03:38 +0000
State-Changed-Why:
fixed and pulled up to -5.
>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-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.