public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [build] Move unwinder to toplevel libgcc
@ 2011-06-20 12:44 Rainer Orth
  2011-06-20 15:21 ` Joseph S. Myers
  2011-06-29 10:05 ` [build] " Paolo Bonzini
  0 siblings, 2 replies; 36+ messages in thread
From: Rainer Orth @ 2011-06-20 12:44 UTC (permalink / raw)
  To: gcc-patches
  Cc: Paolo Bonzini, Ralf Wildenhues, Ian Lance Taylor,
	Joseph S. Myers, Steve Ellcey, Richard Earnshaw,
	Ramana Radhakrishnan, Nick Clifton, Douglas Rupp,
	Tristan Gingold, Mike Stump, Kaz Kojima, David Edelsohn,
	Sterling Augustine, Arnaud Charlet, java-patches, Nicola Pero,
	libstdc++,
	Richard Sandiford

As the next step in moving libgcc parts to toplevel libgcc, this patch
moves unwinder-related files and configuration.  Since the patch affects
many parts of the compiler and targets I cannot test, I'm liberally
copying the affected maintainers.

Overall, what the patch does is simple:

* Move all settings of LIB2ADDEH* and referenced files to libgcc.

* Likewise for UNWIND_H.

* Since libunwind is tightly tangled into the unwinder, I'm moving that, too.

* Move all remaining unwinder-only macros to libgcc: UNW_IVMS_MODE,
  MD_UNW_COMPATIBLE_PERSONALITY_P, MD_FROB_UPDATE_CONTEXT.

* Some target libraries refer to unwinder headers other than unwind.h,
  which now only live in libgcc.  Those references must be adapted.

A few issues bear comment:

* There are several users of unwind-dw2-fde-glibc.c, on Linux, FreeBSD,
  and Solaris.  Rather than replicate the relevant file list in several
  places, I'm using a new t-eh-dw2-dip instead.  The ...-dip refers to
  dl_iterate_phdr, since there's nothing glibc-specific about the file.
  I'm renaming the source file itself to unwind-dw2-fde-dip.c for
  consistency.

* Large parts of the compiler refer to unwind.h and expect it to live in
  gcc.  To avoid invasive changes, I'm backcopying that file from libgcc
  to gcc, just like the crt files and libgcc itself.

* UNW_IVMS_MODE and MD_UNW_COMPATIBLE_PERSONALITY_P are VMS/ia64 only.
  I'm moving their definitions to vms-unwind.h and include
  md-unwind-support.h in the users.

* gcc/config/sh/t-sh builds an alternate libgcc.  This stuff seemed far
  too involved to touch, so I'm referring to unwind-dw2.c in the libgcc
  sources.

* The only unwinder-related macro I haven't moved is
  LIBGCC2_UNWIND_ATTRIBUTE.  It is only defined gcc/config/mips/mips.h.
  I suppose we would need a libgcc equivalent of tm.h for that,
  something I didn't want to attack at this point.

This patch has been bootstrapped without regressions on
i386-pc-solaris2.11, a slightly earlier version on {i386,
sparc}-*-solaris2.{8, 9, 10, 11}.

I'd appreciate comments, testing on the affected platforms, and approval :-)

Thanks.
	Rainer

2011-06-12  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc:
	* Makefile.in (UNWIND_H): Remove.
	(LIB2ADDEH, LIB2ADDEHSTATIC, LIB2ADDEHSHARED): Move to
	../libgcc/Makefile.in.
	(LIBUNWIND, SHLIBUNWIND_LINK, SHLIBUNWIND_INSTALL): Likewise.
	(LIBUNWINDDEP): Remove.
	(libgcc-support): Remove LIB2ADDEH, $(srcdir)/emutls.c dependencies.
	(libgcc.mvars): Remove LIB2ADDEH, LIB2ADDEHSTATIC, LIB2ADDEHSHARED,
	LIBUNWIND, SHLIBUNWIND_LINK, SHLIBUNWIND_INSTALL.
	(stmp-int-hdrs): Remove $(UNWIND_H) dependency.
	Don't copy $(UNWIND_H).
	* config.gcc (ia64*-*-linux*): Remove with_system_libunwind
	handling.
	* configure.ac (GCC_CHECK_UNWIND_GETIPINFO): Remove.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* emutls.c, unwind-c.c, unwind-compat.c, unwind-compat.h,
	unwind-dw2-fde-compat.c, unwind-dw2-fde-darwin.c,
	unwind-dw2-fde-glibc.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
	unwind-dw2.c, unwind-dw2.h, unwind-generic.h, unwind-pe.h,
	unwind-sjlj.c, unwind.inc: Move to ../libgcc.
	* config/arm/libunwind.S, config/arm/pr-support.c,
	config/arm/unwind-arm.c, config/arm/unwind-arm.h: Move to
	../libgcc/config/arm.
	* config/arm/t-bpabi (UNWIND_H, LIB2ADDEH): Remove.
	* config/arm/t-symbian (UNWIND_H, LIB2ADDEH): Remove.
	* config/frv/t-frv ($(T)frvbegin$(objext)): Use
	$(srcdir)/../libgcc to refer to unwind-dw2-fde.h.
	($(T)frvend$(objext)): Likewise.
	* config/ia64/t-glibc (LIB2ADDEH): Remove.
	* config/ia64/t-glibc-libunwind: Move to ../libgcc/config/ia64.
	* config/ia64/fde-glibc.c, config/ia64/fde-vms.c,
	config/ia64/unwind-ia64.c, config/ia64/unwind-ia64.h: Move to
	../libgcc/config/ia64.
	* config/ia64/t-hpux (LIB2ADDEH): Remove.
	* config/ia64/t-ia64 (LIB2ADDEH): Remove.
	* config/ia64/t-vms (LIB2ADDEH): Remove.
	* config/ia64/vms.h (UNW_IVMS_MODE,
	MD_UNW_COMPATIBLE_PERSONALITY_P): Remove.
	* config/picochip/t-picochip (LIB2ADDEH): Remove.
	* config/rs6000/aix.h (R_LR, MD_FROB_UPDATE_CONTEXT): Remove.
	* config/rs6000/t-darwin (LIB2ADDEH): Remove.
	* config/rs6000/darwin-fallback.c: Move to ../libgcc/config/rs6000.
	* config/sh/t-sh ($(T)unwind-dw2-Os-4-200.o): Use
	$(srcdir)/../libgcc to refer to unwinder sources.
	* config/spu/t-spu-elf (LIB2ADDEH): Remove.
	* config/t-darwin (LIB2ADDEH): Remove.
	* config/t-freebsd (LIB2ADDEH): Remove.
	* config/t-libunwind (LIB2ADDEH, LIB2ADDEHSTATIC): Remove.
	* config/t-linux (LIB2ADDEH): Remove.
	* config/t-sol2 (LIB2ADDEH): Remove.
	* config/xtensa/t-xtensa (LIB2ADDEH): Remove.

	gcc/po:
	* EXCLUDES (unwind-c.c, unwind-dw2-fde-darwin.c,
	unwind-dw2-fde-glibc.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
	unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h): Remove.

	libgcc:
	* Makefile.in (LIB2ADDEH, LIB2ADDEHSTATIC, LIB2ADDEHSHARED): New
	variables.
	(LIBUNWIND, SHLIBUNWIND_LINK, SHLIBUNWIND_INSTALL): New variables.
	(LIB2ADDEH, LIB2ADDEHSTATIC, LIB2ADDEHSHARED): Add $(srcdir)/emutls.c.
	(install-unwind_h): New target.
	(all): Depend on it.
	* config.host (unwind_header): New variable.
	(*-*-freebsd*): Set tmake_file to t-eh-dw2-dip.
	(*-*-linux*, frv-*-*linux*, *-*-kfreebsd*-gnu, *-*-knetbsd*-gnu,
	*-*-gnu*): Likewise, also for *-*-kopensolaris*-gnu.
	(*-*-solaris2*): Add t-eh-dw2-dip to tmake_file.
	(arm*-*-linux-*eabi, arm*-*-uclinux*eabi, arm*-*-eabi*): Add
	arm/t-bpabi to tmake_file.
	Set unwind_header.
	(arm*-*-symbianelf*): Add arm/t-symbian to tmake_file.
	Set unwind_header.
	(ia64*-*-elf*, ia64*-*-freebsd*): Add ia64-t/eh-ia64 to tmake_file.
	(ia64*-*-linux*): Add ia64/t-glibc, ia64/t-eh-ia64 t-libunwind to
	tmake_file.
	Add t-libunwind-elf, ia64/t-glibc-libunwind unless
	$with_system_libunwind.
	(ia64*-*-hpux*): Set tmake_file.
	(ia64-hp-*vms*): Add ia64/t-eh-ia64 to tmake_file.
	(picochip-*-*): Set tmake_file.
	(rs6000-ibm-aix4.[3456789]*, powerpc-ibm-aix4.[3456789]*): Set
	md_unwind_header.
	(rs6000-ibm-aix5.1.*, powerpc-ibm-aix5.1.*): Likewise.
	(rs6000-ibm-aix[56789].*, powerpc-ibm-aix[56789].*): Likewise.
	(s390x-ibm-tpf*): Add t-eh-dw2-dip to tmake_file.
	(xtensa*-*-elf*, xtensa*-*-linux*): Set tmake_file.
	* configure.ac: Include ../config/unwind_ipinfo.m4.
	Call GCC_CHECK_UNWIND_GETIPINFO.
	Link unwind.h to $unwind_header.
	* configure: Regenerate.
	* emutls.c, unwind-c.c, unwind-compat.c, unwind-compat.h,
	unwind-dw2-fde-compat.c, unwind-dw2-fde-darwin.c,
	unwind-dw2-fde-dip.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
	unwind-dw2.c, unwind-dw2.h, unwind-generic.h, unwind-pe.h,
	unwind-sjlj.c, unwind.inc: New files.
	* config/arm/libunwind.S, config/arm/pr-support.c,
	config/arm/t-bpabi, config/arm/t-symbian, config/arm/unwind-arm.c,
	config/arm/unwind-arm.h,: New files.
	* config/ia64/fde-glibc.c, config/ia64/fde-vms.c,
	config/ia64/t-eh-ia64, config/ia64/t-glibc,
	config/ia64/t-glibc-libunwind, config/ia64/t-hpux,
	config/ia64/t-vms, config/ia64/unwind-ia64.c,
	config/ia64/unwind-ia64.h: New files.
	* config/picochip/t-picochip: New file.
	* config/rs6000/aix-unwind.h, config/rs6000/darwin-fallback.c: New
	files.
	* config/s390/t-tpf (LIB2ADDEH): Remove.
	* config/t-darwin: New file.
	* config/t-eh-dw2-dip: New file.
	* config/t-sol2 (LIB2ADDEH): Remove.
	* config/extensa/t-xtensa: New file.

	gcc/ada:
	* gcc-interface/Makefile.in (raise-gcc.o): Search
	$(srcdir)/../libgcc.

	libgo:
	* Makefile.am (AM_CFLAGS): Search $(srcdir)/../libgcc.
	* Makefile.in: Regenerate.

	libjava:
	* configure.ac (GCC_UNWIND_INCLUDE): Rename to
	LIBGCC_UNWIND_INCLUDE.
	Point to $(multi_basedir)/./libjava/../libgcc.
	* configure: Regenerate.
	* Makefile.am (GCC_UNWIND_INCLUDE): Reflect this.
	* Makefile.in: Regenerate.

	libobjc:
	* Makefile.in (INCLUDES): Search
	$(srcdir)/$(MULTISRCTOP)../libgcc.

	libstdc++-v3:
	* acinclude.m4 (GLIBCXX_EXPORT_INCLUDES): Point TOPLEVEL_INCLUDES
	to $(toplevel_srcdir)/libgcc.
	* configure: Regenerate.

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -377,8 +377,6 @@ USER_H = $(srcdir)/ginclude/float.h \
 USER_H_INC_NEXT_PRE = @user_headers_inc_next_pre@
 USER_H_INC_NEXT_POST = @user_headers_inc_next_post@
 
-UNWIND_H = $(srcdir)/unwind-generic.h
-
 # The GCC to use for compiling crt*.o.
 # Usually the one we just built.
 # Don't use this as a dependency--use $(GCC_PASSES).
@@ -741,18 +739,6 @@ CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(IN
   -fno-stack-protector \
   $(INHIBIT_LIBC_CFLAGS)
 
-# Additional sources to handle exceptions; overridden by targets as needed.
-LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
-   $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
-LIB2ADDEHSTATIC = $(LIB2ADDEH)
-LIB2ADDEHSHARED = $(LIB2ADDEH)
-
-# Don't build libunwind by default.
-LIBUNWIND =
-LIBUNWINDDEP =
-SHLIBUNWIND_LINK =
-SHLIBUNWIND_INSTALL =
-
 # nm flags to list global symbols in libgcc object files.
 SHLIB_NM_FLAGS = -pg
 
@@ -1976,7 +1962,7 @@ GCC_EXTRA_PARTS := $(sort $(EXTRA_MULTIL
 
 libgcc-support: libgcc.mvars stmp-int-hdrs $(TCONFIG_H) \
 	$(MACHMODE_H) $(FPBIT) $(DPBIT) $(TPBIT) $(LIB2ADD) \
-	$(LIB2ADD_ST) $(LIB2ADDEH) $(srcdir)/emutls.c gcov-iov.h $(SFP_MACHINE)
+	$(LIB2ADD_ST) gcov-iov.h $(SFP_MACHINE)
 
 libgcc.mvars: config.status Makefile $(LIB2ADD) $(LIB2ADD_ST) specs \
 		xgcc$(exeext)
@@ -1988,13 +1974,7 @@ libgcc.mvars: config.status Makefile $(L
 	echo LIBGCOV = '$(LIBGCOV)' >> tmp-libgcc.mvars
 	echo LIB2ADD = '$(call srcdirify,$(LIB2ADD))' >> tmp-libgcc.mvars
 	echo LIB2ADD_ST = '$(call srcdirify,$(LIB2ADD_ST))' >> tmp-libgcc.mvars
-	echo LIB2ADDEH = '$(call srcdirify,$(LIB2ADDEH) $(srcdir)/emutls.c)' >> tmp-libgcc.mvars
-	echo LIB2ADDEHSTATIC = '$(call srcdirify,$(LIB2ADDEHSTATIC) $(srcdir)/emutls.c)' >> tmp-libgcc.mvars
-	echo LIB2ADDEHSHARED = '$(call srcdirify,$(LIB2ADDEHSHARED) $(srcdir)/emutls.c)' >> tmp-libgcc.mvars
 	echo LIB2_SIDITI_CONV_FUNCS = '$(LIB2_SIDITI_CONV_FUNCS)' >> tmp-libgcc.mvars
-	echo LIBUNWIND = '$(call srcdirify,$(LIBUNWIND))' >> tmp-libgcc.mvars
-	echo SHLIBUNWIND_LINK = '$(SHLIBUNWIND_LINK)' >> tmp-libgcc.mvars
-	echo SHLIBUNWIND_INSTALL = '$(SHLIBUNWIND_INSTALL)' >> tmp-libgcc.mvars
 	echo FPBIT = '$(FPBIT)' >> tmp-libgcc.mvars
 	echo FPBIT_FUNCS = '$(FPBIT_FUNCS)' >> tmp-libgcc.mvars
 	echo LIB2_DIVMOD_FUNCS = '$(LIB2_DIVMOD_FUNCS)' >> tmp-libgcc.mvars
@@ -4183,7 +4163,7 @@ gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(
 # be rebuilt.
 
 # Build the include directories.
-stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) $(UNWIND_H) fixinc_list
+stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) fixinc_list
 # Copy in the headers provided with gcc.
 # The sed command gets just the last file name component;
 # this is necessary because VPATH could add a dirname.
@@ -4215,9 +4195,6 @@ stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) 
 	    chmod a+r include/$$file; \
 	  fi; \
 	done
-	rm -f include/unwind.h
-	cp $(UNWIND_H) include/unwind.h
-	chmod a+r include/unwind.h
 	rm -f include/stdint.h
 	if [ $(USE_GCC_STDINT) = wrap ]; then \
 	  rm -f include/stdint-gcc.h; \
diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4
--- a/gcc/aclocal.m4
+++ b/gcc/aclocal.m4
@@ -116,6 +116,5 @@ m4_include([../config/lib-prefix.m4])
 m4_include([../config/override.m4])
 m4_include([../config/progtest.m4])
 m4_include([../config/stdint.m4])
-m4_include([../config/unwind_ipinfo.m4])
 m4_include([../config/warnings.m4])
 m4_include([acinclude.m4])
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -2799,7 +2799,7 @@ vx_stack_info.o : vx_stack_info.c
 
 raise-gcc.o : raise-gcc.c raise.h
 	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
-		-iquote $(srcdir) \
+		-iquote $(srcdir)/../libgcc \
 		$(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
 
 cio.o     : cio.c
diff --git a/gcc/config.gcc b/gcc/config.gcc
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1586,9 +1586,6 @@ ia64*-*-freebsd*)
 ia64*-*-linux*)
 	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ia64/sysv4.h ia64/linux.h"
 	tmake_file="${tmake_file} ia64/t-ia64 t-libunwind ia64/t-glibc"
-	if test x$with_system_libunwind != xyes ; then
-		tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind"
-	fi
 	target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
 	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
 	;;
diff --git a/gcc/config/arm/t-bpabi b/gcc/config/arm/t-bpabi
--- a/gcc/config/arm/t-bpabi
+++ b/gcc/config/arm/t-bpabi
@@ -25,11 +25,6 @@ LIB2FUNCS_EXTRA = $(srcdir)/config/arm/b
 
 LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/arm/fp16.c
 
-UNWIND_H = $(srcdir)/config/arm/unwind-arm.h
-LIB2ADDEH = $(srcdir)/config/arm/unwind-arm.c \
-  $(srcdir)/config/arm/libunwind.S \
-  $(srcdir)/config/arm/pr-support.c $(srcdir)/unwind-c.c
-
 # Add the BPABI names.
 SHLIB_MAPFILES += $(srcdir)/config/arm/libgcc-bpabi.ver
 
diff --git a/gcc/config/arm/t-symbian b/gcc/config/arm/t-symbian
--- a/gcc/config/arm/t-symbian
+++ b/gcc/config/arm/t-symbian
@@ -30,10 +30,6 @@ LIB1ASMFUNCS += \
 	_truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
 	_fixsfsi _fixunssfsi
 
-# Include the gcc personality routine
-UNWIND_H = $(srcdir)/config/arm/unwind-arm.h
-LIB2ADDEH = $(srcdir)/unwind-c.c $(srcdir)/config/arm/pr-support.c
-
 # Include half-float helpers.
 LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/arm/fp16.c
 
diff --git a/gcc/config/frv/t-frv b/gcc/config/frv/t-frv
--- a/gcc/config/frv/t-frv
+++ b/gcc/config/frv/t-frv
@@ -1,4 +1,4 @@
-# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -81,12 +81,12 @@ EXTRA_MULTILIB_PARTS=frvbegin.o frvend.o
 FRVSTUFF_CFLAGS = $(TARGET_LIBGCC2_CFLAGS)
 
 $(T)frvbegin$(objext): $(srcdir)/config/frv/frvbegin.c $(GCC_PASSES) \
-  $(CONFIG_H) defaults.h unwind-dw2-fde.h gbl-ctors.h
+  $(CONFIG_H) defaults.h $(srcdir)/../libgcc/unwind-dw2-fde.h gbl-ctors.h
 	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) $(FRVSTUFF_CFLAGS) \
 	  -c $(srcdir)/config/frv/frvbegin.c -o $(T)frvbegin$(objext)
 
 $(T)frvend$(objext): $(srcdir)/config/frv/frvend.c $(GCC_PASSES) \
-  $(CONFIG_H) defaults.h unwind-dw2-fde.h gbl-ctors.h
+  $(CONFIG_H) defaults.h $(srcdir)/../libgcc/unwind-dw2-fde.h gbl-ctors.h
 	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) $(FRVSTUFF_CFLAGS) \
 	  -c $(srcdir)/config/frv/frvend.c -o $(T)frvend$(objext)
 
diff --git a/gcc/config/ia64/t-glibc b/gcc/config/ia64/t-glibc
--- a/gcc/config/ia64/t-glibc
+++ b/gcc/config/ia64/t-glibc
@@ -1,5 +1,1 @@
-# Use system libunwind library on IA-64 GLIBC based system.
-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
-  $(srcdir)/unwind-compat.c
-
 SHLIB_MAPFILES += $(srcdir)/config/ia64/libgcc-glibc.ver
diff --git a/gcc/config/ia64/t-hpux b/gcc/config/ia64/t-hpux
--- a/gcc/config/ia64/t-hpux
+++ b/gcc/config/ia64/t-hpux
@@ -1,5 +1,5 @@
 # Copyright (C) 2001, 2002, 2003, 2004, 2005,
-# 2006 Free Software Foundation, Inc.
+# 2006, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -50,8 +50,6 @@ LIBGCC1_TEST =
 
 T_CFLAGS += -DUSE_LIBUNWIND_EXCEPTIONS
 
-LIB2ADDEH = $(srcdir)/unwind-c.c
-
 SHLIB_EXT = .so
 # Must include -lunwind in the link, so that libgcc_s.so has the necessary
 # DT_NEEDED entry for libunwind.
diff --git a/gcc/config/ia64/t-ia64 b/gcc/config/ia64/t-ia64
--- a/gcc/config/ia64/t-ia64
+++ b/gcc/config/ia64/t-ia64
@@ -43,9 +43,6 @@ SHLIB_MAPFILES += $(srcdir)/config/ia64/
 # Effectively disable the crtbegin/end rules using crtstuff.c
 T = disable
 
-LIB2ADDEH = $(srcdir)/config/ia64/unwind-ia64.c $(srcdir)/unwind-sjlj.c \
-  $(srcdir)/unwind-c.c
-
 ia64-c.o: $(srcdir)/config/ia64/ia64-c.c $(CONFIG_H) $(SYSTEM_H) \
     coretypes.h $(TM_H) $(TREE_H) $(CPPLIB_H) $(C_COMMON_H) $(C_PRAGMA_H)
 	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
diff --git a/gcc/config/ia64/t-vms b/gcc/config/ia64/t-vms
--- a/gcc/config/ia64/t-vms
+++ b/gcc/config/ia64/t-vms
@@ -32,8 +32,6 @@ CRTSTUFF_T_CFLAGS_S = -O0
 	$(GCC_FOR_TARGET) -I. -c -o $(T)crtinitS.o -x assembler-with-cpp \
 		$(srcdir)/config/ia64/vms-crtinit.asm
 
-LIB2ADDEH += $(srcdir)/config/ia64/fde-vms.c
-
 # Shared library macros
 shlib_version:=$(shell echo $(BASEVER_c) | sed -e 's/\./,/' -e 's/\.//g')
 SHLIB_EXT = .exe
diff --git a/gcc/config/ia64/vms.h b/gcc/config/ia64/vms.h
--- a/gcc/config/ia64/vms.h
+++ b/gcc/config/ia64/vms.h
@@ -185,9 +185,6 @@ typedef struct crtl_name_spec
 /* Define this to be nonzero if static stack checking is supported.  */
 #define STACK_CHECK_STATIC_BUILTIN 1
 
-#define UNW_IVMS_MODE(HEADER) (((HEADER) >> 44) & 0x3L)
-#define MD_UNW_COMPATIBLE_PERSONALITY_P(HEADER) (!UNW_IVMS_MODE (HEADER))
-
 /* Minimum amount of stack required to recover from an anticipated stack
    overflow detection.  The default value conveys an estimate of the amount
    of stack required to propagate an exception.  */
diff --git a/gcc/config/picochip/t-picochip b/gcc/config/picochip/t-picochip
--- a/gcc/config/picochip/t-picochip
+++ b/gcc/config/picochip/t-picochip
@@ -43,9 +43,6 @@ LIB2FUNCS_EXTRA = \
 LIB1ASMFUNCS = _mulsc3 _divsc3
 LIB1ASMSRC = picochip/libgccExtras/fake_libgcc.asm
 
-# Turn off the building of exception handling libraries.
-LIB2ADDEH =
-
 # Turn off ranlib on target libraries.
 RANLIB_FOR_TARGET = cat
 
diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h
--- a/gcc/config/rs6000/aix.h
+++ b/gcc/config/rs6000/aix.h
@@ -209,40 +209,6 @@
 /* And similarly for general purpose registers.  */
 #define GP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 32)
 
