Commit 70a69509 by Enkovich Ilya Committed by H.J. Lu

Add and use config/i386/gnu-user-common.h

	* config.gcc: Add i386/gnu-user-common.h before all
	i386/gnu-user.h and i386/gnu-user64.h usages.

	* config/i386/gnu-user-common.h: New.

	* config/i386/gnu-user.h (CPP_SPEC): Moved to gnu-user-common.h.
	(CC1_SPEC): Likewise.
	(ENDFILE_SPEC): Likewise.
	(DEFAULT_PCC_STRUCT_RETURN): Likewise.
	(TARGET_TLS_DIRECT_SEG_REFS_DEFAULT): Likewise.
	(TARGET_OS_CPP_BUILTINS): Likewise.
	(LIBGCC2_HAS_TF_MODE): Likewise.
	(LIBGCC2_TF_CEXT): Likewise.
	(TF_SIZE): Likewise.
	(TARGET_ASM_FILE_END): Likewise.
	(STACK_CHECK_MOVING_SP): Likewise.
	(STACK_CHECK_STATIC_BUILTIN): Likewise.
	* config/i386/gnu-user64.h: Likewise.

From-SVN: r186427
parent 65dc645a
2012-04-13 Enkovich Ilya <ilya.enkovich@intel.com>
* config.gcc: Add i386/gnu-user-common.h before all
i386/gnu-user.h and i386/gnu-user64.h usages.
* config/i386/gnu-user-common.h: New.
* config/i386/gnu-user.h (CPP_SPEC): Moved to gnu-user-common.h.
(CC1_SPEC): Likewise.
(ENDFILE_SPEC): Likewise.
(DEFAULT_PCC_STRUCT_RETURN): Likewise.
(TARGET_TLS_DIRECT_SEG_REFS_DEFAULT): Likewise.
(TARGET_OS_CPP_BUILTINS): Likewise.
(LIBGCC2_HAS_TF_MODE): Likewise.
(LIBGCC2_TF_CEXT): Likewise.
(TF_SIZE): Likewise.
(TARGET_ASM_FILE_END): Likewise.
(STACK_CHECK_MOVING_SP): Likewise.
(STACK_CHECK_STATIC_BUILTIN): Likewise.
* config/i386/gnu-user64.h: Likewise.
2012-04-13 Martin Jambor <mjambor@suse.cz> 2012-04-13 Martin Jambor <mjambor@suse.cz>
* expr.c (expand_expr_real_1): Pass type, not the expression, to * expr.c (expand_expr_real_1): Pass type, not the expression, to
......
...@@ -1228,7 +1228,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i ...@@ -1228,7 +1228,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i
# Assume modern glibc # Assume modern glibc
default_gnu_indirect_function=yes default_gnu_indirect_function=yes
if test x$enable_targets = xall; then if test x$enable_targets = xall; then
tm_file="${tm_file} i386/x86-64.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/linux64.h"
tm_defines="${tm_defines} TARGET_BI_ARCH=1" tm_defines="${tm_defines} TARGET_BI_ARCH=1"
tmake_file="${tmake_file} i386/t-linux64" tmake_file="${tmake_file} i386/t-linux64"
x86_multilibs="${with_multilib_list}" x86_multilibs="${with_multilib_list}"
...@@ -1263,26 +1263,26 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i ...@@ -1263,26 +1263,26 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i
;; ;;
esac esac
else else
tm_file="${tm_file} i386/gnu-user.h i386/linux.h" tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h i386/linux.h"
fi fi
;; ;;
i[34567]86-*-knetbsd*-gnu) i[34567]86-*-knetbsd*-gnu)
tm_file="${tm_file} i386/gnu-user.h knetbsd-gnu.h i386/knetbsd-gnu.h" tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h knetbsd-gnu.h i386/knetbsd-gnu.h"
;; ;;
i[34567]86-*-kfreebsd*-gnu) i[34567]86-*-kfreebsd*-gnu)
tm_file="${tm_file} i386/gnu-user.h kfreebsd-gnu.h i386/kfreebsd-gnu.h" tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h kfreebsd-gnu.h i386/kfreebsd-gnu.h"
;; ;;
i[34567]86-*-kopensolaris*-gnu) i[34567]86-*-kopensolaris*-gnu)
tm_file="${tm_file} i386/gnu-user.h kopensolaris-gnu.h i386/kopensolaris-gnu.h" tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h kopensolaris-gnu.h i386/kopensolaris-gnu.h"
;; ;;
i[34567]86-*-gnu*) i[34567]86-*-gnu*)
tm_file="$tm_file i386/gnu-user.h gnu.h i386/gnu.h" tm_file="$tm_file i386/gnu-user-common.h i386/gnu-user.h gnu.h i386/gnu.h"
;; ;;
esac esac
;; ;;
x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu) x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h \ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h \
i386/x86-64.h i386/gnu-user64.h" i386/x86-64.h i386/gnu-user-common.h i386/gnu-user64.h"
case ${target} in case ${target} in
x86_64-*-linux*) x86_64-*-linux*)
tm_file="${tm_file} linux.h i386/linux64.h" tm_file="${tm_file} linux.h i386/linux64.h"
......
/* Common definitions for Intel 386 and AMD x86-64 systems using
GNU userspace. 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/>. */
/* The svr4 ABI for the i386 says that records and unions are returned
in memory. In the 64bit compilation we will turn this flag off in
ix86_option_override_internal, as we never do pcc_struct_return
scheme on this target. */
#undef DEFAULT_PCC_STRUCT_RETURN
#define DEFAULT_PCC_STRUCT_RETURN 1
/* We arrange for the whole %fs segment to map the tls area. */
#undef TARGET_TLS_DIRECT_SEG_REFS_DEFAULT
#define TARGET_TLS_DIRECT_SEG_REFS_DEFAULT MASK_TLS_DIRECT_SEG_REFS
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
GNU_USER_TARGET_OS_CPP_BUILTINS(); \
} \
while (0)
#undef CPP_SPEC
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
#undef CC1_SPEC
#define CC1_SPEC "%(cc1_cpu) %{profile:-p}"
/* Similar to standard GNU userspace, but adding -ffast-math support. */
#undef ENDFILE_SPEC
#define ENDFILE_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"
/* Put all *tf routines in libgcc. */
#undef LIBGCC2_HAS_TF_MODE
#define LIBGCC2_HAS_TF_MODE 1
#define LIBGCC2_TF_CEXT q
#define TF_SIZE 113
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
/* The stack pointer needs to be moved while checking the stack. */
#define STACK_CHECK_MOVING_SP 1
/* Static stack checking is supported by means of probes. */
#define STACK_CHECK_STATIC_BUILTIN 1
...@@ -24,15 +24,6 @@ along with GCC; see the file COPYING3. If not see ...@@ -24,15 +24,6 @@ along with GCC; see the file COPYING3. If not see
/* The .file command should always begin the output. */ /* The .file command should always begin the output. */
#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
/* The svr4 ABI for the i386 says that records and unions are returned
in memory. */
#undef DEFAULT_PCC_STRUCT_RETURN
#define DEFAULT_PCC_STRUCT_RETURN 1
/* We arrange for the whole %gs segment to map the tls area. */
#undef TARGET_TLS_DIRECT_SEG_REFS_DEFAULT
#define TARGET_TLS_DIRECT_SEG_REFS_DEFAULT MASK_TLS_DIRECT_SEG_REFS
#undef ASM_COMMENT_START #undef ASM_COMMENT_START
#define ASM_COMMENT_START "#" #define ASM_COMMENT_START "#"
...@@ -67,19 +58,6 @@ along with GCC; see the file COPYING3. If not see ...@@ -67,19 +58,6 @@ along with GCC; see the file COPYING3. If not see
#undef WCHAR_TYPE_SIZE #undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE BITS_PER_WORD #define WCHAR_TYPE_SIZE BITS_PER_WORD
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
GNU_USER_TARGET_OS_CPP_BUILTINS(); \
} \
while (0)
#undef CPP_SPEC
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
#undef CC1_SPEC
#define CC1_SPEC "%(cc1_cpu) %{profile:-p}"
/* Provide a LINK_SPEC appropriate for GNU userspace. Here we provide support /* Provide a LINK_SPEC appropriate for GNU userspace. Here we provide support
for the special GCC options -static and -shared, which allow us to for the special GCC options -static and -shared, which allow us to
link things in one of these three modes by applying the appropriate link things in one of these three modes by applying the appropriate
...@@ -105,15 +83,6 @@ along with GCC; see the file COPYING3. If not see ...@@ -105,15 +83,6 @@ along with GCC; see the file COPYING3. If not see
-dynamic-linker %(dynamic_linker)} \ -dynamic-linker %(dynamic_linker)} \
%{static:-static}}" %{static:-static}}"
/* Similar to standard GNU userspace, but adding -ffast-math support. */
#undef ENDFILE_SPEC
#define ENDFILE_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"
/* A C statement (sans semicolon) to output to the stdio stream /* A C statement (sans semicolon) to output to the stdio stream
FILE the assembler definition of uninitialized global DECL named FILE the assembler definition of uninitialized global DECL named
NAME whose size is SIZE bytes and alignment is ALIGN bytes. NAME whose size is SIZE bytes and alignment is ALIGN bytes.
...@@ -180,20 +149,6 @@ along with GCC; see the file COPYING3. If not see ...@@ -180,20 +149,6 @@ along with GCC; see the file COPYING3. If not see
: "=d"(BASE)) : "=d"(BASE))
#endif #endif
/* Put all *tf routines in libgcc. */
#undef LIBGCC2_HAS_TF_MODE
#define LIBGCC2_HAS_TF_MODE 1
#define LIBGCC2_TF_CEXT q
#define TF_SIZE 113
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
/* The stack pointer needs to be moved while checking the stack. */
#define STACK_CHECK_MOVING_SP 1
/* Static stack checking is supported by means of probes. */
#define STACK_CHECK_STATIC_BUILTIN 1
#ifdef TARGET_LIBC_PROVIDES_SSP #ifdef TARGET_LIBC_PROVIDES_SSP
/* i386 glibc provides __stack_chk_guard in %gs:0x14. */ /* i386 glibc provides __stack_chk_guard in %gs:0x14. */
#define TARGET_THREAD_SSP_OFFSET 0x14 #define TARGET_THREAD_SSP_OFFSET 0x14
......
...@@ -24,30 +24,6 @@ a copy of the GCC Runtime Library Exception along with this program; ...@@ -24,30 +24,6 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */ <http://www.gnu.org/licenses/>. */
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
GNU_USER_TARGET_OS_CPP_BUILTINS(); \
} \
while (0)
#undef CPP_SPEC
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
#undef CC1_SPEC
#define CC1_SPEC "%(cc1_cpu) %{profile:-p}"
/* The svr4 ABI for the i386 says that records and unions are returned
in memory. In the 64bit compilation we will turn this flag off in
ix86_option_override_internal, as we never do pcc_struct_return
scheme on this target. */
#undef DEFAULT_PCC_STRUCT_RETURN
#define DEFAULT_PCC_STRUCT_RETURN 1
/* We arrange for the whole %fs segment to map the tls area. */
#undef TARGET_TLS_DIRECT_SEG_REFS_DEFAULT
#define TARGET_TLS_DIRECT_SEG_REFS_DEFAULT MASK_TLS_DIRECT_SEG_REFS
/* Provide a LINK_SPEC. Here we provide support for the special GCC /* Provide a LINK_SPEC. Here we provide support for the special GCC
options -static and -shared, which allow us to link things in one options -static and -shared, which allow us to link things in one
of these three modes by applying the appropriate combinations of of these three modes by applying the appropriate combinations of
...@@ -90,15 +66,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ...@@ -90,15 +66,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
%{" SPEC_X32 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKERX32 "}} \ %{" SPEC_X32 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKERX32 "}} \
%{static:-static}}" %{static:-static}}"
/* Similar to standard GNU userspace, but adding -ffast-math support. */
#undef ENDFILE_SPEC
#define ENDFILE_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"
#if TARGET_64BIT_DEFAULT #if TARGET_64BIT_DEFAULT
#if TARGET_BI_ARCH == 2 #if TARGET_BI_ARCH == 2
#define MULTILIB_DEFAULTS { "mx32" } #define MULTILIB_DEFAULTS { "mx32" }
...@@ -109,23 +76,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ...@@ -109,23 +76,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define MULTILIB_DEFAULTS { "m32" } #define MULTILIB_DEFAULTS { "m32" }
#endif #endif
/* Put all *tf routines in libgcc. */
#undef LIBGCC2_HAS_TF_MODE
#define LIBGCC2_HAS_TF_MODE 1
#define LIBGCC2_TF_CEXT q
#define TF_SIZE 113
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
/* The stack pointer needs to be moved while checking the stack. */
#define STACK_CHECK_MOVING_SP 1
/* Static stack checking is supported by means of probes. */
#define STACK_CHECK_STATIC_BUILTIN 1
#ifdef TARGET_LIBC_PROVIDES_SSP #ifdef TARGET_LIBC_PROVIDES_SSP
/* i386 glibc provides __stack_chk_guard in %gs:0x14, /* i386 glibc provides __stack_chk_guard in %gs:0x14,
x32 glibc provides it in %fs:0x18. x32 glibc provides it in %fs:0x18.
x86_64 glibc provides it in %fs:0x28. */ x86_64 glibc provides it in %fs:0x28. */
#define TARGET_THREAD_SSP_OFFSET \ #define TARGET_THREAD_SSP_OFFSET \
(TARGET_64BIT ? (TARGET_X32 ? 0x18 : 0x28) : 0x14) (TARGET_64BIT ? (TARGET_X32 ? 0x18 : 0x28) : 0x14)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment