From 63087a7dddb1a015af48d7e7cb42295329147edd Mon Sep 17 00:00:00 2001 From: drochner Date: Mon, 18 Jul 2011 21:48:03 +0000 Subject: [PATCH] let gcc-4.5 use dl_iterate_phdr (which has been present for a while) for exception handling rather than register_frame_info -- this is what other OSes are doing, and what is supposedly more efficient. committed generated files for i386 only --- external/gpl3/gcc/dist/gcc/config.gcc | 1 + external/gpl3/gcc/dist/gcc/config/t-netbsd | 5 +++++ external/gpl3/gcc/dist/gcc/crtstuff.c | 9 +++++++++ external/gpl3/gcc/dist/gcc/unwind-dw2-fde-glibc.c | 6 ++++++ external/gpl3/gcc/lib/crtstuff/arch/i386.mk | 2 +- external/gpl3/gcc/lib/libgcc/arch/i386.mk | 2 +- external/gpl3/gcc/usr.bin/gcc/arch/i386/configargs.h | 2 +- external/gpl3/gcc/usr.bin/gcc/arch/i386/defs.mk | 2 +- 8 files changed, 25 insertions(+), 4 deletions(-) diff --git a/external/gpl3/gcc/dist/gcc/config.gcc b/external/gpl3/gcc/dist/gcc/config.gcc index e638bfa407eb..e4ff3a3c303e 100644 --- a/external/gpl3/gcc/dist/gcc/config.gcc +++ b/external/gpl3/gcc/dist/gcc/config.gcc @@ -1133,6 +1133,7 @@ x86_64-*-freebsd*) ;; i[34567]86-*-netbsdelf*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h" + tmake_file="${tmake_file} i386/t-crtstuff" ;; i[34567]86-*-netbsd*) tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h netbsd.h netbsd-aout.h i386/netbsd.h" diff --git a/external/gpl3/gcc/dist/gcc/config/t-netbsd b/external/gpl3/gcc/dist/gcc/config/t-netbsd index 34949e12858c..4dadcf0f74d6 100644 --- a/external/gpl3/gcc/dist/gcc/config/t-netbsd +++ b/external/gpl3/gcc/dist/gcc/config/t-netbsd @@ -1,2 +1,7 @@ # Always build crtstuff with PIC. CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC + +# Use unwind-dw2-fde-glibc +LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \ + $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c +LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c diff --git a/external/gpl3/gcc/dist/gcc/crtstuff.c b/external/gpl3/gcc/dist/gcc/crtstuff.c index c44abb54d043..1e29c18de74e 100644 --- a/external/gpl3/gcc/dist/gcc/crtstuff.c +++ b/external/gpl3/gcc/dist/gcc/crtstuff.c @@ -88,6 +88,15 @@ call_ ## FUNC (void) \ # define USE_PT_GNU_EH_FRAME #endif +#if defined(OBJECT_FORMAT_ELF) \ + && !defined(OBJECT_FORMAT_FLAT) \ + && defined(HAVE_LD_EH_FRAME_HDR) \ + && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \ + && defined(__NetBSD__) +#include +# define USE_PT_GNU_EH_FRAME +#endif + #if defined(OBJECT_FORMAT_ELF) \ && !defined(OBJECT_FORMAT_FLAT) \ && defined(HAVE_LD_EH_FRAME_HDR) \ diff --git a/external/gpl3/gcc/dist/gcc/unwind-dw2-fde-glibc.c b/external/gpl3/gcc/dist/gcc/unwind-dw2-fde-glibc.c index b8a7312f5011..beec2cb820e5 100644 --- a/external/gpl3/gcc/dist/gcc/unwind-dw2-fde-glibc.c +++ b/external/gpl3/gcc/dist/gcc/unwind-dw2-fde-glibc.c @@ -57,6 +57,12 @@ # define USE_PT_GNU_EH_FRAME #endif +#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ + && defined(__NetBSD__) +# define ElfW(n) Elf_##n +# define USE_PT_GNU_EH_FRAME +#endif + #if defined(USE_PT_GNU_EH_FRAME) #ifndef __RELOC_POINTER diff --git a/external/gpl3/gcc/lib/crtstuff/arch/i386.mk b/external/gpl3/gcc/lib/crtstuff/arch/i386.mk index cd1ee97c1840..2ac599df3efd 100644 --- a/external/gpl3/gcc/lib/crtstuff/arch/i386.mk +++ b/external/gpl3/gcc/lib/crtstuff/arch/i386.mk @@ -4,7 +4,7 @@ # G_INCLUDES=-I. -I. -I${GNUHOSTDIST}/gcc -I${GNUHOSTDIST}/gcc/. -I${GNUHOSTDIST}/gcc/../include -I./../intl -I${GNUHOSTDIST}/gcc/../libcpp/include -I${GNUHOSTDIST}/gcc/../libdecnumber -I${GNUHOSTDIST}/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/include/libelf G_CRTSTUFF_CFLAGS=-O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -I. -I. -I${GNUHOSTDIST}/gcc -I${GNUHOSTDIST}/gcc/. -I${GNUHOSTDIST}/gcc/../include -I./../intl -I${GNUHOSTDIST}/gcc/../libcpp/include -I${GNUHOSTDIST}/gcc/../libdecnumber -I${GNUHOSTDIST}/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/include/libelf -g0 -finhibit-size-directive -fno-inline -fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize -G_CRTSTUFF_T_CFLAGS= +G_CRTSTUFF_T_CFLAGS= -fno-omit-frame-pointer -fno-asynchronous-unwind-tables G_tm_defines=NETBSD_ENABLE_PTHREADS G_xm_file= G_xm_defines= diff --git a/external/gpl3/gcc/lib/libgcc/arch/i386.mk b/external/gpl3/gcc/lib/libgcc/arch/i386.mk index c77ee20467a1..34a4648331e3 100644 --- a/external/gpl3/gcc/lib/libgcc/arch/i386.mk +++ b/external/gpl3/gcc/lib/libgcc/arch/i386.mk @@ -4,7 +4,7 @@ # G_INCLUDES=-I. -I. -I${GNUHOSTDIST}/gcc -I${GNUHOSTDIST}/gcc/. -I${GNUHOSTDIST}/gcc/../include -I./../intl -I${GNUHOSTDIST}/gcc/../libcpp/include -I${GNUHOSTDIST}/gcc/../libdecnumber -I${GNUHOSTDIST}/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/include/libelf G_LIB2ADD= -G_LIB2ADDEH=${GNUHOSTDIST}/gcc/unwind-dw2.c ${GNUHOSTDIST}/gcc/unwind-dw2-fde.c ${GNUHOSTDIST}/gcc/unwind-sjlj.c ${GNUHOSTDIST}/gcc/gthr-gnat.c ${GNUHOSTDIST}/gcc/unwind-c.c +G_LIB2ADDEH=${GNUHOSTDIST}/gcc/unwind-dw2.c ${GNUHOSTDIST}/gcc/unwind-dw2-fde-glibc.c ${GNUHOSTDIST}/gcc/unwind-sjlj.c ${GNUHOSTDIST}/gcc/gthr-gnat.c ${GNUHOSTDIST}/gcc/unwind-c.c G_LIB2ADD_ST= G_LIB1ASMFUNCS= G_LIB1ASMSRC= diff --git a/external/gpl3/gcc/usr.bin/gcc/arch/i386/configargs.h b/external/gpl3/gcc/usr.bin/gcc/arch/i386/configargs.h index bce5e1ea6845..15a4a8bf7b49 100644 --- a/external/gpl3/gcc/usr.bin/gcc/arch/i386/configargs.h +++ b/external/gpl3/gcc/usr.bin/gcc/arch/i386/configargs.h @@ -3,7 +3,7 @@ /* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ /* Generated automatically. */ -static const char configuration_arguments[] = "/usr/src3/tools/gcc/../../external/gpl3/gcc/dist/configure --target=i486--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb1 20110620' --enable-__cxa_atexit --with-arch=i486 --with-tune=nocona --with-mpc=/var/obj/i386/usr/src3/destdir.i386/usr --with-mpfr=/var/obj/i386/usr/src3/destdir.i386/usr --with-gmp=/var/obj/i386/usr/src3/destdir.i386/usr --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd5.99.48 --host=i486--netbsdelf : (reconfigured) /usr/src3/tools/gcc/../../external/gpl3/gcc/dist/configure --target=i486--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb1 20110620' --enable-__cxa_atexit --with-arch=i486 --with-tune=nocona --with-mpc=/var/obj/i386/usr/src3/destdir.i386/usr --with-mpfr=/var/obj/i386/usr/src3/destdir.i386/usr --with-gmp=/var/obj/i386/usr/src3/destdir.i386/usr --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd5.99.48 --host=i486--netbsdelf"; +static const char configuration_arguments[] = "/home/drochner/netbsd/work/tools/gcc/../../external/gpl3/gcc/dist/configure --target=i486--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb1 20110620' --enable-__cxa_atexit --with-arch=i486 --with-tune=nocona --with-mpc=//usr --with-mpfr=//usr --with-gmp=//usr --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=i386-unknown-netbsdelf5.99.54 --host=i486--netbsdelf"; static const char thread_model[] = "posix"; static const struct { diff --git a/external/gpl3/gcc/usr.bin/gcc/arch/i386/defs.mk b/external/gpl3/gcc/usr.bin/gcc/arch/i386/defs.mk index 8c858bcacdaa..095ffc4a2da5 100644 --- a/external/gpl3/gcc/usr.bin/gcc/arch/i386/defs.mk +++ b/external/gpl3/gcc/usr.bin/gcc/arch/i386/defs.mk @@ -42,7 +42,7 @@ G_tm_file_list=options.h ${GNUHOSTDIST}/gcc/config/vxworks-dummy.h ${GNUHOSTDIST G_build_xm_include_list=auto-build.h ansidecl.h G_lang_specs_files=${GNUHOSTDIST}/gcc/cp/lang-specs.h ${GNUHOSTDIST}/gcc/lto/lang-specs.h ${GNUHOSTDIST}/gcc/objc/lang-specs.h G_tm_p_include_list=config/i386/i386-protos.h tm-preds.h -G_LIB2ADDEHDEP=${GNUHOSTDIST}/gcc/unwind-generic.h unwind-pe.h unwind-dw2-fde.h unwind-dw2.h +G_LIB2ADDEHDEP= unwind-dw2-fde.h unwind-dw2-fde.c G_CXX_OBJS=cp-lang.o stub-objc.o call.o decl.o expr.o pt.o typeck2.o class.o decl2.o error.o lex.o parser.o ptree.o rtti.o typeck.o cvt.o except.o friend.o init.o method.o search.o semantics.o tree.o repo.o dump.o optimize.o mangle.o cp-objcp-common.o name-lookup.o cxx-pretty-print.o cp-gimplify.o tree-mudflap.o attribs.o c-common.o c-format.o c-pragma.o c-semantics.o c-lex.o c-dump.o i386-c.o c-pretty-print.o c-opts.o c-pch.o incpath.o c-ppoutput.o c-cppbuiltin.o prefix.o c-gimplify.o c-omp.o G_CXX_C_OBJS=attribs.o c-common.o c-format.o c-pragma.o c-semantics.o c-lex.o c-dump.o i386-c.o c-pretty-print.o c-opts.o c-pch.o incpath.o c-ppoutput.o c-cppbuiltin.o prefix.o c-gimplify.o c-omp.o G_F77_OBJS=