diff mbox

[build] Remove LIB2ADDEHDEP

Message ID yddzklzq79n.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth June 3, 2011, 3:11 p.m. UTC
When checking in the Solaris toplevel libgcc patch on wednesday, I
notice that I still had LIB2ADDEH and LIB2ADDEHDEP in gcc/config/t-sol2.

The latter is completely unused now that libgcc does automatic
dependency generation and I had already removed it in
libgcc/config/t-sol2.  This patch removes it completely.

I also noticed that the move of LIB2ADDEH to libgcc should have made the
variable unnecessary in gcc and was about to remove it on checkin
(seemed obvious at the time), but fortunately I didn't because it
completely broke Solaris 11 EH:

libgcc/Makefile.in completely ignores LIB2ADDEH with --enable-shared,
but only looks at LIB2ADDEHSTATIC and LIB2ADDEHSHARED.  Those variables
are only set in libgcc.mvars from gcc/Makefile.in, and if you remove
them from gcc/config, hell breaks loose ;-(  In the Solaris 11 case, we
need unwind-dw2-fde-glibc.c, but miss it because the LIB2ADDEH default
in gcc/Makefile.in doesn't include it.  I also noticed that
libgcc/config/t-sol2 LIB2ADDEH incorrectly refers to $(srcdir), not
$(gcc_srcdir), and omits emutls.c, which is added behind the scenes by
gcc/Makefile.in.  This patch corrects this.

Bootstrapped without regressions on i386-pc-solaris2.11, ok for
mainline?  I suppose this is obvious.

To get rid of this mess, it seems like we should move all EH-related
stuff to libgcc.  There are several things to do:

* We have mainly two variants of LIB2ADDEH, one (the default) with

  unwind-dw2.c unwind-dw2-fde.c unwind-sjlj.c unwind-c.c

  the other, which uses dl_iterate_phdr, with

  unwind-dw2.c unwind-dw2-fde-glibc.c unwind-sjlj.c unwind-c.c

  There's considerable duplication here right now, so I'd move them to
  t-eh-dw2 and t-eh-dw2-dip (dip is short for dl_iterate_phdr;
  unwind-dw2-fde-glibc.c is a misnomer here since the function is
  available on non-glibc systems like FreeBSD and Solaris).

  The special cases can still be dealt with in target-specific t-* files
  in libgcc.

* The gcc/unwind* files and gcc/emutls.c can move, too.

* LIB2ADDEH* handling in gcc/Makefile.in must be moved to
  libgcc/Makefile.in instead.

If this seems like a sensible plan, I can start working on that.

Thanks.
	Rainer


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

	gcc:
	* Makefile.in (LIB2ADDEHDEP): Remove.
	* config/arm/t-bpabi (LIB2ADDEHDEP): Remove.
	* config/arm/t-symbian (LIB2ADDEHDEP): Remove.
	* config/picochip/t-picochip (LIB2ADDEHDEP): Remove.
	* config/t-darwin (LIB2ADDEHDEP): Remove.
	* config/t-freebsd (LIB2ADDEHDEP): Remove.
	* config/t-linux (LIB2ADDEHDEP): Remove.

	libgcc:
	* config/s390/t-tpf (LIB2ADDEHDEP): Remove.
	* config/t-sol2 (LIB2ADDEH): Use gcc_srcdir, add emutls.c.

Comments

Paolo Bonzini June 3, 2011, 4:02 p.m. UTC | #1
On 06/03/2011 05:11 PM, Rainer Orth wrote:
> Bootstrapped without regressions on i386-pc-solaris2.11, ok for
> mainline?  I suppose this is obvious.
>

The patch is okay, I'll look at the rest next week.

Paolo
Joseph Myers June 7, 2011, 3:11 p.m. UTC | #2
On Fri, 3 Jun 2011, Rainer Orth wrote:

> * The gcc/unwind* files and gcc/emutls.c can move, too.

And the other files listed in LIB2ADDEH for various targets, I expect.

arm/libunwind.S
arm/pr-support.c
arm/unwind-arm.c
arm/unwind-arm.h
ia64/fde-vms.c
ia64/unwind-ia64.c
ia64/unwind-ia64.h
rs6000/darwin-fallback.c
xtensa/unwind-dw2-xtensa.c
xtensa/unwind-dw2-xtensa.h

(at least)
Rainer Orth June 7, 2011, 3:13 p.m. UTC | #3
"Joseph S. Myers" <joseph@codesourcery.com> writes:

> On Fri, 3 Jun 2011, Rainer Orth wrote:
>
>> * The gcc/unwind* files and gcc/emutls.c can move, too.
>
> And the other files listed in LIB2ADDEH for various targets, I expect.
>
> arm/libunwind.S
> arm/pr-support.c
> arm/unwind-arm.c
> arm/unwind-arm.h
> ia64/fde-vms.c
> ia64/unwind-ia64.c
> ia64/unwind-ia64.h
> rs6000/darwin-fallback.c
> xtensa/unwind-dw2-xtensa.c
> xtensa/unwind-dw2-xtensa.h
>
> (at least)

Right, my plan was to move all files only referenced by LIB2ADDEH*.

Does the plan seem ok otherwise?

	Rainer
Joseph Myers June 7, 2011, 7:08 p.m. UTC | #4
On Tue, 7 Jun 2011, Rainer Orth wrote:

> Right, my plan was to move all files only referenced by LIB2ADDEH*.
> 
> Does the plan seem ok otherwise?

Yes, it seems plausible.  Thanks for working on this transition.
diff mbox

Patch

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -744,7 +744,6 @@  LIB2ADDEH = $(srcdir)/unwind-dw2.c $(src
    $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
 LIB2ADDEHSTATIC = $(LIB2ADDEH)
 LIB2ADDEHSHARED = $(LIB2ADDEH)
-LIB2ADDEHDEP = $(UNWIND_H) unwind-pe.h unwind.inc unwind-dw2-fde.h unwind-dw2.h
 
 # Don't build libunwind by default.
 LIBUNWIND =
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
@@ -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.
 #
@@ -29,7 +29,6 @@  UNWIND_H = $(srcdir)/config/arm/unwind-a
 LIB2ADDEH = $(srcdir)/config/arm/unwind-arm.c \
   $(srcdir)/config/arm/libunwind.S \
   $(srcdir)/config/arm/pr-support.c $(srcdir)/unwind-c.c
-LIB2ADDEHDEP = $(UNWIND_H) $(srcdir)/config/$(LIB1ASMSRC)
 
 # 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
@@ -1,4 +1,4 @@ 
-# Copyright (C) 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005, 2006, 2008, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -33,7 +33,6 @@  LIB1ASMFUNCS += \
 # Include the gcc personality routine
 UNWIND_H = $(srcdir)/config/arm/unwind-arm.h
 LIB2ADDEH = $(srcdir)/unwind-c.c $(srcdir)/config/arm/pr-support.c
-LIB2ADDEHDEP = $(UNWIND_H)
 
 # Include half-float helpers.
 LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/arm/fp16.c
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
@@ -1,4 +1,4 @@ 
-# Copyright (C) 2008 Free Software Foundation, Inc.
+# Copyright (C) 2008, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -45,7 +45,6 @@  LIB1ASMSRC = picochip/libgccExtras/fake_
 
 # Turn off the building of exception handling libraries.
 LIB2ADDEH =
-LIB2ADDEHDEP =
 
 # Turn off ranlib on target libraries.
 RANLIB_FOR_TARGET = cat
diff --git a/gcc/config/t-darwin b/gcc/config/t-darwin
--- a/gcc/config/t-darwin
+++ b/gcc/config/t-darwin
@@ -54,7 +54,6 @@  EXTRA_MULTILIB_PARTS=crt3.o
 # Use unwind-dw2-fde-darwin
 LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-darwin.c \
   $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
-LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
 
 # -pipe because there's an assembler bug, 4077127, which causes
 # it to not properly process the first # directive, causing temporary
diff --git a/gcc/config/t-freebsd b/gcc/config/t-freebsd
--- a/gcc/config/t-freebsd
+++ b/gcc/config/t-freebsd
@@ -7,4 +7,3 @@  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
-LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
diff --git a/gcc/config/t-linux b/gcc/config/t-linux
--- a/gcc/config/t-linux
+++ b/gcc/config/t-linux
@@ -29,4 +29,3 @@  SHLIB_MAPFILES += $(srcdir)/config/libgc
 # Use unwind-dw2-fde-glibc
 LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
   $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
-LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
diff --git a/gcc/config/t-sol2 b/gcc/config/t-sol2
--- a/gcc/config/t-sol2
+++ b/gcc/config/t-sol2
@@ -36,4 +36,3 @@  TARGET_LIBGCC2_CFLAGS = -fPIC
 # 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
-LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
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
@@ -5,4 +5,3 @@  HOST_LIBGCC2_CFLAGS += -fPIC
 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
-LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
diff --git a/libgcc/config/t-sol2 b/libgcc/config/t-sol2
--- a/libgcc/config/t-sol2
+++ b/libgcc/config/t-sol2
@@ -18,8 +18,8 @@ 
 
 # 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
+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