-/* If the current unwind info (FS) does not contain explicit info
-   saving R2, then we have to do a minor amount of code reading to
-   figure out if it was saved.  The big problem here is that the
-   code that does the save/restore is generated by the linker, so
-   we have no good way to determine at compile time what to do.  */
-
-#define R_LR 65
-
-#ifdef __64BIT__
-#define MD_FROB_UPDATE_CONTEXT(CTX, FS)					\
-  do {									\
-    if ((FS)->regs.reg[2].how == REG_UNSAVED)				\
-      {									\
-	unsigned int *insn						\
-	  = (unsigned int *)						\
-	    _Unwind_GetGR ((CTX), R_LR);				\
-	if (*insn == 0xE8410028)					\
-	  _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 40);			\
-      }									\
-  } while (0)
-#else
-#define MD_FROB_UPDATE_CONTEXT(CTX, FS)					\
-  do {									\
-    if ((FS)->regs.reg[2].how == REG_UNSAVED)				\
-      {									\
-	unsigned int *insn						\
-	  = (unsigned int *)						\
-	    _Unwind_GetGR ((CTX), R_LR);				\
-	if (*insn == 0x80410014)					\
-	  _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 20);			\
-      }									\
-  } while (0)
-#endif
-
 #define PROFILE_HOOK(LABEL)   output_profile_hook (LABEL)
 
 /* No version of AIX fully supports AltiVec or 64-bit instructions in
diff --git a/gcc/config/rs6000/t-darwin b/gcc/config/rs6000/t-darwin
--- a/gcc/config/rs6000/t-darwin
+++ b/gcc/config/rs6000/t-darwin
@@ -1,5 +1,5 @@
 # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006,
-# 2007 Free Software Foundation, Inc.
+# 2007, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -42,8 +42,6 @@ TARGET_LIBGCC2_CFLAGS = -Wa,-force_cpusu
 # Export the _xlq* symbols from darwin-ldouble.c.
 SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ppc64.ver
 
-LIB2ADDEH += $(srcdir)/config/rs6000/darwin-fallback.c
-
 darwin-fpsave.o:	$(srcdir)/config/rs6000/darwin-asm.h
 darwin-tramp.o:		$(srcdir)/config/rs6000/darwin-asm.h
 
diff --git a/gcc/config/sh/t-sh b/gcc/config/sh/t-sh
--- a/gcc/config/sh/t-sh
+++ b/gcc/config/sh/t-sh
@@ -1,5 +1,5 @@
 # Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2006, 2008, 2009 Free Software Foundation, Inc.
+# 2003, 2004, 2006, 2008, 2009, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -149,7 +149,7 @@ EXTRA_MULTILIB_PARTS= $(IC_EXTRA_PARTS) 
 	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $@ -DL_sdivsi3_i4i -x assembler-with-cpp $<
 $(T)udivsi3_i4i-Os-4-200.o: $(srcdir)/config/sh/lib1funcs-Os-4-200.asm $(GCC_PASSES)
 	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $@ -DL_udivsi3_i4i -x assembler-with-cpp $<
-$(T)unwind-dw2-Os-4-200.o: $(srcdir)/unwind-dw2.c $(srcdir)/unwind-generic.h unwind-pe.h unwind.inc unwind-dw2-fde.h unwind-dw2.h $(CONFIG_H) coretypes.h $(TM_H) $(MACHMODE_H) longlong.h config.status stmp-int-hdrs tsystem.h $(GCC_PASSES)
+$(T)unwind-dw2-Os-4-200.o: $(srcdir)/../libgcc/unwind-dw2.c $(srcdir)/../libgcc/unwind-generic.h $(srcdir)/../libgcc/unwind-pe.h $(srcdir)/../libgcc/unwind.inc $(srcdir)/../libgcc/unwind-dw2-fde.h $(srcdir)/../libgcc/unwind-dw2.h $(CONFIG_H) coretypes.h $(TM_H) $(MACHMODE_H) longlong.h config.status stmp-int-hdrs tsystem.h $(GCC_PASSES)
 	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) $(LIBGCC2_CFLAGS) $(INCLUDES) $(vis_hide) -fexceptions -Os -c -o $@ $<
 OBJS_Os_4_200=$(T)sdivsi3_i4i-Os-4-200.o $(T)udivsi3_i4i-Os-4-200.o $(T)unwind-dw2-Os-4-200.o
 $(T)libgcc-Os-4-200.a: $(OBJS_Os_4_200) $(GCC_PASSES)
diff --git a/gcc/config/spu/t-spu-elf b/gcc/config/spu/t-spu-elf
--- a/gcc/config/spu/t-spu-elf
+++ b/gcc/config/spu/t-spu-elf
@@ -47,9 +47,6 @@ LIB2FUNCS_STATIC_EXTRA = $(srcdir)/confi
 			 $(srcdir)/config/spu/divmodti4.c \
 			 $(srcdir)/config/spu/divv2df3.c
 
-LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
-   $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
-
 # We want fine grained libraries, so use the new code to build the
 # floating point emulation libraries.
 FPBIT = fp-bit.c
diff --git a/gcc/config/t-darwin b/gcc/config/t-darwin
--- a/gcc/config/t-darwin
+++ b/gcc/config/t-darwin
@@ -51,10 +51,6 @@ EXTRA_MULTILIB_PARTS=crt3.o
 	  -fno-tree-dominator-opts $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) \
 	  -c $(srcdir)/config/darwin-crt3.c -o $(T)crt3$(objext)
 
-# Use unwind-dw2-fde-darwin
-LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-darwin.c \
-  $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
-
 # -pipe because there's an assembler bug, 4077127, which causes
 # it to not properly process the first # directive, causing temporary
 # file names to appear in stabs, causing the bootstrap to fail.  Using -pipe
diff --git a/gcc/config/t-freebsd b/gcc/config/t-freebsd
--- a/gcc/config/t-freebsd
+++ b/gcc/config/t-freebsd
@@ -3,7 +3,3 @@ CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAG
 
 # Compile libgcc.a with pic.
 TARGET_LIBGCC2_CFLAGS += -fPIC
-
-# Use unwind-dw2-fde-glibc
-LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
-  $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
diff --git a/gcc/config/t-libunwind b/gcc/config/t-libunwind
--- a/gcc/config/t-libunwind
+++ b/gcc/config/t-libunwind
@@ -1,4 +1,4 @@
-# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -22,9 +22,6 @@
 # so that the resulting libgcc_s.so has the necessary DT_NEEDED entry for
 # libunwind.
 SHLIB_LC = -lunwind -lc
-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
-  $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c
-LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
 
 T_CFLAGS += -DUSE_LIBUNWIND_EXCEPTIONS
 TARGET_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER
diff --git a/gcc/config/t-linux b/gcc/config/t-linux
--- a/gcc/config/t-linux
+++ b/gcc/config/t-linux
@@ -25,7 +25,3 @@ TARGET_LIBGCC2_CFLAGS = -fPIC
 # Override t-slibgcc-elf-ver to export some libgcc symbols with
 # the symbol versions that glibc used.
 SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver
-
-# Use unwind-dw2-fde-glibc
-LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
-  $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
diff --git a/gcc/config/t-sol2 b/gcc/config/t-sol2
--- a/gcc/config/t-sol2
+++ b/gcc/config/t-sol2
@@ -31,8 +31,3 @@ sol2.o: $(srcdir)/config/sol2.c $(CONFIG
 
 # This is required by gcc/ada/gcc-interface/Makefile.in.
 TARGET_LIBGCC2_CFLAGS = -fPIC
-
-# Use unwind-dw2-fde-glibc.c.  Unless linker support and dl_iterate_phdr
-# are present, automatically falls back to unwind-dw2-fde.c.
-LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
-  $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
diff --git a/gcc/config/xtensa/t-xtensa b/gcc/config/xtensa/t-xtensa
--- a/gcc/config/xtensa/t-xtensa
+++ b/gcc/config/xtensa/t-xtensa
@@ -1,4 +1,5 @@
-# Copyright (C) 2002, 2003, 2006, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2006, 2007, 2008, 2011
+# Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -29,8 +30,6 @@ LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3 _
 	_truncdfsf2 _extendsfdf2
 
 LIB2FUNCS_EXTRA = $(srcdir)/config/xtensa/lib2funcs.S
-LIB2ADDEH = $(srcdir)/config/xtensa/unwind-dw2-xtensa.c \
-   $(srcdir)/unwind-dw2-fde.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
 
 $(T)crti.o: $(srcdir)/config/xtensa/crti.asm $(GCC_PASSES)
 	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
diff --git a/gcc/configure.ac b/gcc/configure.ac
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1173,11 +1173,6 @@ if test $force_sjlj_exceptions = yes; th
     [Define 0/1 to force the choice for exception handling model.])
 fi
 
-# For platforms with the unwind ABI which includes an unwind library,
-# libunwind, we can choose to use the system libunwind.
-# config.gcc also contains tests of with_system_libunwind.
-GCC_CHECK_UNWIND_GETIPINFO
-
 # --------------------------------------------------------
 # Build, host, and target specific configuration fragments
 # --------------------------------------------------------
diff --git a/gcc/po/EXCLUDES b/gcc/po/EXCLUDES
--- a/gcc/po/EXCLUDES
+++ b/gcc/po/EXCLUDES
@@ -46,15 +46,6 @@ libgcov.c
 limitx.h
 limity.h
 longlong.h
-unwind-c.c
-unwind-dw2-fde-darwin.c
-unwind-dw2-fde-glibc.c
-unwind-dw2-fde.c
-unwind-dw2-fde.h
-unwind-dw2.c
-unwind-pe.h
-unwind-sjlj.c
-unwind.h
 
 #   These programs are meant to be executed only by GCC maintainers or
 #   installers.  Such files do not need to be translated, as these
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -255,6 +255,17 @@ objects = $(filter %$(objext),$^)
 LIBGCC_VER_GNU_PREFIX = __
 LIBGCC_VER_SYMBOLS_PREFIX =
 
+# Additional sources to handle exceptions; overridden by targets as needed.
+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
+  $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+LIB2ADDEHSTATIC = $(LIB2ADDEH)
+LIB2ADDEHSHARED = $(LIB2ADDEH)
+
+# Don't build libunwind by default.
+LIBUNWIND =
+SHLIBUNWIND_LINK =
+SHLIBUNWIND_INSTALL =
+
 tmake_file = @tmake_file@
 include $(srcdir)/empty.mk $(tmake_file)
 
@@ -315,6 +326,10 @@ endif
 
 LIB2ADD += enable-execute-stack.c
 
+LIB2ADDEH += $(srcdir)/emutls.c
+LIB2ADDEHSTATIC += $(srcdir)/emutls.c
+LIB2ADDEHSHARED += $(srcdir)/emutls.c
+
 # Library members defined in libgcc2.c.
 lib2funcs = _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _cmpdi2 _ucmpdi2	   \
 	    _clear_cache _trampoline __main _absvsi2 \
@@ -931,6 +946,12 @@ gcc-extra-parts:
 
 all: $(extra-parts)
 
+install-unwind_h:
+	cp unwind.h $(gcc_objdir)/include/unwind.h
+	chmod a+r $(gcc_objdir)/include/unwind.h
+
+all: install-unwind_h
+
 # Documentation targets (empty).
 .PHONY: info html dvi pdf install-info install-html install-pdf
 
diff --git a/libgcc/config.host b/libgcc/config.host
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -57,12 +57,15 @@
 #  tmake_file		A list of machine-description-specific
 #			makefile-fragments, if different from
 #			"$cpu_type/t-$cpu_type".
+#  unwind_header	The name of the header file declaring the unwind
+#			runtime interface routines.
 
 asm_hidden_op=.hidden
 enable_execute_stack=
 extra_parts=
 tmake_file=
 md_unwind_header=no-unwind.h
+unwind_header=unwind-generic.h
 
 # Set default cpu_type so it can be updated in each machine entry.
 cpu_type=`echo ${host} | sed 's/-.*$//'`
@@ -164,8 +167,10 @@ case ${host} in
   # This is the generic ELF configuration of FreeBSD.  Later
   # machine-specific sections may refine and add to this
   # configuration.
+  tmake_file=t-eh-dw2-dip
   ;;
-*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu*)
+*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
+  tmake_file=t-eh-dw2-dip
   extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
   ;;
 *-*-netbsd*)
@@ -175,7 +180,9 @@ case ${host} in
 *-*-rtems*)
   ;;
 *-*-solaris2*)
-  tmake_file="$tmake_file t-sol2 t-slibgcc t-slibgcc-elf-ver"
+  # Unless linker support and dl_iterate_phdr are present,
+  # unwind-dw2-fde-dip.c automatically falls back to unwind-dw2-fde.c.
+  tmake_file="$tmake_file t-sol2 t-eh-dw2-dip t-slibgcc t-slibgcc-elf-ver"
   if test $with_gnu_ld = yes; then
     tmake_file="$tmake_file t-slibgcc-gld"
   else
@@ -262,12 +269,34 @@ arm*-*-freebsd*)
 arm*-*-netbsdelf*)
 	;;
 arm*-*-linux*)			# ARM GNU/Linux with ELF
+	case ${host} in
+	arm*-*-linux-*eabi)
+	  tmake_file=arm/t-bpabi
+	  unwind_header=config/arm/unwind-arm.h
+	  ;;
+	esac
 	;;
 arm*-*-uclinux*)		# ARM ucLinux
+	case ${host} in
+	arm*-*-uclinux*eabi)
+	  tmake_file=arm/t-bpabi
+	  unwind_header=config/arm/unwind-arm.h
+	  ;;
+	esac
 	;;
 arm*-*-ecos-elf)
 	;;
 arm*-*-eabi* | arm*-*-symbianelf* )
+	case ${host} in
+	arm*-*-eabi*)
+	  tmake_file=arm/t-bpabi
+	  unwind_header=config/arm/unwind-arm.h
+	  ;;
+	arm*-*-symbianelf*)
+	  tmake_file=arm/t-symbian
+	  unwind_header=config/arm/unwind-arm.h
+	  ;;
+	esac
 	;;
 arm*-*-rtems*)
 	;;
@@ -397,21 +426,25 @@ i[34567]86-*-interix3*)
 	;;
 ia64*-*-elf*)
 	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
-	tmake_file="ia64/t-ia64"
+	tmake_file="ia64/t-ia64 ia64/t-eh-ia64"
 	;;
 ia64*-*-freebsd*)
 	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
-	tmake_file="ia64/t-ia64"
+	tmake_file="ia64/t-ia64 ia64/t-eh-ia64"
 	;;
 ia64*-*-linux*)
 	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
-	tmake_file="ia64/t-ia64 t-softfp ia64/t-fprules-softfp ia64/t-softfp-compat"
+	tmake_file="ia64/t-ia64 t-softfp ia64/t-fprules-softfp ia64/t-softfp-compat ia64/t-glibc ia64/t-eh-ia64 t-libunwind"
+	if test x$with_system_libunwind != xyes ; then
+		tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind"
+	fi
 	md_unwind_header=ia64/linux-unwind.h
 	;;
 ia64*-*-hpux*)
+	tmake_file="ia64/t-hpux ia64/t-eh-ia64"
 	;;
 ia64-hp-*vms*)
-	tmake_file="vms/t-vms vms/t-vms64 ia64/t-vms"
+	tmake_file="vms/t-vms vms/t-vms64 ia64/t-eh-ia64 ia64/t-vms"
 	md_unwind_header=ia64/vms-unwind.h
 	;;
 iq2000*-*-elf*)
@@ -511,6 +544,7 @@ moxie-*-*)
 pdp11-*-*)
 	;;
 picochip-*-*)
+	tmake_file=picochip/t-picochip
         ;;
 powerpc-*-darwin*)
 	case ${host} in
@@ -561,10 +595,13 @@ powerpcle-*-eabisim*)
 powerpcle-*-eabi*)
 	;;
 rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*)
+	md_unwind_header=rs6000/aix-unwind.h
 	;;
 rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*)
+	md_unwind_header=rs6000/aix-unwind.h
 	;;
 rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*)
+	md_unwind_header=rs6000/aix-unwind.h
 	;;
 rx-*-elf)
 	extra_parts="crtbegin.o crtend.o"
@@ -579,7 +616,7 @@ s390x-*-linux*)
 	md_unwind_header=s390/linux-unwind.h
 	;;
 s390x-ibm-tpf*)
-	tmake_file="${tmake_file} s390/t-crtstuff s390/t-tpf"
+	tmake_file="${tmake_file} s390/t-crtstuff s390/t-tpf t-eh-dw2-dip"
 	md_unwind_header=s390/tpf-unwind.h
 	;;
 score-*-elf)
@@ -660,8 +697,10 @@ vax-*-openbsd*)
 xstormy16-*-elf)
 	;;
 xtensa*-*-elf*)
+	tmake_file=xtensa/t-xtensa
 	;;
 xtensa*-*-linux*)
+	tmake_file=xtensa/t-xtensa
 	md_unwind_header=xtensa/linux-unwind.h
 	;;
 am33_2.0-*-linux*)
diff --git a/gcc/config/arm/libunwind.S b/libgcc/config/arm/libunwind.S
rename from gcc/config/arm/libunwind.S
rename to libgcc/config/arm/libunwind.S
diff --git a/gcc/config/arm/pr-support.c b/libgcc/config/arm/pr-support.c
rename from gcc/config/arm/pr-support.c
rename to libgcc/config/arm/pr-support.c
diff --git a/libgcc/config/arm/t-bpabi b/libgcc/config/arm/t-bpabi
new file mode 100644
--- /dev/null
+++ b/libgcc/config/arm/t-bpabi
@@ -0,0 +1,3 @@
+LIB2ADDEH = $(srcdir)/config/arm/unwind-arm.c \
+  $(srcdir)/config/arm/libunwind.S \
+  $(srcdir)/config/arm/pr-support.c $(srcdir)/unwind-c.c
diff --git a/libgcc/config/arm/t-symbian b/libgcc/config/arm/t-symbian
new file mode 100644
--- /dev/null
+++ b/libgcc/config/arm/t-symbian
@@ -0,0 +1,2 @@
+# Include the gcc personality routine
+LIB2ADDEH = $(srcdir)/unwind-c.c $(srcdir)/config/arm/pr-support.c
diff --git a/gcc/config/arm/unwind-arm.c b/libgcc/config/arm/unwind-arm.c
rename from gcc/config/arm/unwind-arm.c
rename to libgcc/config/arm/unwind-arm.c
diff --git a/gcc/config/arm/unwind-arm.h b/libgcc/config/arm/unwind-arm.h
rename from gcc/config/arm/unwind-arm.h
rename to libgcc/config/arm/unwind-arm.h
diff --git a/gcc/config/ia64/fde-glibc.c b/libgcc/config/ia64/fde-glibc.c
rename from gcc/config/ia64/fde-glibc.c
rename to libgcc/config/ia64/fde-glibc.c
diff --git a/gcc/config/ia64/fde-vms.c b/libgcc/config/ia64/fde-vms.c
rename from gcc/config/ia64/fde-vms.c
rename to libgcc/config/ia64/fde-vms.c
--- a/gcc/config/ia64/fde-vms.c
+++ b/libgcc/config/ia64/fde-vms.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2009, 2011 Free Software Foundation, Inc.
    Contributed by Douglas B Rupp <rupp@gnat.com>
 
    This file is part of GCC.
@@ -32,6 +32,7 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include "md-unwind-support.h"
 #include "unwind-ia64.h"
 
 #define __int64 long
diff --git a/libgcc/config/ia64/t-eh-ia64 b/libgcc/config/ia64/t-eh-ia64
new file mode 100644
--- /dev/null
+++ b/libgcc/config/ia64/t-eh-ia64
@@ -0,0 +1,2 @@
+LIB2ADDEH = $(srcdir)/config/ia64/unwind-ia64.c $(srcdir)/unwind-sjlj.c \
+  $(srcdir)/unwind-c.c
diff --git a/libgcc/config/ia64/t-glibc b/libgcc/config/ia64/t-glibc
new file mode 100644
--- /dev/null
+++ b/libgcc/config/ia64/t-glibc
@@ -0,0 +1,3 @@
+# Use system libunwind library on IA-64 GLIBC based system.
+LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
+  $(srcdir)/unwind-compat.c
diff --git a/gcc/config/ia64/t-glibc-libunwind b/libgcc/config/ia64/t-glibc-libunwind
rename from gcc/config/ia64/t-glibc-libunwind
rename to libgcc/config/ia64/t-glibc-libunwind
--- a/gcc/config/ia64/t-glibc-libunwind
+++ b/libgcc/config/ia64/t-glibc-libunwind
@@ -1,4 +1,3 @@
 # Build libunwind for IA-64 GLIBC based system.
 LIBUNWIND = $(srcdir)/config/ia64/fde-glibc.c \
   $(srcdir)/config/ia64/unwind-ia64.c
-LIBUNWINDDEP = unwind.inc
diff --git a/libgcc/config/ia64/t-hpux b/libgcc/config/ia64/t-hpux
new file mode 100644
--- /dev/null
+++ b/libgcc/config/ia64/t-hpux
@@ -0,0 +1,1 @@
+LIB2ADDEH = $(srcdir)/unwind-c.c
diff --git a/libgcc/config/ia64/t-vms b/libgcc/config/ia64/t-vms
new file mode 100644
--- /dev/null
+++ b/libgcc/config/ia64/t-vms
@@ -0,0 +1,1 @@
+LIB2ADDEH += $(srcdir)/config/ia64/fde-vms.c
diff --git a/gcc/config/ia64/unwind-ia64.c b/libgcc/config/ia64/unwind-ia64.c
rename from gcc/config/ia64/unwind-ia64.c
rename to libgcc/config/ia64/unwind-ia64.c
--- a/gcc/config/ia64/unwind-ia64.c
+++ b/libgcc/config/ia64/unwind-ia64.c
@@ -32,6 +32,7 @@
 #include "coretypes.h"
 #include "tm.h"
 #include "unwind.h"
+#include "md-unwind-support.h"
 #include "unwind-ia64.h"
 #include "unwind-compat.h"
 #include "ia64intrin.h"
diff --git a/gcc/config/ia64/unwind-ia64.h b/libgcc/config/ia64/unwind-ia64.h
rename from gcc/config/ia64/unwind-ia64.h
rename to libgcc/config/ia64/unwind-ia64.h
diff --git a/libgcc/config/ia64/vms-unwind.h b/libgcc/config/ia64/vms-unwind.h
--- a/libgcc/config/ia64/vms-unwind.h
+++ b/libgcc/config/ia64/vms-unwind.h
@@ -1,5 +1,5 @@
 /* DWARF2 EH unwinding support for IA64 VMS.
-   Copyright (C) 2005-2009 Free Software Foundation, Inc.
+   Copyright (C) 2005-2011 Free Software Foundation, Inc.
 
    This file is part of GCC.
 
@@ -32,6 +32,9 @@
 #include <stdio.h>
 #include <string.h>
 
+#define UNW_IVMS_MODE(HEADER) (((HEADER) >> 44) & 0x3L)
+#define MD_UNW_COMPATIBLE_PERSONALITY_P(HEADER) (!UNW_IVMS_MODE (HEADER))
+
 #define DYN$C_SSENTRY 66
 /* ??? would rather get the proper header file.  */
 
diff --git a/libgcc/config/picochip/t-picochip b/libgcc/config/picochip/t-picochip
new file mode 100644
--- /dev/null
+++ b/libgcc/config/picochip/t-picochip
@@ -0,0 +1,2 @@
+# Turn off the building of exception handling libraries.
+LIB2ADDEH =
diff --git a/libgcc/config/rs6000/aix-unwind.h b/libgcc/config/rs6000/aix-unwind.h
new file mode 100644
--- /dev/null
+++ b/libgcc/config/rs6000/aix-unwind.h
@@ -0,0 +1,57 @@
+/* DWARF2 EH unwinding support for AIX.
+   Copyright (C) 2011 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* If the current unwind info (FS) does not contain explicit info
+   saving R2, then we have to do a minor amount of code reading to
+   figure out if it was saved.  The big problem here is that the
+   code that does the save/restore is generated by the linker, so
+   we have no good way to determine at compile time what to do.  */
+
+#define R_LR 65
+
+#ifdef __64BIT__
+#define MD_FROB_UPDATE_CONTEXT(CTX, FS)					\
+  do {									\
+    if ((FS)->regs.reg[2].how == REG_UNSAVED)				\
+      {									\
+	unsigned int *insn						\
+	  = (unsigned int *)						\
+	    _Unwind_GetGR ((CTX), R_LR);				\
+	if (*insn == 0xE8410028)					\
+	  _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 40);			\
+      }									\
+  } while (0)
+#else
+#define MD_FROB_UPDATE_CONTEXT(CTX, FS)					\
+  do {									\
+    if ((FS)->regs.reg[2].how == REG_UNSAVED)				\
+      {									\
+	unsigned int *insn						\
+	  = (unsigned int *)						\
+	    _Unwind_GetGR ((CTX), R_LR);				\
+	if (*insn == 0x80410014)					\
+	  _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 20);			\
+      }									\
+  } while (0)
+#endif
diff --git a/gcc/config/rs6000/darwin-fallback.c b/libgcc/config/rs6000/darwin-fallback.c
rename from gcc/config/rs6000/darwin-fallback.c
rename to libgcc/config/rs6000/darwin-fallback.c
diff --git a/libgcc/config/rs6000/t-darwin b/libgcc/config/rs6000/t-darwin
--- a/libgcc/config/rs6000/t-darwin
+++ b/libgcc/config/rs6000/t-darwin
@@ -1,1 +1,3 @@
+LIB2ADDEH += $(srcdir)/config/rs6000/darwin-fallback.c
+
 SHLIB_VERPFX = $(gcc_srcdir)/config/rs6000/darwin-libgcc
