From db2fd1989feff759014e24d9efc59e8af104f4eb Mon Sep 17 00:00:00 2001 From: PulkoMandy Date: Fri, 22 Feb 2019 21:31:07 +0100 Subject: [PATCH] Fix gcc config for Haiku on sparc - Remove accidentally copied NetBSD stuff, so we actually use our linkspec - Put the files in the correct order in config.gcc This gets us past stage0 bootstrapping (building gcc_bootstrap package). Change-Id: I245a5ae111a6ca5e02b55e7a49e47cadcbc21731 Reviewed-on: https://review.haiku-os.org/c/1081 Reviewed-by: waddlesplash --- gcc/gcc/config.gcc | 2 +- gcc/gcc/config/sparc/haiku.h | 133 +++----------------------------------------------------------------------------- 2 files changed, 3 insertions(+), 132 deletions(-) diff --git a/gcc/gcc/config.gcc b/gcc/gcc/config.gcc index 24df8ee..6397cf4 100644 --- a/gcc/gcc/config.gcc +++ a/gcc/gcc/config.gcc @@ -2944,7 +2944,7 @@ tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems-64" ;; sparc64-*-haiku*) - tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp64-elf.h sparc/haiku.h haiku.h" + tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp64-elf.h haiku.h sparc/haiku.h" extra_options="${extra_options}" tmake_file="${tmake_file} t-haiku sparc/t-sparc sparc/t-haiku" ;; diff --git a/gcc/gcc/config/sparc/haiku.h b/gcc/gcc/config/sparc/haiku.h index 2bd3e47..8c81d7e 100644 --- a/gcc/gcc/config/sparc/haiku.h +++ a/gcc/gcc/config/sparc/haiku.h @@ -39,17 +39,9 @@ link things in one of these three modes by applying the appropriate combinations of options at link-time. */ -#if TARGET_64BIT_DEFAULT -#define SPEC_32 "m32" -#define SPEC_64 "!m32" -#else -#define SPEC_32 "!m64" -#define SPEC_64 "m64" -#endif - #undef LINK_SPEC -#define LINK_SPEC "%{" SPEC_64 ":-m elf_sparc64_haiku} %{" SPEC_32 ":-m elf_sparc_haiku} \ - %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" +#define LINK_SPEC "-m elf64_sparc %{!r:-shared} %{nostart:-e 0} \ + %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" /* SIZE_TYPE and PTRDIFF_TYPE are wrong from sparc/sparc.h. */ #undef SIZE_TYPE #define SIZE_TYPE "long unsigned int" @@ -80,30 +72,9 @@ #undef ASM_SPEC #define ASM_SPEC "%{" FPIE_OR_FPIC_SPEC ":-K PIC} \ %(asm_cpu) %(asm_arch) %(asm_relax)" - -#undef STDC_0_IN_SYSTEM_HEADERS #define HAVE_ENABLE_EXECUTE_STACK - -/* Below here exists the merged NetBSD/sparc & NetBSD/sparc64 compiler - description, allowing one to build 32-bit or 64-bit applications - on either. We define the sparc & sparc64 versions of things, - occasionally a neutral version (should be the same as "netbsd-elf.h") - and then based on SPARC_BI_ARCH, DEFAULT_ARCH32_P, and TARGET_CPU_DEFAULT, - we choose the correct version. */ - -/* We use the default NetBSD ELF STARTFILE_SPEC and ENDFILE_SPEC - definitions, even for the SPARC_BI_ARCH compiler, because NetBSD does - not have a default place to find these libraries.. */ -/* TARGET_CPU_DEFAULT is set in Makefile.in. We test for 64-bit default - platform here. */ - -#if TARGET_CPU_DEFAULT == TARGET_CPU_v9 \ - || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc -/* A 64 bit v9 compiler with stack-bias, - in a Medium/Low code model environment. */ - #undef TARGET_DEFAULT #define TARGET_DEFAULT \ (MASK_V9 + MASK_PTR64 + MASK_64BIT /* + MASK_HARD_QUAD */ \ @@ -111,111 +82,11 @@ #undef SPARC_DEFAULT_CMODEL #define SPARC_DEFAULT_CMODEL CM_MEDANY - -#endif - -/* CC1_SPEC for NetBSD/sparc. */ -#define CC1_SPEC32 \ - "%{m32:%{m64:%emay not use both -m32 and -m64}} \ - %{m64: \ - -mptr64 -mstack-bias -mno-v8plus -mlong-double-128 \ - %{!mcpu*:%{!mv8plus:-mcpu=ultrasparc}} \ - %{!mno-vis:%{!mcpu=v9:-mvis}} \ - %{p:-mcmodel=medlow} \ - %{pg:-mcmodel=medlow}}" - -#define CC1_SPEC64 \ - "%{m32:%{m64:%emay not use both -m32 and -m64}} \ - %{m32: \ - -mptr32 -mno-stack-bias \ - %{!mlong-double-128:-mlong-double-64} \ - %{!mcpu*:%{!mv8plus:-mcpu=cypress}}} \ - %{!m32: \ - %{p:-mcmodel=medlow} \ - %{pg:-mcmodel=medlow}}" - -/* Make sure we use the right output format. Pick a default and then - make sure -m32/-m64 switch to the right one. */ - -#define LINK_ARCH32_SPEC "-m elf32_sparc" - -#define LINK_ARCH64_SPEC "-m elf64_sparc" - -#define LINK_ARCH_SPEC \ - "%{m32:%(link_arch32)} \ - %{m64:%(link_arch64)} \ - %{!m32:%{!m64:%(link_arch_default)}}" - -#undef LINK_SPEC -#define LINK_SPEC \ - "%(link_arch) \ - %{!mno-relax:%{!r:-relax}} \ - %(netbsd_link_spec)" - -#define NETBSD_ENTRY_POINT "__start" - -#if DEFAULT_ARCH32_P -#define LINK_ARCH_DEFAULT_SPEC LINK_ARCH32_SPEC -#else -#define LINK_ARCH_DEFAULT_SPEC LINK_ARCH64_SPEC -#endif -/* What extra spec entries do we need? */ -#undef SUBTARGET_EXTRA_SPECS -#define SUBTARGET_EXTRA_SPECS \ - { "link_arch32", LINK_ARCH32_SPEC }, \ - { "link_arch64", LINK_ARCH64_SPEC }, \ - { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \ - { "link_arch", LINK_ARCH_SPEC }, - - /* Build a compiler that supports -m32 and -m64? */ - -#ifdef SPARC_BI_ARCH - -#undef LONG_DOUBLE_TYPE_SIZE -#define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64) - -#undef CC1_SPEC -#if DEFAULT_ARCH32_P -#define CC1_SPEC CC1_SPEC32 -#else -#define CC1_SPEC CC1_SPEC64 -#endif - -#if DEFAULT_ARCH32_P -#define MULTILIB_DEFAULTS { "m32" } -#else -#define MULTILIB_DEFAULTS { "m64" } -#endif - -#else /* SPARC_BI_ARCH */ -#if TARGET_CPU_DEFAULT == TARGET_CPU_v9 \ - || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc - #undef LONG_DOUBLE_TYPE_SIZE #define LONG_DOUBLE_TYPE_SIZE 128 - -#undef CC1_SPEC -#define CC1_SPEC CC1_SPEC64 - -#else /* TARGET_CPU_DEFAULT == TARGET_CPU_v9 \ - || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc */ - -/* A 32-bit only compiler. NetBSD don't support 128 bit `long double' - for 32-bit code, unlike Solaris. */ - -#undef LONG_DOUBLE_TYPE_SIZE -#define LONG_DOUBLE_TYPE_SIZE 64 - -#undef CC1_SPEC -#define CC1_SPEC CC1_SPEC32 - -#endif /* TARGET_CPU_DEFAULT == TARGET_CPU_v9 \ - || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc */ - -#endif /* SPARC_BI_ARCH */ /* We use GNU ld so undefine this so that attribute((init_priority)) works. */ #undef CTORS_SECTION_ASM_OP -- gitore 0.2.1