This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[build] Remove LIB2ADDEHDEP


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.

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]