Subject: Re: C++ program handling in
To: None <>
From: Oleg Polyanski <>
List: tech-toolchain
Date: 01/03/2002 18:11:51

Jason R Thorpe <> writes:

>  >  One more question regarding the GCC 3.x and NetBSD. Do the
>  >  exceptions work in programs compiled with gcc-current? I have just
>  >  checked against gcc-current and it seems that they are still broken.
>  >  If you are interested in details, please have a look at the PR#4356
>  >  on `'.
> I just tried the attachment in the PR.  It seems to work fine on
> i386-unknown-netbsdelf on gcc-current (I have several NetBSD
> configuration changes that I have not yet submitted to the GCC
> folks, so maybe my compiler is behaving a bit differently than yours).
> dr-evil:thorpej 1103$ i386-unknown-netbsdelf-c++ exc.ii -o exc 
> dr-evil:thorpej 1104$ ./exc                                                    
> dr-evil:thorpej 1105$ 
> What version of NetBSD are you using?  You need to have crtbegin/crtend
> files that support DWARF2 exception handling...

 I'm using the most recent -current on ix86 platform that was last
 updated and recompiled on yesterday's evening. The same applies for
 gcc sources. The version numbers for `crtbegin.c' and `crtend.c'
 are `1.17' and `1.9' respectively. Just in case, I have also
 attached the `-v' compilation output for the test program from PR.

> It also works with NetBSD-current's GCC 2.95.3-based toolchain:
> dr-evil:thorpej 1105$ c++ exc.ii -o exc
> dr-evil:thorpej 1106$ ./exc
> dr-evil:thorpej 1107$ 

 Yes, it does with 2.95.x, but does not with 3.x.


Content-Type: application/octet-stream
Content-Disposition: attachment; filename=exc.compilation.log

Reading specs from /usr/local/gcc-3.1/lib/gcc-lib/i386-unknown-netbsdelf1.5Y/3.1/specs
Configured with: ../configure --prefix=/usr/local/gcc-3.1 --disable-checking : (reconfigured) 
Thread model: single
gcc version 3.1 20020102 (experimental)
 /usr/local/gcc-3.1/lib/gcc-lib/i386-unknown-netbsdelf1.5Y/3.1/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=0 -Di386 -D__NetBSD__ -D__ELF__ -D__i386__ -D__NetBSD__ -D__ELF__ -D__i386 -Asystem(unix) -Asystem(NetBSD) -D__NO_INLINE__ -D__STDC_HOSTED__=1 exc.C -D__GNUG__=3 -D__DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase exc.C -version -o /var/tmp//cctHKemI.s
GNU CPP version 3.1 20020102 (experimental) (cpplib) (NetBSD/i386 ELF target)
GNU C++ version 3.1 20020102 (experimental) (i386-unknown-netbsdelf1.5Y)
	compiled by GNU C version 2.95.3 20010315 (release).
ignoring nonexistent directory "/usr/local/gcc-3.1/i386-unknown-netbsdelf1.5Y/include"
#include "..." search starts here:
#include <...> search starts here:
End of search list.
 as -o /var/tmp//ccWDd6Li.o /var/tmp//cctHKemI.s
 /usr/local/gcc-3.1/lib/gcc-lib/i386-unknown-netbsdelf1.5Y/3.1/collect2 -m elf_i386 -dp -e __start -dy -dynamic-linker /usr/libexec/ld.elf_so -o exc /usr/lib/crt0.o /usr/lib/crtbegin.o -L/usr/local/gcc-3.1/lib/gcc-lib/i386-unknown-netbsdelf1.5Y/3.1 -L/usr/local/gcc-3.1/lib/gcc-lib/i386-unknown-netbsdelf1.5Y/3.1/../../.. /var/tmp//ccWDd6Li.o -lstdc++ -lm -lgcc -lc -lgcc /usr/lib/crtend.o