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

2012-04-13 Thread Uros Bizjak
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.enkov...@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.


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

2012-04-13 Thread Ilya Enkovich
 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.enkov...@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.

Hello,

Thanks for review! Here is a new version with all issues fixed.

Bootstrapped on linux-x86_64 and check is in progress. Will it be OK
for trunk and 4.7 after successfull check?

Thanks,
Ilya
---
2012-04-13  Enkovich Ilya  ilya.enkov...@intel.com

* 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.


mandroid.patch
Description: Binary data


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

2012-04-13 Thread Richard Guenther
On Fri, Apr 13, 2012 at 12:37 PM, Ilya Enkovich enkovich@gmail.com wrote:
 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.enkov...@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.

 Hello,

 Thanks for review! Here is a new version with all issues fixed.

 Bootstrapped on linux-x86_64 and check is in progress. Will it be OK
 for trunk and 4.7 after successfull check?

For sure such changes are not appropriate for a release branch.

Richard.

 Thanks,
 Ilya
 ---
 2012-04-13  Enkovich Ilya  ilya.enkov...@intel.com

        * 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.


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

2012-04-13 Thread Uros Bizjak
On Fri, Apr 13, 2012 at 12:37 PM, Ilya Enkovich enkovich@gmail.com wrote:

 2012-04-13  Enkovich Ilya  ilya.enkov...@intel.com

        * 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.

OK for mainline SVN, but as Richard said, this is not appropriate for
release branches.

Thanks,
Uros.


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

2012-04-13 Thread H.J. Lu
On Fri, Apr 13, 2012 at 7:02 AM, Uros Bizjak ubiz...@gmail.com wrote:
 On Fri, Apr 13, 2012 at 12:37 PM, Ilya Enkovich enkovich@gmail.com 
 wrote:

 2012-04-13  Enkovich Ilya  ilya.enkov...@intel.com

        * 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.

 OK for mainline SVN, but as Richard said, this is not appropriate for
 release branches.


Ilya, I will check it for you.  There is no need for release branches.

Thanks.


-- 
H.J.


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

2012-04-13 Thread H.J. Lu
On Fri, Apr 13, 2012 at 7:34 AM, H.J. Lu hjl.to...@gmail.com wrote:
 On Fri, Apr 13, 2012 at 7:02 AM, Uros Bizjak ubiz...@gmail.com wrote:
 On Fri, Apr 13, 2012 at 12:37 PM, Ilya Enkovich enkovich@gmail.com 
 wrote:

 2012-04-13  Enkovich Ilya  ilya.enkov...@intel.com

        * 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.

 OK for mainline SVN, but as Richard said, this is not appropriate for
 release branches.


 Ilya, I will check it for you.  There is no need for release branches.


ChangeLog for config.gcc is missing.


-- 
H.J.


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

2012-04-13 Thread Ilya Enkovich
 On Fri, Apr 13, 2012 at 7:34 AM, H.J. Lu hjl.to...@gmail.com wrote:
 On Fri, Apr 13, 2012 at 7:02 AM, Uros Bizjak ubiz...@gmail.com wrote:
 On Fri, Apr 13, 2012 at 12:37 PM, Ilya Enkovich enkovich@gmail.com 
 wrote:

 2012-04-13  Enkovich Ilya  ilya.enkov...@intel.com

        * 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.

 OK for mainline SVN, but as Richard said, this is not appropriate for
 release branches.


 Ilya, I will check it for you.  There is no need for release branches.


 ChangeLog for config.gcc is missing.


 --
 H.J.

Hi H.J.,

Here is fixed ChangeLog

Thanks,
Ilya
---
2012-04-13  Enkovich Ilya  ilya.enkov...@intel.com

* 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.

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