NetBSD Problem Report #43044

From www@NetBSD.org  Tue Mar 23 10:21:33 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 6C9FE63B873
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 23 Mar 2010 10:21:33 +0000 (UTC)
Message-Id: <20100323102132.E28FC63B86C@www.NetBSD.org>
Date: Tue, 23 Mar 2010 10:21:32 +0000 (UTC)
From: dennis.c.ferguson@gmail.com
Reply-To: dennis.c.ferguson@gmail.com
To: gnats-bugs@NetBSD.org
Subject: linking powerpc64 gdbtui fails with undefine sim* references
X-Send-Pr-Version: www-1.0

>Number:         43044
>Category:       port-powerpc
>Synopsis:       linking powerpc64 gdbtui fails with undefine sim* references
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    port-powerpc-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 23 10:25:00 +0000 2010
>Closed-Date:    Sat Mar 27 19:47:33 +0000 2010
>Last-Modified:  Sat Mar 27 19:50:01 +0000 2010
>Originator:     Dennis Ferguson
>Release:        very recent 5.99.24
>Organization:
>Environment:
Darwin dennisbigmac.akit-ferguson.com 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov  3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386

>Description:
When doing a macppc64 build, linking gdbtui fails with
a bunch of undefined references to functions mostly
named sim_something(), i.e.:

#      link  gdbtui/gdbtui
[...]
/Users/dennis/NetBSD/5.0-current/src/gnu/usr.bin/gdb6/libgdb/obj/libgdb.a(remote-sim.o): In function `._initialize_remote_sim':
remote-sim.c:(.text+0x1d4): undefined reference to `.sim_stop'
remote-sim.c:(.text+0x454): undefined reference to `.sim_create_inferior'
remote-sim.c:(.text+0x584): undefined reference to `.sim_load'
remote-sim.c:(.text+0x654): undefined reference to `.sim_info'
remote-sim.c:(.text+0x870): undefined reference to `.sim_write'
remote-sim.c:(.text+0x894): undefined reference to `.sim_read'
remote-sim.c:(.text+0x9c4): undefined reference to `.sim_store_register'
/Users/dennis/NetBSD/5.0-current/src/gnu/usr.bin/gdb6/libgdb/obj/libgdb.a(remote-sim.o): In function `.one2one_register_sim_regno':
remote-sim.c:(.text+0xc38): undefined reference to `.sim_fetch_register'
remote-sim.c:(.text+0xe2c): undefined reference to `.sim_resume'
remote-sim.c:(.text+0xe54): undefined reference to `.sim_stop_reason'
remote-sim.c:(.text+0x1098): undefined reference to `.sim_close'
remote-sim.c:(.text+0x13bc): undefined reference to `.sim_open'
/Users/dennis/NetBSD/5.0-current/src/gnu/usr.bin/gdb6/libgdb/obj/libgdb.a(remote-sim.o): In function `.simulator_command':
remote-sim.c:(.text+0x1724): undefined reference to `.sim_do_command'
/Users/dennis/NetBSD/5.0-current/src/gnu/usr.bin/gdb6/libgdb/obj/libgdb.a(remote-sim.o):(.toc+0x2b0): undefined reference to `default_callback'
collect2: ld returned 1 exit status

*** Failed target:  gdbtui

>How-To-Repeat:
Do a:

    MACHINE=macppc64 ./build.sh distribution
>Fix:
The functions are all supposed to be in gdb's libsim.a,
which isn't included in the link.  The reason for this
is that while libsim.a's Makefile is willing to make
the library for powerpc64, gdbtui's Makefile forgets to
include the library when building for powerpc64.  The following
patch to src/gnu/usr.bin/gdb6/gdbtui/Makefile repairs the oversight.


Index: Makefile
===================================================================
RCS file: /cvsroot/src/gnu/usr.bin/gdb6/gdbtui/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- Makefile	3 Feb 2010 15:34:39 -0000	1.4
+++ Makefile	23 Mar 2010 07:41:45 -0000
@@ -45,7 +45,8 @@
 DPADD+= ${LIBGDBDIR}/libgdb.a

 # Simulator support
-.if ${MACHINE_ARCH} == powerpc || ${MACHINE_ARCH} == powerpcle
+.if ${MACHINE_ARCH} == powerpc || ${MACHINE_ARCH} == powerpcle || \
+    ${MACHINE_ARCH} == powerpc64
 SIMOBJ!=	cd ${.CURDIR}/../sim/ppc && ${PRINTOBJDIR}
 LDADD+=		-L${SIMOBJ} -lsim
 DPADD+=		${SIMOBJ}/libsim.a

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: mrg@NetBSD.org
State-Changed-When: Sat, 27 Mar 2010 19:47:33 +0000
State-Changed-Why:
i applied the gdbtui patch.  thanks!


From: matthew green <mrg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43044 CVS commit: src/gnu/usr.bin/gdb6/gdbtui
Date: Sat, 27 Mar 2010 19:46:58 +0000

 Module Name:	src
 Committed By:	mrg
 Date:		Sat Mar 27 19:46:58 UTC 2010

 Modified Files:
 	src/gnu/usr.bin/gdb6/gdbtui: Makefile

 Log Message:
 link in libsim on powerpc64 as well.
 from dennis.c.ferguson@gmail.com in PR#43044.


 To generate a diff of this commit:
 cvs rdiff -u -r1.4 -r1.5 src/gnu/usr.bin/gdb6/gdbtui/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(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.