linux-common.h: New.
authorEnkovich Ilya <ilya.enkovich@intel.com>
Wed, 18 Apr 2012 08:29:55 +0000 (08:29 +0000)
committerKirill Yukhin <kyukhin@gcc.gnu.org>
Wed, 18 Apr 2012 08:29:55 +0000 (08:29 +0000)
2012-04-18  Enkovich Ilya  <ilya.enkovich@intel.com>

       * config/i386/linux-common.h: New.

       * config.gcc: Add i386/linux-common.h before
       all i386/linux.h and i386/linux64.h usages.

       * config/i386/gnu-user.h (GNU_USER_TARGET_LINK_SPEC): New.
       (LINK_SPEC): Use GNU_USER_TARGET_LINK_SPEC.
       * config/i386/gnu-user64.h: Likewise.

       * config/i386/gnu-user.common.h (GNU_USER_TARGET_CC1_SPEC): New.
       (CC1_SPEC): Use GNU_USER_TARGET_CC1_SPEC.
       (GNU_USER_TARGET_MATHFILE_SPEC): New.
       (ENDFILE_SPEC): Use GNU_USER_TARGET_MATHFILE_SPEC.

From-SVN: r186560

gcc/ChangeLog
gcc/config.gcc
gcc/config/i386/gnu-user-common.h
gcc/config/i386/gnu-user.h
gcc/config/i386/gnu-user64.h
gcc/config/i386/linux-common.h [new file with mode: 0644]

index 11bb11cdfabe59e96f679425070c6e1a058fdc26..bb0e5e2793cbbd3d33bc3212a89015d5ffada918 100644 (file)
@@ -1,3 +1,19 @@
+2012-04-18  Enkovich Ilya  <ilya.enkovich@intel.com>
+
+       * config/i386/linux-common.h: New.
+
+       * config.gcc: Add i386/linux-common.h before
+       all i386/linux.h and i386/linux64.h usages.
+
+       * config/i386/gnu-user.h (GNU_USER_TARGET_LINK_SPEC): New.
+       (LINK_SPEC): Use GNU_USER_TARGET_LINK_SPEC.
+       * config/i386/gnu-user64.h: Likewise.
+
+       * config/i386/gnu-user.common.h (GNU_USER_TARGET_CC1_SPEC): New.
+       (CC1_SPEC): Use GNU_USER_TARGET_CC1_SPEC.
+       (GNU_USER_TARGET_MATHFILE_SPEC): New.
+       (ENDFILE_SPEC): Use GNU_USER_TARGET_MATHFILE_SPEC.
+
 2012-04-18  Jan Hubicka  <jh@suse.cz>
 
        * cgraph.c (cgraph_node_name): Remove.
index bf3b2c3c0e363241e760778c05f239dadcd10bc2..63d661285b2083ff7a58f2c959bdc5569b9f895a 100644 (file)
@@ -1228,7 +1228,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i
                # Assume modern glibc
                default_gnu_indirect_function=yes
                if test x$enable_targets = xall; then
-                       tm_file="${tm_file} i386/x86-64.h i386/gnu-user-common.h i386/gnu-user64.h i386/linux64.h"
+                       tm_file="${tm_file} i386/x86-64.h i386/gnu-user-common.h i386/gnu-user64.h i386/linux-common.h i386/linux64.h"
                        tm_defines="${tm_defines} TARGET_BI_ARCH=1"
                        tmake_file="${tmake_file} i386/t-linux64"
                        x86_multilibs="${with_multilib_list}"
@@ -1263,7 +1263,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i
                                ;;
                        esac
                else
-                       tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h i386/linux.h"
+                       tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h i386/linux-common.h i386/linux.h"
                fi
                ;;
        i[34567]86-*-knetbsd*-gnu)
@@ -1285,7 +1285,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
                 i386/x86-64.h i386/gnu-user-common.h i386/gnu-user64.h"
        case ${target} in
        x86_64-*-linux*)
-               tm_file="${tm_file} linux.h i386/linux64.h"
+               tm_file="${tm_file} linux.h i386/linux-common.h i386/linux64.h"
                # Assume modern glibc
                default_gnu_indirect_function=yes
                ;;
index 6ca954d55cc4d257a94bd2e0b9a147e7b2a5fbb3..555493685638eab264887a251e7ebcff313afff0 100644 (file)
@@ -39,17 +39,23 @@ along with GCC; see the file COPYING3.  If not see
 #undef CPP_SPEC
 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
 
+#undef GNU_USER_TARGET_CC1_SPEC
+#define GNU_USER_TARGET_CC1_SPEC "%(cc1_cpu) %{profile:-p}"
+
 #undef CC1_SPEC