diff --git a/libgcc/config/s390/t-tpf b/libgcc/config/s390/t-tpf
--- a/libgcc/config/s390/t-tpf
+++ b/libgcc/config/s390/t-tpf
@@ -1,7 +1,2 @@
 # Compile libgcc2.a with pic.
 HOST_LIBGCC2_CFLAGS += -fPIC
-
-# Use unwind-dw2-fde-glibc.
-LIB2ADDEH = $(gcc_srcdir)/unwind-dw2.c $(gcc_srcdir)/unwind-dw2-fde-glibc.c \
-  $(gcc_srcdir)/unwind-sjlj.c $(gcc_srcdir)/unwind-c.c \
-  $(gcc_srcdir)/emutls.c
diff --git a/libgcc/config/t-darwin b/libgcc/config/t-darwin
new file mode 100644
--- /dev/null
+++ b/libgcc/config/t-darwin
@@ -0,0 +1,3 @@
+# Use unwind-dw2-fde-darwin
+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-darwin.c \
+  $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
diff --git a/libgcc/config/t-eh-dw2-dip b/libgcc/config/t-eh-dw2-dip
new file mode 100644
--- /dev/null
+++ b/libgcc/config/t-eh-dw2-dip
@@ -0,0 +1,3 @@
+# Use unwind-dw2-fde-dip.
+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-dip.c \
+  $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
diff --git a/libgcc/config/t-libunwind b/libgcc/config/t-libunwind
new file mode 100644
--- /dev/null
+++ b/libgcc/config/t-libunwind
@@ -0,0 +1,3 @@
+LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
+  $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c
+LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
diff --git a/gcc/config/t-libunwind-elf b/libgcc/config/t-libunwind-elf
rename from gcc/config/t-libunwind-elf
rename to libgcc/config/t-libunwind-elf
--- a/gcc/config/t-libunwind-elf
+++ b/libgcc/config/t-libunwind-elf
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -18,14 +18,13 @@
 
 # Build libunwind for ELF with the GNU linker.
 
-# Use unwind-dw2-fde-glibc
-LIBUNWIND = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c
-LIBUNWINDDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
+# Use unwind-dw2-fde-dip
+LIBUNWIND = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-dip.c
 
 SHLIBUNWIND_SOVERSION = 7
 SHLIBUNWIND_SONAME = @shlib_base_name@.so.$(SHLIBUNWIND_SOVERSION)
 
-SHLIBUNWIND_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared \
+SHLIBUNWIND_LINK = $(CC) $(LIBGCC2_CFLAGS) -shared \
 	-nodefaultlibs -Wl,-h,$(SHLIBUNWIND_SONAME) \
 	-Wl,-z,text -Wl,-z,defs -o $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME).tmp \
 	@multilib_flags@ $(SHLIB_OBJS) -lc && \
@@ -38,12 +37,10 @@ SHLIBUNWIND_LINK = $(GCC_FOR_TARGET) $(L
 	   $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME) && \
 	$(LN_S) $(SHLIBUNWIND_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK)
 
-# $(slibdir) double quoted to protect it from expansion while building
-# libgcc.mk.  We want this delayed until actual install time.
 SHLIBUNWIND_INSTALL = \
-	$$(SHELL) $$(srcdir)/mkinstalldirs $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
+	$(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
 	$(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME) \
-	  $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIBUNWIND_SONAME); \
-	rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
+	  $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIBUNWIND_SONAME); \
+	rm -f $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
 	$(LN_S) $(SHLIBUNWIND_SONAME) \
-	  $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
+	  $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
diff --git a/libgcc/config/t-sol2 b/libgcc/config/t-sol2
--- a/libgcc/config/t-sol2
+++ b/libgcc/config/t-sol2
@@ -16,11 +16,6 @@
 # along with GCC; see the file COPYING3.  If not see
 # <http://www.gnu.org/licenses/>.
 
-# Use unwind-dw2-fde-glibc.c.  Unless linker support and dl_iterate_phdr
-# are present, automatically falls back to unwind-dw2-fde.c.
-LIB2ADDEH = $(gcc_srcdir)/unwind-dw2.c $(gcc_srcdir)/unwind-dw2-fde-glibc.c \
-  $(gcc_srcdir)/unwind-sjlj.c $(gcc_srcdir)/unwind-c.c $(gcc_srcdir)/emutls.c
-
 # gmon build rule:
 gmon.o:	$(srcdir)/config/gmon-sol2.c
 	$(gcc_compile) -c $<
diff --git a/libgcc/config/xtensa/t-xtensa b/libgcc/config/xtensa/t-xtensa
new file mode 100644
--- /dev/null
+++ b/libgcc/config/xtensa/t-xtensa
@@ -0,0 +1,2 @@
+LIB2ADDEH = $(srcdir)/config/xtensa/unwind-dw2-xtensa.c \
+   $(srcdir)/unwind-dw2-fde.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
diff --git a/gcc/config/xtensa/unwind-dw2-xtensa.c b/libgcc/config/xtensa/unwind-dw2-xtensa.c
rename from gcc/config/xtensa/unwind-dw2-xtensa.c
rename to libgcc/config/xtensa/unwind-dw2-xtensa.c
diff --git a/gcc/config/xtensa/unwind-dw2-xtensa.h b/libgcc/config/xtensa/unwind-dw2-xtensa.h
rename from gcc/config/xtensa/unwind-dw2-xtensa.h
rename to libgcc/config/xtensa/unwind-dw2-xtensa.h
diff --git a/libgcc/configure.ac b/libgcc/configure.ac
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -7,6 +7,7 @@ sinclude(../config/no-executables.m4)
 sinclude(../config/lib-ld.m4)
 sinclude(../config/override.m4)
 sinclude(../config/dfp.m4)
+sinclude(../config/unwind_ipinfo.m4)
 
 AC_PREREQ(2.64)
 AC_INIT([GNU C Runtime Library], 1.0,,[libgcc])
