aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
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/lto
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/lto')
-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
4 files changed, 8 insertions, 227 deletions
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. */