-#define CC1_SPEC "%(cc1_cpu) %{profile:-p}"
+#define CC1_SPEC GNU_USER_TARGET_CC1_SPEC
 
 /* Similar to standard GNU userspace, but adding -ffast-math support.  */
-#undef  ENDFILE_SPEC
-#define ENDFILE_SPEC \
+#define GNU_USER_TARGET_MATHFILE_SPEC \
   "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
    %{mpc32:crtprec32.o%s} \
    %{mpc64:crtprec64.o%s} \
-   %{mpc80:crtprec80.o%s} \
-   %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+   %{mpc80:crtprec80.o%s}"
+
+#undef  ENDFILE_SPEC
+#define ENDFILE_SPEC \
+  GNU_USER_TARGET_MATHFILE_SPEC " " \
+  GNU_USER_TARGET_ENDFILE_SPEC
 
 /* Put all *tf routines in libgcc.  */
 #undef LIBGCC2_HAS_TF_MODE
index 3b48b0002cab4ac784918204fbb5074599b67cce..9020be9a3a926df9ad2cdeca95f7bd38bad92c9a 100644 (file)
@@ -75,14 +75,16 @@ along with GCC; see the file COPYING3.  If not see
   { "link_emulation", GNU_USER_LINK_EMULATION },\
   { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
 
-#undef LINK_SPEC
-#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
+#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
   %{!shared: \
     %{!static: \
       %{rdynamic:-export-dynamic} \
       -dynamic-linker %(dynamic_linker)} \
       %{static:-static}}"
 
+#undef LINK_SPEC
+#define LINK_SPEC GNU_USER_TARGET_LINK_SPEC
+
 /* A C statement (sans semicolon) to output to the stdio stream
    FILE the assembler definition of uninitialized global DECL named
    NAME whose size is SIZE bytes and alignment is ALIGN bytes.
index 1ec5e20c4a58e766bdea5f9d614af77208783ae0..0e66d26169b16357a8896bf4ff9b25e6bf4bb774 100644 (file)
@@ -53,8 +53,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
  %{" SPEC_X32 ":--x32} \
  %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}"
 
-#undef LINK_SPEC
-#define LINK_SPEC "%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \
+#define GNU_USER_TARGET_LINK_SPEC                                 \
+                  "%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \
                    %{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \
                    %{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \
   %{shared:-shared} \
@@ -66,6 +66,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
       %{" SPEC_X32 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKERX32 "}} \
     %{static:-static}}"
 
+#undef LINK_SPEC
+#define LINK_SPEC GNU_USER_TARGET_LINK_SPEC
+
 #if TARGET_64BIT_DEFAULT
 #if TARGET_BI_ARCH == 2
 #define MULTILIB_DEFAULTS { "mx32" }
diff --git a/gcc/config/i386/linux-common.h b/gcc/config/i386/linux-common.h
new file mode 100644 (file)
index 0000000..fd53b32
--- /dev/null
@@ -0,0 +1,55 @@
+/* Definitions for Intel 386 running Linux-based GNU systems with ELF format.
+   Copyright (C) 2012 Free Software Foundation, Inc.
+   Contributed by Ilya Enkovich.
+
+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/>.  */
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()               \
+  do                                           \
+    {                                          \
+      GNU_USER_TARGET_OS_CPP_BUILTINS();       \
+      ANDROID_TARGET_OS_CPP_BUILTINS();               \
+    }                                          \
+  while (0)
+
+#undef CC1_SPEC
+#define CC1_SPEC \
+  LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC, \
+                      GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC)
+
+#undef LINK_SPEC
+#define LINK_SPEC \
+  LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LINK_SPEC, \
+                      GNU_USER_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
+
+#undef  LIB_SPEC
+#define LIB_SPEC \
+  LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LIB_SPEC, \
+                      GNU_USER_TARGET_LIB_SPEC " " ANDROID_LIB_SPEC)
+
+#undef  STARTFILE_SPEC
+#define STARTFILE_SPEC \
+  LINUX_OR_ANDROID_LD (GNU_USER_TARGET_STARTFILE_SPEC, \
+                      ANDROID_STARTFILE_SPEC)
+
+#undef  ENDFILE_SPEC
+#define ENDFILE_SPEC \
+  LINUX_OR_ANDROID_LD (GNU_USER_TARGET_MATHFILE_SPEC " " \
+                      GNU_USER_TARGET_ENDFILE_SPEC,     \
+                      GNU_USER_TARGET_MATHFILE_SPEC " " \
+                      ANDROID_ENDFILE_SPEC)