@@ -167,6 +168,11 @@ AC_CACHE_CHECK([whether fixed-point is s
 fixed_point=$libgcc_cv_fixed_point
 AC_SUBST(fixed_point)
 
+# For platforms with the unwind ABI which includes an unwind library,
+# libunwind, we can choose to use the system libunwind.
+# config.gcc also contains tests of with_system_libunwind.
+GCC_CHECK_UNWIND_GETIPINFO
+
 AC_LIB_PROG_LD_GNU
 
 AC_MSG_CHECKING([for thread model used by GCC])
@@ -279,6 +285,7 @@ AC_SUBST(cpu_type)
 AC_SUBST(extra_parts)
 AC_SUBST(asm_hidden_op)
 AC_CONFIG_LINKS([enable-execute-stack.c:$enable_execute_stack])
+AC_CONFIG_LINKS([unwind.h:$unwind_header])
 AC_CONFIG_LINKS([md-unwind-support.h:config/$md_unwind_header])
 
 # We need multilib support.
diff --git a/gcc/emutls.c b/libgcc/emutls.c
rename from gcc/emutls.c
rename to libgcc/emutls.c
diff --git a/gcc/unwind-c.c b/libgcc/unwind-c.c
rename from gcc/unwind-c.c
rename to libgcc/unwind-c.c
diff --git a/gcc/unwind-compat.c b/libgcc/unwind-compat.c
rename from gcc/unwind-compat.c
rename to libgcc/unwind-compat.c
diff --git a/gcc/unwind-compat.h b/libgcc/unwind-compat.h
rename from gcc/unwind-compat.h
rename to libgcc/unwind-compat.h
diff --git a/gcc/unwind-dw2-fde-compat.c b/libgcc/unwind-dw2-fde-compat.c
rename from gcc/unwind-dw2-fde-compat.c
rename to libgcc/unwind-dw2-fde-compat.c
diff --git a/gcc/unwind-dw2-fde-darwin.c b/libgcc/unwind-dw2-fde-darwin.c
rename from gcc/unwind-dw2-fde-darwin.c
rename to libgcc/unwind-dw2-fde-darwin.c
diff --git a/gcc/unwind-dw2-fde-glibc.c b/libgcc/unwind-dw2-fde-dip.c
rename from gcc/unwind-dw2-fde-glibc.c
rename to libgcc/unwind-dw2-fde-dip.c
diff --git a/gcc/unwind-dw2-fde.c b/libgcc/unwind-dw2-fde.c
rename from gcc/unwind-dw2-fde.c
rename to libgcc/unwind-dw2-fde.c
diff --git a/gcc/unwind-dw2-fde.h b/libgcc/unwind-dw2-fde.h
rename from gcc/unwind-dw2-fde.h
rename to libgcc/unwind-dw2-fde.h
diff --git a/gcc/unwind-dw2.c b/libgcc/unwind-dw2.c
rename from gcc/unwind-dw2.c
rename to libgcc/unwind-dw2.c
diff --git a/gcc/unwind-dw2.h b/libgcc/unwind-dw2.h
rename from gcc/unwind-dw2.h
rename to libgcc/unwind-dw2.h
diff --git a/gcc/unwind-generic.h b/libgcc/unwind-generic.h
rename from gcc/unwind-generic.h
rename to libgcc/unwind-generic.h
diff --git a/gcc/unwind-pe.h b/libgcc/unwind-pe.h
rename from gcc/unwind-pe.h
rename to libgcc/unwind-pe.h
diff --git a/gcc/unwind-sjlj.c b/libgcc/unwind-sjlj.c
rename from gcc/unwind-sjlj.c
rename to libgcc/unwind-sjlj.c
diff --git a/gcc/unwind.inc b/libgcc/unwind.inc
rename from gcc/unwind.inc
rename to libgcc/unwind.inc
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -38,7 +38,7 @@ ACLOCAL_AMFLAGS = -I ./config -I ../conf
 
 AM_CFLAGS = -fexceptions -fplan9-extensions $(SPLIT_STACK) $(WARN_CFLAGS) \
 	$(STRINGOPS_FLAG) \
-	-I $(srcdir)/../gcc -I $(MULTIBUILDTOP)../../gcc/include
+	-I $(srcdir)/../libgcc -I $(MULTIBUILDTOP)../../gcc/include
 
 if USING_SPLIT_STACK
 AM_LDFLAGS = -XCClinker $(SPLIT_STACK)
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -342,7 +342,7 @@ LIBLINK = $(LIBTOOL) --tag=CXX $(LIBTOOL
 CXXLINK = $(LIBTOOL) --tag=CXX $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
 	  $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LTLDFLAGS) -o $@
 
-GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
+LIBGCC_UNWIND_INCLUDE = @LIBGCC_UNWIND_INCLUDE@
 
 WARNINGS = -Wextra -Wall
 ## Some systems don't allow `$' in identifiers by default, so we force
@@ -410,7 +410,7 @@ AM_CPPFLAGS = -I$(top_srcdir) \
 	-Iclasspath/include \
 	-I$(top_srcdir)/classpath/native/fdlibm \
 	$(GCINCS) $(THREADINCS) $(INCLTDL) \
-	$(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
+	$(LIBGCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
 
 BOOTCLASSPATH = $(srcdir)/classpath/lib
 
diff --git a/libjava/configure.ac b/libjava/configure.ac
--- a/libjava/configure.ac
+++ b/libjava/configure.ac
@@ -469,7 +469,7 @@ case "${which_gcj}" in
    cross)
       if test "x${with_newlib}" = "xyes"; then
          # FIXME (comment): Why is this needed?
-         GCC_UNWIND_INCLUDE=
+         LIBGCC_UNWIND_INCLUDE=
       fi
       GCJH='$(target_noncanonical)-gcjh'
    ;;
@@ -1199,8 +1199,8 @@ AC_SUBST(HASH_SYNC_SPEC)
 
 AM_CONDITIONAL(USING_GCC, test "$GCC" = yes)
 
-# We're in the tree with gcc, and need to include some of its headers.
-GCC_UNWIND_INCLUDE='-I$(multi_basedir)/./libjava/../gcc'
+# We're in the tree with libgcc, and need to include some of its headers.
+LIBGCC_UNWIND_INCLUDE='-I$(multi_basedir)/./libjava/../libgcc'
 
 if test "x${with_newlib}" = "xyes"; then
    # We are being configured with a cross compiler.  AC_REPLACE_FUNCS
@@ -1564,7 +1564,7 @@ AM_CONDITIONAL(NATIVE, test "$NATIVE" = 
 AM_CONDITIONAL(ENABLE_SHARED, test "$enable_shared" = yes)
 AM_CONDITIONAL(NEEDS_DATA_START, test "$NEEDS_DATA_START" = yes && test "$NATIVE" = yes)
 AM_CONDITIONAL(INSTALL_BINARIES, test -z "${with_multisubdir}")
-AC_SUBST(GCC_UNWIND_INCLUDE)
+AC_SUBST(LIBGCC_UNWIND_INCLUDE)
 
 # Process the option "--enable-version-specific-runtime-libs"
 # Calculate toolexeclibdir
diff --git a/libobjc/Makefile.in b/libobjc/Makefile.in
--- a/libobjc/Makefile.in
+++ b/libobjc/Makefile.in
@@ -101,6 +101,7 @@ OBJC_BOEHM_GC_LIBS=../boehm-gc/libgcjgc_
 INCLUDES = -I$(srcdir)/$(MULTISRCTOP)../gcc \
   -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
   -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
+  -I$(srcdir)/$(MULTISRCTOP)../libgcc \
   -I$(srcdir)/$(MULTISRCTOP)../include \
   $(OBJC_BOEHM_GC_INCLUDES)
 
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -682,9 +682,9 @@ AC_DEFUN([GLIBCXX_EXPORT_INCLUDES], [
   fi
 
   # Stuff in the actual top level.  Currently only used by libsupc++ to
-  # get unwind* headers from the gcc dir.
-  #TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include'
-  TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/gcc'
+  # get unwind* headers from the libgcc dir.
+  #TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/libgcc -I$(toplevel_srcdir)/include'
+  TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/libgcc'
 
   # Now, export this to all the little Makefiles....
   AC_SUBST(GLIBCXX_INCLUDES)

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [build] Move unwinder to toplevel libgcc
  2011-06-20 12:44 [build] Move unwinder to toplevel libgcc Rainer Orth
@ 2011-06-20 15:21 ` Joseph S. Myers
  2011-06-20 15:23   ` Rainer Orth
  2011-07-04 18:10   ` CFT: " Rainer Orth
  2011-06-29 10:05 ` [build] " Paolo Bonzini
  1 sibling, 2 replies; 36+ messages in thread
From: Joseph S. Myers @ 2011-06-20 15:21 UTC (permalink / raw)
  To: Rainer Orth
  Cc: gcc-patches, Paolo Bonzini, Ralf Wildenhues, Ian Lance Taylor,
	Steve Ellcey, Richard Earnshaw, Ramana Radhakrishnan,
	Nick Clifton, Douglas Rupp, Tristan Gingold, Mike Stump,
	Kaz Kojima, David Edelsohn, Sterling Augustine, Arnaud Charlet,
	java-patches, Nicola Pero, libstdc++,
	Richard Sandiford

On Mon, 20 Jun 2011, Rainer Orth wrote:

> * Move all remaining unwinder-only macros to libgcc: UNW_IVMS_MODE,
>   MD_UNW_COMPATIBLE_PERSONALITY_P, MD_FROB_UPDATE_CONTEXT.

I don't see any sign of macros being poisoned in system.h.  For macros 
used in target-independent unwinder code - at least MD_FROB_UPDATE_CONTEXT 
- that used to be defined in the host tm.h but now no longer should be, I 
think poisoning in system.h is appropriate.

> * The only unwinder-related macro I haven't moved is
>   LIBGCC2_UNWIND_ATTRIBUTE.  It is only defined gcc/config/mips/mips.h.
>   I suppose we would need a libgcc equivalent of tm.h for that,
>   something I didn't want to attack at this point.

What about DWARF_ZERO_REG and PRE_GCC3_DWARF_FRAME_REGISTERS?  
DWARF_REG_TO_UNWIND_COLUMN may be more complicated because it's used on 
the host in rs6000.c (although not in target-independent host code) as 
well as on the target - I suspect that will be a case where duplicating 
the definition (with a comment in one place pointing to the other place as 
needing to be kept consistent, and with the host-side copy renamed to 
facilitate poisoning) may make sense.  And all three are defined in 
<arch>.h headers so your reason for moving them separately may apply.

(There are lots more macros used in the unwinder and on the host for which 
macros predefined with -fbuilding-libgcc may be appropriate in a later 
patch.)

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [build] Move unwinder to toplevel libgcc
  2011-06-20 15:21 ` Joseph S. Myers
@ 2011-06-20 15:23   ` Rainer Orth
  2011-06-20 15:37     ` Joseph S. Myers
  2011-07-04 18:10   ` CFT: " Rainer Orth
  1 sibling, 1 reply; 36+ messages in thread
From: Rainer Orth @ 2011-06-20 15:23 UTC (permalink / raw)
  To: Joseph S. Myers
  Cc: gcc-patches, Paolo Bonzini, Ralf Wildenhues, Ian Lance Taylor,
	Steve Ellcey, Richard Earnshaw, Ramana Radhakrishnan,
	Nick Clifton, Douglas Rupp, Tristan Gingold, Mike Stump,
	Kaz Kojima, David Edelsohn, Sterling Augustine, Arnaud Charlet,
	java-patches, Nicola Pero, libstdc++,
	Richard Sandiford

"Joseph S. Myers" <joseph@codesourcery.com> writes:

> On Mon, 20 Jun 2011, Rainer Orth wrote:
>
>> * Move all remaining unwinder-only macros to libgcc: UNW_IVMS_MODE,
>>   MD_UNW_COMPATIBLE_PERSONALITY_P, MD_FROB_UPDATE_CONTEXT.
>
> I don't see any sign of macros being poisoned in system.h.  For macros 
> used in target-independent unwinder code - at least MD_FROB_UPDATE_CONTEXT 
> - that used to be defined in the host tm.h but now no longer should be, I 
> think poisoning in system.h is appropriate.

Good point: I simply had forgotten about this.

>> * The only unwinder-related macro I haven't moved is
>>   LIBGCC2_UNWIND_ATTRIBUTE.  It is only defined gcc/config/mips/mips.h.
>>   I suppose we would need a libgcc equivalent of tm.h for that,
>>   something I didn't want to attack at this point.
>
> What about DWARF_ZERO_REG and PRE_GCC3_DWARF_FRAME_REGISTERS?  
> DWARF_REG_TO_UNWIND_COLUMN may be more complicated because it's used on 
> the host in rs6000.c (although not in target-independent host code) as 
> well as on the target - I suspect that will be a case where duplicating 
> the definition (with a comment in one place pointing to the other place as 
> needing to be kept consistent, and with the host-side copy renamed to 
> facilitate poisoning) may make sense.  And all three are defined in 
> <arch>.h headers so your reason for moving them separately may apply.

I guess.  For the moment, I've concentrated on moving the sources
themselves and the build logic since I've experienced the gcc side
getting in the way of the libgcc side here.

> (There are lots more macros used in the unwinder and on the host for which 
> macros predefined with -fbuilding-libgcc may be appropriate in a later 
> patch.)

Certainly: your wiki entry gives a good overview.  For the moment, I'll
probably concentrate on the build side of things, though.  I may attack
gthr* stuff and fp-bit.[ch] next, both of which I can at least partially
test on my targets.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [build] Move unwinder to toplevel libgcc
  2011-06-20 15:23   ` Rainer Orth
@ 2011-06-20 15:37     ` Joseph S. Myers
  2011-06-20 15:47       ` Rainer Orth
  0 siblings, 1 reply; 36+ messages in thread
From: Joseph S. Myers @ 2011-06-20 15:37 UTC (permalink / raw)
  To: Rainer Orth
  Cc: gcc-patches, Paolo Bonzini, Ralf Wildenhues, Ian Lance Taylor,
	Steve Ellcey, Richard Earnshaw, Ramana Radhakrishnan,
	Nick Clifton, Douglas Rupp, Tristan Gingold, Mike Stump,
	Kaz Kojima, David Edelsohn, Sterling Augustine, Arnaud Charlet,
	java-patches, Nicola Pero, libstdc++,
	Richard Sandiford

On Mon, 20 Jun 2011, Rainer Orth wrote:

> Certainly: your wiki entry gives a good overview.  For the moment, I'll
> probably concentrate on the build side of things, though.  I may attack
> gthr* stuff and fp-bit.[ch] next, both of which I can at least partially
> test on my targets.

fp-bit.[ch] has the interesting issue of FLOAT_BIT_ORDER_MISMATCH and 
FLOAT_WORD_ORDER_MISMATCH being defined by makefile rules when it ought to 
be possible to deduce that information from macros predefined by the 
compiler.  (See what I said in 
<http://gcc.gnu.org/ml/gcc-patches/2010-11/msg02262.html> about the 
meanings of those macros.)

dfp-bit.* and fixed-bit.* can probably move along with fp-bit.* (or 
before, or after), and I don't think there are any complicated issues 
around those files.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [build] Move unwinder to toplevel libgcc
  2011-06-20 15:37     ` Joseph S. Myers
@ 2011-06-20 15:47       ` Rainer Orth
  0 siblings, 0 replies; 36+ messages in thread
From: Rainer Orth @ 2011-06-20 15:47 UTC (permalink / raw)
  To: Joseph S. Myers
  Cc: gcc-patches, Paolo Bonzini, Ralf Wildenhues, Ian Lance Taylor

[Dropping the target maintainers from the Cc: since this isn't relevant
to the patch at hand.]

"Joseph S. Myers" <joseph@codesourcery.com> writes:

> On Mon, 20 Jun 2011, Rainer Orth wrote:
>
>> Certainly: your wiki entry gives a good overview.  For the moment, I'll
>> probably concentrate on the build side of things, though.  I may attack
>> gthr* stuff and fp-bit.[ch] next, both of which I can at least partially
>> test on my targets.
>
> fp-bit.[ch] has the interesting issue of FLOAT_BIT_ORDER_MISMATCH and 
> FLOAT_WORD_ORDER_MISMATCH being defined by makefile rules when it ought to 
> be possible to deduce that information from macros predefined by the 
> compiler.  (See what I said in 
> <http://gcc.gnu.org/ml/gcc-patches/2010-11/msg02262.html> about the 
> meanings of those macros.)

Thanks for the pointer.  Those makefile rules are messy indeed, and what
prompted me to consider looking into this stuff: I just had a
mips-sgi-irix6.5 bootstrap break for me because the generated tp-bit.c
was corrupted, most likely because both multilibs created the file
quasi-simultaneously, mangling it in the process.

> dfp-bit.* and fixed-bit.* can probably move along with fp-bit.* (or 
> before, or after), and I don't think there are any complicated issues 
> around those files.

I'll have a look.  I may move them together if I have to touch many of
the same t-* files for that anyway.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [build] Move unwinder to toplevel libgcc
  2011-06-20 12:44 [build] Move unwinder to toplevel libgcc Rainer Orth
  2011-06-20 15:21 ` Joseph S. Myers
@ 2011-06-29 10:05 ` Paolo Bonzini
  2011-06-29 10:06   ` Rainer Orth
  2011-06-29 11:29   ` Joseph S. Myers
  1 sibling, 2 replies; 36+ messages in thread
From: Paolo Bonzini @ 2011-06-29 10:05 UTC (permalink / raw)
  To: Rainer Orth
  Cc: gcc-patches, Ralf Wildenhues, Ian Lance Taylor, Joseph S. Myers,
	Steve Ellcey, Richard Earnshaw, Ramana Radhakrishnan,
	Nick Clifton, Douglas Rupp, Tristan Gingold, Mike Stump,
	Kaz Kojima, David Edelsohn, Sterling Augustine, Arnaud Charlet,
	java-patches, Nicola Pero, libstdc++,
	Richard Sandiford

[-- Attachment #1: Type: text/plain, Size: 331 bytes --]

On 06/20/2011 02:24 PM, Rainer Orth wrote:
> * The only unwinder-related macro I haven't moved is
>    LIBGCC2_UNWIND_ATTRIBUTE.  It is only defined gcc/config/mips/mips.h.
>    I suppose we would need a libgcc equivalent of tm.h for that,
>    something I didn't want to attack at this point.

Something like the attached?

Paolo

[-- Attachment #2: libgcc-tm.patch --]
[-- Type: text/x-patch, Size: 3148 bytes --]

Index: configure.ac
===================================================================
--- configure.ac	(revision 169877)
+++ configure.ac	(working copy)
@@ -267,6 +267,16 @@ done
 tmake_file="${tmake_file_}"
 AC_SUBST(tmake_file)
 
+# Likewise export definitions for libgcc_tm.h
+tm_file_=
+for f in ${tm_file}
+do
+	tm_file_="${tm_file_} \$(srcdir)/config/$f"
+done
+tm_file="${tm_file_}"
+AC_SUBST(tm_file)
+AC_SUBST(tm_defines)
+
 # Substitute configuration variables
 AC_SUBST(extra_parts)
 AC_SUBST(asm_hidden_op)
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 169877)
+++ Makefile.in	(working copy)
@@ -253,6 +253,16 @@ objects = $(filter %$(objext),$^)
 tmake_file = @tmake_file@
 include $(srcdir)/empty.mk $(tmake_file)
 
+# Collect target defines and headers from config.host.
+libgcc_tm_defines = @tm_defines@
+libgcc_tm_file = @tm_file@
+libgcc_tm.h: libgcc_tm.stamp; @true
+libgcc_tm.stamp:
+	DEFINES='$(libgcc_tm_defines)' HEADERS='$(libgcc_tm_file)' \
+		$(srcdir)/mkheader.sh > tmp-libgcc_tm.h
+	$(SHELL) $(srcdir)/../move-if-change tmp-libgcc_tm.h libgcc_tm.h
+	echo timestamp > $@
+
 # Only handle shared libraries if both:
 #   - the user requested them
 #   - we know how to build them
Index: config.host
===================================================================
--- config.host	(revision 169877)
+++ config.host	(working copy)
@@ -57,6 +57,8 @@
 asm_hidden_op=.hidden
 extra_parts=
 tmake_file=
+tm_defines=
+tm_file=
 
 # Set default cpu_type so it can be updated in each machine entry.
 cpu_type=`echo ${host} | sed 's/-.*$//'`
Index: mkheader.sh
===================================================================
--- mkheader.sh	(revision 0)
+++ mkheader.sh	(revision 0)
@@ -0,0 +1,41 @@
+#! /bin/sh
+
+# Copyright (C) 2001, 2002, 2006, 2007, 2010, 2011 Free Software Foundation, Inc.
+# This file is part of GCC.
+
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.  
+
+
+# Print libgcc_tm.h to the standard output.
+# DEFINES and HEADERS are expected to be set in the environment.
+
+# Add multiple inclusion protection guard, part one.
+echo "#ifndef LIBGCC_TM_H"
+echo "#define LIBGCC_TM_H"
+
+# Generate the body of the file
+echo "/* Automatically generated by mkheader.sh.  */"
+for def in $DEFINES; do
+    echo "#ifndef $def" | sed 's/=.*//'
+    echo "# define $def" | sed 's/=/ /'
+    echo "#endif"
+done
+
+for file in $HEADERS; do
+    echo "#include \"$file\""
+done
+
+# Add multiple inclusion protection guard, part two.
+echo "#endif /* LIBGCC_TM_H"

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [build] Move unwinder to toplevel libgcc
  2011-06-29 10:05 ` [build] " Paolo Bonzini
@ 2011-06-29 10:06   ` Rainer Orth
  2011-06-29 11:29   ` Joseph S. Myers
  1 sibling, 0 replies; 36+ messages in thread
From: Rainer Orth @ 2011-06-29 10:06 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: gcc-patches, Ralf Wildenhues, Ian Lance Taylor, Joseph S. Myers,
	Steve Ellcey, Richard Earnshaw, Ramana Radhakrishnan,
	Nick Clifton, Douglas Rupp, Tristan Gingold, Mike Stump,
	Kaz Kojima, David Edelsohn, Sterling Augustine, Arnaud Charlet,
	java-patches, Nicola Pero, libstdc++,
	Richard Sandiford

Paolo Bonzini <bonzini@gnu.org> writes:

> On 06/20/2011 02:24 PM, Rainer Orth wrote:
>> * The only unwinder-related macro I haven't moved is
>>    LIBGCC2_UNWIND_ATTRIBUTE.  It is only defined gcc/config/mips/mips.h.
>>    I suppose we would need a libgcc equivalent of tm.h for that,
>>    something I didn't want to attack at this point.
>
> Something like the attached?

Yep, that should do it.

Thanks.
	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [build] Move unwinder to toplevel libgcc
  2011-06-29 10:05 ` [build] " Paolo Bonzini
  2011-06-29 10:06   ` Rainer Orth
@ 2011-06-29 11:29   ` Joseph S. Myers
  2011-06-29 11:33     ` Paolo Bonzini
  2011-06-29 12:17     ` Rainer Orth
  1 sibling, 2 replies; 36+ messages in thread
From: Joseph S. Myers @ 2011-06-29 11:29 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Rainer Orth, gcc-patches, Ralf Wildenhues, Ian Lance Taylor,
	Steve Ellcey, Richard Earnshaw, Ramana Radhakrishnan,
	Nick Clifton, Douglas Rupp, Tristan Gingold, Mike Stump,
	Kaz Kojima, David Edelsohn, Sterling Augustine, Arnaud Charlet,
	java-patches, Nicola Pero, libstdc++,
	Richard Sandiford

On Wed, 29 Jun 2011, Paolo Bonzini wrote:

> On 06/20/2011 02:24 PM, Rainer Orth wrote:
> > * The only unwinder-related macro I haven't moved is
> >    LIBGCC2_UNWIND_ATTRIBUTE.  It is only defined gcc/config/mips/mips.h.
> >    I suppose we would need a libgcc equivalent of tm.h for that,
> >    something I didn't want to attack at this point.
> 
> Something like the attached?

This patch appears to create a *second* file called libgcc_tm.h, so there 
is one created in gcc/ and one in libgcc/, which seems incredibly 
confusing.  By all means move the libgcc_tm.h logic to libgcc/ (though 
tm.h will need to continue to include libgcc_tm.h for the target, until 
the transition away from tm.h target macros in target code is complete and 
code includes libgcc_tm.h directly instead), but don't have two headers 
with the same name in different build directories.

I interpreted Rainer's comment as meaning that a 
libgcc/config/mips/mips-lib.h (or similar) file would need to be created 
and inserted in the right place in libgcc_tm_file for the large number of 
targets presently putting mips.h in tm_file.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [build] Move unwinder to toplevel libgcc
  2011-06-29 11:29   ` Joseph S. Myers
@ 2011-06-29 11:33     ` Paolo Bonzini
  2011-06-29 12:40       ` Rainer Orth
  2011-06-29 12:17     ` Rainer Orth
  1 sibling, 1 reply; 36+ messages in thread
From: Paolo Bonzini @ 2011-06-29 11:33 UTC (permalink / raw)
  To: Joseph S. Myers
  Cc: Rainer Orth, gcc-patches, Ralf Wildenhues, Ian Lance Taylor,
	Steve Ellcey, Richard Earnshaw, Ramana Radhakrishnan,
	Nick Clifton, Douglas Rupp, Tristan Gingold, Mike Stump,
	Kaz Kojima, David Edelsohn, Sterling Augustine, Arnaud Charlet,
	java-patches, Nicola Pero, libstdc++,
	Richard Sandiford

On 06/29/2011 12:41 PM, Joseph S. Myers wrote:
> On Wed, 29 Jun 2011, Paolo Bonzini wrote:
>
>> On 06/20/2011 02:24 PM, Rainer Orth wrote:
>>> * The only unwinder-related macro I haven't moved is
>>>     LIBGCC2_UNWIND_ATTRIBUTE.  It is only defined gcc/config/mips/mips.h.
>>>     I suppose we would need a libgcc equivalent of tm.h for that,
>>>     something I didn't want to attack at this point.
>>
>> Something like the attached?
>
> This patch appears to create a *second* file called libgcc_tm.h, so there
> is one created in gcc/ and one in libgcc/, which seems incredibly
> confusing.  By all means move the libgcc_tm.h logic to libgcc/ (though
> tm.h will need to continue to include libgcc_tm.h for the target, until
> the transition away from tm.h target macros in target code is complete and
> code includes libgcc_tm.h directly instead), but don't have two headers
> with the same name in different build directories.

Yes, the patch was not complete and only meant to be the plumbing for 
what you describe.

I think Rainer missed the existence of libgcc_tm_file. :)

Paolo

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [build] Move unwinder to toplevel libgcc
  2011-06-29 11:29   ` Joseph S. Myers
  2011-06-29 11:33     ` Paolo Bonzini
@ 2011-06-29 12:17     ` Rainer Orth
  1 sibling, 0 replies; 36+ messages in thread
From: Rainer Orth @ 2011-06-29 12:17 UTC (permalink / raw)
  To: Joseph S. Myers
  Cc: Paolo Bonzini, gcc-patches, Ralf Wildenhues, Ian Lance Taylor,
	Steve Ellcey, Richard Earnshaw, Ramana Radhakrishnan,
	Nick Clifton, Douglas Rupp, Tristan Gingold, Mike Stump,
	Kaz Kojima, David Edelsohn, Sterling Augustine, Arnaud Charlet,
	java-patches, Nicola Pero, libstdc++,
	Richard Sandiford

"Joseph S. Myers" <joseph@codesourcery.com> writes:

> I interpreted Rainer's comment as meaning that a 
> libgcc/config/mips/mips-lib.h (or similar) file would need to be created 
> and inserted in the right place in libgcc_tm_file for the large number of 
> targets presently putting mips.h in tm_file.

Indeed, that's why I refrained from attacking this by other means.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [build] Move unwinder to toplevel libgcc
  2011-06-29 11:33     ` Paolo Bonzini
@ 2011-06-29 12:40       ` Rainer Orth
  0 siblings, 0 replies; 36+ messages in thread
From: Rainer Orth @ 2011-06-29 12:40 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Joseph S. Myers, gcc-patches, Ralf Wildenhues, Ian Lance Taylor,
	Steve Ellcey, Richard Earnshaw, Ramana Radhakrishnan,
	Nick Clifton, Douglas Rupp, Tristan Gingold, Mike Stump,
	Kaz Kojima, David Edelsohn, Sterling Augustine, Arnaud Charlet,
	java-patches, Nicola Pero, libstdc++,
	Richard Sandiford

Paolo Bonzini <bonzini@gnu.org> writes:

> I think Rainer missed the existence of libgcc_tm_file. :)

I didn't, but it lives in gcc/config.gcc, which is contrary to the move
from gcc to libgcc.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 36+ messages in thread

* CFT: Move unwinder to toplevel libgcc
  2011-06-20 15:21 ` Joseph S. Myers
  2011-06-20 15:23   ` Rainer Orth
@ 2011-07-04 18:10   ` Rainer Orth
  2011-07-05  9:35     ` Tristan Gingold
  1 sibling, 1 reply; 36+ messages in thread
From: Rainer Orth @ 2011-07-04 18:10 UTC (permalink / raw)
  To: Joseph S. Myers
  Cc: gcc-patches, Paolo Bonzini, Ralf Wildenhues, Ian Lance Taylor,
	Steve Ellcey, Richard Earnshaw, Ramana Radhakrishnan,
	Nick Clifton, Douglas Rupp, Tristan Gingold, Mike Stump,
	Kaz Kojima, David Edelsohn, Sterling Augustine, Arnaud Charlet,
	java-patches, Nicola Pero, libstdc++,
	Richard Sandiford

"Joseph S. Myers" <joseph@codesourcery.com> writes:

> On Mon, 20 Jun 2011, Rainer Orth wrote:
>
>> * Move all remaining unwinder-only macros to libgcc: UNW_IVMS_MODE,
>>   MD_UNW_COMPATIBLE_PERSONALITY_P, MD_FROB_UPDATE_CONTEXT.
>
> I don't see any sign of macros being poisoned in system.h.  For macros 
> used in target-independent unwinder code - at least MD_FROB_UPDATE_CONTEXT 
> - that used to be defined in the host tm.h but now no longer should be, I 
> think poisoning in system.h is appropriate.

Done in the updated patch below.  Given that the other two are ia64 only
and not documented in md.texi, I don't think they need to be poisoned.

Otherwise, the patch is unchanged from the original submission:

	[build] Move unwinder to toplevel libgcc
	http://gcc.gnu.org/ml/gcc-patches/2011-06/msg01452.html

Unfortunately, it hasn't seen much comment.  I'm now looking for testers
especially on platforms with more change and approval of those parts:

* Several IA-64 targets:

	ia64*-*-linux*
        ia64*-*-hpux*
        ia64-hp-*vms*

* AIX:

	rs6000-ibm-aix*

Thanks.
	Rainer

	
2011-06-12  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc:
	* Makefile.in (UNWIND_H): Remove.
	(LIB2ADDEH, LIB2ADDEHSTATIC, LIB2ADDEHSHARED): Move to
	../libgcc/Makefile.in.
	(LIBUNWIND, SHLIBUNWIND_LINK, SHLIBUNWIND_INSTALL): Likewise.
	(LIBUNWINDDEP): Remove.
	(libgcc-support): Remove LIB2ADDEH, $(srcdir)/emutls.c dependencies.
	(libgcc.mvars): Remove LIB2ADDEH, LIB2ADDEHSTATIC, LIB2ADDEHSHARED,
	LIBUNWIND, SHLIBUNWIND_LINK, SHLIBUNWIND_INSTALL.
	(stmp-int-hdrs): Remove $(UNWIND_H) dependency.
	Don't copy $(UNWIND_H).
	* config.gcc (ia64*-*-linux*): Remove with_system_libunwind
	handling.
	* configure.ac (GCC_CHECK_UNWIND_GETIPINFO): Remove.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* emutls.c, unwind-c.c, unwind-compat.c, unwind-compat.h,
	unwind-dw2-fde-compat.c, unwind-dw2-fde-darwin.c,
	unwind-dw2-fde-glibc.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
	unwind-dw2.c, unwind-dw2.h, unwind-generic.h, unwind-pe.h,
	unwind-sjlj.c, unwind.inc: Move to ../libgcc.
	* config/arm/libunwind.S, config/arm/pr-support.c,
	config/arm/unwind-arm.c, config/arm/unwind-arm.h: Move to
	../libgcc/config/arm.
	* config/arm/t-bpabi (UNWIND_H, LIB2ADDEH): Remove.
	* config/arm/t-symbian (UNWIND_H, LIB2ADDEH): Remove.
	* config/frv/t-frv ($(T)frvbegin$(objext)): Use
	$(srcdir)/../libgcc to refer to unwind-dw2-fde.h.
	($(T)frvend$(objext)): Likewise.
	* config/ia64/t-glibc (LIB2ADDEH): Remove.
	* config/ia64/t-glibc-libunwind: Move to ../libgcc/config/ia64.
	* config/ia64/fde-glibc.c, config/ia64/fde-vms.c,
	config/ia64/unwind-ia64.c, config/ia64/unwind-ia64.h: Move to
	../libgcc/config/ia64.
	* config/ia64/t-hpux (LIB2ADDEH): Remove.
	* config/ia64/t-ia64 (LIB2ADDEH): Remove.
	* config/ia64/t-vms (LIB2ADDEH): Remove.
	* config/ia64/vms.h (UNW_IVMS_MODE,
	MD_UNW_COMPATIBLE_PERSONALITY_P): Remove.
	* config/picochip/t-picochip (LIB2ADDEH): Remove.
	* config/rs6000/aix.h (R_LR, MD_FROB_UPDATE_CONTEXT): Remove.
	* config/rs6000/t-darwin (LIB2ADDEH): Remove.
	* config/rs6000/darwin-fallback.c: Move to ../libgcc/config/rs6000.
	* config/sh/t-sh ($(T)unwind-dw2-Os-4-200.o): Use
	$(srcdir)/../libgcc to refer to unwinder sources.
	* config/spu/t-spu-elf (LIB2ADDEH): Remove.
	* config/t-darwin (LIB2ADDEH): Remove.
	* config/t-freebsd (LIB2ADDEH): Remove.
	* config/t-libunwind (LIB2ADDEH, LIB2ADDEHSTATIC): Remove.
	* config/t-linux (LIB2ADDEH): Remove.
	* config/t-sol2 (LIB2ADDEH): Remove.
	* config/xtensa/t-xtensa (LIB2ADDEH): Remove.
	* system.h (MD_FROB_UPDATE_CONTEXT): Poison.

	gcc/po:
	* EXCLUDES (unwind-c.c, unwind-dw2-fde-darwin.c,
	unwind-dw2-fde-glibc.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
	unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h): Remove.

	libgcc:
	* Makefile.in (LIB2ADDEH, LIB2ADDEHSTATIC, LIB2ADDEHSHARED): New
	variables.
	(LIBUNWIND, SHLIBUNWIND_LINK, SHLIBUNWIND_INSTALL): New variables.
	(LIB2ADDEH, LIB2ADDEHSTATIC, LIB2ADDEHSHARED): Add $(srcdir)/emutls.c.
	(install-unwind_h): New target.
	(all): Depend on it.
	* config.host (unwind_header): New variable.
	(*-*-freebsd*): Set tmake_file to t-eh-dw2-dip.
	(*-*-linux*, frv-*-*linux*, *-*-kfreebsd*-gnu, *-*-knetbsd*-gnu,
	*-*-gnu*): Likewise, also for *-*-kopensolaris*-gnu.
	(*-*-solaris2*): Add t-eh-dw2-dip to tmake_file.
	(arm*-*-linux-*eabi, arm*-*-uclinux*eabi, arm*-*-eabi*): Add
	arm/t-bpabi to tmake_file.
	Set unwind_header.
	(arm*-*-symbianelf*): Add arm/t-symbian to tmake_file.
	Set unwind_header.
	(ia64*-*-elf*, ia64*-*-freebsd*): Add ia64-t/eh-ia64 to tmake_file.
	(ia64*-*-linux*): Add ia64/t-glibc, ia64/t-eh-ia64 t-libunwind to
	tmake_file.
	Add t-libunwind-elf, ia64/t-glibc-libunwind unless
	$with_system_libunwind.
	(ia64*-*-hpux*): Set tmake_file.
	(ia64-hp-*vms*): Add ia64/t-eh-ia64 to tmake_file.
	(picochip-*-*): Set tmake_file.
	(rs6000-ibm-aix4.[3456789]*, powerpc-ibm-aix4.[3456789]*): Set
	md_unwind_header.
	(rs6000-ibm-aix5.1.*, powerpc-ibm-aix5.1.*): Likewise.
	(rs6000-ibm-aix[56789].*, powerpc-ibm-aix[56789].*): Likewise.
	(s390x-ibm-tpf*): Add t-eh-dw2-dip to tmake_file.
	(xtensa*-*-elf*, xtensa*-*-linux*): Set tmake_file.
	* configure.ac: Include ../config/unwind_ipinfo.m4.
	Call GCC_CHECK_UNWIND_GETIPINFO.
	Link unwind.h to $unwind_header.
	* configure: Regenerate.
	* emutls.c, unwind-c.c, unwind-compat.c, unwind-compat.h,
	unwind-dw2-fde-compat.c, unwind-dw2-fde-darwin.c,
	unwind-dw2-fde-dip.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
	unwind-dw2.c, unwind-dw2.h, unwind-generic.h, unwind-pe.h,
	unwind-sjlj.c, unwind.inc: New files.
	* config/arm/libunwind.S, config/arm/pr-support.c,
	config/arm/t-bpabi, config/arm/t-symbian, config/arm/unwind-arm.c,
	config/arm/unwind-arm.h,: New files.
	* config/ia64/fde-glibc.c, config/ia64/fde-vms.c,
	config/ia64/t-eh-ia64, config/ia64/t-glibc,
	config/ia64/t-glibc-libunwind, config/ia64/t-hpux,
	config/ia64/t-vms, config/ia64/unwind-ia64.c,
	config/ia64/unwind-ia64.h: New files.
	* config/picochip/t-picochip: New file.
	* config/rs6000/aix-unwind.h, config/rs6000/darwin-fallback.c: New
	files.
	* config/s390/t-tpf (LIB2ADDEH): Remove.
	* config/t-darwin: New file.
	* config/t-eh-dw2-dip: New file.
	* config/t-sol2 (LIB2ADDEH): Remove.
	* config/extensa/t-xtensa: New file.

	gcc/ada:
	* gcc-interface/Makefile.in (raise-gcc.o): Search
	$(srcdir)/../libgcc.

	libgo:
	* Makefile.am (AM_CFLAGS): Search $(srcdir)/../libgcc.
	* Makefile.in: Regenerate.

	libjava:
	* configure.ac (GCC_UNWIND_INCLUDE): Rename to
	LIBGCC_UNWIND_INCLUDE.
	Point to $(multi_basedir)/./libjava/../libgcc.
	* configure: Regenerate.
	* Makefile.am (GCC_UNWIND_INCLUDE): Reflect this.
	* Makefile.in: Regenerate.

	libobjc:
	* Makefile.in (INCLUDES): Search
	$(srcdir)/$(MULTISRCTOP)../libgcc.

	libstdc++-v3:
	* acinclude.m4 (GLIBCXX_EXPORT_INCLUDES): Point TOPLEVEL_INCLUDES
	to $(toplevel_srcdir)/libgcc.
	* configure: Regenerate.

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -377,8 +377,6 @@ USER_H = $(srcdir)/ginclude/float.h \
 USER_H_INC_NEXT_PRE = @user_headers_inc_next_pre@
 USER_H_INC_NEXT_POST = @user_headers_inc_next_post@
 
-UNWIND_H = $(srcdir)/unwind-generic.h
-
 # The GCC to use for compiling crt*.o.
 # Usually the one we just built.
 # Don't use this as a dependency--use $(GCC_PASSES).
@@ -688,18 +686,6 @@ CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(IN
   -fno-stack-protector \
   $(INHIBIT_LIBC_CFLAGS)
 
-# Additional sources to handle exceptions; overridden by targets as needed.
-LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
-   $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
-LIB2ADDEHSTATIC = $(LIB2ADDEH)
-LIB2ADDEHSHARED = $(LIB2ADDEH)
-
-# Don't build libunwind by default.
-LIBUNWIND =
-LIBUNWINDDEP =
-SHLIBUNWIND_LINK =
-SHLIBUNWIND_INSTALL =
-
 # nm flags to list global symbols in libgcc object files.
 SHLIB_NM_FLAGS = -pg
 
@@ -1923,7 +1909,7 @@ GCC_EXTRA_PARTS := $(sort $(EXTRA_MULTIL
 
 libgcc-support: libgcc.mvars stmp-int-hdrs $(TCONFIG_H) \
 	$(MACHMODE_H) $(FPBIT) $(DPBIT) $(TPBIT) $(LIB2ADD) \
-	$(LIB2ADD_ST) $(LIB2ADDEH) $(srcdir)/emutls.c gcov-iov.h $(SFP_MACHINE)
+	$(LIB2ADD_ST) gcov-iov.h $(SFP_MACHINE)
 
 libgcc.mvars: config.status Makefile $(LIB2ADD) $(LIB2ADD_ST) specs \
 		xgcc$(exeext)
@@ -1935,13 +1921,7 @@ libgcc.mvars: config.status Makefile $(L
 	echo LIBGCOV = '$(LIBGCOV)' >> tmp-libgcc.mvars
 	echo LIB2ADD = '$(call srcdirify,$(LIB2ADD))' >> tmp-libgcc.mvars
 	echo LIB2ADD_ST = '$(call srcdirify,$(LIB2ADD_ST))' >> tmp-libgcc.mvars
-	echo LIB2ADDEH = '$(call srcdirify,$(LIB2ADDEH) $(srcdir)/emutls.c)' >> tmp-libgcc.mvars
-	echo LIB2ADDEHSTATIC = '$(call srcdirify,$(LIB2ADDEHSTATIC) $(srcdir)/emutls.c)' >> tmp-libgcc.mvars
-	echo LIB2ADDEHSHARED = '$(call srcdirify,$(LIB2ADDEHSHARED) $(srcdir)/emutls.c)' >> tmp-libgcc.mvars
 	echo LIB2_SIDITI_CONV_FUNCS = '$(LIB2_SIDITI_CONV_FUNCS)' >> tmp-libgcc.mvars
-	echo LIBUNWIND = '$(call srcdirify,$(LIBUNWIND))' >> tmp-libgcc.mvars
-	echo SHLIBUNWIND_LINK = '$(SHLIBUNWIND_LINK)' >> tmp-libgcc.mvars
-	echo SHLIBUNWIND_INSTALL = '$(SHLIBUNWIND_INSTALL)' >> tmp-libgcc.mvars
 	echo FPBIT = '$(FPBIT)' >> tmp-libgcc.mvars
 	echo FPBIT_FUNCS = '$(FPBIT_FUNCS)' >> tmp-libgcc.mvars
 	echo LIB2_DIVMOD_FUNCS = '$(LIB2_DIVMOD_FUNCS)' >> tmp-libgcc.mvars
@@ -4130,7 +4110,7 @@ gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(
 # be rebuilt.
 
 # Build the include directories.
-stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) $(UNWIND_H) fixinc_list
+stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) fixinc_list
 # Copy in the headers provided with gcc.
 # The sed command gets just the last file name component;
 # this is necessary because VPATH could add a dirname.
@@ -4162,9 +4142,6 @@ stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) 
 	    chmod a+r include/$$file; \
 	  fi; \
 	done
-	rm -f include/unwind.h
-	cp $(UNWIND_H) include/unwind.h
-	chmod a+r include/unwind.h
 	rm -f include/stdint.h
 	if [ $(USE_GCC_STDINT) = wrap ]; then \
 	  rm -f include/stdint-gcc.h; \
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -2799,7 +2799,7 @@ vx_stack_info.o : vx_stack_info.c
 
 raise-gcc.o : raise-gcc.c raise.h
 	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
-		-iquote $(srcdir) \
+		-iquote $(srcdir)/../libgcc \
 		$(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
 
 cio.o     : cio.c
diff --git a/gcc/config.gcc b/gcc/config.gcc
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1582,9 +1582,6 @@ ia64*-*-freebsd*)
 ia64*-*-linux*)
 	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ia64/sysv4.h ia64/linux.h"
 	tmake_file="${tmake_file} ia64/t-ia64 t-libunwind ia64/t-glibc"
-	if test x$with_system_libunwind != xyes ; then
-		tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind"
-	fi
 	target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
 	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
 	;;
diff --git a/gcc/config/arm/t-bpabi b/gcc/config/arm/t-bpabi
--- a/gcc/config/arm/t-bpabi
+++ b/gcc/config/arm/t-bpabi
@@ -25,11 +25,6 @@ LIB2FUNCS_EXTRA = $(srcdir)/config/arm/b
 
 LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/arm/fp16.c
 
-UNWIND_H = $(srcdir)/config/arm/unwind-arm.h
-LIB2ADDEH = $(srcdir)/config/arm/unwind-arm.c \
-  $(srcdir)/config/arm/libunwind.S \
-  $(srcdir)/config/arm/pr-support.c $(srcdir)/unwind-c.c
-
 # Add the BPABI names.
 SHLIB_MAPFILES += $(srcdir)/config/arm/libgcc-bpabi.ver
 
diff --git a/gcc/config/arm/t-symbian b/gcc/config/arm/t-symbian
--- a/gcc/config/arm/t-symbian
+++ b/gcc/config/arm/t-symbian
@@ -30,10 +30,6 @@ LIB1ASMFUNCS += \
 	_truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
 	_fixsfsi _fixunssfsi
 
-# Include the gcc personality routine
-UNWIND_H = $(srcdir)/config/arm/unwind-arm.h
-LIB2ADDEH = $(srcdir)/unwind-c.c $(srcdir)/config/arm/pr-support.c
-
 # Include half-float helpers.
 LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/arm/fp16.c
 
diff --git a/gcc/config/frv/t-frv b/gcc/config/frv/t-frv
--- a/gcc/config/frv/t-frv
+++ b/gcc/config/frv/t-frv
@@ -1,4 +1,4 @@
-# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -81,12 +81,12 @@ EXTRA_MULTILIB_PARTS=frvbegin.o frvend.o
 FRVSTUFF_CFLAGS = $(TARGET_LIBGCC2_CFLAGS)
 
 $(T)frvbegin$(objext): $(srcdir)/config/frv/frvbegin.c $(GCC_PASSES) \
-  $(CONFIG_H) defaults.h unwind-dw2-fde.h gbl-ctors.h
+  $(CONFIG_H) defaults.h $(srcdir)/../libgcc/unwind-dw2-fde.h gbl-ctors.h
 	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) $(FRVSTUFF_CFLAGS) \
 	  -c $(srcdir)/config/frv/frvbegin.c -o $(T)frvbegin$(objext)
 
 $(T)frvend$(objext): $(srcdir)/config/frv/frvend.c $(GCC_PASSES) \
-  $(CONFIG_H) defaults.h unwind-dw2-fde.h gbl-ctors.h
+  $(CONFIG_H) defaults.h $(srcdir)/../libgcc/unwind-dw2-fde.h gbl-ctors.h
 	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) $(FRVSTUFF_CFLAGS) \
 	  -c $(srcdir)/config/frv/frvend.c -o $(T)frvend$(objext)
 
diff --git a/gcc/config/ia64/t-glibc b/gcc/config/ia64/t-glibc
--- a/gcc/config/ia64/t-glibc
+++ b/gcc/config/ia64/t-glibc
@@ -1,5 +1,1 @@
-# Use system libunwind library on IA-64 GLIBC based system.
-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
-  $(srcdir)/unwind-compat.c
-
 SHLIB_MAPFILES += $(srcdir)/config/ia64/libgcc-glibc.ver
diff --git a/gcc/config/ia64/t-hpux b/gcc/config/ia64/t-hpux
--- a/gcc/config/ia64/t-hpux
+++ b/gcc/config/ia64/t-hpux
@@ -1,5 +1,5 @@
 # Copyright (C) 2001, 2002, 2003, 2004, 2005,
-# 2006 Free Software Foundation, Inc.
+# 2006, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -50,8 +50,6 @@ LIBGCC1_TEST =
 
 T_CFLAGS += -DUSE_LIBUNWIND_EXCEPTIONS
 
-LIB2ADDEH = $(srcdir)/unwind-c.c
-
 SHLIB_EXT = .so
 # Must include -lunwind in the link, so that libgcc_s.so has the necessary
 # DT_NEEDED entry for libunwind.
diff --git a/gcc/config/ia64/t-ia64 b/gcc/config/ia64/t-ia64
--- a/gcc/config/ia64/t-ia64
+++ b/gcc/config/ia64/t-ia64
@@ -43,9 +43,6 @@ SHLIB_MAPFILES += $(srcdir)/config/ia64/
 # Effectively disable the crtbegin/end rules using crtstuff.c
 T = disable
 
-LIB2ADDEH = $(srcdir)/config/ia64/unwind-ia64.c $(srcdir)/unwind-sjlj.c \
-  $(srcdir)/unwind-c.c
-
 ia64-c.o: $(srcdir)/config/ia64/ia64-c.c $(CONFIG_H) $(SYSTEM_H) \
     coretypes.h $(TM_H) $(TREE_H) $(CPPLIB_H) $(C_COMMON_H) $(C_PRAGMA_H)
 	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
diff --git a/gcc/config/ia64/t-vms b/gcc/config/ia64/t-vms
--- a/gcc/config/ia64/t-vms
+++ b/gcc/config/ia64/t-vms
@@ -32,8 +32,6 @@ CRTSTUFF_T_CFLAGS_S = -O0
 	$(GCC_FOR_TARGET) -I. -c -o $(T)crtinitS.o -x assembler-with-cpp \
 		$(srcdir)/config/ia64/vms-crtinit.asm
 
-LIB2ADDEH += $(srcdir)/config/ia64/fde-vms.c
-
 # Shared library macros
 shlib_version:=$(shell echo $(BASEVER_c) | sed -e 's/\./,/' -e 's/\.//g')
 SHLIB_EXT = .exe
diff --git a/gcc/config/ia64/vms.h b/gcc/config/ia64/vms.h
--- a/gcc/config/ia64/vms.h
+++ b/gcc/config/ia64/vms.h
@@ -185,9 +185,6 @@ typedef struct crtl_name_spec
 /* Define this to be nonzero if static stack checking is supported.  */
 #define STACK_CHECK_STATIC_BUILTIN 1
 
-#define UNW_IVMS_MODE(HEADER) (((HEADER) >> 44) & 0x3L)
-#define MD_UNW_COMPATIBLE_PERSONALITY_P(HEADER) (!UNW_IVMS_MODE (HEADER))
-
 /* Minimum amount of stack required to recover from an anticipated stack
    overflow detection.  The default value conveys an estimate of the amount
    of stack required to propagate an exception.  */
diff --git a/gcc/config/picochip/t-picochip b/gcc/config/picochip/t-picochip
--- a/gcc/config/picochip/t-picochip
+++ b/gcc/config/picochip/t-picochip
@@ -43,9 +43,6 @@ LIB2FUNCS_EXTRA = \
 LIB1ASMFUNCS = _mulsc3 _divsc3
 LIB1ASMSRC = picochip/libgccExtras/fake_libgcc.asm
 
-# Turn off the building of exception handling libraries.
-LIB2ADDEH =
-
 # Turn off ranlib on target libraries.
 RANLIB_FOR_TARGET = cat
 
diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h
--- a/gcc/config/rs6000/aix.h
+++ b/gcc/config/rs6000/aix.h
@@ -209,40 +209,6 @@
 /* And similarly for general purpose registers.  */
 #define GP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 32)
 
-/* If the current unwind info (FS) does not contain explicit info
-   saving R2, then we have to do a minor amount of code reading to
-   figure out if it was saved.  The big problem here is that the
-   code that does the save/restore is generated by the linker, so
-   we have no good way to determine at compile time what to do.  */
-
-#define R_LR 65
-
-#ifdef __64BIT__
-#define MD_FROB_UPDATE_CONTEXT(CTX, FS)					\
-  do {									\
-    if ((FS)->regs.reg[2].how == REG_UNSAVED)				\
-      {									\
-	unsigned int *insn						\
-	  = (unsigned int *)						\
-	    _Unwind_GetGR ((CTX), R_LR);				\
-	if (*insn == 0xE8410028)					\
-	  _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 40);			\
-      }									\
-  } while (0)
-#else
-#define MD_FROB_UPDATE_CONTEXT(CTX, FS)					\
-  do {									\
-    if ((FS)->regs.reg[2].how == REG_UNSAVED)				\
-      {									\
-	unsigned int *insn						\
-	  = (unsigned int *)						\
-	    _Unwind_GetGR ((CTX), R_LR);				\
-	if (*insn == 0x80410014)					\
-	  _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 20);			\
-      }									\
-  } while (0)
-#endif
-
 #define PROFILE_HOOK(LABEL)   output_profile_hook (LABEL)
 
 /* No version of AIX fully supports AltiVec or 64-bit instructions in
diff --git a/gcc/config/rs6000/t-darwin b/gcc/config/rs6000/t-darwin
--- a/gcc/config/rs6000/t-darwin
+++ b/gcc/config/rs6000/t-darwin
@@ -1,5 +1,5 @@
 # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006,
-# 2007 Free Software Foundation, Inc.
+# 2007, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -42,8 +42,6 @@ TARGET_LIBGCC2_CFLAGS = -Wa,-force_cpusu
 # Export the _xlq* symbols from darwin-ldouble.c.
 SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ppc64.ver
 
-LIB2ADDEH += $(srcdir)/config/rs6000/darwin-fallback.c
-
 darwin-fpsave.o:	$(srcdir)/config/rs6000/darwin-asm.h
 darwin-tramp.o:		$(srcdir)/config/rs6000/darwin-asm.h
 
diff --git a/gcc/config/sh/t-sh b/gcc/config/sh/t-sh
--- a/gcc/config/sh/t-sh
+++ b/gcc/config/sh/t-sh
@@ -1,5 +1,5 @@
 # Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2006, 2008, 2009 Free Software Foundation, Inc.
+# 2003, 2004, 2006, 2008, 2009, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -149,7 +149,7 @@ EXTRA_MULTILIB_PARTS= $(IC_EXTRA_PARTS) 
 	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $@ -DL_sdivsi3_i4i -x assembler-with-cpp $<
 $(T)udivsi3_i4i-Os-4-200.o: $(srcdir)/config/sh/lib1funcs-Os-4-200.asm $(GCC_PASSES)
 	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $@ -DL_udivsi3_i4i -x assembler-with-cpp $<
-$(T)unwind-dw2-Os-4-200.o: $(srcdir)/unwind-dw2.c $(srcdir)/unwind-generic.h unwind-pe.h unwind.inc unwind-dw2-fde.h unwind-dw2.h $(CONFIG_H) coretypes.h $(TM_H) $(MACHMODE_H) longlong.h config.status stmp-int-hdrs tsystem.h $(GCC_PASSES)
+$(T)unwind-dw2-Os-4-200.o: $(srcdir)/../libgcc/unwind-dw2.c $(srcdir)/../libgcc/unwind-generic.h $(srcdir)/../libgcc/unwind-pe.h $(srcdir)/../libgcc/unwind.inc $(srcdir)/../libgcc/unwind-dw2-fde.h $(srcdir)/../libgcc/unwind-dw2.h $(CONFIG_H) coretypes.h $(TM_H) $(MACHMODE_H) longlong.h config.status stmp-int-hdrs tsystem.h $(GCC_PASSES)
 	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) $(LIBGCC2_CFLAGS) $(INCLUDES) $(vis_hide) -fexceptions -Os -c -o $@ $<
 OBJS_Os_4_200=$(T)sdivsi3_i4i-Os-4-200.o $(T)udivsi3_i4i-Os-4-200.o $(T)unwind-dw2-Os-4-200.o
 $(T)libgcc-Os-4-200.a: $(OBJS_Os_4_200) $(GCC_PASSES)
diff --git a/gcc/config/spu/t-spu-elf b/gcc/config/spu/t-spu-elf
--- a/gcc/config/spu/t-spu-elf
+++ b/gcc/config/spu/t-spu-elf
@@ -47,9 +47,6 @@ LIB2FUNCS_STATIC_EXTRA = $(srcdir)/confi
 			 $(srcdir)/config/spu/divmodti4.c \
 			 $(srcdir)/config/spu/divv2df3.c
 
-LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
-   $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
-
 # We want fine grained libraries, so use the new code to build the
 # floating point emulation libraries.
 FPBIT = fp-bit.c
diff --git a/gcc/config/t-darwin b/gcc/config/t-darwin
--- a/gcc/config/t-darwin
+++ b/gcc/config/t-darwin
@@ -51,10 +51,6 @@ EXTRA_MULTILIB_PARTS=crt3.o
 	  -fno-tree-dominator-opts $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) \
 	  -c $(srcdir)/config/darwin-crt3.c -o $(T)crt3$(objext)
 
-# Use unwind-dw2-fde-darwin
-LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-darwin.c \
-  $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
-
 # -pipe because there's an assembler bug, 4077127, which causes
 # it to not properly process the first # directive, causing temporary
 # file names to appear in stabs, causing the bootstrap to fail.  Using -pipe
diff --git a/gcc/config/t-freebsd b/gcc/config/t-freebsd
--- a/gcc/config/t-freebsd
+++ b/gcc/config/t-freebsd
@@ -3,7 +3,3 @@ CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAG
 
 # Compile libgcc.a with pic.
 TARGET_LIBGCC2_CFLAGS += -fPIC
-
-# Use unwind-dw2-fde-glibc
-LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
-  $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
diff --git a/gcc/config/t-libunwind b/gcc/config/t-libunwind
--- a/gcc/config/t-libunwind
+++ b/gcc/config/t-libunwind
@@ -1,4 +1,4 @@
-# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -22,9 +22,6 @@
 # so that the resulting libgcc_s.so has the necessary DT_NEEDED entry for
 # libunwind.
 SHLIB_LC = -lunwind -lc
-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
-  $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c
-LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
 
 T_CFLAGS += -DUSE_LIBUNWIND_EXCEPTIONS
 TARGET_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER
diff --git a/gcc/config/t-linux b/gcc/config/t-linux
--- a/gcc/config/t-linux
+++ b/gcc/config/t-linux
@@ -25,7 +25,3 @@ TARGET_LIBGCC2_CFLAGS = -fPIC
 # Override t-slibgcc-elf-ver to export some libgcc symbols with
 # the symbol versions that glibc used.
 SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver
-
-# Use unwind-dw2-fde-glibc
-LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
-  $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
diff --git a/gcc/config/t-sol2 b/gcc/config/t-sol2
--- a/gcc/config/t-sol2
+++ b/gcc/config/t-sol2
@@ -31,8 +31,3 @@ sol2.o: $(srcdir)/config/sol2.c $(CONFIG
 
 # This is required by gcc/ada/gcc-interface/Makefile.in.
 TARGET_LIBGCC2_CFLAGS = -fPIC
-
-# Use unwind-dw2-fde-glibc.c.  Unless linker support and dl_iterate_phdr
-# are present, automatically falls back to unwind-dw2-fde.c.
-LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
-  $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
diff --git a/gcc/config/xtensa/t-xtensa b/gcc/config/xtensa/t-xtensa
--- a/gcc/config/xtensa/t-xtensa
+++ b/gcc/config/xtensa/t-xtensa
@@ -1,4 +1,5 @@
-# Copyright (C) 2002, 2003, 2006, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2006, 2007, 2008, 2011
+# Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -29,8 +30,6 @@ LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3 _
 	_truncdfsf2 _extendsfdf2
 
 LIB2FUNCS_EXTRA = $(srcdir)/config/xtensa/lib2funcs.S
-LIB2ADDEH = $(srcdir)/config/xtensa/unwind-dw2-xtensa.c \
-   $(srcdir)/unwind-dw2-fde.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
 
 $(T)crti.o: $(srcdir)/config/xtensa/crti.asm $(GCC_PASSES)
 	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
diff --git a/gcc/configure.ac b/gcc/configure.ac
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1173,11 +1173,6 @@ if test $force_sjlj_exceptions = yes; th
     [Define 0/1 to force the choice for exception handling model.])
 fi
 
-# For platforms with the unwind ABI which includes an unwind library,
-# libunwind, we can choose to use the system libunwind.
-# config.gcc also contains tests of with_system_libunwind.
-GCC_CHECK_UNWIND_GETIPINFO
-
 # --------------------------------------------------------
 # Build, host, and target specific configuration fragments
 # --------------------------------------------------------
diff --git a/gcc/po/EXCLUDES b/gcc/po/EXCLUDES
--- a/gcc/po/EXCLUDES
+++ b/gcc/po/EXCLUDES
@@ -46,15 +46,6 @@ libgcov.c
 limitx.h
 limity.h
 longlong.h
-unwind-c.c
-unwind-dw2-fde-darwin.c
-unwind-dw2-fde-glibc.c
-unwind-dw2-fde.c
-unwind-dw2-fde.h
-unwind-dw2.c
-unwind-pe.h
-unwind-sjlj.c
-unwind.h
 
 #   These programs are meant to be executed only by GCC maintainers or
 #   installers.  Such files do not need to be translated, as these
diff --git a/gcc/system.h b/gcc/system.h
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -764,7 +764,7 @@ extern void fancy_abort (const char *, i
 /* Target macros only used for code built for the target, that have
    moved to libgcc-tm.h or have never been present elsewhere.  */
  #pragma GCC poison DECLARE_LIBRARY_RENAMES LIBGCC2_GNU_PREFIX		\
-	MD_UNWIND_SUPPORT ENABLE_EXECUTE_STACK
+	MD_UNWIND_SUPPORT MD_FROB_UPDATE_CONTEXT ENABLE_EXECUTE_STACK
 
 /* Other obsolete target macros, or macros that used to be in target
    headers and were not used, and may be obsolete or may never have
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -255,6 +255,17 @@ objects = $(filter %$(objext),$^)
 LIBGCC_VER_GNU_PREFIX = __
 LIBGCC_VER_SYMBOLS_PREFIX =
 
+# Additional sources to handle exceptions; overridden by targets as needed.
+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
+  $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+LIB2ADDEHSTATIC = $(LIB2ADDEH)
+LIB2ADDEHSHARED = $(LIB2ADDEH)
+
+# Don't build libunwind by default.
+LIBUNWIND =
+SHLIBUNWIND_LINK =
+SHLIBUNWIND_INSTALL =
+
 tmake_file = @tmake_file@
 include $(srcdir)/empty.mk $(tmake_file)
 
@@ -315,6 +326,10 @@ endif
 
 LIB2ADD += enable-execute-stack.c
 
+LIB2ADDEH += $(srcdir)/emutls.c
+LIB2ADDEHSTATIC += $(srcdir)/emutls.c
+LIB2ADDEHSHARED += $(srcdir)/emutls.c
+
 # Library members defined in libgcc2.c.
 lib2funcs = _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _cmpdi2 _ucmpdi2	   \
 	    _clear_cache _trampoline __main _absvsi2 \
@@ -931,6 +946,12 @@ gcc-extra-parts:
 
 all: $(extra-parts)
 
+install-unwind_h:
+	cp unwind.h $(gcc_objdir)/include/unwind.h
+	chmod a+r $(gcc_objdir)/include/unwind.h
+
+all: install-unwind_h
+
 # Documentation targets (empty).
 .PHONY: info html dvi pdf install-info install-html install-pdf
 
diff --git a/libgcc/config.host b/libgcc/config.host
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -57,12 +57,15 @@
 #  tmake_file		A list of machine-description-specific
 #			makefile-fragments, if different from
 #			"$cpu_type/t-$cpu_type".
+#  unwind_header	The name of the header file declaring the unwind
+#			runtime interface routines.
 
 asm_hidden_op=.hidden
 enable_execute_stack=
 extra_parts=
 tmake_file=
 md_unwind_header=no-unwind.h
+unwind_header=unwind-generic.h
 
 # Set default cpu_type so it can be updated in each machine entry.
 cpu_type=`echo ${host} | sed 's/-.*$//'`
@@ -164,8 +167,10 @@ case ${host} in
   # This is the generic ELF configuration of FreeBSD.  Later
   # machine-specific sections may refine and add to this
   # configuration.
+  tmake_file=t-eh-dw2-dip
   ;;
-*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu*)
+*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
+  tmake_file=t-eh-dw2-dip
   extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
   ;;
 *-*-netbsd*)
@@ -175,7 +180,9 @@ case ${host} in
 *-*-rtems*)
   ;;
 *-*-solaris2*)
-  tmake_file="$tmake_file t-sol2 t-slibgcc t-slibgcc-elf-ver"
+  # Unless linker support and dl_iterate_phdr are present,
+  # unwind-dw2-fde-dip.c automatically falls back to unwind-dw2-fde.c.
+  tmake_file="$tmake_file t-sol2 t-eh-dw2-dip t-slibgcc t-slibgcc-elf-ver"
   if test $with_gnu_ld = yes; then
     tmake_file="$tmake_file t-slibgcc-gld"
   else
@@ -262,12 +269,34 @@ arm*-*-freebsd*)
 arm*-*-netbsdelf*)
 	;;
 arm*-*-linux*)			# ARM GNU/Linux with ELF
+	case ${host} in
+	arm*-*-linux-*eabi)
+	  tmake_file=arm/t-bpabi
+	  unwind_header=config/arm/unwind-arm.h
+	  ;;
+	esac
 	;;
 arm*-*-uclinux*)		# ARM ucLinux
+	case ${host} in
+	arm*-*-uclinux*eabi)
+	  tmake_file=arm/t-bpabi
+	  unwind_header=config/arm/unwind-arm.h
+	  ;;
+	esac
 	;;
 arm*-*-ecos-elf)
 	;;
 arm*-*-eabi* | arm*-*-symbianelf* )
+	case ${host} in
+	arm*-*-eabi*)
+	  tmake_file=arm/t-bpabi
+	  unwind_header=config/arm/unwind-arm.h
+	  ;;
+	arm*-*-symbianelf*)
+	  tmake_file=arm/t-symbian
+	  unwind_header=config/arm/unwind-arm.h
+	  ;;
+	esac
 	;;
 arm*-*-rtems*)
 	;;
@@ -397,21 +426,25 @@ i[34567]86-*-interix3*)
 	;;
 ia64*-*-elf*)
 	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
-	tmake_file="ia64/t-ia64"
+	tmake_file="ia64/t-ia64 ia64/t-eh-ia64"
 	;;
 ia64*-*-freebsd*)
 	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
-	tmake_file="ia64/t-ia64"
+	tmake_file="ia64/t-ia64 ia64/t-eh-ia64"
 	;;
 ia64*-*-linux*)
 	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
-	tmake_file="ia64/t-ia64 t-softfp ia64/t-fprules-softfp ia64/t-softfp-compat"
+	tmake_file="ia64/t-ia64 t-softfp ia64/t-fprules-softfp ia64/t-softfp-compat ia64/t-glibc ia64/t-eh-ia64 t-libunwind"
+	if test x$with_system_libunwind != xyes ; then
+		tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind"
+	fi
 	md_unwind_header=ia64/linux-unwind.h
 	;;
 ia64*-*-hpux*)
+	tmake_file="ia64/t-hpux ia64/t-eh-ia64"
 	;;
 ia64-hp-*vms*)
-	tmake_file="vms/t-vms vms/t-vms64 ia64/t-vms"
+	tmake_file="vms/t-vms vms/t-vms64 ia64/t-eh-ia64 ia64/t-vms"
 	md_unwind_header=ia64/vms-unwind.h
 	;;
 iq2000*-*-elf*)
@@ -511,6 +544,7 @@ moxie-*-*)
 pdp11-*-*)
 	;;
 picochip-*-*)
+	tmake_file=picochip/t-picochip
         ;;
 powerpc-*-darwin*)
 	case ${host} in
@@ -561,10 +595,13 @@ powerpcle-*-eabisim*)
 powerpcle-*-eabi*)
 	;;
 rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*)
+	md_unwind_header=rs6000/aix-unwind.h
 	;;
 rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*)
+	md_unwind_header=rs6000/aix-unwind.h
 	;;
 rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*)
+	md_unwind_header=rs6000/aix-unwind.h
 	;;
 rx-*-elf)
 	extra_parts="crtbegin.o crtend.o"
@@ -579,7 +616,7 @@ s390x-*-linux*)
 	md_unwind_header=s390/linux-unwind.h
 	;;
 s390x-ibm-tpf*)
-	tmake_file="${tmake_file} s390/t-crtstuff s390/t-tpf"
+	tmake_file="${tmake_file} s390/t-crtstuff s390/t-tpf t-eh-dw2-dip"
 	md_unwind_header=s390/tpf-unwind.h
 	;;
 score-*-elf)
@@ -660,8 +697,10 @@ vax-*-openbsd*)
 xstormy16-*-elf)
 	;;
 xtensa*-*-elf*)
+	tmake_file=xtensa/t-xtensa
 	;;
 xtensa*-*-linux*)
+	tmake_file=xtensa/t-xtensa
 	md_unwind_header=xtensa/linux-unwind.h
 	;;
 am33_2.0-*-linux*)
diff --git a/gcc/config/arm/libunwind.S b/libgcc/config/arm/libunwind.S
rename from gcc/config/arm/libunwind.S
rename to libgcc/config/arm/libunwind.S
diff --git a/gcc/config/arm/pr-support.c b/libgcc/config/arm/pr-support.c
rename from gcc/config/arm/pr-support.c
rename to libgcc/config/arm/pr-support.c
diff --git a/libgcc/config/arm/t-bpabi b/libgcc/config/arm/t-bpabi
new file mode 100644
--- /dev/null
+++ b/libgcc/config/arm/t-bpabi
@@ -0,0 +1,3 @@
+LIB2ADDEH = $(srcdir)/config/arm/unwind-arm.c \
+  $(srcdir)/config/arm/libunwind.S \
+  $(srcdir)/config/arm/pr-support.c $(srcdir)/unwind-c.c
diff --git a/libgcc/config/arm/t-symbian b/libgcc/config/arm/t-symbian
new file mode 100644
--- /dev/null
+++ b/libgcc/config/arm/t-symbian
@@ -0,0 +1,2 @@
+# Include the gcc personality routine
+LIB2ADDEH = $(srcdir)/unwind-c.c $(srcdir)/config/arm/pr-support.c
diff --git a/gcc/config/arm/unwind-arm.c b/libgcc/config/arm/unwind-arm.c
rename from gcc/config/arm/unwind-arm.c
rename to libgcc/config/arm/unwind-arm.c
diff --git a/gcc/config/arm/unwind-arm.h b/libgcc/config/arm/unwind-arm.h
rename from gcc/config/arm/unwind-arm.h
rename to libgcc/config/arm/unwind-arm.h
diff --git a/gcc/config/ia64/fde-glibc.c b/libgcc/config/ia64/fde-glibc.c
rename from gcc/config/ia64/fde-glibc.c
rename to libgcc/config/ia64/fde-glibc.c
diff --git a/gcc/config/ia64/fde-vms.c b/libgcc/config/ia64/fde-vms.c
rename from gcc/config/ia64/fde-vms.c
rename to libgcc/config/ia64/fde-vms.c
--- a/gcc/config/ia64/fde-vms.c
+++ b/libgcc/config/ia64/fde-vms.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2009, 2011 Free Software Foundation, Inc.
    Contributed by Douglas B Rupp <rupp@gnat.com>
 
    This file is part of GCC.
@@ -32,6 +32,7 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include "md-unwind-support.h"
 #include "unwind-ia64.h"
 
 #define __int64 long
diff --git a/libgcc/config/ia64/t-eh-ia64 b/libgcc/config/ia64/t-eh-ia64
new file mode 100644
--- /dev/null
+++ b/libgcc/config/ia64/t-eh-ia64
@@ -0,0 +1,2 @@
+LIB2ADDEH = $(srcdir)/config/ia64/unwind-ia64.c $(srcdir)/unwind-sjlj.c \
+  $(srcdir)/unwind-c.c
diff --git a/libgcc/config/ia64/t-glibc b/libgcc/config/ia64/t-glibc
new file mode 100644
--- /dev/null
+++ b/libgcc/config/ia64/t-glibc
@@ -0,0 +1,3 @@
+# Use system libunwind library on IA-64 GLIBC based system.
+LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
+  $(srcdir)/unwind-compat.c
diff --git a/gcc/config/ia64/t-glibc-libunwind b/libgcc/config/ia64/t-glibc-libunwind
rename from gcc/config/ia64/t-glibc-libunwind
rename to libgcc/config/ia64/t-glibc-libunwind
--- a/gcc/config/ia64/t-glibc-libunwind
+++ b/libgcc/config/ia64/t-glibc-libunwind
@@ -1,4 +1,3 @@
 # Build libunwind for IA-64 GLIBC based system.
 LIBUNWIND = $(srcdir)/config/ia64/fde-glibc.c \
   $(srcdir)/config/ia64/unwind-ia64.c
-LIBUNWINDDEP = unwind.inc
diff --git a/libgcc/config/ia64/t-hpux b/libgcc/config/ia64/t-hpux
new file mode 100644
--- /dev/null
+++ b/libgcc/config/ia64/t-hpux
@@ -0,0 +1,1 @@
+LIB2ADDEH = $(srcdir)/unwind-c.c
diff --git a/libgcc/config/ia64/t-vms b/libgcc/config/ia64/t-vms
new file mode 100644
--- /dev/null
+++ b/libgcc/config/ia64/t-vms
@@ -0,0 +1,1 @@
+LIB2ADDEH += $(srcdir)/config/ia64/fde-vms.c
diff --git a/gcc/config/ia64/unwind-ia64.c b/libgcc/config/ia64/unwind-ia64.c
rename from gcc/config/ia64/unwind-ia64.c
rename to libgcc/config/ia64/unwind-ia64.c
--- a/gcc/config/ia64/unwind-ia64.c
+++ b/libgcc/config/ia64/unwind-ia64.c
@@ -32,6 +32,7 @@
 #include "coretypes.h"
 #include "tm.h"
 #include "unwind.h"
+#include "md-unwind-support.h"
 #include "unwind-ia64.h"
 #include "unwind-compat.h"
 #include "ia64intrin.h"
diff --git a/gcc/config/ia64/unwind-ia64.h b/libgcc/config/ia64/unwind-ia64.h
rename from gcc/config/ia64/unwind-ia64.h
rename to libgcc/config/ia64/unwind-ia64.h
diff --git a/libgcc/config/ia64/vms-unwind.h b/libgcc/config/ia64/vms-unwind.h
--- a/libgcc/config/ia64/vms-unwind.h
+++ b/libgcc/config/ia64/vms-unwind.h
@@ -1,5 +1,5 @@
 /* DWARF2 EH unwinding support for IA64 VMS.
-   Copyright (C) 2005-2009 Free Software Foundation, Inc.
+   Copyright (C) 2005-2011 Free Software Foundation, Inc.
 
    This file is part of GCC.
 
@@ -32,6 +32,9 @@
 #include <stdio.h>
 #include <string.h>
 
+#define UNW_IVMS_MODE(HEADER) (((HEADER) >> 44) & 0x3L)
+#define MD_UNW_COMPATIBLE_PERSONALITY_P(HEADER) (!UNW_IVMS_MODE (HEADER))
+
 #define DYN$C_SSENTRY 66
 /* ??? would rather get the proper header file.  */
 
diff --git a/libgcc/config/picochip/t-picochip b/libgcc/config/picochip/t-picochip
new file mode 100644
--- /dev/null
+++ b/libgcc/config/picochip/t-picochip
@@ -0,0 +1,2 @@
+# Turn off the building of exception handling libraries.
+LIB2ADDEH =
diff --git a/libgcc/config/rs6000/aix-unwind.h b/libgcc/config/rs6000/aix-unwind.h
new file mode 100644
--- /dev/null
+++ b/libgcc/config/rs6000/aix-unwind.h
@@ -0,0 +1,57 @@
+/* DWARF2 EH unwinding support for AIX.
+   Copyright (C) 2011 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* If the current unwind info (FS) does not contain explicit info
+   saving R2, then we have to do a minor amount of code reading to
+   figure out if it was saved.  The big problem here is that the
+   code that does the save/restore is generated by the linker, so
+   we have no good way to determine at compile time what to do.  */
+
+#define R_LR 65
+
+#ifdef __64BIT__
+#define MD_FROB_UPDATE_CONTEXT(CTX, FS)					\
+  do {									\
+    if ((FS)->regs.reg[2].how == REG_UNSAVED)				\
+      {									\
+	unsigned int *insn						\
+	  = (unsigned int *)						\
+	    _Unwind_GetGR ((CTX), R_LR);				\
+	if (*insn == 0xE8410028)					\
+	  _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 40);			\
+      }									\
+  } while (0)
+#else
+#define MD_FROB_UPDATE_CONTEXT(CTX, FS)					\
+  do {									\
+    if ((FS)->regs.reg[2].how == REG_UNSAVED)				\
+      {									\
+	unsigned int *insn						\
+	  = (unsigned int *)						\
+	    _Unwind_GetGR ((CTX), R_LR);				\
+	if (*insn == 0x80410014)					\
+	  _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 20);			\
+      }									\
+  } while (0)
+#endif
diff --git a/gcc/config/rs6000/darwin-fallback.c b/libgcc/config/rs6000/darwin-fallback.c
rename from gcc/config/rs6000/darwin-fallback.c
rename to libgcc/config/rs6000/darwin-fallback.c
diff --git a/libgcc/config/rs6000/t-darwin b/libgcc/config/rs6000/t-darwin
--- a/libgcc/config/rs6000/t-darwin
+++ b/libgcc/config/rs6000/t-darwin
@@ -1,1 +1,3 @@
+LIB2ADDEH += $(srcdir)/config/rs6000/darwin-fallback.c
+
 SHLIB_VERPFX = $(gcc_srcdir)/config/rs6000/darwin-libgcc
