aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2010-11-29 14:09:41 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2010-11-29 14:09:41 +0000
commit71f3e391b3fdd791965321747ac078a61472fb87 (patch)
tree7546d2e8d80d8eb06c632d680bcbe09820689b95 /gcc
parentb3f122e0f9fc5d5503d23fc82d03456cc4a575b3 (diff)
downloadgcc-71f3e391b3fdd791965321747ac078a61472fb87.zip
gcc-71f3e391b3fdd791965321747ac078a61472fb87.tar.gz
gcc-71f3e391b3fdd791965321747ac078a61472fb87.tar.bz2
system.h: Include "safe-ctype.h" instead of <safe-ctype.h>.
* system.h: Include "safe-ctype.h" instead of <safe-ctype.h>. Include <signal.h>, <sys/mman.h>, <sys/resource.h> and <sys/times.h>. (O_BINARY, SIGCHLD, MAP_FAILED, MAP_ANONYMOUS, kill): Conditionally define. (GET_ENVIRONMENT): Poison. * configure.ac: Don't test for mincore. * configure: Regenerate. * config.in: Regenerate. * collect2-aix.c: Don't include <sys/mman.h>. * collect2.c: Don't include <signal.h>. (SIGCHLD): Don't define. (prefix_from_env): Use getenv instead of GET_ENVIRONMENT. * config/alpha/alpha.c: Include "splay-tree.h" instead of <splay-tree.h>. * config/arm/arm.c (arm_target_help): Use getenv instead of GET_ENVIRONMENT. * config/avr/driver-avr.c: Don't include <stdlib.h>. * config/frv/frv.c: Don't include <ctype.h>. * config/host-darwin.c: Don't include <sys/mman.h>. * config/host-hpux.c: Don't include <sys/mman.h> or <unistd.h>. (MAP_FAILED): Don't define. * config/host-linux.c: Don't include <sys/mman.h> or <limits.h>. * config/host-solaris.c: Don't include <sys/mman.h>. * config/i386/cygming.h: Don't include <stdio.h>. * config/i386/driver-i386.c: Don't include <stdlib.h>. * config/i386/host-cygwin.c: Don't include <sys/mman.h>. * config/iq2000/iq2000.c: Don't include <signal.h>. * config/m32c/m32c-pragma.c: Don't include <stdio.h>. * config/m68hc11/m68hc11.c: Don't include <stdio.h>. * config/mep/mep-pragma.c: Don't include <stdio.h>. * config/microblaze/microblaze.c: Don't include <signal.h>. * config/mips/mips.c: Don't include <signal.h>. * config/rs6000/host-darwin.c: Don't include <signal.h>. * cppdefault.c (cpp_relocated): Use getenv instead of GET_ENVIRONMENT. * defaults.h (GET_ENVIRONMENT): Don't define. * et-forest.h: Don't include <ansidecl.h> or <stddef.h>. * gcc.c: Don't include <signal.h>, <sys/mman.h> or <sys/types.h>. (SIGCHLD, MAP_FAILED, kill): Don't define. (process_command): Use getenv instead of GET_ENVIRONMENT. * genhooks.c: Don't include <string.h>. * ggc-common.c: Don't include <sys/resource.h>, <sys/mman.h> or <sys/types.h>. (MAP_FAILED): Don't define. * ggc-page.c Don't include <sys/mman.h>. (MAP_ANONYMOUS, MAP_FAILED): Don't define. * ggc-zone.c: Don't include <sys/mman.h>. (MAP_ANONYMOUS, MAP_FAILED): Don't define. * graph.c: Include "config.h" instead of <config.h>. * incpath.c (add_env_var_paths): Use getenv instead of GET_ENVIRONMENT. * lto-wrapper.c: Don't include <errno.h>, <signal.h> or "libiberty.h". (SIGCHLD, kill): Don't define. * mips-tfile.c: Don't include <signal.h>. * opts.c: Don't include <signal.h> or <sys/resource.h>. (print_specific_help): Use getenv instead of GET_ENVIRONMENT. * passes.c: Don't include <signal.h>, <sys/resource.h> or <sys/times.h>. * sparseset.h: Don't include <assert.h>. * timevar.c: Don't include <sys/times.h> or <sys/resource.h>. * tlink.c: Don't include "libiberty.h". * toplev.c: Don't include <signal.h> or <sys/times.h>. * tree-mudflap.c: Include "demangle.h" instead of <demangle.h>. * tree-switch-conversion.c: Don't include <signal.h>. * vmsdbgout.c: Don't include <errno.h> or <string.h>. c-family: * c-opts.c (check_deps_environment_vars): Use getenv instead of GET_ENVIRONMENT. * c-pch.c (O_BINARY): Don't define here. * c-pragma.h: Include "cpplib.h" instead of <cpplib.h>. fortran: * gfortran.h (alloca): Don't include definitions. (NULL): Don't define. java: * boehm.c: Include "config.h" instead of <config.h>. * builtins.c: Don't include <stdarg.h>. * class.c: Don't include "stdio.h". (O_BINARY): Don't define here. * jcf-depend.c: Don't include <assert.h>. (jcf_dependency_set_dep_file, jcf_dependency_init, jcf_dependency_write): Use gcc_assert. * jcf-io.c (O_BINARY): Don't define here. * jcf-path.c: Don't include "tm.h". (jcf_path_init): Use getenv instead of GET_ENVIRONMENT. * resource.c: Don't include "stdio.h". (O_BINARY): Don't define here. * verify-impl.c: Don't include <stdio.h>. lto: * lto-endian.h: Delete. * lto-object.c: Don't include "libiberty.h". (O_BINARY): Don't define. * lto.c: Don't include "libiberty.h" or <sys/mman.h>. (O_BINARY): Don't define. From-SVN: r167241
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog70
-rw-r--r--gcc/c-family/ChangeLog7
-rw-r--r--gcc/c-family/c-opts.c4
-rw-r--r--gcc/c-family/c-pch.c4
-rw-r--r--gcc/c-family/c-pragma.h2
-rw-r--r--gcc/collect2-aix.c4
-rw-r--r--gcc/collect2.c6
-rw-r--r--gcc/config.in6
-rw-r--r--gcc/config/alpha/alpha.c2
-rw-r--r--gcc/config/arm/arm.c2
-rwxr-xr-xgcc/config/avr/driver-avr.c3
-rw-r--r--gcc/config/frv/frv.c1
-rw-r--r--gcc/config/host-darwin.c3
-rw-r--r--gcc/config/host-hpux.c8
-rw-r--r--gcc/config/host-linux.c4
-rw-r--r--gcc/config/host-solaris.c1
-rw-r--r--gcc/config/i386/cygming.h2
-rw-r--r--gcc/config/i386/driver-i386.c1
-rw-r--r--gcc/config/i386/host-cygwin.c3
-rw-r--r--gcc/config/iq2000/iq2000.c1
-rw-r--r--gcc/config/m32c/m32c-pragma.c3
-rw-r--r--gcc/config/m68hc11/m68hc11.c1
-rw-r--r--gcc/config/mep/mep-pragma.c3
-rw-r--r--gcc/config/microblaze/microblaze.c1
-rw-r--r--gcc/config/mips/mips.c1
-rw-r--r--gcc/config/rs6000/host-darwin.c3
-rwxr-xr-xgcc/configure2
-rw-r--r--gcc/configure.ac2
-rw-r--r--gcc/cppdefault.c4
-rw-r--r--gcc/defaults.h4
-rw-r--r--gcc/et-forest.h6
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/gfortran.h22
-rw-r--r--gcc/gcc.c28
-rw-r--r--gcc/genhooks.c1
-rw-r--r--gcc/ggc-common.c16
-rw-r--r--gcc/ggc-page.c15
-rw-r--r--gcc/ggc-zone.c12
-rw-r--r--gcc/graph.c2
-rw-r--r--gcc/incpath.c2
-rw-r--r--gcc/java/ChangeLog16
-rw-r--r--gcc/java/boehm.c6
-rw-r--r--gcc/java/builtins.c1
-rw-r--r--gcc/java/class.c6
-rw-r--r--gcc/java/jcf-depend.c10
-rw-r--r--gcc/java/jcf-io.c7
-rw-r--r--gcc/java/jcf-path.c7
-rw-r--r--gcc/java/resource.c8
-rw-r--r--gcc/java/verify-impl.c6
-rw-r--r--gcc/lto-wrapper.c10
-rw-r--r--gcc/lto/ChangeLog8
-rw-r--r--gcc/lto/lto-endian.h205
-rw-r--r--gcc/lto/lto-object.c7
-rw-r--r--gcc/lto/lto.c15
-rw-r--r--gcc/mips-tfile.c2
-rw-r--r--gcc/opts.c9
-rw-r--r--gcc/passes.c10
-rw-r--r--gcc/sparseset.h4
-rw-r--r--gcc/system.h36
-rw-r--r--gcc/timevar.c9
-rw-r--r--gcc/tlink.c5
-rw-r--r--gcc/toplev.c6
-rw-r--r--gcc/tree-mudflap.c2
-rw-r--r--gcc/tree-switch-conversion.c2
-rw-r--r--gcc/vmsdbgout.c2
65 files changed, 187 insertions, 479 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1bc7228..585429c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,73 @@
+2010-11-29 Joseph Myers <joseph@codesourcery.com>
+
+ * system.h: Include "safe-ctype.h" instead of <safe-ctype.h>.
+ Include <signal.h>, <sys/mman.h>, <sys/resource.h> and
+ <sys/times.h>.
+ (O_BINARY, SIGCHLD, MAP_FAILED, MAP_ANONYMOUS, kill):
+ Conditionally define.
+ (GET_ENVIRONMENT): Poison.
+ * configure.ac: Don't test for mincore.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+ * collect2-aix.c: Don't include <sys/mman.h>.
+ * collect2.c: Don't include <signal.h>.
+ (SIGCHLD): Don't define.
+ (prefix_from_env): Use getenv instead of GET_ENVIRONMENT.
+ * config/alpha/alpha.c: Include "splay-tree.h" instead of
+ <splay-tree.h>.
+ * config/arm/arm.c (arm_target_help): Use getenv instead of
+ GET_ENVIRONMENT.
+ * config/avr/driver-avr.c: Don't include <stdlib.h>.
+ * config/frv/frv.c: Don't include <ctype.h>.
+ * config/host-darwin.c: Don't include <sys/mman.h>.
+ * config/host-hpux.c: Don't include <sys/mman.h> or <unistd.h>.
+ (MAP_FAILED): Don't define.
+ * config/host-linux.c: Don't include <sys/mman.h> or <limits.h>.
+ * config/host-solaris.c: Don't include <sys/mman.h>.
+ * config/i386/cygming.h: Don't include <stdio.h>.
+ * config/i386/driver-i386.c: Don't include <stdlib.h>.
+ * config/i386/host-cygwin.c: Don't include <sys/mman.h>.
+ * config/iq2000/iq2000.c: Don't include <signal.h>.
+ * config/m32c/m32c-pragma.c: Don't include <stdio.h>.
+ * config/m68hc11/m68hc11.c: Don't include <stdio.h>.
+ * config/mep/mep-pragma.c: Don't include <stdio.h>.
+ * config/microblaze/microblaze.c: Don't include <signal.h>.
+ * config/mips/mips.c: Don't include <signal.h>.
+ * config/rs6000/host-darwin.c: Don't include <signal.h>.
+ * cppdefault.c (cpp_relocated): Use getenv instead of
+ GET_ENVIRONMENT.
+ * defaults.h (GET_ENVIRONMENT): Don't define.
+ * et-forest.h: Don't include <ansidecl.h> or <stddef.h>.
+ * gcc.c: Don't include <signal.h>, <sys/mman.h> or <sys/types.h>.
+ (SIGCHLD, MAP_FAILED, kill): Don't define.
+ (process_command): Use getenv instead of GET_ENVIRONMENT.
+ * genhooks.c: Don't include <string.h>.
+ * ggc-common.c: Don't include <sys/resource.h>, <sys/mman.h> or
+ <sys/types.h>.
+ (MAP_FAILED): Don't define.
+ * ggc-page.c Don't include <sys/mman.h>.
+ (MAP_ANONYMOUS, MAP_FAILED): Don't define.
+ * ggc-zone.c: Don't include <sys/mman.h>.
+ (MAP_ANONYMOUS, MAP_FAILED): Don't define.
+ * graph.c: Include "config.h" instead of <config.h>.
+ * incpath.c (add_env_var_paths): Use getenv instead of
+ GET_ENVIRONMENT.
+ * lto-wrapper.c: Don't include <errno.h>, <signal.h> or
+ "libiberty.h".
+ (SIGCHLD, kill): Don't define.
+ * mips-tfile.c: Don't include <signal.h>.
+ * opts.c: Don't include <signal.h> or <sys/resource.h>.
+ (print_specific_help): Use getenv instead of GET_ENVIRONMENT.
+ * passes.c: Don't include <signal.h>, <sys/resource.h> or
+ <sys/times.h>.
+ * sparseset.h: Don't include <assert.h>.
+ * timevar.c: Don't include <sys/times.h> or <sys/resource.h>.
+ * tlink.c: Don't include "libiberty.h".
+ * toplev.c: Don't include <signal.h> or <sys/times.h>.
+ * tree-mudflap.c: Include "demangle.h" instead of <demangle.h>.
+ * tree-switch-conversion.c: Don't include <signal.h>.
+ * vmsdbgout.c: Don't include <errno.h> or <string.h>.
+
2010-11-29 Nicola Pero <nicola.pero@meta-innovation.com>
* c-parser.c (c_parser_objc_try_catch_statement): Renamed to
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 41ae904..dadedfa 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,10 @@
+2010-11-29 Joseph Myers <joseph@codesourcery.com>
+
+ * c-opts.c (check_deps_environment_vars): Use getenv instead of
+ GET_ENVIRONMENT.
+ * c-pch.c (O_BINARY): Don't define here.
+ * c-pragma.h: Include "cpplib.h" instead of <cpplib.h>.
+
2010-11-25 Joseph Myers <joseph@codesourcery.com>
* c-cppbuiltin.c (c_cpp_builtins): Pass &global_options to
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index 03af07a..befd644 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -1131,12 +1131,12 @@ check_deps_environment_vars (void)
{
char *spec;
- GET_ENVIRONMENT (spec, "DEPENDENCIES_OUTPUT");
+ spec = getenv ("DEPENDENCIES_OUTPUT");
if (spec)
cpp_opts->deps.style = DEPS_USER;
else
{
- GET_ENVIRONMENT (spec, "SUNPRO_DEPENDENCIES");
+ spec = getenv ("SUNPRO_DEPENDENCIES");
if (spec)
{
cpp_opts->deps.style = DEPS_SYSTEM;
diff --git a/gcc/c-family/c-pch.c b/gcc/c-family/c-pch.c
index 951ab1f..b863c25 100644
--- a/gcc/c-family/c-pch.c
+++ b/gcc/c-family/c-pch.c
@@ -472,10 +472,6 @@ c_common_no_more_pch (void)
/* Handle #pragma GCC pch_preprocess, to load in the PCH file. */
-#ifndef O_BINARY
-# define O_BINARY 0
-#endif
-
void
c_common_pch_pragma (cpp_reader *pfile, const char *name)
{
diff --git a/gcc/c-family/c-pragma.h b/gcc/c-family/c-pragma.h
index 1c29ec4..cec9cd1 100644
--- a/gcc/c-family/c-pragma.h
+++ b/gcc/c-family/c-pragma.h
@@ -21,7 +21,7 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_C_PRAGMA_H
#define GCC_C_PRAGMA_H
-#include <cpplib.h> /* For enum cpp_ttype. */
+#include "cpplib.h" /* For enum cpp_ttype. */
/* Pragma identifiers built in to the front end parsers. Identifiers
for ancillary handlers will follow these. */
diff --git a/gcc/collect2-aix.c b/gcc/collect2-aix.c
index 7d25e7e..1018265 100644
--- a/gcc/collect2-aix.c
+++ b/gcc/collect2-aix.c
@@ -1,5 +1,5 @@
/* AIX cross support for collect2.
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -25,8 +25,6 @@ along with GCC; see the file COPYING3. If not see
#ifdef CROSS_AIX_SUPPORT
-#include <sys/mman.h>
-
/* Read SIZE bytes starting at DATA as a big-endian value. */
static inline bfd_vma
diff --git a/gcc/collect2.c b/gcc/collect2.c
index 0d745ae..df91d34 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -30,10 +30,6 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
-#include <signal.h>
-#if ! defined( SIGCHLD ) && defined( SIGCLD )
-# define SIGCHLD SIGCLD
-#endif
/* TARGET_64BIT may be defined to use driver specific functionality. */
#undef TARGET_64BIT
@@ -822,7 +818,7 @@ static void
prefix_from_env (const char *env, struct path_prefix *pprefix)
{
const char *p;
- GET_ENVIRONMENT (p, env);
+ p = getenv (env);
if (p)
prefix_from_string (p, pprefix);
diff --git a/gcc/config.in b/gcc/config.in
index b6a95b5..7c5c617 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -1251,12 +1251,6 @@
#endif
-/* Define to 1 if you have the `mincore' function. */
-#ifndef USED_FOR_TARGET
-#undef HAVE_MINCORE
-#endif
-
-
/* Define to 1 if you have the `mmap' function. */
#ifndef USED_FOR_TARGET
#undef HAVE_MMAP
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index eb35367..1ecd2c4 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -50,7 +50,7 @@ along with GCC; see the file COPYING3. If not see
#include "target-def.h"
#include "debug.h"
#include "langhooks.h"
-#include <splay-tree.h>
+#include "splay-tree.h"
#include "cfglayout.h"
#include "gimple.h"
#include "tree-flow.h"
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index f9fbb19..53a847d 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -1364,7 +1364,7 @@ arm_target_help (void)
{
const char *p;
- GET_ENVIRONMENT (p, "COLUMNS");
+ p = getenv ("COLUMNS");
if (p != NULL)
{
int value = atoi (p);
diff --git a/gcc/config/avr/driver-avr.c b/gcc/config/avr/driver-avr.c
index 55af6516d..6ab0bb8 100755
--- a/gcc/config/avr/driver-avr.c
+++ b/gcc/config/avr/driver-avr.c
@@ -1,5 +1,5 @@
/* Subroutines for the gcc driver.
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010 Free Software Foundation, Inc.
Contributed by Anatoly Sokolov <aesok@post.ru>
This file is part of GCC.
@@ -22,7 +22,6 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
-#include <stdlib.h>
/* Current architecture. */
const struct base_arch_s *avr_current_arch = NULL;
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index 5003bb7..f8653c7 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -44,7 +44,6 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "tm_p.h"
#include "ggc.h"
-#include <ctype.h>
#include "target.h"
#include "target-def.h"
#include "targhooks.h"
diff --git a/gcc/config/host-darwin.c b/gcc/config/host-darwin.c
index 223abb8..3fd0a71 100644
--- a/gcc/config/host-darwin.c
+++ b/gcc/config/host-darwin.c
@@ -1,5 +1,5 @@
/* Darwin host-specific hook definitions.
- Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2007, 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -20,7 +20,6 @@
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include <sys/mman.h>
#include "diagnostic-core.h"
#include "toplev.h"
#include "config/host-darwin.h"
diff --git a/gcc/config/host-hpux.c b/gcc/config/host-hpux.c
index 6fe2b55..00adfcf 100644
--- a/gcc/config/host-hpux.c
+++ b/gcc/config/host-hpux.c
@@ -1,5 +1,5 @@
/* HP-UX host-specific hook definitions.
- Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2007, 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -20,15 +20,9 @@
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include <sys/mman.h>
-#include <unistd.h>
#include "hosthooks.h"
#include "hosthooks-def.h"
-#ifndef MAP_FAILED
-#define MAP_FAILED (void *)-1L
-#endif
-
static void *hpux_gt_pch_get_address (size_t, int);
static int hpux_gt_pch_use_address (void *, size_t, int, size_t);
diff --git a/gcc/config/host-linux.c b/gcc/config/host-linux.c
index 9f6ef0a..47ce3ea 100644
--- a/gcc/config/host-linux.c
+++ b/gcc/config/host-linux.c
@@ -1,5 +1,5 @@
/* Linux host-specific hook definitions.
- Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2007, 2008, 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -20,8 +20,6 @@
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include <sys/mman.h>
-#include <limits.h>
#include "hosthooks.h"
#include "hosthooks-def.h"
diff --git a/gcc/config/host-solaris.c b/gcc/config/host-solaris.c
index 835832b..12eab3c 100644
--- a/gcc/config/host-solaris.c
+++ b/gcc/config/host-solaris.c
@@ -20,7 +20,6 @@
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include <sys/mman.h>
#include "hosthooks.h"
#include "hosthooks-def.h"
diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index 28c3082..733c7c7 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -118,8 +118,6 @@ along with GCC; see the file COPYING3. If not see
#define TARGET_EXECUTABLE_SUFFIX ".exe"
-#include <stdio.h>
-
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c
index 0e13162..bf7ec0c 100644
--- a/gcc/config/i386/driver-i386.c
+++ b/gcc/config/i386/driver-i386.c
@@ -21,7 +21,6 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
-#include <stdlib.h>
const char *host_detect_local_cpu (int argc, const char **argv);
diff --git a/gcc/config/i386/host-cygwin.c b/gcc/config/i386/host-cygwin.c
index ac699b3..8510bde 100644
--- a/gcc/config/i386/host-cygwin.c
+++ b/gcc/config/i386/host-cygwin.c
@@ -1,5 +1,5 @@
/* Cygwin host-specific hook definitions.
- Copyright (C) 2004, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2007, 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -20,7 +20,6 @@
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include <sys/mman.h>
#include "hosthooks.h"
#include "hosthooks-def.h"
#include "toplev.h"
diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c
index 433af64..cc4c80f 100644
--- a/gcc/config/iq2000/iq2000.c
+++ b/gcc/config/iq2000/iq2000.c
@@ -21,7 +21,6 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include <signal.h>
#include "tm.h"
#include "tree.h"
#include "rtl.h"
diff --git a/gcc/config/m32c/m32c-pragma.c b/gcc/config/m32c/m32c-pragma.c
index f3f1ca9..fda6a6b 100644
--- a/gcc/config/m32c/m32c-pragma.c
+++ b/gcc/config/m32c/m32c-pragma.c
@@ -1,5 +1,5 @@
/* M32C Pragma support
- Copyright (C) 2004, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2007, 2010 Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
This file is part of GCC.
@@ -18,7 +18,6 @@
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-#include <stdio.h>
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c
index f8a67ba..00d409e 100644
--- a/gcc/config/m68hc11/m68hc11.c
+++ b/gcc/config/m68hc11/m68hc11.c
@@ -32,7 +32,6 @@ Note:
*/
-#include <stdio.h>
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/mep/mep-pragma.c b/gcc/config/mep/mep-pragma.c
index 1c9651a..1e37403 100644
--- a/gcc/config/mep/mep-pragma.c
+++ b/gcc/config/mep/mep-pragma.c
@@ -1,5 +1,5 @@
/* Definitions of Toshiba Media Processor
- Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007, 2009 Free
+ Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007, 2009, 2010 Free
Software Foundation, Inc. Contributed by Red Hat, Inc.
This file is part of GCC.
@@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-#include <stdio.h>
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
index efa000c..2cd28fc 100644
--- a/gcc/config/microblaze/microblaze.c
+++ b/gcc/config/microblaze/microblaze.c
@@ -22,7 +22,6 @@
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include <signal.h>
#include "tm.h"
#include "rtl.h"
#include "regs.h"
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 23907b6..7e7e428 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -27,7 +27,6 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
-#include <signal.h>
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
diff --git a/gcc/config/rs6000/host-darwin.c b/gcc/config/rs6000/host-darwin.c
index 333f488..ca1f6bb 100644
--- a/gcc/config/rs6000/host-darwin.c
+++ b/gcc/config/rs6000/host-darwin.c
@@ -1,5 +1,5 @@
/* Darwin/powerpc host-specific hook definitions.
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010
Free Software Foundation, Inc.
This file is part of GCC.
@@ -21,7 +21,6 @@
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include <signal.h>
#include <sys/ucontext.h>
#include "hosthooks.h"
#include "hosthooks-def.h"
diff --git a/gcc/configure b/gcc/configure
index ce8a676..e1866a4 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -8610,7 +8610,7 @@ fi
for ac_func in times clock kill getrlimit setrlimit atoll atoq \
sysconf strsignal getrusage nl_langinfo \
- gettimeofday mbstowcs wcswidth mmap mincore setlocale \
+ gettimeofday mbstowcs wcswidth mmap setlocale \
clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
diff --git a/gcc/configure.ac b/gcc/configure.ac
index b8f35af..dace19c 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -974,7 +974,7 @@ define(gcc_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl
putchar_unlocked putc_unlocked)
AC_CHECK_FUNCS(times clock kill getrlimit setrlimit atoll atoq \
sysconf strsignal getrusage nl_langinfo \
- gettimeofday mbstowcs wcswidth mmap mincore setlocale \
+ gettimeofday mbstowcs wcswidth mmap setlocale \
gcc_UNLOCKED_FUNCS)
if test x$ac_cv_func_mbstowcs = xyes; then
diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c
index bd705ff..9b1495f 100644
--- a/gcc/cppdefault.c
+++ b/gcc/cppdefault.c
@@ -1,6 +1,6 @@
/* CPP Library.
Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+ 1999, 2000, 2003, 2004, 2006, 2007, 2010 Free Software Foundation, Inc.
Contributed by Per Bothner, 1994-95.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
@@ -127,7 +127,7 @@ cpp_relocated (void)
if (relocated == -1)
{
/* Check if the toolchain was relocated? */
- GET_ENVIRONMENT (gcc_exec_prefix, "GCC_EXEC_PREFIX");
+ gcc_exec_prefix = getenv ("GCC_EXEC_PREFIX");
if (gcc_exec_prefix)
relocated = 1;
else
diff --git a/gcc/defaults.h b/gcc/defaults.h
index 77e7685..815ddd2 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -28,10 +28,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#ifndef GCC_DEFAULTS_H
#define GCC_DEFAULTS_H
-#ifndef GET_ENVIRONMENT
-#define GET_ENVIRONMENT(VALUE, NAME) do { (VALUE) = getenv (NAME); } while (0)
-#endif
-
/* Store in OUTPUT a string (made with alloca) containing an
assembler-name for a local static variable or function named NAME.
LABELNO is an integer which is different for each call. */
diff --git a/gcc/et-forest.h b/gcc/et-forest.h
index 8f49a82..06bd82e 100644
--- a/gcc/et-forest.h
+++ b/gcc/et-forest.h
@@ -1,5 +1,6 @@
/* Et-forest data structure implementation.
- Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2007, 2010
+ 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
@@ -48,9 +49,6 @@
#ifndef _ET_TREE_H
#define _ET_TREE_H
-#include <ansidecl.h>
-#include <stddef.h>
-
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index b7901ad..f8e8e20 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2010-11-29 Joseph Myers <joseph@codesourcery.com>
+
+ * gfortran.h (alloca): Don't include definitions.
+ (NULL): Don't define.
+
2010-11-28 Janus Weil <janus@gcc.gnu.org>
PR fortran/46662
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index d8dd147..52f11c5 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -38,24 +38,6 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "input.h"
#include "splay-tree.h"
-/* The following ifdefs are recommended by the autoconf documentation
- for any code using alloca. */
-
-/* AIX requires this to be the first thing in the file. */
-#ifdef __GNUC__
-#else /* not __GNUC__ */
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#else /* do not HAVE_ALLOCA_H */
-#ifdef _AIX
-#pragma alloca
-#else
-#ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-#endif /* not predefined */
-#endif /* not _AIX */
-#endif /* do not HAVE_ALLOCA_H */
-#endif /* not __GNUC__ */
/* Major control parameters. */
@@ -70,10 +52,6 @@ char *alloca ();
#define free(x) Use_gfc_free_instead_of_free()
#define gfc_is_whitespace(c) ((c==' ') || (c=='\t'))
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
-
/* Stringization. */
#define stringize(x) expand_macro(x)
#define expand_macro(x) # x
diff --git a/gcc/gcc.c b/gcc/gcc.c
index c2998bd..1e525b5 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -35,10 +35,6 @@ compilation is specified by a string called a "spec". */
#include "coretypes.h"
#include "multilib.h" /* before tm.h */
#include "tm.h"
-#include <signal.h>
-#if ! defined( SIGCHLD ) && defined( SIGCLD )
-# define SIGCHLD SIGCLD
-#endif
#include "xregex.h"
#include "obstack.h"
#include "intl.h"
@@ -49,18 +45,6 @@ compilation is specified by a string called a "spec". */
#include "opts.h"
#include "vec.h"
-#ifdef HAVE_MMAP_FILE
-# include <sys/mman.h>
-# ifdef HAVE_MINCORE
-/* This is on Solaris. */
-# include <sys/types.h>
-# endif
-#endif
-
-#ifndef MAP_FAILED
-# define MAP_FAILED ((void *)-1)
-#endif
-
/* By default there is no special suffix for target executables. */
/* FIXME: when autoconf is fixed, remove the host check - dj */
#if defined(TARGET_EXECUTABLE_SUFFIX) && defined(HOST_EXECUTABLE_SUFFIX)
@@ -88,10 +72,6 @@ static const char dir_separator_str[] = { DIR_SEPARATOR, 0 };
#define LIBRARY_PATH_ENV "LIBRARY_PATH"
#endif
-#ifndef HAVE_KILL
-#define kill(p,s) raise(s)
-#endif
-
/* If a stage of compilation returns an exit status >= 1,
compilation of that file ceases. */
@@ -3506,7 +3486,7 @@ process_command (unsigned int decoded_options_count,
struct cl_option_handlers handlers;
unsigned int j;
- GET_ENVIRONMENT (gcc_exec_prefix, "GCC_EXEC_PREFIX");
+ gcc_exec_prefix = getenv ("GCC_EXEC_PREFIX");
n_switches = 0;
n_infiles = 0;
@@ -3611,7 +3591,7 @@ process_command (unsigned int decoded_options_count,
/* COMPILER_PATH and LIBRARY_PATH have values
that are lists of directory names with colons. */
- GET_ENVIRONMENT (temp, "COMPILER_PATH");
+ temp = getenv ("COMPILER_PATH");
if (temp)
{
const char *startp, *endp;
@@ -3645,7 +3625,7 @@ process_command (unsigned int decoded_options_count,
}
}
- GET_ENVIRONMENT (temp, LIBRARY_PATH_ENV);
+ temp = getenv (LIBRARY_PATH_ENV);
if (temp && *cross_compile == '0')
{
const char *startp, *endp;
@@ -3678,7 +3658,7 @@ process_command (unsigned int decoded_options_count,
}
/* Use LPATH like LIBRARY_PATH (for the CMU build program). */
- GET_ENVIRONMENT (temp, "LPATH");
+ temp = getenv ("LPATH");
if (temp && *cross_compile == '0')
{
const char *startp, *endp;
diff --git a/gcc/genhooks.c b/gcc/genhooks.c
index a9eecd7..6d92448 100644
--- a/gcc/genhooks.c
+++ b/gcc/genhooks.c
@@ -19,7 +19,6 @@ along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "bconfig.h"
#include "system.h"
-#include <string.h>
#include "hashtab.h"
#include "errors.h"
diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c
index 2c3c8b3..b7f1524 100644
--- a/gcc/ggc-common.c
+++ b/gcc/ggc-common.c
@@ -36,22 +36,6 @@ along with GCC; see the file COPYING3. If not see
#include "vec.h"
#include "timevar.h"
-#ifdef HAVE_SYS_RESOURCE_H
-# include <sys/resource.h>
-#endif
-
-#ifdef HAVE_MMAP_FILE
-# include <sys/mman.h>
-# ifdef HAVE_MINCORE
-/* This is on Solaris. */
-# include <sys/types.h>
-# endif
-#endif
-
-#ifndef MAP_FAILED
-# define MAP_FAILED ((void *)-1)
-#endif
-
/* When set, ggc_collect will do collection. */
bool ggc_force_collect;
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index c0d2f9a..3104058 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -40,26 +40,11 @@ along with GCC; see the file COPYING3. If not see
file open. Prefer either to valloc. */
#ifdef HAVE_MMAP_ANON
# undef HAVE_MMAP_DEV_ZERO
-
-# include <sys/mman.h>
-# ifndef MAP_FAILED
-# define MAP_FAILED -1
-# endif
-# if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
-# define MAP_ANONYMOUS MAP_ANON
-# endif
# define USING_MMAP
-
#endif
#ifdef HAVE_MMAP_DEV_ZERO
-
-# include <sys/mman.h>
-# ifndef MAP_FAILED
-# define MAP_FAILED -1
-# endif
# define USING_MMAP
-
#endif
#ifndef USING_MMAP
diff --git a/gcc/ggc-zone.c b/gcc/ggc-zone.c
index 0fd5c2b..bd68008 100644
--- a/gcc/ggc-zone.c
+++ b/gcc/ggc-zone.c
@@ -43,22 +43,10 @@ along with GCC; see the file COPYING3. If not see
file open. Prefer either to valloc. */
#ifdef HAVE_MMAP_ANON
# undef HAVE_MMAP_DEV_ZERO
-
-# include <sys/mman.h>
-# ifndef MAP_FAILED
-# define MAP_FAILED -1
-# endif
-# if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
-# define MAP_ANONYMOUS MAP_ANON
-# endif
# define USING_MMAP
#endif
#ifdef HAVE_MMAP_DEV_ZERO
-# include <sys/mman.h>
-# ifndef MAP_FAILED
-# define MAP_FAILED -1
-# endif
# define USING_MMAP
#endif
diff --git a/gcc/graph.c b/gcc/graph.c
index 64e6c3f..d3513fd 100644
--- a/gcc/graph.c
+++ b/gcc/graph.c
@@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-#include <config.h>
+#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
diff --git a/gcc/incpath.c b/gcc/incpath.c
index 91bd241..5126598 100644
--- a/gcc/incpath.c
+++ b/gcc/incpath.c
@@ -100,7 +100,7 @@ add_env_var_paths (const char *env_var, int chain)
{
char *p, *q, *path;
- GET_ENVIRONMENT (q, env_var);
+ q = getenv (env_var);
if (!q)
return;
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 05cbb03..075d183 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,19 @@
+2010-11-29 Joseph Myers <joseph@codesourcery.com>
+
+ * boehm.c: Include "config.h" instead of <config.h>.
+ * builtins.c: Don't include <stdarg.h>.
+ * class.c: Don't include "stdio.h".
+ (O_BINARY): Don't define here.
+ * jcf-depend.c: Don't include <assert.h>.
+ (jcf_dependency_set_dep_file, jcf_dependency_init,
+ jcf_dependency_write): Use gcc_assert.
+ * jcf-io.c (O_BINARY): Don't define here.
+ * jcf-path.c: Don't include "tm.h".
+ (jcf_path_init): Use getenv instead of GET_ENVIRONMENT.
+ * resource.c: Don't include "stdio.h".
+ (O_BINARY): Don't define here.
+ * verify-impl.c: Don't include <stdio.h>.
+
2010-11-17 Joseph Myers <joseph@codesourcery.com>
* jcf-parse.c (java_parse_file): Take no arguments.
diff --git a/gcc/java/boehm.c b/gcc/java/boehm.c
index 2a0690c..ce0ca2d7 100644
--- a/gcc/java/boehm.c
+++ b/gcc/java/boehm.c
@@ -1,5 +1,6 @@
/* Functions related to the Boehm garbage collector.
- Copyright (C) 2000, 2003, 2004, 2006, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2003, 2004, 2006, 2009, 2010
+ Free Software Foundation, Inc.
This file is part of GCC.
@@ -23,8 +24,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
/* Written by Tom Tromey <tromey@cygnus.com>. */
-#include <config.h>
-
+#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "double-int.h"
diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c
index fbaaf3e..2100f09 100644
--- a/gcc/java/builtins.c
+++ b/gcc/java/builtins.c
@@ -36,7 +36,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "flags.h"
#include "langhooks.h"
#include "java-tree.h"
-#include <stdarg.h>
/* FIXME: All these headers are necessary for sync_compare_and_swap.
Front ends should never have to look at that. */
diff --git a/gcc/java/class.c b/gcc/java/class.c
index a1dc9c0..92091f9 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -38,18 +38,12 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "parse.h"
#include "function.h"
#include "ggc.h"
-#include "stdio.h"
#include "cgraph.h"
#include "tree-iterator.h"
#include "vecprim.h"
#include "tm.h" /* FIXME: For gcc_obstack_init from defaults.h. */
#include "target.h"
-/* DOS brain-damage */
-#ifndef O_BINARY
-#define O_BINARY 0 /* MS-DOS brain-damage */
-#endif
-
static tree make_method_value (tree);
static tree build_java_method_type (tree, tree, int);
static int32 hashUtf8String (const char *, int);
diff --git a/gcc/java/jcf-depend.c b/gcc/java/jcf-depend.c
index c93c73b..cde2a8d 100644
--- a/gcc/java/jcf-depend.c
+++ b/gcc/java/jcf-depend.c
@@ -1,6 +1,6 @@
/* Functions for handling dependency tracking when reading .class files.
- Copyright (C) 1998, 1999, 2000, 2001, 2003, 2006, 2007
+ Copyright (C) 1998, 1999, 2000, 2001, 2003, 2006, 2007, 2010
Free Software Foundation, Inc.
This file is part of GCC.
@@ -30,8 +30,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "coretypes.h"
#include "mkdeps.h"
-#include <assert.h>
-
#include "jcf.h"
@@ -89,7 +87,7 @@ jcf_dependency_add_target (const char *name)
void
jcf_dependency_set_dep_file (const char *name)
{
- assert (dep_out != stdout);
+ gcc_assert (dep_out != stdout);
if (dep_out)
fclose (dep_out);
if (! strcmp (name, "-"))
@@ -117,7 +115,7 @@ jcf_dependency_add_file (const char *filename ATTRIBUTE_UNUSED, int system_p)
void
jcf_dependency_init (int system_p)
{
- assert (! dependencies);
+ gcc_assert (! dependencies);
system_files = system_p;
dependencies = deps_init ();
}
@@ -134,7 +132,7 @@ jcf_dependency_write (void)
if (! dep_out)
return;
- assert (dependencies);
+ gcc_assert (dependencies);
deps_write (dependencies, dep_out, 72);
if (print_dummies)
diff --git a/gcc/java/jcf-io.c b/gcc/java/jcf-io.c
index 1c455da..0dc7615 100644
--- a/gcc/java/jcf-io.c
+++ b/gcc/java/jcf-io.c
@@ -1,6 +1,6 @@
/* Utility routines for finding and reading Java(TM) .class files.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+ 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -36,11 +36,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "zlib.h"
-/* DOS brain-damage */
-#ifndef O_BINARY
-#define O_BINARY 0 /* MS-DOS brain-damage */
-#endif
-
int
jcf_unexpected_eof (JCF *jcf, int count ATTRIBUTE_UNUSED)
{
diff --git a/gcc/java/jcf-path.c b/gcc/java/jcf-path.c
index 04764c3..16ec655 100644
--- a/gcc/java/jcf-path.c
+++ b/gcc/java/jcf-path.c
@@ -1,6 +1,6 @@
/* Handle CLASSPATH, -classpath, and path searching.
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006,
- 2007, 2008 Free Software Foundation, Inc.
+ 2007, 2008, 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -27,7 +27,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include "tm.h" /* FIXME: For GET_ENVIRONMENT from defaults.h. */
#include <dirent.h>
@@ -224,7 +223,7 @@ jcf_path_init (void)
sep[0] = DIR_SEPARATOR;
sep[1] = '\0';
- GET_ENVIRONMENT (cp, "GCC_EXEC_PREFIX");
+ cp = getenv ("GCC_EXEC_PREFIX");
if (cp)
{
attempt = (char *) alloca (strlen (cp) + 50);
@@ -295,7 +294,7 @@ jcf_path_init (void)
jcf_path_extdirs_arg (extdirs);
}
- GET_ENVIRONMENT (cp, "CLASSPATH");
+ cp = getenv ("CLASSPATH");
add_path (&classpath_env, cp, 0);
}
diff --git a/gcc/java/resource.c b/gcc/java/resource.c
index f954024..25a9bdd 100644
--- a/gcc/java/resource.c
+++ b/gcc/java/resource.c
@@ -1,6 +1,6 @@
/* Functions related to building resource files.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2007, 2008 Free Software Foundation, Inc.
+ 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -34,15 +34,9 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "parse.h"
#include "function.h"
#include "ggc.h"
-#include "stdio.h"
#include "tree-iterator.h"
#include "cgraph.h"
-/* DOS brain-damage */
-#ifndef O_BINARY
-#define O_BINARY 0 /* MS-DOS brain-damage */
-#endif
-
/* A list of all the resources files. */
static GTY(()) VEC(tree,gc) *resources;
diff --git a/gcc/java/verify-impl.c b/gcc/java/verify-impl.c
index 1286121..1ca2d9f 100644
--- a/gcc/java/verify-impl.c
+++ b/gcc/java/verify-impl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009
+/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010
Free Software Foundation
This file is part of libgcj.
@@ -19,10 +19,6 @@ details. */
/* Hack to work around namespace pollution from java-tree.h. */
#undef current_class
-#ifdef VERIFY_DEBUG
-#include <stdio.h>
-#endif /* VERIFY_DEBUG */
-
/* This is used to mark states which are not scheduled for
verification. */
#define INVALID_STATE ((state *) -1)
diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c
index d0a80ad..143e3fd 100644
--- a/gcc/lto-wrapper.c
+++ b/gcc/lto-wrapper.c
@@ -40,19 +40,9 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include <errno.h>
-#include <signal.h>
-#if ! defined( SIGCHLD ) && defined( SIGCLD )
-# define SIGCHLD SIGCLD
-#endif
#include "intl.h"
-#include "libiberty.h"
#include "obstack.h"
-#ifndef HAVE_KILL
-#define kill(p,s) raise(s)
-#endif
-
int debug; /* true if -save-temps. */
int verbose; /* true if -v. */
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 7df4c50..5bc6468 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,11 @@
+2010-11-29 Joseph Myers <joseph@codesourcery.com>
+
+ * lto-endian.h: Delete.
+ * lto-object.c: Don't include "libiberty.h".
+ (O_BINARY): Don't define.
+ * lto.c: Don't include "libiberty.h" or <sys/mman.h>.
+ (O_BINARY): Don't define.
+
2010-11-23 Richard Guenther <rguenther@suse.de>
* lto.c (read_cgraph_and_symbols): Remove newline from diagnostic.
diff --git a/gcc/lto/lto-endian.h b/gcc/lto/lto-endian.h
deleted file mode 100644
index 1f51cee..0000000
--- a/gcc/lto/lto-endian.h
+++ /dev/null
@@ -1,205 +0,0 @@
-/* Very simple endian-ness layer for LTO object file handling
- Copyright 2010 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
-<http://www.gnu.org/licenses/>. */
-
-/* This header file provides a simple way to handle object files in
- another endian-ness than the host machine. This is necesarry to
- enable cross-compilation with LTO enabled. Targets that use the
- ELF binary object format do not need this (libelf already handles
- endian-ness) but for COFF and Mach-O the functions in this header
- are used in the minimal binary object reader/writer.
-
- For all functions in this header, the user is responsible for
- making sure that the memory accesses are valid. */
-
-#ifndef GCC_LTO_ENDIAN_H
-#define GCC_LTO_ENDIAN_H
-
-#include <stdint.h>
-#include <inttypes.h>
-
-static inline uint16_t
-get_uint16_le (const unsigned char *ptr)
-{
- return ptr[0] | (ptr[1] << 8);
-}
-
-static inline uint32_t
-get_uint32_le (const unsigned char *ptr)
-{
- return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) | (ptr[3] << 24);
-}
-
-static inline uint64_t
-get_uint64_le (const unsigned char *ptr_)
-{
-#define ptr (uint64_t) ptr_
- return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) | (ptr[3] << 24)
- | (ptr[4] << 32) | (ptr[5] << 40) | (ptr[6] << 48) | (ptr[7] << 56);
-#undef ptr
-}
-
-static inline uint16_t
-get_uint16_be (const unsigned char *ptr)
-{
- return ptr[1] | (ptr[2] << 8);
-}
-
-static inline uint32_t
-get_uint32_be (const unsigned char *ptr)
-{
- return ptr[3] | (ptr[2] << 8) | (ptr[1] << 16) | (ptr[0] << 24);
-}
-
-static inline uint64_t
-get_uint64_be (const unsigned char *ptr_)
-{
-#define ptr (uint64_t) ptr_
- return ptr[7] | (ptr[6] << 8) | (ptr[5] << 16) | (ptr[4] << 24)
- | (ptr[3] << 32) | (ptr[2] << 40) | (ptr[1] << 48) | (ptr[0] << 56);
-#undef ptr
-}
-
-static inline void
-put_uint16_le (unsigned char *ptr, uint16_t data)
-{
- ptr[0] = data & 0xff;
- ptr[1] = (data >> 8) & 0xff;
-}
-
-static inline void
-put_uint32_le (unsigned char *ptr, uint32_t data)
-{
- ptr[0] = data & 0xff;
- ptr[1] = (data >> 8) & 0xff;
- ptr[2] = (data >> 16) & 0xff;
- ptr[3] = (data >> 24) & 0xff;
-}
-
-static inline void
-put_uint64_le (unsigned char *ptr, uint64_t data)
-{
- ptr[0] = data & 0xff;
- ptr[1] = (data >> 8) & 0xff;
- ptr[2] = (data >> 16) & 0xff;
- ptr[3] = (data >> 24) & 0xff;
- ptr[4] = (data >> 32) & 0xff;
- ptr[5] = (data >> 40) & 0xff;
- ptr[6] = (data >> 48) & 0xff;
- ptr[7] = (data >> 56) & 0xff;
-}
-
-static inline void
-put_uint16_be (unsigned char *ptr, uint16_t data)
-{
- ptr[1] = data & 0xff;
- ptr[0] = (data >> 8) & 0xff;
-}
-
-static inline void
-put_uint32_be (unsigned char *ptr, uint32_t data)
-{
- ptr[3] = data & 0xff;
- ptr[2] = (data >> 8) & 0xff;
- ptr[1] = (data >> 16) & 0xff;
- ptr[0] = (data >> 24) & 0xff;
-}
-
-static inline void
-put_uint64_be (unsigned char *ptr, uint64_t data)
-{
- ptr[7] = data & 0xff;
- ptr[6] = (data >> 8) & 0xff;
- ptr[5] = (data >> 16) & 0xff;
- ptr[4] = (data >> 24) & 0xff;
- ptr[3] = (data >> 32) & 0xff;
- ptr[2] = (data >> 40) & 0xff;
- ptr[1] = (data >> 48) & 0xff;
- ptr[0] = (data >> 56) & 0xff;
-}
-
-static inline void
-get_string (unsigned char *ptr, char *dest, size_t len)
-{
- memcpy (dest, ptr, len);
-}
-
-static inline void
-put_string (unsigned char *ptr, char *src, size_t len)
-{
- memcpy (ptr, src, len);
-}
-
-/* Use the target macro BYTES_BIG_ENDIAN to choose. */
-
-static inline uint16_t
-get_uint16 (const unsigned char *ptr)
-{
- if (BYTES_BIG_ENDIAN)
- return get_uint16_be (ptr);
- else
- return get_uint16_le (ptr);
-}
-
-static inline uint32_t
-get_uint32 (const unsigned char *ptr)
-{
- if (BYTES_BIG_ENDIAN)
- return get_uint32_be (ptr);
- else
- return get_uint32_le (ptr);
-}
-
-static inline uint64_t
-get_uint64 (const unsigned char *ptr)
-{
- if (BYTES_BIG_ENDIAN)
- return get_uint64_be (ptr);
- else
- return get_uint64_le (ptr);
-}
-
-static inline void
-put_uint16 (unsigned char *ptr, uint16_t data)
-{
- if (BYTES_BIG_ENDIAN)
- put_uint16_be (ptr, data);
- else
- put_uint16_le (ptr, data);
-}
-
-static inline void
-put_uint32 (unsigned char *ptr, uint32_t data)
-{
- if (BYTES_BIG_ENDIAN)
- put_uint32_be (ptr, data);
- else
- put_uint32_le (ptr, data);
-}
-
-static inline void
-put_uint64 (unsigned char *ptr, uint64_t data)
-{
- if (BYTES_BIG_ENDIAN)
- put_uint64_be (ptr, data);
- else
- put_uint64_le (ptr, data);
-}
-
-#endif /* GCC_LTO_ENDIAN_H */
-
diff --git a/gcc/lto/lto-object.c b/gcc/lto/lto-object.c
index 4a67580..21da20b 100644
--- a/gcc/lto/lto-object.c
+++ b/gcc/lto/lto-object.c
@@ -26,15 +26,8 @@ along with GCC; see the file COPYING3. If not see
#include "lto.h"
#include "tm.h"
#include "lto-streamer.h"
-#include "libiberty.h"
#include "simple-object.h"
-/* Handle opening elf files on hosts, such as Windows, that may use
- text file handling that will break binary access. */
-#ifndef O_BINARY
-# define O_BINARY 0
-#endif
-
/* Segment name for LTO sections. This is only used for Mach-O.
FIXME: This needs to be kept in sync with darwin.c. */
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 3db5ac1..9cfb5e2 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -26,7 +26,6 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "diagnostic-core.h"
#include "tm.h"
-#include "libiberty.h"
#include "cgraph.h"
#include "ggc.h"
#include "tree-ssa-operands.h"
@@ -46,20 +45,6 @@ along with GCC; see the file COPYING3. If not see
#include "splay-tree.h"
#include "params.h"
-/* This needs to be included after config.h. Otherwise, _GNU_SOURCE will not
- be defined in time to set __USE_GNU in the system headers, and strsignal
- will not be declared. */
-#if HAVE_MMAP_FILE
-#include <sys/mman.h>
-#endif
-
-/* Handle opening elf files on hosts, such as Windows, that may use
- text file handling that will break binary access. */
-
-#ifndef O_BINARY
-# define O_BINARY 0
-#endif
-
static GTY(()) tree first_personality_decl;
/* Returns a hash code for P. */
diff --git a/gcc/mips-tfile.c b/gcc/mips-tfile.c
index 1475e95..3dfb8ae 100644
--- a/gcc/mips-tfile.c
+++ b/gcc/mips-tfile.c
@@ -665,8 +665,6 @@ main (void)
#undef index
-#include <signal.h>
-
#ifndef CROSS_DIRECTORY_STRUCTURE
#include <a.out.h>
#else
diff --git a/gcc/opts.c b/gcc/opts.c
index cd41c2a..8174d15 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -21,13 +21,6 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#include "system.h"
-
-#include <signal.h>
-
-#ifdef HAVE_SYS_RESOURCE_H
-# include <sys/resource.h>
-#endif
-
#include "intl.h"
#include "coretypes.h"
#include "tm.h" /* Needed by rtl.h and used for DWARF2_DEBUGGING_INFO
@@ -1128,7 +1121,7 @@ print_specific_help (unsigned int include_flags,
{
const char *p;
- GET_ENVIRONMENT (p, "COLUMNS");
+ p = getenv ("COLUMNS");
if (p != NULL)
{
int value = atoi (p);
diff --git a/gcc/passes.c b/gcc/passes.c
index 38cc570..4be61a9 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -28,16 +28,6 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
-#include <signal.h>
-
-#ifdef HAVE_SYS_RESOURCE_H
-# include <sys/resource.h>
-#endif
-
-#ifdef HAVE_SYS_TIMES_H
-# include <sys/times.h>
-#endif
-
#include "line-map.h"
#include "input.h"
#include "tree.h"
diff --git a/gcc/sparseset.h b/gcc/sparseset.h
index 3554ef6..c177d2d 100644
--- a/gcc/sparseset.h
+++ b/gcc/sparseset.h
@@ -1,5 +1,5 @@
/* SparseSet implementation.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2010 Free Software Foundation, Inc.
Contributed by Peter Bergner <bergner@vnet.ibm.com>
This file is part of GCC.
@@ -21,8 +21,6 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_SPARSESET_H
#define GCC_SPARSESET_H
-#include <assert.h>
-
#define SPARSESET_ELT_BITS ((unsigned) HOST_BITS_PER_WIDEST_FAST_INT)
#define SPARSESET_ELT_TYPE unsigned int
diff --git a/gcc/system.h b/gcc/system.h
index 41e8657..3dc3b4e 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -180,7 +180,7 @@ extern int fprintf_unlocked (FILE *, const char *, ...);
/* There are an extraordinary number of issues with <ctype.h>.
The last straw is that it varies with the locale. Use libiberty's
replacement instead. */
-#include <safe-ctype.h>
+#include "safe-ctype.h"
#include <sys/types.h>
@@ -314,6 +314,9 @@ extern int errno;
#ifndef O_WRONLY
# define O_WRONLY 1
#endif
+#ifndef O_BINARY
+# define O_BINARY 0
+#endif
/* Some systems define these in, e.g., param.h. We undefine these names
here to avoid the warnings. We prefer to use our definitions since we
@@ -353,6 +356,31 @@ extern int errno;
#define WCOREFLG 0200
#endif
+#include <signal.h>
+#if !defined (SIGCHLD) && defined (SIGCLD)
+# define SIGCHLD SIGCLD
+#endif
+
+#ifdef HAVE_SYS_MMAN_H
+# include <sys/mman.h>
+#endif
+
+#ifndef MAP_FAILED
+# define MAP_FAILED ((void *)-1)
+#endif
+
+#if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
+# define MAP_ANONYMOUS MAP_ANON
+#endif
+
+#ifdef HAVE_SYS_RESOURCE_H
+# include <sys/resource.h>
+#endif
+
+#ifdef HAVE_SYS_TIMES_H
+# include <sys/times.h>
+#endif
+
/* The HAVE_DECL_* macros are three-state, undefined, 0 or 1. If they
are defined to 0 then we must provide the relevant declaration
here. These checks will be in the undefined state while configure
@@ -526,6 +554,10 @@ extern int vsnprintf(char *, size_t, const char *, va_list);
# define mkdir(a,b) mkdir(a)
#endif
+#ifndef HAVE_KILL
+# define kill(p,s) raise(s)
+#endif
+
/* Provide a way to print an address via printf. */
#ifndef HOST_PTR_PRINTF
#define HOST_PTR_PRINTF "%p"
@@ -804,7 +836,7 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
LIBGCC2_FLOAT_WORDS_BIG_ENDIAN
/* Miscellaneous macros that are no longer used. */
- #pragma GCC poison USE_MAPPED_LOCATION
+ #pragma GCC poison USE_MAPPED_LOCATION GET_ENVIRONMENT
/* Libiberty macros that are no longer used in GCC. */
#undef ANSI_PROTOTYPES
diff --git a/gcc/timevar.c b/gcc/timevar.c
index df671e4..f1d20e8 100644
--- a/gcc/timevar.c
+++ b/gcc/timevar.c
@@ -1,5 +1,6 @@
/* Timing variables for measuring compiler performance.
- Copyright (C) 2000, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2003, 2004, 2005, 2007, 2010
+ Free Software Foundation, Inc.
Contributed by Alex Samuel <samuel@codesourcery.com>
This file is part of GCC.
@@ -20,12 +21,6 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#include "system.h"
-#ifdef HAVE_SYS_TIMES_H
-# include <sys/times.h>
-#endif
-#ifdef HAVE_SYS_RESOURCE_H
-#include <sys/resource.h>
-#endif
#include "timevar.h"
#ifndef HAVE_CLOCK_T
diff --git a/gcc/tlink.c b/gcc/tlink.c
index 7b58983..44618ed 100644
--- a/gcc/tlink.c
+++ b/gcc/tlink.c
@@ -1,8 +1,8 @@
/* Scan linker error messages for missing template instantiations and provide
them.
- Copyright (C) 1995, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2007, 2008
- Free Software Foundation, Inc.
+ Copyright (C) 1995, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2007, 2008,
+ 2009, 2010 Free Software Foundation, Inc.
Contributed by Jason Merrill (jason@cygnus.com).
This file is part of GCC.
@@ -30,7 +30,6 @@ along with GCC; see the file COPYING3. If not see
#include "hashtab.h"
#include "demangle.h"
#include "collect2.h"
-#include "libiberty.h"
/* TARGET_64BIT may be defined to use driver specific functionality. */
#undef TARGET_64BIT
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 1bfdbe2..37114ce 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -28,12 +28,6 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
-#include <signal.h>
-
-#ifdef HAVE_SYS_TIMES_H
-# include <sys/times.h>
-#endif
-
#include "line-map.h"
#include "input.h"
#include "tree.h"
diff --git a/gcc/tree-mudflap.c b/gcc/tree-mudflap.c
index f65d1da..a85733b 100644
--- a/gcc/tree-mudflap.c
+++ b/gcc/tree-mudflap.c
@@ -39,7 +39,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h"
#include "hashtab.h"
#include "diagnostic.h"
-#include <demangle.h>
+#include "demangle.h"
#include "langhooks.h"
#include "ggc.h"
#include "cgraph.h"
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index fc333f7..0f4b429 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -80,8 +80,6 @@ eight) times the number of the actual switch branches. */
#include "system.h"
#include "coretypes.h"
#include "tm.h"
-#include <signal.h>
-
#include "line-map.h"
#include "params.h"
#include "flags.h"
diff --git a/gcc/vmsdbgout.c b/gcc/vmsdbgout.c
index 45da441..2278d1a 100644
--- a/gcc/vmsdbgout.c
+++ b/gcc/vmsdbgout.c
@@ -1625,9 +1625,7 @@ vmsdbgout_finish (const char *main_input_filename ATTRIBUTE_UNUSED)
#include <vms/stsdef.h>
#include <vms/iodef.h>
#include <vms/fatdef.h>
-#include <errno.h>
#include <vms/descrip.h>
-#include <string.h>
#include <unixlib.h>
#define MAXPATH 256