From patchwork Thu Apr 21 16:33:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 92425 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 A352EB6EE9 for ; Fri, 22 Apr 2011 02:39:25 +1000 (EST) Received: (qmail 24155 invoked by alias); 21 Apr 2011 16:39:22 -0000 Received: (qmail 24141 invoked by uid 22791); 21 Apr 2011 16:39:19 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Apr 2011 16:39:03 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 8543CCB0279 for ; Thu, 21 Apr 2011 18:39:01 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oXlx-BdeOMbJ for ; Thu, 21 Apr 2011 18:38:58 +0200 (CEST) Received: from [192.168.1.2] (bon31-9-83-155-120-49.fbx.proxad.net [83.155.120.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 57839CB022B for ; Thu, 21 Apr 2011 18:38:58 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [Ada] Adjust rules for selected files in Makefiles Date: Thu, 21 Apr 2011 18:33:20 +0200 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Message-Id: <201104211833.21020.ebotcazou@adacore.com> 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 A few selected files must be compiled with special options in Ada, both for the compiler and the runtime. The attached patch cleans things up a bit in this area and also fixes various minor related issues. Bootstrapped/regtested on i586-suse-linux, applied on the mainline. 2011-04-21 Eric Botcazou * gcc-interface/Makefile.in (NO_SIBLING_ADAFLAGS): Always define. (NO_REORDER_ADAFLAGS): New variable. (EXTRA_GNATTOOLS): Always define. (../stamp-gnatlib1-$(RTSDIR): Copy tsystem.h. Clean up and adjust list of files compiled with special options. * gcc-interface/Make-lang.in: Likewise. (ada/decl.o): Cosmetical change. (ada/misc.o): Remove dependency on $(PLUGIN_H). Index: gcc-interface/Makefile.in =================================================================== --- gcc-interface/Makefile.in (revision 172811) +++ gcc-interface/Makefile.in (working copy) @@ -107,6 +107,8 @@ ADA_CFLAGS = ADAFLAGS = -W -Wall -gnatpg -gnata SOME_ADAFLAGS =-gnata FORCE_DEBUG_ADAFLAGS = -g +NO_SIBLING_ADAFLAGS=-fno-optimize-sibling-calls +NO_REORDER_ADAFLAGS=-fno-toplevel-reorder GNATLIBFLAGS = -gnatpg -nostdinc GNATLIBCFLAGS = -g -O2 # Pretend that _Unwind_GetIPInfo is available for the target by default. This @@ -180,6 +182,9 @@ SYSLIBS = @GNAT_LIBEXC@ # List of extra object files linked in with various programs. EXTRA_GNATTOOLS_OBJS = ../../prefix.o ../../version.o +# List extra gnattools +EXTRA_GNATTOOLS = + # List of target dependent sources, overridden below as necessary TARGET_ADA_SRCS = @@ -243,6 +248,21 @@ LIBDEPS = $(LIBINTL_DEP) $(LIBIBERTY) TGT_LIB = TOOLS_LIBS = $(EXTRA_GNATTOOLS_OBJS) targext.o link.o $(LIBGNAT) ../../../libiberty/libiberty.a $(SYSLIBS) $(TGT_LIB) +# Convert the target variable into a space separated list of architecture, +# manufacturer, and operating system and assign each of those to its own +# variable. + +host:=$(subst -, ,$(host_canonical)) +targ:=$(subst -, ,$(target)) +arch:=$(word 1,$(targ)) +ifeq ($(words $(targ)),2) + manu:= + osys:=$(word 2,$(targ)) +else + manu:=$(word 2,$(targ)) + osys:=$(word 3,$(targ)) +endif + # Specify the directories to be searched for header files. # Both . and srcdir are used, in that order, # so that tm.h and config.h will be found in the compilation @@ -312,21 +332,6 @@ GNATMAKE_OBJS = a-except.o ali.o ali-uti uintp.o uname.o urealp.o usage.o widechar.o scil_ll.o \ $(EXTRA_GNATMAKE_OBJS) -# Convert the target variable into a space separated list of architecture, -# manufacturer, and operating system and assign each of those to its own -# variable. - -host:=$(subst -, ,$(host_canonical)) -targ:=$(subst -, ,$(target)) -arch:=$(word 1,$(targ)) -ifeq ($(words $(targ)),2) - manu:= - osys:=$(word 2,$(targ)) -else - manu:=$(word 2,$(targ)) - osys:=$(word 3,$(targ)) -endif - # Make arch match the current multilib so that the RTS selection code # picks up the right files. For a given target this must be coherent # with MULTILIB_DIRNAMES defined in gcc/config/target/t-*. @@ -1634,7 +1639,6 @@ ifeq ($(strip $(filter-out cygwin32% min s-osprim.adb $(RTSDIR)/s.ads $(MV) $(RTSDIR)/s.ads $(RTSDIR)/system.ads $(MAKE) $(FLAGS_TO_PASS) \ @@ -2709,22 +2717,15 @@ b_gnatm.o : b_gnatm.adb ADA_INCLUDE_DIR = $(libsubdir)/adainclude ADA_RTL_OBJ_DIR = $(libsubdir)/adalib +# Special flags + # force no sibling call optimization on s-traceb.o so the number of stack # frames to be skipped when computing a call chain is not modified by -# optimization. However we can do that only when building the runtime -# (not the compiler) because the -fno-optimize-sibling-calls option exists -# only in GCC 3 and above. +# optimization. -ifneq (,$(findstring xgcc,$(CC))) -NO_SIBLING_ADAFLAGS=-fno-optimize-sibling-calls -else -NO_SIBLING_ADAFLAGS= -endif - -s-traceb.o : s-traceb.adb +s-traceb.o : s-traceb.adb s-traceb.ads $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) \ - $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) \ - $< $(OUTPUT_OPTION) + $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION) # force debugging information on s-tasdeb.o so that it is always # possible to set conditional breakpoints on tasks. @@ -2733,11 +2734,16 @@ s-tasdeb.o : s-tasdeb.adb s-tasdeb.ads $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \ $< $(OUTPUT_OPTION) -# force no function reordering on a-except.o because of the exclusion bounds -# mechanism (see the source file for more detailed information). +# force debugging information on s-vaflop.o so that it is always +# possible to call the VAX float debug print routines. +# force at least -O so that the inline assembly works. -NO_REORDER_ADAFLAGS=-fno-toplevel-reorder +s-vaflop.o : s-vaflop.adb s-vaflop.ads + $(CC) -c -O $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \ + $< $(OUTPUT_OPTION) +# force no function reordering on a-except.o because of the exclusion bounds +# mechanism (see the source file for more detailed information). # force debugging information on a-except.o so that it is always # possible to set conditional breakpoints on exceptions. # use -O1 otherwise gdb isn't able to get a full backtrace on mips targets. @@ -2757,10 +2763,23 @@ s-except.o : s-except.adb s-except.ads # force debugging information on s-assert.o so that it is always # possible to set breakpoint on assert failures. -s-assert.o : s-assert.adb s-assert.ads a-except.ads - $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O2 $(ADA_INCLUDES) \ +s-assert.o : s-assert.adb s-assert.ads + $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \ $< $(OUTPUT_OPTION) +# force debugging information on a-tags.o so that the debugger can find +# the description of Ada.Tags.Type_Specific_Data. + +a-tags.o : a-tags.adb a-tags.ads + $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \ + $< $(OUTPUT_OPTION) + +# need to keep the frame pointer in this file to pop the stack properly on +# some targets. +tracebak.o : tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c + $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) \ + $(INCLUDES) -fno-omit-frame-pointer $< $(OUTPUT_OPTION) + adadecode.o : adadecode.c adadecode.h aux-io.o : aux-io.c argv.o : argv.c @@ -2770,15 +2789,18 @@ errno.o : errno.c exit.o : adaint.h exit.c expect.o : expect.c final.o : final.c -link.o : link.c locales.o : locales.c mkdir.o : mkdir.c socket.o : socket.c gsocket.h sysdep.o : sysdep.c -raise-gcc.o : raise-gcc.c raise.h raise.o : raise.c raise.h vx_stack_info.o : vx_stack_info.c +raise-gcc.o : raise-gcc.c raise.h + $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \ + -iquote $(srcdir) \ + $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) + cio.o : cio.c $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \ $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) @@ -2791,16 +2813,16 @@ initialize.o : initialize.c raise.h $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \ $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) -targext.o : targext.c +link.o : link.c $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \ $(ALL_CPPFLAGS) $(INCLUDES_FOR_SUBDIR) \ $< $(OUTPUT_OPTION) -# Need to keep the frame pointer in this file to pop the stack properly on -# some targets. -tracebak.o : tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c - $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) \ - $(INCLUDES) -fno-omit-frame-pointer $< $(OUTPUT_OPTION) +targext.o : targext.c + $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \ + -iquote $(srcdir) \ + $(ALL_CPPFLAGS) $(INCLUDES_FOR_SUBDIR) \ + $< $(OUTPUT_OPTION) # In GNU Make, ignore whether `stage*' exists. .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap Index: gcc-interface/Make-lang.in =================================================================== --- gcc-interface/Make-lang.in (revision 172811) +++ gcc-interface/Make-lang.in (working copy) @@ -1,6 +1,6 @@ # Top level -*- makefile -*- fragment for GNU Ada (GNAT). # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 # Free Software Foundation, Inc. #This file is part of GCC. @@ -1127,43 +1127,39 @@ ada/sdefault.o : ada/ada.ads ada/a-excep ADA_TREE_H = ada/gcc-interface/ada-tree.h -# force debugging information on s-tasdeb.o so that it is always -# possible to set conditional breakpoints on tasks. +# Special flags - see gcc-interface/Makefile.in for the template + +ada/s-traceb.o : ada/s-traceb.adb ada/s-traceb.ads + $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \ + $< $(OUTPUT_OPTION) ada/s-tasdeb.o : ada/s-tasdeb.adb ada/s-tasdeb.ads $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \ $< $(OUTPUT_OPTION) -# force debugging information on s-vaflop.o so that it is always -# possible to call the VAX float debug print routines. -# force at least -O so that the inline assembly works. - ada/s-vaflop.o : ada/s-vaflop.adb ada/s-vaflop.ads $(CC) -c -O $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \ - $(OUTPUT_OPTION) $< - -# force debugging information on a-except.o so that it is always -# possible to set conditional breakpoints on exceptions. -# use -O1 otherwise gdb isn't able to get a full backtrace on mips targets. + $< $(OUTPUT_OPTION) ada/a-except.o : ada/a-except.adb ada/a-except.ads $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \ $(ADA_INCLUDES) $< $(OUTPUT_OPTION) -# compile s-except.o without optimization and with debug info to let the -# debugger set breakpoints and inspect subprogram parameters on exception -# related events. - ada/s-except.o : ada/s-except.adb ada/s-except.ads $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 \ $(ADA_INCLUDES) $< $(OUTPUT_OPTION) -# force debugging information on s-assert.o so that it is always -# possible to set breakpoint on assert failures. +ada/s-assert.o : ada/s-assert.adb ada/s-assert.ads + $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \ + $< $(OUTPUT_OPTION) -ada/s-assert.o : ada/s-assert.adb ada/s-assert.ads ada/a-except.ads - $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O2 \ - $(ADA_INCLUDES) $< $(OUTPUT_OPTION) +ada/a-tags.o : ada/a-tags.adb ada/a-tags.ads + $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \ + $< $(OUTPUT_OPTION) + +ada/tracebak.o : ada/tracebak.c $(CONFIG_H) $(SYSTEM_H) + $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) \ + $(INCLUDES) -fno-omit-frame-pointer $< $(OUTPUT_OPTION) # dependencies for windows specific tool (mdll) @@ -1176,19 +1172,6 @@ ada/mdll-fil.o : ada/mdll-fil.adb ada/md ada/mdll-utl.o : ada/mdll-utl.adb ada/mdll.ads ada/mdll-utl.ads ada/sdefault.ads ada/types.ads $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION) -# force debugging information and no optimization on s-memory.o so that it -# is always possible to set breakpoint on __gnat_malloc and __gnat_free -# this is important for gnatmem using GDB. memtrack.o is built from -# memtrack.adb, and used by the post-mortem analysis with gnatmem. - -ada/s-memory.o : ada/s-memory.adb ada/s-memory.ads - $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 \ - $(ADA_INCLUDES) $< $(OUTPUT_OPTION) - -ada/memtrack.o : ada/memtrack.adb ada/s-memory.ads - $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 \ - $(ADA_INCLUDES) $< $(OUTPUT_OPTION) - ada/adadecode.o : ada/adadecode.c $(CONFIG_H) $(SYSTEM_H) ada/adadecode.h ada/adaint.o : ada/adaint.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h ada/argv.o : ada/argv.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h @@ -1197,7 +1180,6 @@ ada/exit.o : ada/exit.c $(CONFIG_H) ada/final.o : ada/final.c $(CONFIG_H) $(SYSTEM_H) ada/raise.h ada/link.o : ada/link.c - ada/targext.o : ada/targext.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \ $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) @@ -1218,11 +1200,6 @@ ada/raise.o : ada/raise.c $(CONFIG_H) $( $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \ $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) -# Need to keep the frame pointer to unwind the stack properly for some targets. -ada/tracebak.o : ada/tracebak.c $(CONFIG_H) $(SYSTEM_H) - $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) \ - $(INCLUDES) -fno-omit-frame-pointer $< $(OUTPUT_OPTION) - ada/cuintp.o : ada/gcc-interface/cuintp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) $(TREE_H) ada/gcc-interface/ada.h ada/types.h ada/uintp.h \ ada/atree.h ada/elists.h ada/nlists.h ada/stringt.h ada/fe.h $(ADA_TREE_H) \ @@ -1230,8 +1207,8 @@ ada/cuintp.o : ada/gcc-interface/cuintp. $(COMPILER) -c $(ALL_COMPILERFLAGS) -I.. $(ALL_CPPFLAGS) $< -o $@ ada/decl.o : ada/gcc-interface/decl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(TREE_H) $(FLAGS_H) toplev.h $(TARGET_H) $(TREE_INLINE_H) \ - ada/gcc-interface/ada.h ada/types.h ada/atree.h \ + $(TM_H) $(TREE_H) $(FLAGS_H) toplev.h $(TARGET_H) \ + $(TREE_INLINE_H) ada/gcc-interface/ada.h ada/types.h ada/atree.h \ ada/elists.h ada/namet.h ada/nlists.h ada/repinfo.h ada/snames.h \ ada/stringt.h ada/uintp.h ada/fe.h ada/sinfo.h ada/einfo.h $(ADA_TREE_H) \ ada/gcc-interface/gigi.h gt-ada-decl.h @@ -1240,7 +1217,7 @@ ada/decl.o : ada/gcc-interface/decl.c $( ada/misc.o : ada/gcc-interface/misc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) $(TREE_H) $(DIAGNOSTIC_H) $(TARGET_H) $(FUNCTION_H) \ $(FLAGS_H) debug.h toplev.h langhooks.h \ - $(LANGHOOKS_DEF_H) $(OPTS_H) $(OPTIONS_H) $(TREE_INLINE_H) $(PLUGIN_H) \ + $(LANGHOOKS_DEF_H) $(OPTS_H) $(OPTIONS_H) $(TREE_INLINE_H) \ ada/gcc-interface/ada.h ada/adadecode.h ada/types.h ada/atree.h \ ada/elists.h ada/namet.h ada/nlists.h ada/stringt.h ada/uintp.h ada/fe.h \ ada/sinfo.h ada/einfo.h $(ADA_TREE_H) ada/gcc-interface/gigi.h \