diff --git a/libgcc/config/s390/t-tpf b/libgcc/config/s390/t-tpf
--- a/libgcc/config/s390/t-tpf
+++ b/libgcc/config/s390/t-tpf
@@ -1,7 +1,2 @@
 # Compile libgcc2.a with pic.
 HOST_LIBGCC2_CFLAGS += -fPIC
-
-# Use unwind-dw2-fde-glibc.
-LIB2ADDEH = $(gcc_srcdir)/unwind-dw2.c $(gcc_srcdir)/unwind-dw2-fde-glibc.c \
-  $(gcc_srcdir)/unwind-sjlj.c $(gcc_srcdir)/unwind-c.c \
-  $(gcc_srcdir)/emutls.c
diff --git a/libgcc/config/t-darwin b/libgcc/config/t-darwin
new file mode 100644
--- /dev/null
+++ b/libgcc/config/t-darwin
@@ -0,0 +1,3 @@
+# Use unwind-dw2-fde-darwin
+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-darwin.c \
+  $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
diff --git a/libgcc/config/t-eh-dw2-dip b/libgcc/config/t-eh-dw2-dip
new file mode 100644
--- /dev/null
+++ b/libgcc/config/t-eh-dw2-dip
@@ -0,0 +1,3 @@
+# Use unwind-dw2-fde-dip.
+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-dip.c \
+  $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
diff --git a/libgcc/config/t-libunwind b/libgcc/config/t-libunwind
new file mode 100644
--- /dev/null
+++ b/libgcc/config/t-libunwind
@@ -0,0 +1,3 @@
+LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
+  $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c
+LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
diff --git a/gcc/config/t-libunwind-elf b/libgcc/config/t-libunwind-elf
rename from gcc/config/t-libunwind-elf
rename to libgcc/config/t-libunwind-elf
--- a/gcc/config/t-libunwind-elf
+++ b/libgcc/config/t-libunwind-elf
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -18,14 +18,13 @@
 
 # Build libunwind for ELF with the GNU linker.
 
