From patchwork Fri Jun 3 15:11:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 98596 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 0D0C4B6F5A for ; Sat, 4 Jun 2011 01:12:13 +1000 (EST) Received: (qmail 20905 invoked by alias); 3 Jun 2011 15:12:11 -0000 Received: (qmail 20896 invoked by uid 22791); 3 Jun 2011 15:12:10 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 03 Jun 2011 15:11:55 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 1A296C99; Fri, 3 Jun 2011 17:11:54 +0200 (CEST) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id xtl10CzpcRvv; Fri, 3 Jun 2011 17:11:49 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id DE46BC98; Fri, 3 Jun 2011 17:11:48 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id p53FBmU2001933; Fri, 3 Jun 2011 17:11:48 +0200 (MEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Paolo Bonzini , Ralf Wildenhues Subject: [build] Remove LIB2ADDEHDEP Date: Fri, 03 Jun 2011 17:11:48 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 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