This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Ada] Clean up and document use of IN_GCC outside the compiler
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 30 Aug 2011 18:37:20 +0200
- Subject: [Ada] Clean up and document use of IN_GCC outside the compiler
This cleans up and documents the use of IN_GCC in the GNAT build system.
No functional change. Tested on x86_64-suse-linux, applied on the mainline.
2011-08-30 Eric Botcazou <ebotcazou@adacore.com>
* raise-gcc.c: Do not include coretypes.h and tm.h.
(setup_to_install): Remove test for compiler macro.
* targext.c: Document use for the library.
* gcc-interface/Makefile.in: Fix comment on the use of IN_GCC.
--
Eric Botcazou
Index: raise-gcc.c
===================================================================
--- raise-gcc.c (revision 178331)
+++ raise-gcc.c (working copy)
@@ -35,14 +35,6 @@
#ifdef IN_RTS
#include "tconfig.h"
#include "tsystem.h"
-/* In the top-of-tree GCC, tconfig does not include tm.h, but in GCC 3.2
- it does. To avoid branching raise.c just for that purpose, we kludge by
- looking for a symbol always defined by tm.h and if it's not defined,
- we include it. */
-#ifndef FIRST_PSEUDO_REGISTER
-#include "coretypes.h"
-#include "tm.h"
-#endif
#include <sys/stat.h>
#include <stdarg.h>
typedef char bool;
@@ -1007,11 +999,6 @@ setup_to_install (_Unwind_Context *uw_co
_Unwind_Ptr uw_landing_pad,
int uw_filter)
{
-#ifndef EH_RETURN_DATA_REGNO
- /* We should not be called if the appropriate underlying support is not
- there. */
- abort ();
-#else
/* 1/ exception object pointer, which might be provided back to
_Unwind_Resume (and thus to this personality routine) if we are jumping
to a cleanup. */
@@ -1026,7 +1013,6 @@ setup_to_install (_Unwind_Context *uw_co
/* Setup the address we should jump at to reach the code where there is the
"something" we found. */
_Unwind_SetIP (uw_context, uw_landing_pad);
-#endif
}
/* The following is defined from a-except.adb. Its purpose is to enable
Index: targext.c
===================================================================
--- targext.c (revision 178331)
+++ targext.c (working copy)
@@ -31,7 +31,9 @@
/* This file contains target-specific parameters describing the file
extension for object and executable files. It is used by the compiler,
- binder and tools. */
+ binder, library and tools.
+ Note that, in order to have access to the TARGET_* macros used below,
+ the file must be compiled with IN_GCC defined, even for the library. */
#ifdef __cplusplus
extern "C" {
Index: gcc-interface/Makefile.in
===================================================================
--- gcc-interface/Makefile.in (revision 178331)
+++ gcc-interface/Makefile.in (working copy)
@@ -223,8 +223,9 @@ endif
all.indirect: Makefile ../gnat1$(exeext)
-# IN_GCC distinguishes between code compiled into GCC itself and other
-# programs built during a bootstrap.
+# IN_GCC is meant to distinguish between code compiled into GCC itself, i.e.
+# for the host, and the rest. But we also use it for the tools (link.c) and
+# even break the host/target wall by using it for the library (targext.c).
# autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a cross
# compiler which does not use the native libraries and headers.
INTERNAL_CFLAGS = @CROSS@ -DIN_GCC