This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, i386] Move common definitions of gnu-user.h and gnu-user64.h to separate file


Hello!

> Here is a patch which creates new gnu-user-common.h file and moves all
> common gnu-user.h and gnu-user64.h definitions to this new file. New
> file is required to avoid duplication of Android specific changes in
> gnu-user.h and gnu-user64.h. This patch is actually a non Android
> specific part of previously submitted patch to support Android in x86
> target (http://gcc.gnu.org/ml/gcc-patches/2012-04/msg00127.html).
> Bootstrapped and tested on linux-x86_64. Is it OK for mainline and
> 4.7?

> 2012-04-13  Enkovich Ilya  <ilya.enkovich@intel.com>
>
> 	* config/i386/gnu-user.h: Include gnu-user-common.h.
> 	(CPP_SPEC): Removed.
> 	(CC1_SPEC): Removed.
> 	(ENDFILE_SPEC): Removed.
> 	(DEFAULT_PCC_STRUCT_RETURN): Removed.
> 	(TARGET_TLS_DIRECT_SEG_REFS_DEFAULT): Removed.
> 	(TARGET_OS_CPP_BUILTINS): Removed.
> 	(LIBGCC2_HAS_TF_MODE): Removed.
> 	(LIBGCC2_TF_CEXT): Removed.
> 	(TF_SIZE): Removed.
> 	(TARGET_ASM_FILE_END): Removed.
> 	(STACK_CHECK_MOVING_SP): Removed.
> 	(STACK_CHECK_STATIC_BUILTIN): Removed.
> 	(TARGET_THREAD_SSP_OFFSET): Removed.
> 	(TARGET_CAN_SPLIT_STACK): Removed.
> 	(TARGET_THREAD_SPLIT_STACK_OFFSET): Removed.
>
> 	* config/i386/gnu-user64.h: Likewise.
>
> 	* config/i386/gnu-user-common.h: New.

This ChangeLog is wrong, you didn't remove these files but move them
to new file.

+#ifdef TARGET_LIBC_PROVIDES_SSP
+/* i386 glibc provides __stack_chk_guard in %gs:0x14,
+   x32 glibc provides it in %fs:0x18.
+   x86_64 glibc provides it in %fs:0x28.  */
+#define TARGET_THREAD_SSP_OFFSET \
+  (TARGET_64BIT ? (TARGET_X32 ? 0x18 : 0x28) : 0x14)
+
+/* We steal the last transactional memory word.  */
+#define TARGET_CAN_SPLIT_STACK
+#define TARGET_THREAD_SPLIT_STACK_OFFSET \
+  (TARGET_64BIT ? (TARGET_X32 ? 0x40 : 0x70) : 0x30)
+#endif

Shouldn't TARGET_64BIT part remain in gnu_user64.h and !TARGET_64BIT
in gnu-user.h? I don't see the reason to put these conditinal defines
in shared file. However, this may be due to biarch handling that I'm
not familiar with in all details.

+#include "config/i386/gnu-user-common.h"

You shouldn't include new file here, list it in config.gcc before
i386/gnu-user.h or i386/gnu-user64.c

Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]