Subject: port-alpha/5605: c++ on alpha seems to be broken
To: None <gnats-bugs@gnats.netbsd.org>
From: Tim Rightnour <root@polaris.garbled.net>
List: netbsd-bugs
Date: 06/18/1998 02:52:53
>Number:         5605
>Category:       port-alpha
>Synopsis:       c++ on alpha seems to be broken
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jun 18 02:50:00 1998
>Last-Modified:
>Originator:     Tim Rightnour
>Organization:
Tim Rightnour    -  root@garbled.net
http://www.zynetwc.com/~garbled/garbled.html
>Release:        6/10/98<NetBSD-current source date>
>Environment:
	
System: NetBSD polaris 1.3 NetBSD 1.3 (POLARIS) #0: Thu Mar 26 13:17:18 MST 1998 root@polaris:/usr/src/sys/arch/i386/compile/POLARIS i386


>Description:
Using a 1.3.2 toolchain I can cause the following nightmare:

rigel# c++ test.c -lossaudio
test.c: In function `int main()':
test.c:6: warning: implicit declaration of function `int Setvolume(...)'
test.c: In function `int Setvolume(int)':
test.c:25: warning: implicit declaration of function `int close(...)'
/var/tmp/cc18393a1.o: In function `main':
test.c(.text+0x1c): undefined reference to `Setvolume'
test.c(.text+0x20): undefined reference to `Setvolume'
/var/tmp/cc18393a1.o: In function `Setvolume(int)':
test.c(.text+0xe0): undefined reference to `_oss_ioctl(int, unsigned long, void *)'
test.c(.text+0xe4): undefined reference to `_oss_ioctl(int, unsigned long, void *)'
test.c(.text+0x108): undefined reference to `_oss_ioctl(int, unsigned long, void *)'
test.c(.text+0x10c): undefined reference to `_oss_ioctl(int, unsigned long, void *)'

rigel# gcc test.c -lossaudio
rigel# 

As you can see, test.c linked with ossaudio under gcc works just fine, and
"as planned".  Trying to do the same thing with c++ causes undefined references
to perfectly valid calls within the library.  

	
>How-To-Repeat:
this tiny little snippet will jiggle the problem when compiled:
c++ foo.c -lossaudio

#include <soundcard.h>
main(){_oss_ioctl(1,1,1);}

compile with gcc foo.c -lossaudio to see the proper behavior.

(dont even try to run it, for obvious reasons)

	
>Fix:
Ummm...  ENOCLUE.
	
>Audit-Trail:
>Unformatted: