From patchwork Wed Jun 29 09:22:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 102541 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 E384CB6F54 for ; Wed, 29 Jun 2011 19:23:20 +1000 (EST) Received: (qmail 18240 invoked by alias); 29 Jun 2011 09:23:18 -0000 Received: (qmail 18214 invoked by uid 22791); 29 Jun 2011 09:23:16 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ww0-f51.google.com (HELO mail-ww0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Jun 2011 09:23:02 +0000 Received: by wwj26 with SMTP id 26so958805wwj.8 for ; Wed, 29 Jun 2011 02:23:00 -0700 (PDT) Received: by 10.227.200.198 with SMTP id ex6mr480510wbb.73.1309339380145; Wed, 29 Jun 2011 02:23:00 -0700 (PDT) Received: from yakj.usersys.redhat.com (93-34-199-31.ip51.fastwebnet.it [93.34.199.31]) by mx.google.com with ESMTPS id b13sm762470wbh.24.2011.06.29.02.22.57 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 29 Jun 2011 02:22:59 -0700 (PDT) Message-ID: <4E0AEEF0.7080406@gnu.org> Date: Wed, 29 Jun 2011 11:22:56 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Mnenhy/0.8.3 Thunderbird/3.1.10 MIME-Version: 1.0 To: Rainer Orth CC: gcc-patches@gcc.gnu.org, 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@gcc.gnu.org, Nicola Pero , libstdc++@gcc.gnu.org, Richard Sandiford Subject: Re: [build] Move unwinder to toplevel libgcc References: In-Reply-To: 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 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 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 +# . + + +# 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"