Subject: pkg/10906: graphics/dx -- dxexec cannot resolve _cerr
To: None <gnats-bugs@gnats.netbsd.org>
From: Brook Milligan <brook@biology.nmsu.edu>
List: netbsd-bugs
Date: 08/28/2000 12:58:12
>Number:         10906
>Category:       pkg
>Synopsis:       graphics/dx -- dxexec cannot resolve _cerr
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 28 12:59:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Brook Milligan
>Release:        NetBSD-1.4<NetBSD-current source date>
>Organization:
Brook G. Milligan                      Internet:  brook@nmsu.edu
Department of Biology
New Mexico State University            Telephone:  (505) 646-7980
Las Cruces, New Mexico  88003  U.S.A.  FAX:        (505) 646-5665
>Environment:
	
System: NetBSD biology.nmsu.edu 1.4 NetBSD 1.4 (BIOLOGY) #0: Tue Nov 23 11:51:18 MST 1999 root@biology.nmsu.edu:/usr/src/sys/arch/i386/compile/BIOLOGY i386


>Description:
	
After compiling the graphics/dx package, program dxexec is not linked
against the libstdc++ library.  This causes the loader to complain of
unresolved references when it is executed.

The problem is that the configure script tests to see if libstdc++ is
required, but uses a compile command invoking c++.  That compiler
automatically adds libstdc++ to the library list, so the test
indicates that the library is not needed.  However, in the
src/exec/dxexec directory, dxexec is linked using cc not c++.
Consequently, libstdc++ is not automatically added to the libraries
and there are unresolved references.

The patch below replaces the link command with one that invokes c++
(as was tested by configure).  As a result, dxexec works.
>How-To-Repeat:
	<code/input/activities to reproduce the problem (multiple
lines)> Build the graphics/dx package.  (In case it matters even
though it shouldn't, my machine has installed the libg++ library which
is not a package dependency but might affect the configure script.)
Note that

	ldd .../src/exec/dxexec/dxexec

does not list libstdc++.  Try to execute the same file and note the
unresolved symbol errors.
>Fix:
	
Add this patch to the patches directory.

--- src/exec/dxexec/Makefile.in.orig	Wed Apr  5 13:01:12 2000
+++ src/exec/dxexec/Makefile.in	Mon Aug 28 13:19:24 2000
@@ -139,7 +139,8 @@
 CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+CXXLD = $(CXX)
+LINK = $(CXXLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
 DIST_COMMON =  Makefile.am Makefile.in
 
 
>Release-Note:
>Audit-Trail:
>Unformatted: