From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10928 invoked by alias); 25 May 2011 19:22:22 -0000 Received: (qmail 10920 invoked by uid 22791); 25 May 2011 19:22:19 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 May 2011 19:22:01 +0000 Received: (qmail 7761 invoked from network); 25 May 2011 19:21:59 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 25 May 2011 19:21:59 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1QPJeY-0002hQ-3F for gcc-patches@gcc.gnu.org; Wed, 25 May 2011 19:21:58 +0000 Date: Wed, 25 May 2011 19:54:00 -0000 From: "Joseph S. Myers" To: gcc-patches@gcc.gnu.org Subject: Re: Create common hooks structure shared between driver and cc1 In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg01917.txt.bz2 Here is a revised version of my patch to create the common hooks structure. Tested in the same way as the original patch. OK to commit? In the course of working on moving hooks to the new structure, I found that every target architecture except for moxie has at least one of the hooks that will move. I didn't want to create 35 separate makefile rules with manually maintained dependencies to build the associated new source files for those hooks (with, probably, many new t-* files to contain those rules and dependencies). So this patch makes $arch-common.o follow a similar approach to $arch.o: have a single common_out_file and common_out_object_file instead of the previous more general extra_common_objs, and have a shared makefile rule, with a standard set of dependencies, in gcc/Makefile.in. (This means the patch no longer touches pa/t-pa, which is again an unused file along with i386/t-crtpic and i386/t-svr3dbx; note that $arch/t-$arch is *only* automatically used if config.gcc leaves tmake_file completely empty, otherwise config.gcc needs to add such a file explicitly to tmake_file to cause it to be used.) There are actually two separate things I wanted to avoid replicating 35-fold: manually maintained rules, and manually maintained dependencies. For the latter, I looked again at Tom's reverted patch from March 2008 to use automatic dependency generation. Although there is now a fixed GNU make release (since last July), and although I'd like to see automatic dependency generation go in (I hope Paolo may follow up on it as per ), actually getting it working looks like a potential rathole and I couldn't figure out from the 2008 thread what the makefile feature was that caused problems with a GNU make bug and whether it would be possible to disable use of that feature (instead having stupid dependencies of all objects on all headers) when using older versions of make (which would I think be desirable, to avoid forcing everyone to upgrade make immediately). For the former (avoided in this patch by having one new rule instead of 35), as far as I can see the main reason extra rules are involved for target-specific files is just to build them directly in the gcc/ object directory, instead of with a .o name matching the path to the source directory ($objdir/config/i386/i386.o, etc.). So most of them could probably be eliminated (leaving only dependencies) by putting all objects in subdirectories (and making configure.ac create all those directories). Some involve extra compiler options, which the dependencies patch dealt with by using GNU make variable settings applying to individual makefile targets, and I suppose it might be possible to use that feature separately from automatic dependency generation - though the way those settings apply to dependencies of the target being built could cause problems, so maybe we should instead put $($@-CPPFLAGS) or similar in CPPFLAGS - though if it were that simple to avoid the replication of compilation commands, I'd expect this to be done already. 2011-05-25 Joseph Myers * common/common-target-def.h, common/common-target.def, common/common-target.h, common/config/default-common.c, common/config/pa/pa-common.c: New files. * Makefile.in (common_out_file, common_out_object_file, COMMON_TARGET_H, COMMON_TARGET_DEF_H): New. (OBJS-libcommon-target): Include $(common_out_object_file). (prefix.o): Update dependencies. ($(common_out_object_file), common/common-target-hooks-def.h, s-common-target-hooks-def-h): New. (s-tm-texi): Also check timestamp on common-target.def. (build/genhooks.o): Update dependencies. * config.gcc (common_out_file, target_has_targetm_common): Define. * config/pa/som.h (ALWAYS_STRIP_DOTDOT): Replace with TARGET_ALWAYS_STRIP_DOTDOT. * configure.ac (common_out_object_file): Define. (common_out_file, common_out_object_file): Substitute. (common): Create directory. * configure: Regenerate. * doc/tm.texi.in (targetm_common): Document. (TARGET_ALWAYS_STRIP_DOTDOT): Add @hook entry. * doc/tm.texi: Regenerate. * genhooks.c (hook_array): Also include common/common-target.def. * prefix.c (tm.h): Don't include. (common/common-target.h): Include. (ALWAYS_STRIP_DOTDOT): Don't define. (update_path): Use targetm_common.always_strip_dotdot instead of ALWAYS_STRIP_DOTDOT. * system.h (ALWAYS_STRIP_DOTDOT): Poison. Index: gcc/doc/tm.texi =================================================================== --- gcc/doc/tm.texi (revision 174109) +++ gcc/doc/tm.texi (working copy) @@ -99,6 +99,16 @@ initializer @code{TARGETCM_INITIALIZER} themselves, they should set @code{target_has_targetcm=yes} in @file{config.gcc}; otherwise a default definition is used. +Similarly, there is a @code{targetm_common} variable for hooks that +are shared between the compiler driver and the compilers proper, +documented as ``Common Target Hook''. This is declared in +@file{common/common-target.h}, the initializer +@code{TARGETM_COMMON_INITIALIZER} in +@file{common/common-target-def.h}. If targets initialize +@code{targetm_common} themselves, they should set +@code{target_has_targetm_common=yes} in @file{config.gcc}; otherwise a +default definition is used. + @node Driver @section Controlling the Compilation Driver, @file{gcc} @cindex driver @@ -383,6 +393,10 @@ directories from linking commands. Do n removing duplicate search directories changes the linker's semantics. @end defmac +@deftypevr {Common Target Hook} bool TARGET_ALWAYS_STRIP_DOTDOT +True if @file{..} components should always be removed from directory names computed relative to GCC's internal directories, false (default) if such components should be preserved and directory names containing them passed to other tools such as the linker. +@end deftypevr + @defmac MULTILIB_DEFAULTS Define this macro as a C expression for the initializer of an array of string to tell the driver program which options are defaults for this Index: gcc/doc/tm.texi.in =================================================================== --- gcc/doc/tm.texi.in (revision 174109) +++ gcc/doc/tm.texi.in (working copy) @@ -99,6 +99,16 @@ initializer @code{TARGETCM_INITIALIZER} themselves, they should set @code{target_has_targetcm=yes} in @file{config.gcc}; otherwise a default definition is used. +Similarly, there is a @code{targetm_common} variable for hooks that +are shared between the compiler driver and the compilers proper, +documented as ``Common Target Hook''. This is declared in +@file{common/common-target.h}, the initializer +@code{TARGETM_COMMON_INITIALIZER} in +@file{common/common-target-def.h}. If targets initialize +@code{targetm_common} themselves, they should set +@code{target_has_targetm_common=yes} in @file{config.gcc}; otherwise a +default definition is used. + @node Driver @section Controlling the Compilation Driver, @file{gcc} @cindex driver @@ -383,6 +393,8 @@ directories from linking commands. Do n removing duplicate search directories changes the linker's semantics. @end defmac +@hook TARGET_ALWAYS_STRIP_DOTDOT + @defmac MULTILIB_DEFAULTS Define this macro as a C expression for the initializer of an array of string to tell the driver program which options are defaults for this Index: gcc/configure =================================================================== --- gcc/configure (revision 174109) +++ gcc/configure (working copy) @@ -624,6 +624,8 @@ tm_defines tm_include_list tm_file_list thread_file +common_out_object_file +common_out_file out_object_file out_file objc_boehm_gc @@ -11217,6 +11219,7 @@ done tmake_file="${tmake_file_}" out_object_file=`basename $out_file .c`.o +common_out_object_file=`basename $common_out_file .c`.o tm_file_list="options.h" tm_include_list="options.h insn-constants.h" @@ -17517,7 +17520,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17520 "configure" +#line 17523 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17623,7 +17626,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17626 "configure" +#line 17629 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -26297,6 +26300,8 @@ fi + + # Echo link setup. if test x${build} = x${host} ; then if test x${host} = x${target} ; then @@ -27854,7 +27859,7 @@ case ${CONFIG_HEADERS} in echo > cstamp-h ;; esac # Make sure all the subdirs exist. -for d in $subdirs doc build c-family +for d in $subdirs doc build common c-family do test -d $d || mkdir $d done Index: gcc/common/common-target.h =================================================================== --- gcc/common/common-target.h (revision 0) +++ gcc/common/common-target.h (revision 0) @@ -0,0 +1,35 @@ +/* Data structure definitions for common hooks. + Copyright (C) 2011 + Free Software Foundation, Inc. + + This program 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. + + This program 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 this program; see the file COPYING3. If not see + . + + In other words, you are welcome to use, share and improve this program. + You are forbidden to forbid anyone else to use, share and improve + what you give them. Help stamp out software-hoarding! */ + +#ifndef GCC_COMMON_TARGET_H +#define GCC_COMMON_TARGET_H + +#define DEFHOOKPOD(NAME, DOC, TYPE, INIT) TYPE NAME; +#define DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT) TYPE (* NAME) PARAMS; +#define DEFHOOK_UNDOC DEFHOOK +#define HOOKSTRUCT(FRAGMENT) FRAGMENT + +#include "common-target.def" + +extern struct gcc_targetm_common targetm_common; + +#endif /* GCC_C_TARGET_H */ Index: gcc/common/config/pa/pa-common.c =================================================================== --- gcc/common/config/pa/pa-common.c (revision 0) +++ gcc/common/config/pa/pa-common.c (revision 0) @@ -0,0 +1,28 @@ +/* HPPA common hooks. + 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. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "common/common-target.h" +#include "common/common-target-def.h" +#include "tm.h" + +struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER; Index: gcc/common/config/default-common.c =================================================================== --- gcc/common/config/default-common.c (revision 0) +++ gcc/common/config/default-common.c (revision 0) @@ -0,0 +1,34 @@ +/* Default common target hooks initializer. + 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. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "common/common-target.h" +#include "common/common-target-def.h" + +/* Do not include tm.h or tm_p.h here; if it is useful for a target to + define some macros for the initializer in a header without defining + targetm_common itself (for example, because of interactions with + some hooks depending on the target OS and others on the target + architecture), create a separate tm_common.h for only the relevant + definitions. */ + +struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER; Index: gcc/common/common-target.def =================================================================== --- gcc/common/common-target.def (revision 0) +++ gcc/common/common-target.def (revision 0) @@ -0,0 +1,39 @@ +/* Target hook definitions for common hooks. + Copyright (C) 2011 + Free Software Foundation, Inc. + + This program 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. + + This program 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 this program; see the file COPYING3. If not see + . */ + +/* See target-hooks-macros.h for details of macros that should be + provided by the including file, and how to use them here. */ +#include "target-hooks-macros.h" + +#undef HOOK_TYPE +#define HOOK_TYPE "Common Target Hook" + +HOOK_VECTOR (TARGETM_COMMON_INITIALIZER, gcc_targetm_common) + +#undef HOOK_PREFIX +#define HOOK_PREFIX "TARGET_" + +DEFHOOKPOD +(always_strip_dotdot, + "True if @file{..} components should always be removed from directory names\ + computed relative to GCC's internal directories, false (default) if such\ + components should be preserved and directory names containing them passed\ + to other tools such as the linker.", + bool, false) + +HOOK_VECTOR_END (C90_EMPTY_HACK) Index: gcc/common/common-target-def.h =================================================================== --- gcc/common/common-target-def.h (revision 0) +++ gcc/common/common-target-def.h (revision 0) @@ -0,0 +1,20 @@ +/* Default initializers for common target hooks. + Copyright (C) 2011 + Free Software Foundation, Inc. + + This program 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. + + This program 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 this program; see the file COPYING3. If not see + . */ + +#include "common/common-target-hooks-def.h" +#include "hooks.h" Index: gcc/configure.ac =================================================================== --- gcc/configure.ac (revision 174109) +++ gcc/configure.ac (working copy) @@ -1628,6 +1628,7 @@ done tmake_file="${tmake_file_}" out_object_file=`basename $out_file .c`.o +common_out_object_file=`basename $common_out_file .c`.o tm_file_list="options.h" tm_include_list="options.h insn-constants.h" @@ -4828,6 +4829,8 @@ AC_SUBST(md_file) AC_SUBST(objc_boehm_gc) AC_SUBST(out_file) AC_SUBST(out_object_file) +AC_SUBST(common_out_file) +AC_SUBST(common_out_object_file) AC_SUBST(thread_file) AC_SUBST(tm_file_list) AC_SUBST(tm_include_list) @@ -5032,7 +5035,7 @@ case ${CONFIG_HEADERS} in echo > cstamp-h ;; esac # Make sure all the subdirs exist. -for d in $subdirs doc build c-family +for d in $subdirs doc build common c-family do test -d $d || mkdir $d done Index: gcc/genhooks.c =================================================================== --- gcc/genhooks.c (revision 174109) +++ gcc/genhooks.c (working copy) @@ -34,6 +34,7 @@ static struct hook_desc hook_array[] = { { "*", #TYPE, HOOK_PREFIX #NAME, #PARAMS, #INIT, HOOK_TYPE }, #include "target.def" #include "c-family/c-target.def" +#include "common/common-target.def" #undef DEFHOOK }; Index: gcc/system.h =================================================================== --- gcc/system.h (revision 174109) +++ gcc/system.h (working copy) @@ -759,7 +759,7 @@ extern void fancy_abort (const char *, i LABEL_ALIGN_MAX_SKIP LOOP_ALIGN_MAX_SKIP \ LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP JUMP_ALIGN_MAX_SKIP \ CAN_DEBUG_WITHOUT_FP UNLIKELY_EXECUTED_TEXT_SECTION_NAME \ - HOT_TEXT_SECTION_NAME LEGITIMATE_CONSTANT_P + HOT_TEXT_SECTION_NAME LEGITIMATE_CONSTANT_P ALWAYS_STRIP_DOTDOT /* Target macros only used for code built for the target, that have moved to libgcc-tm.h. */ Index: gcc/config.gcc =================================================================== --- gcc/config.gcc (revision 174109) +++ gcc/config.gcc (working copy) @@ -96,6 +96,9 @@ # out_file The name of the machine description C support # file, if different from "$cpu_type/$cpu_type.c". # +# common_out_file The name of the source file for code shared between +# the compiler proper and the driver. +# # md_file The name of the machine-description file, if # different from "$cpu_type/$cpu_type.md". # @@ -192,8 +195,12 @@ # # target_has_targetcm Set to yes or no depending on whether the target # has its own definition of targetcm. +# +# target_has_targetm_common Set to yes or no depending on whether the +# target has its own definition of targetm_common. out_file= +common_out_file= tmake_file= extra_headers= user_headers_inc_next_pre= @@ -210,6 +217,7 @@ c_target_objs= cxx_target_objs= fortran_target_objs= target_has_targetcm=no +target_has_targetm_common=no tm_defines= xm_defines= libgcc_tm_file= @@ -358,6 +366,7 @@ ia64-*-*) ;; hppa*-*-*) cpu_type=pa + target_has_targetm_common=yes ;; lm32*) extra_options="${extra_options} g.opt" @@ -2698,6 +2707,14 @@ if [ "$target_has_targetcm" = "no" ]; th cxx_target_objs="$cxx_target_objs default-c.o" fi +if [ "$common_out_file" = "" ]; then + if [ "$target_has_targetm_common" = "yes" ]; then + common_out_file="$cpu_type/$cpu_type-common.c" + else + common_out_file="default-common.c" + fi +fi + # Support for --with-cpu and related options (and a few unrelated options, # too). case ${with_cpu} in Index: gcc/Makefile.in =================================================================== --- gcc/Makefile.in (revision 174109) +++ gcc/Makefile.in (working copy) @@ -480,6 +480,8 @@ TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@ TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@ out_file=$(srcdir)/config/@out_file@ out_object_file=@out_object_file@ +common_out_file=$(srcdir)/common/config/@common_out_file@ +common_out_object_file=@common_out_object_file@ md_file=$(srcdir)/config/@md_file@ tm_file_list=@tm_file_list@ tm_include_list=@tm_include_list@ @@ -889,8 +891,10 @@ VEC_H = vec.h statistics.h EXCEPT_H = except.h $(HASHTAB_H) vecprim.h vecir.h TARGET_DEF = target.def target-hooks-macros.h C_TARGET_DEF = c-family/c-target.def target-hooks-macros.h +COMMON_TARGET_DEF = common/common-target.def target-hooks-macros.h TARGET_H = $(TM_H) target.h $(TARGET_DEF) insn-modes.h C_TARGET_H = c-family/c-target.h $(C_TARGET_DEF) +COMMON_TARGET_H = common/common-target.h $(COMMON_TARGET_DEF) MACHMODE_H = machmode.h mode-classes.def insn-modes.h HOOKS_H = hooks.h $(MACHMODE_H) HOSTHOOKS_DEF_H = hosthooks-def.h $(HOOKS_H) @@ -898,6 +902,8 @@ LANGHOOKS_DEF_H = langhooks-def.h $(HOOK TARGET_DEF_H = target-def.h target-hooks-def.h $(HOOKS_H) targhooks.h C_TARGET_DEF_H = c-family/c-target-def.h c-family/c-target-hooks-def.h \ $(TREE_H) $(C_COMMON_H) $(HOOKS_H) +COMMON_TARGET_DEF_H = common/common-target-def.h \ + common/common-target-hooks-def.h $(HOOKS_H) RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H) reg-notes.def insn-notes.def \ $(INPUT_H) $(REAL_H) statistics.h $(VEC_H) $(FIXED_VALUE_H) alias.h \ $(HASHTAB_H) @@ -1493,7 +1499,8 @@ OBJS-libcommon = diagnostic.o pretty-pri # Objects in libcommon-target.a, used by drivers and by the core # compiler and containing target-dependent code. -OBJS-libcommon-target = prefix.o opts-common.o options.o +OBJS-libcommon-target = $(common_out_object_file) prefix.o opts-common.o \ + options.o # This lists all host objects for the front ends. ALL_HOST_FRONTEND_OBJS = $(C_OBJS) \ @@ -2220,8 +2227,8 @@ incpath.o: incpath.c incpath.h $(CONFIG_ intl.h prefix.h coretypes.h $(TM_H) cppdefault.h $(TARGET_H) \ $(MACHMODE_H) -prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) prefix.h \ - Makefile $(BASEVER) +prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h prefix.h \ + $(COMMON_TARGET_H) Makefile $(BASEVER) $(COMPILER) $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \ -DPREFIX=\"$(prefix)\" -DBASEVER=$(BASEVER_s) \ -c $(srcdir)/prefix.c $(OUTPUT_OPTION) @@ -3539,6 +3546,11 @@ $(out_object_file): $(out_file) $(CONFIG $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \ $(out_file) $(OUTPUT_OPTION) +$(common_out_object_file): $(common_out_file) $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h $(COMMON_TARGET_H) $(COMMON_TARGET_DEF_H) $(TM_H) + $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \ + $< $(OUTPUT_OPTION) + # Build auxiliary files that support ecoff format. mips-tfile: mips-tfile.o $(LIBDEPS) $(LINKER) $(LINKERFLAGS) $(LDFLAGS) -o $@ \ @@ -3738,6 +3750,15 @@ s-c-target-hooks-def-h: build/genhooks$( c-family/c-target-hooks-def.h $(STAMP) s-c-target-hooks-def-h +common/common-target-hooks-def.h: s-common-target-hooks-def-h; @true + +s-common-target-hooks-def-h: build/genhooks$(build_exeext) + $(RUN_GEN) build/genhooks$(build_exeext) "Common Target Hook" \ + > tmp-common-target-hooks-def.h + $(SHELL) $(srcdir)/../move-if-change tmp-common-target-hooks-def.h \ + common/common-target-hooks-def.h + $(STAMP) s-common-target-hooks-def-h + # check if someone mistakenly only changed tm.texi. # We use a different pathname here to avoid a circular dependency. s-tm-texi: $(srcdir)/doc/../doc/tm.texi @@ -3760,6 +3781,7 @@ s-tm-texi: build/genhooks$(build_exeext) elif test $(srcdir)/doc/tm.texi -nt $(srcdir)/doc/tm.texi.in \ && ( test $(srcdir)/doc/tm.texi -nt $(srcdir)/target.def \ || test $(srcdir)/doc/tm.texi -nt $(srcdir)/c-family/c-target.def \ + || test $(srcdir)/doc/tm.texi -nt $(srcdir)/common/common-target.def \ ); then \ echo >&2 ; \ echo You should edit $(srcdir)/doc/tm.texi.in rather than $(srcdir)/doc/tm.texi . >&2 ; \ @@ -3974,7 +3996,7 @@ build/genpreds.o : genpreds.c $(RTL_BASE build/genrecog.o : genrecog.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h build/genhooks.o : genhooks.c $(TARGET_DEF) $(C_TARGET_DEF) \ - $(BCONFIG_H) $(SYSTEM_H) errors.h + $(COMMON_TARGET_DEF) $(BCONFIG_H) $(SYSTEM_H) errors.h # Compile the programs that generate insn-* from the machine description. # They are compiled with $(COMPILER_FOR_BUILD), and associated libraries, Index: gcc/config/pa/som.h =================================================================== --- gcc/config/pa/som.h (revision 174109) +++ gcc/config/pa/som.h (working copy) @@ -1,5 +1,5 @@ /* Definitions for SOM assembler support. - Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2007, 2010 + Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2007, 2010, 2011 Free Software Foundation, Inc. This file is part of GCC. @@ -269,7 +269,8 @@ do { \ must be removed from library prefixes to prevent binaries from depending on the location of the GCC tool directory. The downside is GCC cannot be moved after installation using a symlink. */ -#define ALWAYS_STRIP_DOTDOT 1 +#undef TARGET_ALWAYS_STRIP_DOTDOT +#define TARGET_ALWAYS_STRIP_DOTDOT true /* If GAS supports weak, we can support weak when we have working linker support for secondary definitions and are generating code for GAS. Index: gcc/prefix.c =================================================================== --- gcc/prefix.c (revision 174109) +++ gcc/prefix.c (working copy) @@ -1,6 +1,6 @@ /* Utility to update paths from internal to external forms. Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2007 Free Software Foundation, Inc. + 2007, 2011 Free Software Foundation, Inc. This file is part of GCC. @@ -67,11 +67,11 @@ License along with GCC; see the file COP #include "config.h" #include "system.h" #include "coretypes.h" -#include "tm.h" #if defined(_WIN32) && defined(ENABLE_WIN32_REGISTRY) #include #endif #include "prefix.h" +#include "common/common-target.h" static const char *std_prefix = PREFIX; @@ -271,10 +271,6 @@ update_path (const char *path, const cha else result = xstrdup (path); -#ifndef ALWAYS_STRIP_DOTDOT -#define ALWAYS_STRIP_DOTDOT 0 -#endif - p = result; while (1) { @@ -289,7 +285,8 @@ update_path (const char *path, const cha && (p != result && IS_DIR_SEPARATOR (p[-1]))) { *p = 0; - if (!ALWAYS_STRIP_DOTDOT && access (result, X_OK) == 0) + if (!targetm_common.always_strip_dotdot + && access (result, X_OK) == 0) { *p = '.'; break; -- Joseph S. Myers joseph@codesourcery.com