* [patch] normalize the x86-vxworks port organization
@ 2014-09-18 17:16 Olivier Hainque
2014-09-18 21:35 ` Jeff Law
0 siblings, 1 reply; 2+ messages in thread
From: Olivier Hainque @ 2014-09-18 17:16 UTC (permalink / raw)
To: GCC Patches; +Cc: Nathan Sidwell
[-- Attachment #1: Type: text/plain, Size: 1478 bytes --]
Hello,
VxWorks ports typically come in two flavors: regular VxWorks and VxWorksAE
(653). In most cases, <cpu>/vxworks.h is used as a common configuration file
for the two flavors and <cpu>/vxworksae.h overrides/adds on top of that.
There are also config/vx*.h shared by everybody.
The x86 port departs from this scheme, with a i386/vx-common.h file.
The attached patch is a proposal to bring the x86 port organization
in line with what is done for other CPUs. It essentially
- moves the contents of i386/vx-common.h within i386/vxworks.h,
- removes i386/vx-common.h
- adjusts config.gcc accordingly
The patch takes the opportunity to
- cleanup i386/vxworksae.h, removing redundant or obsolete
definitions and putting the one we use wrt stack-checking support
for this platform.
We (AdaCore) have been using this succesfully for a while on gcc-4.7
and recently on gcc-4.9, for both VxWorks6 and VxWorksAE targets.
The patch attached here applies on mainline and passes
make all-gcc for --target=i686-wrs-vxworksae --enable-languages=c
OK to commit ?
Thanks in advance for your feedback,
With Kind Regards,
Olivier
2014-09-18 Olivier Hainque <hainque@adacore.com>
* config/i386/vxworksae.h: Remove obsolete definitions.
(STACK_CHECK_PROTECT): Define.
* config/i386/vx-common.h: Remove. Merge contents within
config/i386/vxworks.h.
* config.gcc (i?86-vxworks*): Use i386/vxworks.h instead of
i386/vx-common.h.
[-- Attachment #2: cleanup-x86vx653.diff --]
[-- Type: application/octet-stream, Size: 4179 bytes --]
diff --git gcc/config.gcc gcc/config.gcc
index caafa7e..cc57c5b 100644
--- gcc/config.gcc
+++ gcc/config.gcc
@@ -1556,11 +1556,11 @@ i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae)
tm_file="${tm_file} i386/unix.h i386/att.h elfos.h vx-common.h"
case ${target} in
*-vxworksae*)
- tm_file="${tm_file} vxworksae.h i386/vx-common.h i386/vxworksae.h"
+ tm_file="${tm_file} vxworksae.h i386/vxworks.h i386/vxworksae.h"
tmake_file="${tmake_file} i386/t-vxworks i386/t-vxworksae"
;;
*)
- tm_file="${tm_file} vxworks.h i386/vx-common.h i386/vxworks.h"
+ tm_file="${tm_file} vxworks.h i386/vxworks.h"
tmake_file="${tmake_file} i386/t-vxworks"
;;
esac
diff --git gcc/config/i386/vx-common.h gcc/config/i386/vx-common.h
deleted file mode 100644
index dd096f1..0000000
--- gcc/config/i386/vx-common.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* IA32 VxWorks and VxWorks AE target definitions.
- Copyright (C) 2007-2014 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/>. */
-
-#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
- asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
-
-/* VxWorks uses the same ABI as Solaris 2, so use i386/sol2.h version. */
-
-#undef TARGET_SUBTARGET_DEFAULT
-#define TARGET_SUBTARGET_DEFAULT \
- (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_VECT8_RETURNS)
-
-/* Provide our target specific DBX_REGISTER_NUMBER. VxWorks relies on
- the SVR4 numbering. */
-
-#undef DBX_REGISTER_NUMBER
-#define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
-
-#define IX86_MAYBE_NO_LIBGCC_TFMODE
diff --git gcc/config/i386/vxworks.h gcc/config/i386/vxworks.h
index 49206e0..9b29306 100644
--- gcc/config/i386/vxworks.h
+++ gcc/config/i386/vxworks.h
@@ -21,6 +21,21 @@ along with GCC; see the file COPYING3. If not see
#undef ASM_SPEC
#define ASM_SPEC ""
+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
+ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
+
+/* VxWorks uses the same ABI as Solaris 2, so use i386/sol2.h version. */
+
+#undef TARGET_SUBTARGET_DEFAULT
+#define TARGET_SUBTARGET_DEFAULT \
+ (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_VECT8_RETURNS)
+
+/* Provide our target specific DBX_REGISTER_NUMBER. VxWorks relies on
+ the SVR4 numbering. */
+
+#undef DBX_REGISTER_NUMBER
+#define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
+
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
@@ -71,3 +86,5 @@ along with GCC; see the file COPYING3. If not see
/* We cannot use PC-relative accesses for VxWorks PIC because there is no
fixed gap between segments. */
#undef ASM_PREFERRED_EH_DATA_FORMAT
+
+#define IX86_MAYBE_NO_LIBGCC_TFMODE
diff --git gcc/config/i386/vxworksae.h gcc/config/i386/vxworksae.h
index bb63c07..7b0e42e 100644
--- gcc/config/i386/vxworksae.h
+++ gcc/config/i386/vxworksae.h
@@ -18,18 +18,7 @@ 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/>. */
-/* On VxWorks AE, we only want SIMNT. */
-#undef VXWORKS_CPU_DEFINE
-#define VXWORKS_CPU_DEFINE() \
- do \
- builtin_define ("CPU=SIMNT"); \
- while (0)
-
-#undef ASM_SPEC
-#define ASM_SPEC ""
-
-#undef SIZE_TYPE
-#define SIZE_TYPE "unsigned int"
-
-#undef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "int"
+/* This platform supports the probing method of stack checking and
+ requires 4K of space for executing a possible last chance handler. */
+#undef STACK_CHECK_PROTECT
+#define STACK_CHECK_PROTECT 4096
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch] normalize the x86-vxworks port organization
2014-09-18 17:16 [patch] normalize the x86-vxworks port organization Olivier Hainque
@ 2014-09-18 21:35 ` Jeff Law
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2014-09-18 21:35 UTC (permalink / raw)
To: Olivier Hainque, GCC Patches; +Cc: Nathan Sidwell
On 09/18/14 11:16, Olivier Hainque wrote:
> Hello,
>
> VxWorks ports typically come in two flavors: regular VxWorks and VxWorksAE
> (653). In most cases, <cpu>/vxworks.h is used as a common configuration file
> for the two flavors and <cpu>/vxworksae.h overrides/adds on top of that.
> There are also config/vx*.h shared by everybody.
>
> The x86 port departs from this scheme, with a i386/vx-common.h file.
>
> The attached patch is a proposal to bring the x86 port organization
> in line with what is done for other CPUs. It essentially
>
> - moves the contents of i386/vx-common.h within i386/vxworks.h,
> - removes i386/vx-common.h
> - adjusts config.gcc accordingly
>
> The patch takes the opportunity to
>
> - cleanup i386/vxworksae.h, removing redundant or obsolete
> definitions and putting the one we use wrt stack-checking support
> for this platform.
>
> We (AdaCore) have been using this succesfully for a while on gcc-4.7
> and recently on gcc-4.9, for both VxWorks6 and VxWorksAE targets.
>
> The patch attached here applies on mainline and passes
> make all-gcc for --target=i686-wrs-vxworksae --enable-languages=c
>
> OK to commit ?
>
> Thanks in advance for your feedback,
>
> With Kind Regards,
>
> Olivier
>
> 2014-09-18 Olivier Hainque <hainque@adacore.com>
>
> * config/i386/vxworksae.h: Remove obsolete definitions.
> (STACK_CHECK_PROTECT): Define.
> * config/i386/vx-common.h: Remove. Merge contents within
> config/i386/vxworks.h.
> * config.gcc (i?86-vxworks*): Use i386/vxworks.h instead of
> i386/vx-common.h.
Ok.
jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-18 21:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-18 17:16 [patch] normalize the x86-vxworks port organization Olivier Hainque
2014-09-18 21:35 ` Jeff Law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).