diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config.gcc | 2 | ||||
-rw-r--r-- | gcc/config/i386/t-vxworks | 19 | ||||
-rw-r--r-- | gcc/config/i386/vxworks.h | 96 |
3 files changed, 80 insertions, 37 deletions
diff --git a/gcc/config.gcc b/gcc/config.gcc index d14a1a3..b169f2f 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -2050,7 +2050,7 @@ i[34567]86-*-solaris2* | x86_64-*-solaris2*) esac fi ;; -i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae|i[4567]86-wrs-vxworks7|x86_64-wrs-vxworks7) +i[4567]86-wrs-vxworks*|x86_64-wrs-vxworks7*) tm_file="${tm_file} i386/unix.h i386/att.h elfos.h" case ${target} in x86_64-*) diff --git a/gcc/config/i386/t-vxworks b/gcc/config/i386/t-vxworks index c440b1f..8f5e8c7 100644 --- a/gcc/config/i386/t-vxworks +++ b/gcc/config/i386/t-vxworks @@ -1,8 +1,19 @@ # Multilibs for VxWorks. -# Build multilibs for normal, -mrtp, and -mrtp -fPIC. -MULTILIB_OPTIONS = mrtp fPIC -MULTILIB_DIRNAMES = +# The common variant across the board is for -mrtp +MULTILIB_OPTIONS = mrtp +MULTILIB_DIRNAMES = mrtp + +# Then variants for the "large" code model on x86_64, or fPIC on x86, +# RTP only. -fPIC -mrtp -mcmodel=large is not functional yet. +ifneq (,$(findstring x86_64, $(target))) +MULTILIB_OPTIONS += mcmodel=large +MULTILIB_DIRNAMES += large +else +MULTILIB_OPTIONS += fPIC +MULTILIB_DIRNAMES += fPIC MULTILIB_MATCHES = fPIC=fpic -MULTILIB_EXCEPTIONS = fPIC +# -fPIC is only supported in combination with -mrtp +MULTILIB_EXCEPTIONS = fPIC +endif diff --git a/gcc/config/i386/vxworks.h b/gcc/config/i386/vxworks.h index ad9404b..891b4ff 100644 --- a/gcc/config/i386/vxworks.h +++ b/gcc/config/i386/vxworks.h @@ -18,12 +18,21 @@ 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/>. */ +/* VxWorks after 7 SR0600 use the ELF ABI and the system environment is llvm + based. Earlier versions have GNU based environment components and use the + same ABI as Solaris 2. */ + +#if TARGET_VXWORKS7 + +#undef VXWORKS_PERSONALITY +#define VXWORKS_PERSONALITY "llvm" + +#else + #undef ASM_OUTPUT_ALIGNED_BSS #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) @@ -41,43 +50,73 @@ along with GCC; see the file COPYING3. If not see #undef SIZE_TYPE #define SIZE_TYPE (TARGET_LP64 ? "long unsigned int" : "unsigned int") +/* We cannot use PC-relative accesses for VxWorks PIC because there is no + fixed gap between segments. */ +#undef ASM_PREFERRED_EH_DATA_FORMAT + #if TARGET_64BIT_DEFAULT #undef VXWORKS_SYSCALL_LIBS_RTP #define VXWORKS_SYSCALL_LIBS_RTP "-lsyscall" #endif +#endif + +/* CPU macro definitions, ordered to account for VxWorks 7 not + supporting CPUs older than PENTIUM4 since SR0650. */ + +#define VX_CPUDEF(CPU) builtin_define(VX_CPU_PREFIX "CPU=" #CPU) +#define VX_CPUVDEF(CPU) builtin_define(VX_CPU_PREFIX "CPU_VARIANT=" #CPU) + #define TARGET_OS_CPP_BUILTINS() \ do \ { \ VXWORKS_OS_CPP_BUILTINS (); \ - if (TARGET_386) \ - builtin_define ("CPU=I80386"); \ + if (TARGET_64BIT) \ + VX_CPUDEF (X86_64); \ + else if (TARGET_PENTIUM4) \ + { \ + VX_CPUDEF (PENTIUM4); \ + VX_CPUVDEF (PENTIUM4); \ + } \ + else if (TARGET_CORE2) \ + VX_CPUDEF (CORE2); \ + else if (TARGET_NEHALEM) \ + VX_CPUDEF (NEHALEM); \ + else if (TARGET_SANDYBRIDGE) \ + VX_CPUDEF (SANDYBRIDGE); \ + else if (TARGET_HASWELL) \ + VX_CPUDEF (HASWELL); \ + else if (TARGET_SILVERMONT) \ + VX_CPUDEF (SILVERMONT); \ + else if (TARGET_SKYLAKE || TARGET_SKYLAKE_AVX512) \ + VX_CPUDEF (SKYLAKE); \ + else if (TARGET_GOLDMONT) \ + VX_CPUDEF (GOLDMONT); \ + else if (TARGET_VXWORKS7) \ + VX_CPUDEF (PENTIUM4); \ + else if (TARGET_386) \ + VX_CPUDEF (I80386); \ else if (TARGET_486) \ - builtin_define ("CPU=I80486"); \ + VX_CPUDEF (I80486); \ else if (TARGET_PENTIUM) \ - { \ - builtin_define ("CPU=PENTIUM"); \ - builtin_define ("CPU_VARIANT=PENTIUM"); \ - } \ + { \ + VX_CPUDEF (PENTIUM); \ + VX_CPUVDEF (PENTIUM); \ + } \ else if (TARGET_PENTIUMPRO) \ - { \ - builtin_define ("CPU=PENTIUM2"); \ - builtin_define ("CPU_VARIANT=PENTIUMPRO"); \ - } \ - else if (TARGET_PENTIUM4) \ - { \ - builtin_define ("CPU=PENTIUM4"); \ - builtin_define ("CPU_VARIANT=PENTIUM4"); \ - } \ - else if (TARGET_64BIT) \ - builtin_define ("CPU=X86_64"); \ + { \ + VX_CPUDEF (PENTIUM2); \ + VX_CPUVDEF (PENTIUMPRO); \ + } \ else \ - builtin_define ("CPU=I80386"); \ - } \ + VX_CPUDEF (I80386); \ + } \ while (0) #undef CPP_SPEC #define CPP_SPEC VXWORKS_ADDITIONAL_CPP_SPEC +#undef CC1_SPEC +#define CC1_SPEC VXWORKS_CC1_SPEC #undef LIB_SPEC #define LIB_SPEC VXWORKS_LIB_SPEC #undef STARTFILE_SPEC @@ -97,18 +136,11 @@ along with GCC; see the file COPYING3. If not see #undef FUNCTION_PROFILER #define FUNCTION_PROFILER(FILE,LABELNO) VXWORKS_FUNCTION_PROFILER(FILE,LABELNO) -/* We cannot use PC-relative accesses for VxWorks PIC because there is no - fixed gap between segments. */ -#undef ASM_PREFERRED_EH_DATA_FORMAT - /* Define this to be nonzero if static stack checking is supported. */ #define STACK_CHECK_STATIC_BUILTIN 1 /* This platform supports the probing method of stack checking (RTP mode). - 8K is reserved in the stack to propagate exceptions in case of overflow. + 8K is reserved in the stack to propagate exceptions in case of overflow. On 64-bit targets, we double that size. */ -#if TARGET_64BIT_DEFAULT -#define STACK_CHECK_PROTECT 16384 -#else -#define STACK_CHECK_PROTECT 8192 -#endif + +#define STACK_CHECK_PROTECT (TARGET_64BIT_DEFAULT ? 16 * 1024 : 8 * 1024) |