-# Use unwind-dw2-fde-glibc
-LIBUNWIND = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c
-LIBUNWINDDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
+# Use unwind-dw2-fde-dip
+LIBUNWIND = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-dip.c
 
 SHLIBUNWIND_SOVERSION = 7
 SHLIBUNWIND_SONAME = @shlib_base_name@.so.$(SHLIBUNWIND_SOVERSION)
 
-SHLIBUNWIND_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared \
+SHLIBUNWIND_LINK = $(CC) $(LIBGCC2_CFLAGS) -shared \
 	-nodefaultlibs -Wl,-h,$(SHLIBUNWIND_SONAME) \
 	-Wl,-z,text -Wl,-z,defs -o $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME).tmp \
 	@multilib_flags@ $(SHLIB_OBJS) -lc && \
@@ -38,12 +37,10 @@ SHLIBUNWIND_LINK = $(GCC_FOR_TARGET) $(L
 	   $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME) && \
 	$(LN_S) $(SHLIBUNWIND_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK)
 
-# $(slibdir) double quoted to protect it from expansion while building
-# libgcc.mk.  We want this delayed until actual install time.
 SHLIBUNWIND_INSTALL = \
-	$$(SHELL) $$(srcdir)/mkinstalldirs $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
+	$(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
 	$(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME) \
-	  $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIBUNWIND_SONAME); \
-	rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
+	  $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIBUNWIND_SONAME); \
+	rm -f $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
 	$(LN_S) $(SHLIBUNWIND_SONAME) \
-	  $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
+	  $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
diff --git a/libgcc/config/t-sol2 b/libgcc/config/t-sol2
--- a/libgcc/config/t-sol2
+++ b/libgcc/config/t-sol2
@@ -16,11 +16,6 @@
 # along with GCC; see the file COPYING3.  If not see
 # <http://www.gnu.org/licenses/>.
 
-# Use unwind-dw2-fde-glibc.c.  Unless linker support and dl_iterate_phdr
-# are present, automatically falls back to unwind-dw2-fde.c.
-LIB2ADDEH = $(gcc_srcdir)/unwind-dw2.c $(gcc_srcdir)/unwind-dw2-fde-glibc.c \
-  $(gcc_srcdir)/unwind-sjlj.c $(gcc_srcdir)/unwind-c.c $(gcc_srcdir)/emutls.c
-
 # gmon build rule:
 gmon.o:	$(srcdir)/config/gmon-sol2.c
 	$(gcc_compile) -c $<
diff --git a/libgcc/config/xtensa/t-xtensa b/libgcc/config/xtensa/t-xtensa
new file mode 100644
--- /dev/null
+++ b/libgcc/config/xtensa/t-xtensa
@@ -0,0 +1,2 @@
+LIB2ADDEH = $(srcdir)/config/xtensa/unwind-dw2-xtensa.c \
+   $(srcdir)/unwind-dw2-fde.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
diff --git a/gcc/config/xtensa/unwind-dw2-xtensa.c b/libgcc/config/xtensa/unwind-dw2-xtensa.c
rename from gcc/config/xtensa/unwind-dw2-xtensa.c
rename to libgcc/config/xtensa/unwind-dw2-xtensa.c
diff --git a/gcc/config/xtensa/unwind-dw2-xtensa.h b/libgcc/config/xtensa/unwind-dw2-xtensa.h
rename from gcc/config/xtensa/unwind-dw2-xtensa.h
rename to libgcc/config/xtensa/unwind-dw2-xtensa.h
diff --git a/libgcc/configure.ac b/libgcc/configure.ac
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -7,6 +7,7 @@ sinclude(../config/no-executables.m4)
 sinclude(../config/lib-ld.m4)
 sinclude(../config/override.m4)
 sinclude(../config/dfp.m4)
+sinclude(../config/unwind_ipinfo.m4)
 
 AC_PREREQ(2.64)
 AC_INIT([GNU C Runtime Library], 1.0,,[libgcc])
@@ -167,6 +168,11 @@ AC_CACHE_CHECK([whether fixed-point is s
 fixed_point=$libgcc_cv_fixed_point
 AC_SUBST(fixed_point)
 
+# For platforms with the unwind ABI which includes an unwind library,
+# libunwind, we can choose to use the system libunwind.
+# config.gcc also contains tests of with_system_libunwind.
+GCC_CHECK_UNWIND_GETIPINFO
+
 AC_LIB_PROG_LD_GNU
 
 AC_MSG_CHECKING([for thread model used by GCC])
@@ -279,6 +285,7 @@ AC_SUBST(cpu_type)
 AC_SUBST(extra_parts)
 AC_SUBST(asm_hidden_op)
 AC_CONFIG_LINKS([enable-execute-stack.c:$enable_execute_stack])
+AC_CONFIG_LINKS([unwind.h:$unwind_header])
 AC_CONFIG_LINKS([md-unwind-support.h:config/$md_unwind_header])
 
 # We need multilib support.
diff --git a/gcc/emutls.c b/libgcc/emutls.c
rename from gcc/emutls.c
rename to libgcc/emutls.c
diff --git a/gcc/unwind-c.c b/libgcc/unwind-c.c
rename from gcc/unwind-c.c
rename to libgcc/unwind-c.c
diff --git a/gcc/unwind-compat.c b/libgcc/unwind-compat.c
rename from gcc/unwind-compat.c
rename to libgcc/unwind-compat.c
diff --git a/gcc/unwind-compat.h b/libgcc/unwind-compat.h
rename from gcc/unwind-compat.h
rename to libgcc/unwind-compat.h
diff --git a/gcc/unwind-dw2-fde-compat.c b/libgcc/unwind-dw2-fde-compat.c
rename from gcc/unwind-dw2-fde-compat.c
rename to libgcc/unwind-dw2-fde-compat.c
diff --git a/gcc/unwind-dw2-fde-darwin.c b/libgcc/unwind-dw2-fde-darwin.c
rename from gcc/unwind-dw2-fde-darwin.c
rename to libgcc/unwind-dw2-fde-darwin.c
diff --git a/gcc/unwind-dw2-fde-glibc.c b/libgcc/unwind-dw2-fde-dip.c
rename from gcc/unwind-dw2-fde-glibc.c
rename to libgcc/unwind-dw2-fde-dip.c
diff --git a/gcc/unwind-dw2-fde.c b/libgcc/unwind-dw2-fde.c
rename from gcc/unwind-dw2-fde.c
rename to libgcc/unwind-dw2-fde.c
diff --git a/gcc/unwind-dw2-fde.h b/libgcc/unwind-dw2-fde.h
rename from gcc/unwind-dw2-fde.h
rename to libgcc/unwind-dw2-fde.h
diff --git a/gcc/unwind-dw2.c b/libgcc/unwind-dw2.c
rename from gcc/unwind-dw2.c
rename to libgcc/unwind-dw2.c
diff --git a/gcc/unwind-dw2.h b/libgcc/unwind-dw2.h
rename from gcc/unwind-dw2.h
rename to libgcc/unwind-dw2.h
diff --git a/gcc/unwind-generic.h b/libgcc/unwind-generic.h
rename from gcc/unwind-generic.h
rename to libgcc/unwind-generic.h
diff --git a/gcc/unwind-pe.h b/libgcc/unwind-pe.h
rename from gcc/unwind-pe.h
rename to libgcc/unwind-pe.h
diff --git a/gcc/unwind-sjlj.c b/libgcc/unwind-sjlj.c
rename from gcc/unwind-sjlj.c
rename to libgcc/unwind-sjlj.c
diff --git a/gcc/unwind.inc b/libgcc/unwind.inc
rename from gcc/unwind.inc
rename to libgcc/unwind.inc
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -38,7 +38,7 @@ ACLOCAL_AMFLAGS = -I ./config -I ../conf
 
 AM_CFLAGS = -fexceptions -fplan9-extensions $(SPLIT_STACK) $(WARN_CFLAGS) \
 	$(STRINGOPS_FLAG) \
-	-I $(srcdir)/../gcc -I $(MULTIBUILDTOP)../../gcc/include
+	-I $(srcdir)/../libgcc -I $(MULTIBUILDTOP)../../gcc/include
 
 if USING_SPLIT_STACK
 AM_LDFLAGS = -XCClinker $(SPLIT_STACK)
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -342,7 +342,7 @@ LIBLINK = $(LIBTOOL) --tag=CXX $(LIBTOOL
 CXXLINK = $(LIBTOOL) --tag=CXX $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
 	  $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LTLDFLAGS) -o $@
 
-GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
+LIBGCC_UNWIND_INCLUDE = @LIBGCC_UNWIND_INCLUDE@
 
 WARNINGS = -Wextra -Wall
 ## Some systems don't allow `$' in identifiers by default, so we force
@@ -410,7 +410,7 @@ AM_CPPFLAGS = -I$(top_srcdir) \
 	-Iclasspath/include \
 	-I$(top_srcdir)/classpath/native/fdlibm \
 	$(GCINCS) $(THREADINCS) $(INCLTDL) \
-	$(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
+	$(LIBGCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
 
 BOOTCLASSPATH = $(srcdir)/classpath/lib
 
diff --git a/libjava/configure.ac b/libjava/configure.ac
--- a/libjava/configure.ac
+++ b/libjava/configure.ac
@@ -469,7 +469,7 @@ case "${which_gcj}" in
    cross)
       if test "x${with_newlib}" = "xyes"; then
          # FIXME (comment): Why is this needed?
-         GCC_UNWIND_INCLUDE=
+         LIBGCC_UNWIND_INCLUDE=
       fi
       GCJH='$(target_noncanonical)-gcjh'
    ;;
@@ -1204,8 +1204,8 @@ AC_SUBST(HASH_SYNC_SPEC)
 
 AM_CONDITIONAL(USING_GCC, test "$GCC" = yes)
 
-# We're in the tree with gcc, and need to include some of its headers.
-GCC_UNWIND_INCLUDE='-I$(multi_basedir)/./libjava/../gcc'
+# We're in the tree with libgcc, and need to include some of its headers.
+LIBGCC_UNWIND_INCLUDE='-I$(multi_basedir)/./libjava/../libgcc'
 
 if test "x${with_newlib}" = "xyes"; then
    # We are being configured with a cross compiler.  AC_REPLACE_FUNCS
@@ -1569,7 +1569,7 @@ AM_CONDITIONAL(NATIVE, test "$NATIVE" = 
 AM_CONDITIONAL(ENABLE_SHARED, test "$enable_shared" = yes)
 AM_CONDITIONAL(NEEDS_DATA_START, test "$NEEDS_DATA_START" = yes && test "$NATIVE" = yes)
 AM_CONDITIONAL(INSTALL_BINARIES, test -z "${with_multisubdir}")
-AC_SUBST(GCC_UNWIND_INCLUDE)
+AC_SUBST(LIBGCC_UNWIND_INCLUDE)
 
 # Process the option "--enable-version-specific-runtime-libs"
 # Calculate toolexeclibdir
diff --git a/libobjc/Makefile.in b/libobjc/Makefile.in
--- a/libobjc/Makefile.in
+++ b/libobjc/Makefile.in
@@ -101,6 +101,7 @@ OBJC_BOEHM_GC_LIBS=../boehm-gc/libgcjgc_
 INCLUDES = -I$(srcdir)/$(MULTISRCTOP)../gcc \
   -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
   -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
+  -I$(srcdir)/$(MULTISRCTOP)../libgcc \
   -I$(srcdir)/$(MULTISRCTOP)../include \
   $(OBJC_BOEHM_GC_INCLUDES)
 
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -682,9 +682,9 @@ AC_DEFUN([GLIBCXX_EXPORT_INCLUDES], [
   fi
 
   # Stuff in the actual top level.  Currently only used by libsupc++ to
-  # get unwind* headers from the gcc dir.
-  #TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include'
-  TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/gcc'
+  # get unwind* headers from the libgcc dir.
+  #TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/libgcc -I$(toplevel_srcdir)/include'
+  TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/libgcc'
 
   # Now, export this to all the little Makefiles....
   AC_SUBST(GLIBCXX_INCLUDES)

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-04 18:10   ` CFT: " Rainer Orth
@ 2011-07-05  9:35     ` Tristan Gingold
  2011-07-07 13:11       ` Rainer Orth
  0 siblings, 1 reply; 36+ messages in thread
From: Tristan Gingold @ 2011-07-05  9:35 UTC (permalink / raw)
  To: Rainer Orth; +Cc: GCC Patches, Steve Ellcey, Douglas Rupp


On Jul 4, 2011, at 8:09 PM, Rainer Orth wrote:

> "Joseph S. Myers" <joseph@codesourcery.com> writes:
> 
>> On Mon, 20 Jun 2011, Rainer Orth wrote:
>> 
>>> * Move all remaining unwinder-only macros to libgcc: UNW_IVMS_MODE,
>>>  MD_UNW_COMPATIBLE_PERSONALITY_P, MD_FROB_UPDATE_CONTEXT.
>> 
>> I don't see any sign of macros being poisoned in system.h.  For macros 
>> used in target-independent unwinder code - at least MD_FROB_UPDATE_CONTEXT 
>> - that used to be defined in the host tm.h but now no longer should be, I 
>> think poisoning in system.h is appropriate.
> 
> Done in the updated patch below.  Given that the other two are ia64 only
> and not documented in md.texi, I don't think they need to be poisoned.
> 
> Otherwise, the patch is unchanged from the original submission:
> 
> 	[build] Move unwinder to toplevel libgcc
> 	http://gcc.gnu.org/ml/gcc-patches/2011-06/msg01452.html
> 
> Unfortunately, it hasn't seen much comment.  I'm now looking for testers
> especially on platforms with more change and approval of those parts:
> 
> * Several IA-64 targets:
> 
> 	ia64*-*-linux*
>        ia64*-*-hpux*
>        ia64-hp-*vms*

For ia64-hp-vms, consider your patch approved if the parts for ia64 are.
In case of break, I will fix them.

Tristan.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-05  9:35     ` Tristan Gingold
@ 2011-07-07 13:11       ` Rainer Orth
  2011-07-07 15:53         ` Steve Ellcey
                           ` (2 more replies)
  0 siblings, 3 replies; 36+ messages in thread
From: Rainer Orth @ 2011-07-07 13:11 UTC (permalink / raw)
  To: Tristan Gingold; +Cc: GCC Patches, Steve Ellcey, Douglas Rupp

Tristan Gingold <gingold@adacore.com> writes:

>> Otherwise, the patch is unchanged from the original submission:
>> 
>> 	[build] Move unwinder to toplevel libgcc
>> 	http://gcc.gnu.org/ml/gcc-patches/2011-06/msg01452.html
>> 
>> Unfortunately, it hasn't seen much comment.  I'm now looking for testers
>> especially on platforms with more change and approval of those parts:
>> 
>> * Several IA-64 targets:
>> 
>> 	ia64*-*-linux*
>>        ia64*-*-hpux*
>>        ia64-hp-*vms*
>
> For ia64-hp-vms, consider your patch approved if the parts for ia64 are.
> In case of break, I will fix them.

In that case, perhaps Steve could have a look?  I'd finally like to make
some progress on this patch.

Thanks.
        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-07 13:11       ` Rainer Orth
@ 2011-07-07 15:53         ` Steve Ellcey
  2011-07-08 18:16           ` Rainer Orth
  2011-07-07 16:48         ` Steve Ellcey
  2011-07-07 17:08         ` Steve Ellcey
  2 siblings, 1 reply; 36+ messages in thread
From: Steve Ellcey @ 2011-07-07 15:53 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

On Thu, 2011-07-07 at 15:08 +0200, Rainer Orth wrote:
> Tristan Gingold <gingold@adacore.com> writes:
> 
> >> Otherwise, the patch is unchanged from the original submission:
> >> 
> >> 	[build] Move unwinder to toplevel libgcc
> >> 	http://gcc.gnu.org/ml/gcc-patches/2011-06/msg01452.html
> >> 
> >> Unfortunately, it hasn't seen much comment.  I'm now looking for testers
> >> especially on platforms with more change and approval of those parts:
> >> 
> >> * Several IA-64 targets:
> >> 
> >> 	ia64*-*-linux*
> >>        ia64*-*-hpux*
> >>        ia64-hp-*vms*
> >
> > For ia64-hp-vms, consider your patch approved if the parts for ia64 are.
> > In case of break, I will fix them.
> 
> In that case, perhaps Steve could have a look?  I'd finally like to make
> some progress on this patch.
> 
> Thanks.
>         Rainer

I just tried builds on ia64 linux and HP-UX and both builds failed.  I
am re-trying the HP-UX build with --with-system-libunwind to see if that
changes things but that should be the default on IA64 HP-UX.

On Linux (debian) the build stopped with:

/test/big-foot1/gcc/nightly/gcc-ia64-debian-linux-gnu-trunk/ia64-debian-linux-gnu/bin/ranlib libgcov.a
make[3]: *** No rule to make target
`/test/big-foot1/gcc/nightly/src/trunk/libgcc/unwind-sjlj.c', needed by
`unwind-sjlj.o'.  Stop.
make[3]: Leaving directory
`/test/big-foot1/gcc/nightly/build-ia64-debian-linux-gnu-trunk/obj_gcc/ia64-debian-linux-gnu/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory
`/test/big-foot1/gcc/nightly/build-ia64-debian-linux-gnu-trunk/obj_gcc'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory
`/test/big-foot1/gcc/nightly/build-ia64-debian-linux-gnu-trunk/obj_gcc'
make: *** [bootstrap] Error 2


The patch appeared to install correctly into my source tree and I ran autoreconf to regenerate the
configure files.  It looks like patch didn't handle the unwind files that moved.  I will try doing
that by hand and see if that fixes things.

Steve Ellcey
sje@cup.hp.com

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-07 13:11       ` Rainer Orth
  2011-07-07 15:53         ` Steve Ellcey
@ 2011-07-07 16:48         ` Steve Ellcey
  2011-07-08 18:24           ` Rainer Orth
  2011-07-07 17:08         ` Steve Ellcey
  2 siblings, 1 reply; 36+ messages in thread
From: Steve Ellcey @ 2011-07-07 16:48 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

On Thu, 2011-07-07 at 15:08 +0200, Rainer Orth wrote:

> In that case, perhaps Steve could have a look?  I'd finally like to make
> some progress on this patch.
> 
> Thanks.
>         Rainer

It looks like the GCC build is trying to compile unwind-ia64.c on IA64
HP-UX even though it should not use or need this file.  Using
--with-system-libunwind doesn't seem to help.  I am not sure where this
should be handled under the new setup.  Previously config.gcc would
either include or not include t-glibc-libunwind in the Makefile to build
or not build this file.  This might be coming from t-eh-ia64 rather
then t-glibc-libunwind.  Both of these include unwind-ia64.c.

Steve Ellcey
sje@cup.hp.com

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-07 13:11       ` Rainer Orth
  2011-07-07 15:53         ` Steve Ellcey
  2011-07-07 16:48         ` Steve Ellcey
@ 2011-07-07 17:08         ` Steve Ellcey
  2011-07-07 22:55           ` Steve Ellcey
  2 siblings, 1 reply; 36+ messages in thread
From: Steve Ellcey @ 2011-07-07 17:08 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

On Thu, 2011-07-07 at 15:08 +0200, Rainer Orth wrote:

> In that case, perhaps Steve could have a look?  I'd finally like to make
> some progress on this patch.
> 
> Thanks.
>         Rainer

When doing an IA64 Linux build (where I do need to compile
unwind-ia64.c) I am dying with this failure:

In file included from /test/big-foot1/gcc/nightly/src/trunk/libgcc/config/ia64/unwind-ia64.c:35:0:
./md-unwind-support.h:42:7: error: unknown type name '_Unwind_FrameState'
./md-unwind-support.h:132:54: error: unknown type name '_Unwind_FrameState'
/test/big-foot1/gcc/nightly/src/trunk/libgcc/config/ia64/unwind-ia64.c: In function 'uw_update_reg_address':
/test/big-foot1/gcc/nightly/src/trunk/libgcc/config/ia64/unwind-ia64.c:1931:11: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual]
make[3]: *** [unwind-ia64.o] Error 1
make[3]: Leaving directory `/test/big-foot1/gcc/nightly/build-ia64-debian-linux-gnu-trunk/obj_gcc/ia64-debian-linux-gnu/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2

Steve Ellcey
sje@cup.hp.com

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-07 17:08         ` Steve Ellcey
@ 2011-07-07 22:55           ` Steve Ellcey
  2011-07-08 18:55             ` Rainer Orth
  0 siblings, 1 reply; 36+ messages in thread
From: Steve Ellcey @ 2011-07-07 22:55 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

On Thu, 2011-07-07 at 10:05 -0700, Steve Ellcey wrote:
> On Thu, 2011-07-07 at 15:08 +0200, Rainer Orth wrote:
> 
> > In that case, perhaps Steve could have a look?  I'd finally like to make
> > some progress on this patch.
> > 
> > Thanks.
> >         Rainer
> 
> When doing an IA64 Linux build (where I do need to compile
> unwind-ia64.c) I am dying with this failure:
> 
> In file included from /test/big-foot1/gcc/nightly/src/trunk/libgcc/config/ia64/unwind-ia64.c:35:0:
> ./md-unwind-support.h:42:7: error: unknown type name '_Unwind_FrameState'
> ./md-unwind-support.h:132:54: error: unknown type name '_Unwind_FrameState'
> /test/big-foot1/gcc/nightly/src/trunk/libgcc/config/ia64/unwind-ia64.c: In function 'uw_update_reg_address':
> /test/big-foot1/gcc/nightly/src/trunk/libgcc/config/ia64/unwind-ia64.c:1931:11: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual]
> make[3]: *** [unwind-ia64.o] Error 1
> make[3]: Leaving directory `/test/big-foot1/gcc/nightly/build-ia64-debian-linux-gnu-trunk/obj_gcc/ia64-debian-linux-gnu/libgcc'
> make[2]: *** [all-stage1-target-libgcc] Error 2
> 
> Steve Ellcey
> sje@cup.hp.com

It looks like this is caused by having two '#include "md-unwind-support.h"'
lines in unwind-ia64.c.  If I remove the first one (mixed in with the other
includes at the top of the file) and leave the second one then the file
compiles.  I still get the warning about discarding the cast but I guess that
is OK.  I have a bootstrap running on IA64 Linux and it looks good so far.
I haven't had a chance to follow-up on IA64 HP-UX.

Steve Ellcey
sje@cup.hp.com

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-07 15:53         ` Steve Ellcey
@ 2011-07-08 18:16           ` Rainer Orth
  0 siblings, 0 replies; 36+ messages in thread
From: Rainer Orth @ 2011-07-08 18:16 UTC (permalink / raw)
  To: sje; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

Steve,

> I just tried builds on ia64 linux and HP-UX and both builds failed.  I
> am re-trying the HP-UX build with --with-system-libunwind to see if that
> changes things but that should be the default on IA64 HP-UX.
>
> On Linux (debian) the build stopped with:
>
> /test/big-foot1/gcc/nightly/gcc-ia64-debian-linux-gnu-trunk/ia64-debian-linux-gnu/bin/ranlib libgcov.a
> make[3]: *** No rule to make target
> `/test/big-foot1/gcc/nightly/src/trunk/libgcc/unwind-sjlj.c', needed by
> `unwind-sjlj.o'.  Stop.
[...]
> The patch appeared to install correctly into my source tree and I ran autoreconf to regenerate the
> configure files.  It looks like patch didn't handle the unwind files that moved.  I will try doing
> that by hand and see if that fixes things.

the diff was a git-style patch with renames, which AFAIK only git patch
can handle correctly.  I'm using a mercurial mirror of the gcc repo and
mercurial queues for development, and that style makes if far easier to
see what's going on, compared to the usual remove-and-add which makes
patches excessively long.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-07 16:48         ` Steve Ellcey
@ 2011-07-08 18:24           ` Rainer Orth
  0 siblings, 0 replies; 36+ messages in thread
From: Rainer Orth @ 2011-07-08 18:24 UTC (permalink / raw)
  To: sje; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

Steve,

> It looks like the GCC build is trying to compile unwind-ia64.c on IA64
> HP-UX even though it should not use or need this file.  Using
> --with-system-libunwind doesn't seem to help.  I am not sure where this
> should be handled under the new setup.  Previously config.gcc would
> either include or not include t-glibc-libunwind in the Makefile to build
> or not build this file.  This might be coming from t-eh-ia64 rather
> then t-glibc-libunwind.  Both of these include unwind-ia64.c.

I see what's going on: before my patch, ia64*-*-hpux* would use

tmake_file="ia64/t-ia64 ia64/t-hpux"

The former has

LIB2ADDEH = $(srcdir)/config/ia64/unwind-ia64.c $(srcdir)/unwind-sjlj.c \
  $(srcdir)/unwind-c.c

the latter

LIB2ADDEH = $(srcdir)/unwind-c.c

overriding the ia64 default.

Unfortunately, I got the ordering wrong in libgcc:

tmake_file="ia64/t-hpux ia64/t-eh-ia64"

To fix this, ia64/t-eh-ia64 can go completely.  This should restore
things as they were before.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-07 22:55           ` Steve Ellcey
@ 2011-07-08 18:55             ` Rainer Orth
  2011-07-08 20:18               ` Steve Ellcey
  2011-07-12 17:24               ` Steve Ellcey
  0 siblings, 2 replies; 36+ messages in thread
From: Rainer Orth @ 2011-07-08 18:55 UTC (permalink / raw)
  To: sje; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

Steve,

> It looks like this is caused by having two '#include "md-unwind-support.h"'
> lines in unwind-ia64.c.  If I remove the first one (mixed in with the other
> includes at the top of the file) and leave the second one then the file
> compiles.  I still get the warning about discarding the cast but I guess that
> is OK.  I have a bootstrap running on IA64 Linux and it looks good so far.
> I haven't had a chance to follow-up on IA64 HP-UX.

I added the first #include to provide the definitions of UNW_IVMS_MODE
and MD_UNW_COMPATIBLE_PERSONALITY_P, not realizing that there was
another one already.

I guess the default definition of the latter can be moved below the
second #include "md-unwind-support.h"?

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-08 18:55             ` Rainer Orth
@ 2011-07-08 20:18               ` Steve Ellcey
  2011-07-12 17:24               ` Steve Ellcey
  1 sibling, 0 replies; 36+ messages in thread
From: Steve Ellcey @ 2011-07-08 20:18 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

On Fri, 2011-07-08 at 20:16 +0200, Rainer Orth wrote:
> Steve,
> 
> > It looks like this is caused by having two '#include "md-unwind-support.h"'
> > lines in unwind-ia64.c.  If I remove the first one (mixed in with the other
> > includes at the top of the file) and leave the second one then the file
> > compiles.  I still get the warning about discarding the cast but I guess that
> > is OK.  I have a bootstrap running on IA64 Linux and it looks good so far.
> > I haven't had a chance to follow-up on IA64 HP-UX.
> 
> I added the first #include to provide the definitions of UNW_IVMS_MODE
> and MD_UNW_COMPATIBLE_PERSONALITY_P, not realizing that there was
> another one already.
> 
> I guess the default definition of the latter can be moved below the
> second #include "md-unwind-support.h"?
> 
> 	Rainer

I think that will work for VMS.  I just removed the include since I
don't define the macro on HP-UX or Linux.  With that change and with the
removal of ia64/t-eh-ia64 from tmake_file for HP-UX I got a bootstrap on
both IA64 HP-UX and Linux.  I haven't done a full test run yet, I will
see if I can do that over the weekend.

Steve Ellcey
sje@cup.hp.com

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-08 18:55             ` Rainer Orth
  2011-07-08 20:18               ` Steve Ellcey
@ 2011-07-12 17:24               ` Steve Ellcey
  2011-07-12 17:40                 ` Rainer Orth
  1 sibling, 1 reply; 36+ messages in thread
From: Steve Ellcey @ 2011-07-12 17:24 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp


Rainer,

I did another GCC build with your libgcc patch and with fixes for the
two problems I already mentioned to you and got another failure:

libtool: compile:  /wsp/sje/gcc_git/build-ia64-hp-hpux11.23-gcc/obj_gcc/./gcc/xgcc -shared-libgcc -B/wsp/sje/gcc_git/build-ia64-hp-hpux11.23-gcc/obj_gcc/./gcc -nostdinc++ -L/wsp/sje/gcc_git/build-ia64-hp-hpux11.23-gcc/obj_gcc/ia64-hp-hpux11.23/libstdc++-v3/src -L/wsp/sje/gcc_git/build-ia64-hp-hpux11.23-gcc/obj_gcc/ia64-hp-hpux11.23/libstdc++-v3/src/.libs -B/wsp/sje/gcc_git/gcc-ia64-hp-hpux11.23-gcc/ia64-hp-hpux11.23/bin/ -B/wsp/sje/gcc_git/gcc-ia64-hp-hpux11.23-gcc/ia64-hp-hpux11.23/lib/ -isystem /wsp/sje/gcc_git/gcc-ia64-hp-hpux11.23-gcc/ia64-hp-hpux11.23/include -isystem /wsp/sje/gcc_git/gcc-ia64-hp-hpux11.23-gcc/ia64-hp-hpux11.23/sys-include -I/wsp/sje/gcc_git/src/gcc/libstdc++-v3/../gcc -I/wsp/sje/gcc_git/build-ia64-hp-hpux11.23-gcc/obj_gcc/ia64-hp-hpux11.23/libstdc++-v3/include/ia64-hp-hpux11.23 -I/wsp/sje/gcc_git/build-ia64-hp-hpux11.23-gcc/obj_gcc/ia64-hp-hpux11.23/libstdc++-v3/include -I/wsp/sje/gcc_git/src/gcc/libstdc++-v3/libsupc++ -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -g -O2 -c /wsp/sje/gcc_git/src/gcc/libstdc++-v3/libsupc++/eh_call.cc  -fPIC -DPIC -o eh_call.o
/wsp/sje/gcc_git/src/gcc/libstdc++-v3/libsupc++/eh_call.cc:34:23: fatal error: unwind-pe.h: No such file or directory
compilation terminated.
make[4]: *** [eh_call.lo] Error 1
make[4]: Leaving directory `/wsp/sje/gcc_git/build-ia64-hp-hpux11.23-gcc/obj_gcc/ia64-hp-hpux11.23/libstdc++-v3/libsupc++'
make[3]: *** [all-recursive] Error 1

I think in my earlier build I was building C only (or maybe the compiler only) and that is why I didn't
see this problem.

I think the libstdc++ Makefile needs to add

-I/wsp/sje/gcc_git/src/gcc/libstdc++-v3/../libgcc

in addition (or instead of)

-I/wsp/sje/gcc_git/src/gcc/libstdc++-v3/../gcc

Steve Ellcey
sje@cup.hp.com


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-12 17:24               ` Steve Ellcey
@ 2011-07-12 17:40                 ` Rainer Orth
  2011-07-12 17:42                   ` Steve Ellcey
  2011-07-14  1:47                   ` Steve Ellcey
  0 siblings, 2 replies; 36+ messages in thread
From: Rainer Orth @ 2011-07-12 17:40 UTC (permalink / raw)
  To: sje; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

Steve,

> /wsp/sje/gcc_git/src/gcc/libstdc++-v3/libsupc++/eh_call.cc:34:23: fatal error: unwind-pe.h: No such file or directory
> compilation terminated.
> make[4]: *** [eh_call.lo] Error 1
> make[4]: Leaving directory `/wsp/sje/gcc_git/build-ia64-hp-hpux11.23-gcc/obj_gcc/ia64-hp-hpux11.23/libstdc++-v3/libsupc++'
> make[3]: *** [all-recursive] Error 1
>
> I think in my earlier build I was building C only (or maybe the compiler only) and that is why I didn't
> see this problem.
>
> I think the libstdc++ Makefile needs to add
>
> -I/wsp/sje/gcc_git/src/gcc/libstdc++-v3/../libgcc
>
> in addition (or instead of)
>
> -I/wsp/sje/gcc_git/src/gcc/libstdc++-v3/../gcc

this is strange: my patch already includes this snippet:

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -685,9 +685,9 @@ AC_DEFUN([GLIBCXX_EXPORT_INCLUDES], [
   fi
 
   # Stuff in the actual top level.  Currently only used by libsupc++ to
-  # get unwind* headers from the gcc dir.
-  #TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include'
-  TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/gcc'
+  # get unwind* headers from the libgcc dir.
+  #TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/libgcc -I$(toplevel_srcdir)/include'
+  TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/libgcc'
 
   # Now, export this to all the little Makefiles....
   AC_SUBST(GLIBCXX_INCLUDES)

After rebuilding libstdc++-v3/configure, you should be fine.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-12 17:40                 ` Rainer Orth
@ 2011-07-12 17:42                   ` Steve Ellcey
  2011-07-14  1:47                   ` Steve Ellcey
  1 sibling, 0 replies; 36+ messages in thread
From: Steve Ellcey @ 2011-07-12 17:42 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

On Tue, 2011-07-12 at 19:25 +0200, Rainer Orth wrote:

> After rebuilding libstdc++-v3/configure, you should be fine.
> 
> 	Rainer

Ah, I may have forgotten to run autoconf.  My original testing was with
a subversion workarea, I am now trying to do it in a git area that I
created and I may have forgotten to run autoconf in the new git area
after applying your patch.

Steve Ellcey
sje@cup.hp.com

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-12 17:40                 ` Rainer Orth
  2011-07-12 17:42                   ` Steve Ellcey
@ 2011-07-14  1:47                   ` Steve Ellcey
  2011-07-15  9:38                     ` Rainer Orth
  1 sibling, 1 reply; 36+ messages in thread
From: Steve Ellcey @ 2011-07-14  1:47 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

Rainer,

I have successfully bootstrapped and tested the toplevel libgcc patch on
IA64 HP-UX.  When trying to build IA64 Linux the bootstrap failed with:


/wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/bin/ar  rc libgcc.a $objects
/wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/bin/ranlib libgcc.a
mv tmp-libgcc.map libgcc.map
# @multilib_flags@ is still needed because this may use
# /wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc/./gcc/xgcc -B/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc/./gcc/ -B/wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/bin/ -B/wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/lib/ -isystem /wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/include -isystem /wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/sys-include    and -O2  -g -O2 -DIN_GCC   -DUSE_LIBUNWIND_EXCEPTIONS -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -DUSE_GAS_SYMVER -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector  directly.
# @multilib_dir@ is not really necessary, but sometimes it has
# more uses than just a directory name.
/bin/sh /wsp/sje/gcc_git/src/gcc/libgcc/../mkinstalldirs ./wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc/./gcc/xgcc -B/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc/./gcc/ -B/wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/bin/ -B/wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/lib/ -isystem /wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/include -isystem /wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/sys-include    -O2  -g -O2 -DIN_GCC   -DUSE_LIBUNWIND_EXCEPTIONS -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -DUSE_GAS_SYMVER -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector  -shared -nodefaultlibs -Wl,-h,libunwind.so.7 -Wl,-z,text -Wl,-z,defs -o /libunwind.so.7.tmp -g -O2 -B./  -lc && rm -f / && if [ -f /libunwind.so.7 ]; then mv -f /libunwind.so.7 /libunwind.so.7.backup; else true; fi && mv /libunwind.so.7.tmp /libunwind.so.7 && ln -s libunwind.so.7 /
/wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/bin/ld: cannot open output file /libunwind.so.7.tmp: Permission denied
collect2: error: ld returned 1 exit status
make[3]: *** [libunwind.so] Error 1
make[3]: Target `all' not remade because of errors.
make[3]: Leaving directory `/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc/ia64-debian-linux-gnu/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Target `all-stage1' not remade because of errors.
make[2]: Leaving directory `/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc'
make[1]: *** [stage1-bubble] Error 2
make[1]: Target `stage3-bubble' not remade because of errors.
make[1]: Leaving directory `/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc'
make: *** [bootstrap] Error 2

It looks like a prefix is missing somewhere since it is trying to access /libunwind.so.  This
may be something messed up in my build area again but I did run autoconf in libgcc so I am
not sure what is going on.  I'll dig around some more but I thought I would see if this looks
familiar to you.

Steve Ellcey
sje@cup.hp.com

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-14  1:47                   ` Steve Ellcey
@ 2011-07-15  9:38                     ` Rainer Orth
  2011-07-18 12:07                       ` Rainer Orth
  0 siblings, 1 reply; 36+ messages in thread
From: Rainer Orth @ 2011-07-15  9:38 UTC (permalink / raw)
  To: sje; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

Steve,

> I have successfully bootstrapped and tested the toplevel libgcc patch on
> IA64 HP-UX.  When trying to build IA64 Linux the bootstrap failed with:

great, thanks.

> /bin/sh /wsp/sje/gcc_git/src/gcc/libgcc/../mkinstalldirs ./wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc/./gcc/xgcc -B/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc/./gcc/ -B/wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/bin/ -B/wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/lib/ -isystem /wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/include -isystem /wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/sys-include    -O2  -g -O2 -DIN_GCC   -DUSE_LIBUNWIND_EXCEPTIONS -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -DUSE_GAS_SYMVER -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector  -shared -nodefaultlibs -Wl,-h,libunwind.so.7 -Wl,-z,text -Wl,-z,defs -o /libunwind.so.7.tmp -g -O2 -B./  -lc && rm -f / && if [ -f /libunwind.so.7 ]; then mv -f /libunwind.so.7 /libunwind.so.7.backup; else true; fi && mv /libunwind.so.7.tmp /libunwind.so.7 && ln -s libunwind.so.7 /
> /wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/bin/ld: cannot open output file /libunwind.so.7.tmp: Permission denied
> collect2: error: ld returned 1 exit status
[...]
> It looks like a prefix is missing somewhere since it is trying to access /libunwind.so.  This
> may be something messed up in my build area again but I did run autoconf in libgcc so I am
> not sure what is going on.  I'll dig around some more but I thought I would see if this looks
> familiar to you.

It didn't, but I now see what's going on: gcc/config.gcc has

*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
[...]
  tmake_file="t-slibgcc-elf-ver t-linux"

t-slibgcc-elf-ver has the whole shebang necessary to build versioned ELF
shared libraries, among others SHLIB_DIR which is missing above.  This
should be dealt with by using

tmake_file="$tmake_file t-slibgcc t-slibgcc-elf-ver"

in libgcc/config.host.

t-linux adds

SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver

but there's more SHLIB_* related stuff in the regular gcc/config ia64
t-* files used on ia64*-*-linux*:

ia64/t-ia64:SHLIB_MAPFILES += $(srcdir)/config/ia64/libgcc-ia64.ver
t-libunwind:SHLIB_LC = -lunwind -lc
ia64/t-glibc:SHLIB_MAPFILES += $(srcdir)/config/ia64/libgcc-glibc.ver

This seems all so involved and entangled with the t-slibgcc* stuff that
it's probably best to keep out of this patch.  I'll try to come up with
something over the week, either fixing up this patch that it should
handle things correctly or splitting it out into its own, either
together with the rest of SHLIB_* handling or separate and on top of
that.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-15  9:38                     ` Rainer Orth
@ 2011-07-18 12:07                       ` Rainer Orth
  2011-07-18 17:50                         ` Steve Ellcey
  0 siblings, 1 reply; 36+ messages in thread
From: Rainer Orth @ 2011-07-18 12:07 UTC (permalink / raw)
  To: sje; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

Steve,

>> It looks like a prefix is missing somewhere since it is trying to access /libunwind.so.  This
>> may be something messed up in my build area again but I did run autoconf in libgcc so I am
>> not sure what is going on.  I'll dig around some more but I thought I would see if this looks
>> familiar to you.
>
> It didn't, but I now see what's going on: gcc/config.gcc has
>
> *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
> [...]
>   tmake_file="t-slibgcc-elf-ver t-linux"
>
> t-slibgcc-elf-ver has the whole shebang necessary to build versioned ELF
> shared libraries, among others SHLIB_DIR which is missing above.  This
> should be dealt with by using
>
> tmake_file="$tmake_file t-slibgcc t-slibgcc-elf-ver"
>
> in libgcc/config.host.
>
> t-linux adds
>
> SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver
>
> but there's more SHLIB_* related stuff in the regular gcc/config ia64
> t-* files used on ia64*-*-linux*:
>
> ia64/t-ia64:SHLIB_MAPFILES += $(srcdir)/config/ia64/libgcc-ia64.ver
> t-libunwind:SHLIB_LC = -lunwind -lc
> ia64/t-glibc:SHLIB_MAPFILES += $(srcdir)/config/ia64/libgcc-glibc.ver
>
> This seems all so involved and entangled with the t-slibgcc* stuff that
> it's probably best to keep out of this patch.  I'll try to come up with
> something over the week, either fixing up this patch that it should
> handle things correctly or splitting it out into its own, either
> together with the rest of SHLIB_* handling or separate and on top of
> that.

I had a fresh look and it seems this isn't as bad as it might have been:
the only SHLIB_ macros used are SHLIB_(DIR|OBJS|SOLINK|SLIBDIR_QUAL),
which are all present in libgcc/config/t-slibgcc and are substituted by
configure.  While one might split them out of t-slibgcc for reuse by
both libgcc_s and libunwind or also substitute them t-libunwind-elf,
this is probably overkill.  Could you please try to insert t-slibgcc in
front of t-libunwind-elf in the ia64*-*-linux* case in
libgcc/config.host?

Thanks.
        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-18 12:07                       ` Rainer Orth
@ 2011-07-18 17:50                         ` Steve Ellcey
  2011-07-19 11:43                           ` Rainer Orth
  0 siblings, 1 reply; 36+ messages in thread
From: Steve Ellcey @ 2011-07-18 17:50 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

On Mon, 2011-07-18 at 13:31 +0200, Rainer Orth wrote:
> Steve,

> I had a fresh look and it seems this isn't as bad as it might have been:
> the only SHLIB_ macros used are SHLIB_(DIR|OBJS|SOLINK|SLIBDIR_QUAL),
> which are all present in libgcc/config/t-slibgcc and are substituted by
> configure.  While one might split them out of t-slibgcc for reuse by
> both libgcc_s and libunwind or also substitute them t-libunwind-elf,
> this is probably overkill.  Could you please try to insert t-slibgcc in
> front of t-libunwind-elf in the ia64*-*-linux* case in
> libgcc/config.host?
> 
> Thanks.
>         Rainer

I tried this (here is the libgcc/config.host entry for ia64*-*-linux*):

ia64*-*-linux*)
        extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
        tmake_file="ia64/t-ia64 t-softfp ia64/t-fprules-softfp ia64/t-softfp-compat ia64/t-glibc ia64/t-eh-ia64 t-libunwind"
        if test x$with_system_libunwind != xyes ; then
                tmake_file="${tmake_file} t-slibgcc t-libunwind-elf ia64/t-glibc-libunwind"
        fi
        md_unwind_header=ia64/linux-unwind.h
        ;;


The build still failed, but it failed in a different way.  I got:

/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc/./gcc/xgcc -B/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc/./gcc/ -B/wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/bin/ -B/wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/lib/ -isystem /wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/include -isystem /wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/sys-include    -O2  -g -O2 -DIN_GCC   -DUSE_LIBUNWIND_EXCEPTIONS -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -DUSE_GAS_SYMVER -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector  -shared -nodefaultlibs  -o ./libgcc_s.so.1.tmp -g -O2 -B./ __divdf3_s.o __divsf3_s.o __divdi3_s.o __moddi3_s.o __udivdi3_s.o __umoddi3_s.o __divsi3_s.o __modsi3_s.o __udivsi3_s.o __umodsi3_s.o __save_stack_nonlocal_s.o __nonlocal_goto_s.o __restore_stack_nonlocal_s.o __trampoline_s.o _muldi3_s.o _negdi2_s.o _lshrdi3_s.o _ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o _trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o _addvdi3_s.o _subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o _ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o _ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o _paritysi2_s.o _paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o _powitf2_s.o _mulsc3_s.o _muldc3_s.o _mulxc3_s.o _multc3_s.o _divsc3_s.o _divdc3_s.o _divxc3_s.o _divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o _clrsbsi2_s.o _clrsbdi2_s.o _fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o _fixdfdi_s.o _fixxfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o _fixunsxfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o
 _floatundisf_s.o _floatundidf_s.o _floatundixf_s.o _divdi3_s.o _moddi3_s.o _udivdi3_s.o _umoddi3_s.o _udiv_w_sdiv_s.o _udivmoddi4_s.o addtf3_s.o divtf3_s.o eqtf2_s.o getf2_s.o letf2_s.o multf3_s.o negtf2_s.o subtf3_s.o unordtf2_s.o fixtfsi_s.o fixunstfsi_s.o floatsitf_s.o floatunsitf_s.o fixtfdi_s.o fixunstfdi_s.o floatditf_s.o floatunditf_s.o fixtfti_s.o fixunstfti_s.o floattitf_s.o floatuntitf_s.o extendsftf2_s.o extenddftf2_s.o extendxftf2_s.o trunctfsf2_s.o trunctfdf2_s.o trunctfxf2_s.o tf-signs_s.o __divxf3_s.o _fixtfdi_s.o _fixunstfdi_s.o _floatditf_s.o enable-execute-stack_s.o unwind-sjlj_s.o unwind-c_s.o unwind-compat_s.o unwind-dw2-fde-compat_s.o emutls_s.o -lc && rm -f ./libgcc_s.so && if [ -f ./libgcc_s.so.1 ]; then mv -f ./libgcc_s.so.1 ./libgcc_s.so.1.backup; else true; fi && mv ./libgcc_s.so.1.tmp ./libgcc_s.so.1 && ln -s libgcc_s.so.1 ./libgcc_s.so
/wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/bin/ld: ./libgcc_s.so.1.tmp: version node not found for symbol _Unwind_Backtrace@GCC_3.3
/wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/bin/ld: failed to set dynamic section sizes: Bad value
collect2: error: ld returned 1 exit status
make[3]: *** [libgcc_s.so] Error 1
make[3]: Leaving directory `/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc/ia64-debian-linux-gnu/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc'
make: *** [bootstrap] Error 2




Steve Ellcey
sje@cup.hp.com

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-18 17:50                         ` Steve Ellcey
@ 2011-07-19 11:43                           ` Rainer Orth
  2011-07-20 23:03                             ` Steve Ellcey
  0 siblings, 1 reply; 36+ messages in thread
From: Rainer Orth @ 2011-07-19 11:43 UTC (permalink / raw)
  To: sje; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

Steve,

> I tried this (here is the libgcc/config.host entry for ia64*-*-linux*):
>
> ia64*-*-linux*)
>         extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
>         tmake_file="ia64/t-ia64 t-softfp ia64/t-fprules-softfp ia64/t-softfp-compat ia64/t-glibc ia64/t-eh-ia64 t-libunwind"
>         if test x$with_system_libunwind != xyes ; then
>                 tmake_file="${tmake_file} t-slibgcc t-libunwind-elf ia64/t-glibc-libunwind"
>         fi
>         md_unwind_header=ia64/linux-unwind.h
>         ;;
>
>
> The build still failed, but it failed in a different way.  I got:
>
> /wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc/./gcc/xgcc -B/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc/./gcc/ -B/wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/bin/ -B/wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/lib/ -isystem /wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/include -isystem /wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/sys-include    -O2  -g -O2 -DIN_GCC   -DUSE_LIBUNWIND_EXCEPTIONS -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -DUSE_GAS_SYMVER -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector  -shared -nodefaultlibs  -o ./libgcc_s.so.1.tmp -g -O2 -B./ __divdf3_s.o __divsf3_s.o __divdi3_s.o __moddi3_s.o __udivdi3_s.o __umoddi3_s.o __divsi3_s.o __modsi3_s.o __udivsi3_s.o __umodsi3_s.o __save_stack_nonlocal_s.o __nonlocal_goto_s.o __restore_stack_nonlocal_s.o __trampoline_s.o _muldi3_s.o _negdi2_s.o _lshrdi3_s.o _ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o _trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o _addvdi3_s.o _subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o _ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o _ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o _paritysi2_s.o _paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o _powitf2_s.o _mulsc3_s.o _muldc3_s.o _mulxc3_s.o _multc3_s.o _divsc3_s.o _divdc3_s.o _divxc3_s.o _divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o _clrsbsi2_s.o _clrsbdi2_s.o _fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o _fixdfdi_s.o _fixxfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o _fixunsxfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o
>  _floatundisf_s.o _floatundidf_s.o _floatundixf_s.o _divdi3_s.o _moddi3_s.o _udivdi3_s.o _umoddi3_s.o _udiv_w_sdiv_s.o _udivmoddi4_s.o addtf3_s.o divtf3_s.o eqtf2_s.o getf2_s.o letf2_s.o multf3_s.o negtf2_s.o subtf3_s.o unordtf2_s.o fixtfsi_s.o fixunstfsi_s.o floatsitf_s.o floatunsitf_s.o fixtfdi_s.o fixunstfdi_s.o floatditf_s.o floatunditf_s.o fixtfti_s.o fixunstfti_s.o floattitf_s.o floatuntitf_s.o extendsftf2_s.o extenddftf2_s.o extendxftf2_s.o trunctfsf2_s.o trunctfdf2_s.o trunctfxf2_s.o tf-signs_s.o __divxf3_s.o _fixtfdi_s.o _fixunstfdi_s.o _floatditf_s.o enable-execute-stack_s.o unwind-sjlj_s.o unwind-c_s.o unwind-compat_s.o unwind-dw2-fde-compat_s.o emutls_s.o -lc && rm -f ./libgcc_s.so && if [ -f ./libgcc_s.so.1 ]; then mv -f ./libgcc_s.so.1 ./libgcc_s.so.1.backup; else true; fi && mv ./libgcc_s.so.1.tmp ./libgcc_s.so.1 && ln -s libgcc_s.so.1 ./libgcc_s.so
> /wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/bin/ld: ./libgcc_s.so.1.tmp: version node not found for symbol _Unwind_Backtrace@GCC_3.3
> /wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/bin/ld: failed to set dynamic section sizes: Bad value
> collect2: error: ld returned 1 exit status
> make[3]: *** [libgcc_s.so] Error 1

unfortunately, I don't even have an idea what this error is supposed to
mean.  Seems to be an error ultimately due to bfd/elfxx-ia64.c
(elfNN_ia64_size_dynamic_sections) failing.

To debug this, I'd start by comparing the link lines for a vanilla build
with my patch, then, if no differences are apparent, check the object
files.

Sorry this is such a mess.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-19 11:43                           ` Rainer Orth
@ 2011-07-20 23:03                             ` Steve Ellcey
  2011-07-22 15:36                               ` Rainer Orth
  0 siblings, 1 reply; 36+ messages in thread
From: Steve Ellcey @ 2011-07-20 23:03 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

On Tue, 2011-07-19 at 12:47 +0200, Rainer Orth wrote:

> unfortunately, I don't even have an idea what this error is supposed to
> mean.  Seems to be an error ultimately due to bfd/elfxx-ia64.c
> (elfNN_ia64_size_dynamic_sections) failing.
> 
> To debug this, I'd start by comparing the link lines for a vanilla build
> with my patch, then, if no differences are apparent, check the object
> files.

Ah, I looked at the link lines and the standard build includes this in
the link line:

	-Wl,--version-script=libgcc.map

It is missing in the build I did with your patch.

Steve Ellcey
sje@cup.hp.com

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-20 23:03                             ` Steve Ellcey
@ 2011-07-22 15:36                               ` Rainer Orth
  2011-07-22 18:56                                 ` Steve Ellcey
  0 siblings, 1 reply; 36+ messages in thread
From: Rainer Orth @ 2011-07-22 15:36 UTC (permalink / raw)
  To: sje; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

Steve,

> On Tue, 2011-07-19 at 12:47 +0200, Rainer Orth wrote:
>
>> unfortunately, I don't even have an idea what this error is supposed to
>> mean.  Seems to be an error ultimately due to bfd/elfxx-ia64.c
>> (elfNN_ia64_size_dynamic_sections) failing.
>> 
>> To debug this, I'd start by comparing the link lines for a vanilla build
>> with my patch, then, if no differences are apparent, check the object
>> files.
>
> Ah, I looked at the link lines and the standard build includes this in
> the link line:
>
> 	-Wl,--version-script=libgcc.map
>
> It is missing in the build I did with your patch.

now I understand what's happening: with t-slibgcc included in
libgcc/config.host, all the SHLIB_* variables gcc/libgcc.mvars (which
stem from gcc/config.gcc including t-slibgcc-elf-ver via the *-*-linux*
case) are overridden by the most generic defaults.

I think you'll need the following:

ia64*-*-linux*)
        extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
        # FIXME: Move to *-*-linux* once the SHLIB_* move is complete.
        tmake_file="t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux"
        tmake_file="$tmake_file ia64/t-ia64 t-softfp ia64/t-fprules-softfp ia64/t-softfp-compat ia64/t-glibc ia64/t-eh-ia64 t-libunwind"
        if test x$with_system_libunwind != xyes ; then
                tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind"
        fi
        md_unwind_header=ia64/linux-unwind.h
        ;;

and a new libgcc/config/t-linux:

# Override t-slibgcc-elf-ver to export some libgcc symbols with
# the symbol versions that glibc used.
SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver

The t-slibgcc* fragments have been introduced to avoid the massive
duplication previously found there, but are equivalent to the current
gcc/config/t-slibgcc-elf-ver.

Perhaps you could give this a try?

Thanks.
        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-22 15:36                               ` Rainer Orth
@ 2011-07-22 18:56                                 ` Steve Ellcey
  2011-07-22 19:03                                   ` Rainer Orth
  0 siblings, 1 reply; 36+ messages in thread
From: Steve Ellcey @ 2011-07-22 18:56 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

On Fri, 2011-07-22 at 17:12 +0200, Rainer Orth wrote:

> I think you'll need the following:
> 
> ia64*-*-linux*)
>         extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
>         # FIXME: Move to *-*-linux* once the SHLIB_* move is complete.
>         tmake_file="t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux"
>         tmake_file="$tmake_file ia64/t-ia64 t-softfp ia64/t-fprules-softfp ia64/t-softfp-compat ia64/t-glibc ia64/t-eh-ia64 t-libunwind"
>         if test x$with_system_libunwind != xyes ; then
>                 tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind"
>         fi
>         md_unwind_header=ia64/linux-unwind.h
>         ;;
> 
> and a new libgcc/config/t-linux:
> 
> # Override t-slibgcc-elf-ver to export some libgcc symbols with
> # the symbol versions that glibc used.
> SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver
> 
> The t-slibgcc* fragments have been introduced to avoid the massive
> duplication previously found there, but are equivalent to the current
> gcc/config/t-slibgcc-elf-ver.
> 
> Perhaps you could give this a try?
> 
> Thanks.
>         Rainer

This died with:


make[3]: *** No rule to make target `/wsp/sje/gcc_git/src/gcc/libgcc/config/libgcc-glibc.ver', needed by `libgcc.map'.  Stop.
make[3]: Leaving directory `/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc/ia64-debian-linux-gnu/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc'
make: *** [bootstrap] Error 2

I think I need to copy gcc/config/ia64/libgcc-glibc.ver over to libgcc/config/ia64/libgcc-glibc.ver
and modify SHLIB_MAPFILES to $(srcdir)/config/ia64/libgcc-glibc.ver.  So t-linux might need to be
t-ia64-linux or something like that since it would be IA64 specific now.  Or is there a better way
to fix this?  I will try my fix (leaving the t-linux name alone for now).


Steve Ellcey
sje@cup.hp.com

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-22 18:56                                 ` Steve Ellcey
@ 2011-07-22 19:03                                   ` Rainer Orth
  2011-07-22 22:20                                     ` Steve Ellcey
  0 siblings, 1 reply; 36+ messages in thread
From: Rainer Orth @ 2011-07-22 19:03 UTC (permalink / raw)
  To: sje; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

Steve,

>> and a new libgcc/config/t-linux:
>> 
>> # Override t-slibgcc-elf-ver to export some libgcc symbols with
>> # the symbol versions that glibc used.
>> SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver

> This died with:
>
>
> make[3]: *** No rule to make target `/wsp/sje/gcc_git/src/gcc/libgcc/config/libgcc-glibc.ver', needed by `libgcc.map'.  Stop.
> make[3]: Leaving directory `/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc/ia64-debian-linux-gnu/libgcc'
> make[2]: *** [all-stage1-target-libgcc] Error 2
> make[2]: Leaving directory `/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc'
> make[1]: *** [stage1-bubble] Error 2
> make[1]: Leaving directory `/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc'
> make: *** [bootstrap] Error 2
>
> I think I need to copy gcc/config/ia64/libgcc-glibc.ver over to libgcc/config/ia64/libgcc-glibc.ver
> and modify SHLIB_MAPFILES to $(srcdir)/config/ia64/libgcc-glibc.ver.  So t-linux might need to be
> t-ia64-linux or something like that since it would be IA64 specific now.  Or is there a better way
> to fix this?  I will try my fix (leaving the t-linux name alone for now).

I'm an idiot: I've just copied the relevant lines from
gcc/config/t-linux, forgetting that libgcc-glibc.ver still lives in
gcc/config.

ibgcc/config/t-linux should be

# Override t-slibgcc-elf-ver to export some libgcc symbols with
# the symbol versions that glibc used.
SHLIB_MAPFILES += $(gcc_srcdir)/config/libgcc-glibc.ver

instead.

AFAICS, you will need both the generic gcc/config/libgcc-glibc.ver and
gcc/config/ia64/libgcc-glibc.ver.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-22 19:03                                   ` Rainer Orth
@ 2011-07-22 22:20                                     ` Steve Ellcey
  2011-07-25 17:07                                       ` Rainer Orth
  0 siblings, 1 reply; 36+ messages in thread
From: Steve Ellcey @ 2011-07-22 22:20 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

On Fri, 2011-07-22 at 20:41 +0200, Rainer Orth wrote:

> I'm an idiot: I've just copied the relevant lines from
> gcc/config/t-linux, forgetting that libgcc-glibc.ver still lives in
> gcc/config.
> 
> ibgcc/config/t-linux should be
> 
> # Override t-slibgcc-elf-ver to export some libgcc symbols with
> # the symbol versions that glibc used.
> SHLIB_MAPFILES += $(gcc_srcdir)/config/libgcc-glibc.ver
> 
> instead.
> 
> AFAICS, you will need both the generic gcc/config/libgcc-glibc.ver and
> gcc/config/ia64/libgcc-glibc.ver.
> 
> 	Rainer


Well, I see "-Wl,--version-script=libgcc.map" on the link line now but I
still get an error during the link:

/wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/bin/ld: ./libgcc_s.so.1.tmp: version node not found for symbol _Unwind_GetBSP@GCC_3.3.2
/wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/bin/ld: failed to set dynamic section sizes: Bad value
collect2: error: ld returned 1 exit status
make[3]: *** [libgcc_s.so] Error 1
make[3]: Leaving directory `/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc/ia64-debian-linux-gnu/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc'
make: *** [bootstrap] Error 2

I think the contents of the map file may be wrong.  This error involves a different symbol then when the
mapfile was missing.

From the log file:

sed -e 's/__PFX__/__/g' < /wsp/sje/gcc_git/src/gcc/libgcc/libgcc-std.ver.in > libgcc-std.ver
cat libgcc-std.ver /wsp/sje/gcc_git/src/gcc/libgcc/../gcc/config/libgcc-glibc.ver | ...

I am not sure I am getting the right libgcc-*.ver files yet.  I think I need gcc/config/ia64/libgcc-glibc.ver
and/or gcc/config/ia64/libgcc-ia64.ver and I am not sure I am getting them.

I do see:

echo SHLIB_MAPFILES = 'libgcc-std.ver $(gcc_srcdir)/config/libgcc-glibc.ver $(gcc_srcdir)/config/ia64/libgcc-ia64.ver $(gcc_srcdir)/config/ia64/libgcc-glibc.ver' >> tmp-libgcc.mvars

So maybe I am getting the right files, I'm just not sure.

Steve Ellcey
sje@cup.hp.com




^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: CFT: Move unwinder to toplevel libgcc
  2011-07-22 22:20                                     ` Steve Ellcey
@ 2011-07-25 17:07                                       ` Rainer Orth
  0 siblings, 0 replies; 36+ messages in thread
From: Rainer Orth @ 2011-07-25 17:07 UTC (permalink / raw)
  To: sje; +Cc: Tristan Gingold, GCC Patches, Douglas Rupp

Steve,

> Well, I see "-Wl,--version-script=libgcc.map" on the link line now but I
> still get an error during the link:
>
> /wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/bin/ld: ./libgcc_s.so.1.tmp: version node not found for symbol _Unwind_GetBSP@GCC_3.3.2
> /wsp/sje/gcc_git/gcc-ia64-debian-linux-gnu-gcc/ia64-debian-linux-gnu/bin/ld: failed to set dynamic section sizes: Bad value
> collect2: error: ld returned 1 exit status
> make[3]: *** [libgcc_s.so] Error 1
> make[3]: Leaving directory `/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc/ia64-debian-linux-gnu/libgcc'
> make[2]: *** [all-stage1-target-libgcc] Error 2
> make[2]: Leaving directory `/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc'
> make[1]: *** [stage1-bubble] Error 2
> make[1]: Leaving directory `/wsp/sje/gcc_git/build-ia64-debian-linux-gnu-gcc/obj_gcc'
> make: *** [bootstrap] Error 2
>
> I think the contents of the map file may be wrong.  This error involves a different symbol then when the
> mapfile was missing.

I'm convinced now that this is the wrong approach.  All we need for
libunwind is a couple of common definitions that happen to only live in
t-slibgcc at the moment.  But including t-slibgcc and dependencies opens
a can of worms, so it's far easier to just provide the definitions
t-libunwind-elf needs ourselves.  So could you

* remove all the t-slibgcc* and related files (t-linux) from tmake_file
  in libgcc/config.host and

* add the following at the top of libgcc/config/t-libunwind-elf:

SHLIB_SOLINK = @shlib_base_name@.so
SHLIB_OBJS = @shlib_objs@
SHLIB_DIR = @multilib_dir@
SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@

As you can see, these four variables (the only SHLIB_* ones
t-libunwind-elf uses) are substituted by libgcc/Makefile.in and are
completely generic.

I'll be working on the SHLIB_* move to toplevel libgcc next, so if all
else fails, we could handle all that SHLIB stuff there.

Thanks.
        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2011-07-25 16:52 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-20 12:44 [build] Move unwinder to toplevel libgcc Rainer Orth
2011-06-20 15:21 ` Joseph S. Myers
2011-06-20 15:23   ` Rainer Orth
2011-06-20 15:37     ` Joseph S. Myers
2011-06-20 15:47       ` Rainer Orth
2011-07-04 18:10   ` CFT: " Rainer Orth
2011-07-05  9:35     ` Tristan Gingold
2011-07-07 13:11       ` Rainer Orth
2011-07-07 15:53         ` Steve Ellcey
2011-07-08 18:16           ` Rainer Orth
2011-07-07 16:48         ` Steve Ellcey
2011-07-08 18:24           ` Rainer Orth
2011-07-07 17:08         ` Steve Ellcey
2011-07-07 22:55           ` Steve Ellcey
2011-07-08 18:55             ` Rainer Orth
2011-07-08 20:18               ` Steve Ellcey
2011-07-12 17:24               ` Steve Ellcey
2011-07-12 17:40                 ` Rainer Orth
2011-07-12 17:42                   ` Steve Ellcey
2011-07-14  1:47                   ` Steve Ellcey
2011-07-15  9:38                     ` Rainer Orth
2011-07-18 12:07                       ` Rainer Orth
2011-07-18 17:50                         ` Steve Ellcey
2011-07-19 11:43                           ` Rainer Orth
2011-07-20 23:03                             ` Steve Ellcey
2011-07-22 15:36                               ` Rainer Orth
2011-07-22 18:56                                 ` Steve Ellcey
2011-07-22 19:03                                   ` Rainer Orth
2011-07-22 22:20                                     ` Steve Ellcey
2011-07-25 17:07                                       ` Rainer Orth
2011-06-29 10:05 ` [build] " Paolo Bonzini
2011-06-29 10:06   ` Rainer Orth
2011-06-29 11:29   ` Joseph S. Myers
2011-06-29 11:33     ` Paolo Bonzini
2011-06-29 12:40       ` Rainer Orth
2011-06-29 12:17     ` Rainer Orth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).