Compare commits

...

6 Commits

Author SHA1 Message Date
Alexander von Gluck IV
c162732461 riscv64: Disable MULTILIB for now to keep things simple
Change-Id: I569d0ba9512d635dfe03fbc9fcd95289d9c44098
Reviewed-on: https://review.haiku-os.org/c/1348
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-02 20:06:27 +00:00
Alexander von Gluck IV
fb78ddf2aa riscv64: Fix potentially missing ld/gas
Change-Id: I832bb2f4c2872c1c80cd9cd11e32387f9a48a3df
Reviewed-on: https://review.haiku-os.org/c/1347
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-02 20:06:27 +00:00
PulkoMandy
db2fd1989f 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 <waddlesplash@gmail.com>
2019-02-23 16:37:14 +00:00
Augustin Cavalier
fd2fd983c5 gcc/mpfr: Disable LTO unconditionally.
This is kind of a hack, but really it's the configure script that
is broken, as it hard-checks for "gcc-ar" which of course does not
work with Clang builds. We want LTO to be enabled in GCC, and
GCC unconditionally passes all arguments it gets to sub-configures,
so all we can do is stop the flag from having any effect.

Fixes #14733.
2019-02-20 22:49:25 -05:00
Alexander von Gluck IV
abcbee7bba haiku: Add riscv arch support
Change-Id: Ifa5b93cb959798d74ed045f53f5050651f409314
Reviewed-on: https://review.haiku-os.org/c/1062
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-02-21 01:32:48 +00:00
Adrien Destugues
198e0fde5e haiku: Get sparc buildtools going
- If kallisti5 is having fun with RISC-V, why can't I too?
- Gets as far as complaining we don't have a libsolv package in
  non-bootstrap builds

Change-Id: I0bb2b632d8f9007d5ad130f8cfddda36787050fc
Reviewed-on: https://review.haiku-os.org/c/1060
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2019-02-19 18:28:17 +00:00
10 changed files with 182 additions and 10 deletions

View File

@@ -1724,7 +1724,7 @@ case "${targ}" in
targ_selvecs="sparc_elf32_vec sparc_aout_linux_vec sparc_aout_sunos_be_vec"
want64=true
;;
sparc64-*-elf* | sparc64-*-rtems* )
sparc64-*-elf* | sparc64-*-rtems* | sparc64-*-haiku*)
targ_defvec=sparc_elf64_vec
targ_selvecs=sparc_elf32_vec
want64=true

View File

@@ -433,6 +433,7 @@ case ${generic_target} in
sh64-*-elf*) fmt=elf ;;
sparc64-*-rtems*) fmt=elf ;;
sparc-*-haiku*) fmt=elf em=haiku ;;
sparc-*-rtems*) fmt=elf ;;
sparc-*-sunos4*) fmt=aout em=sun3 ;;
sparc-*-aout) fmt=aout em=sparcaout ;;

View File

@@ -769,6 +769,7 @@ sh64-*-elf*) targ_emul=shelf
sparc64-*-aout*) targ_emul=sparcaout ;;
sparc64-*-elf*) targ_emul=elf64_sparc ;;
sparc64-*-rtems*) targ_emul=elf64_sparc ;;
sparc64-*-haiku*) targ_emul=elf64_sparc ;;
sparc-sun-sunos4*) targ_emul=sun4 ;;
sparclite*-*-elf) targ_emul=elf32_sparc ;;
sparclite*-*-coff) targ_emul=coff_sparc ;;

View File

@@ -2068,6 +2068,12 @@ microblaze*-*-elf)
cxx_target_objs="${cxx_target_objs} microblaze-c.o"
tmake_file="${tmake_file} microblaze/t-microblaze"
;;
riscv*-*-haiku*)
tm_file="elfos.h haiku.h ${tm_file} riscv/haiku.h"
tmake_file="${tmake_file} t-haiku riscv/t-riscv riscv/t-haiku"
gnu_ld=yes
gas=yes
;;
riscv*-*-linux*)
tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} riscv/linux.h"
case "x${enable_multilib}" in
@@ -2939,6 +2945,11 @@ sparc64-*-rtems*)
extra_options="${extra_options}"
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 haiku.h sparc/haiku.h"
extra_options="${extra_options}"
tmake_file="${tmake_file} t-haiku sparc/t-sparc sparc/t-haiku"
;;
sparc64-*-linux*)
tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/default64.h sparc/linux64.h sparc/tso.h"
extra_options="${extra_options} sparc/long-double-switch.opt"

View File

@@ -0,0 +1,54 @@
/* Definitions for RISC-V Haiku systems with ELF format.
Copyright (C) 1998-2017 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/>. */
#undef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("__HAIKU__"); \
if (POINTER_SIZE == 64) \
builtin_define ("__riscv64__"); \
else \
builtin_define ("__riscv32__"); \
builtin_define ("__RISCV__"); \
builtin_define ("__riscv__"); \
builtin_define ("__stdcall=__attribute__((__stdcall__))"); \
builtin_define ("__cdecl=__attribute__((__cdecl__))"); \
builtin_define ("__STDC_ISO_10646__=201103L"); \
builtin_assert ("system=haiku"); \
} \
while (0)
#define MUSL_ABI_SUFFIX \
"%{mabi=ilp32:-sf}" \
"%{mabi=ilp32f:-sp}" \
"%{mabi=ilp32d:}" \
"%{mabi=lp64:-sf}" \
"%{mabi=lp64f:-sp}" \
"%{mabi=lp64d:}" \
/* Because RISC-V only has word-sized atomics, it requries libatomic where
others do not. So link libatomic by default, as needed. */
#undef LIB_SPEC
#define LIB_SPEC " -lroot -latomic "
#define ICACHE_FLUSH_FUNC "__riscv_flush_icache"
#undef LINK_SPEC
#define LINK_SPEC "%{!o*:-o %b} -melf" XLEN_SPEC "lriscv %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}} -X"

View File

@@ -0,0 +1,4 @@
# Disable for now, only RV64 on Haiku for the moment
# Only XLEN and ABI affect multilib dir names, e.g. /lib32/ilp32d/
#MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib64,$(MULTILIB_DIRNAMES)))
#MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES))

View File

@@ -0,0 +1,93 @@
/* Definitions of target machine for GCC, for ELF on Haiku/sparc64.
Copyright (C) 2002-2017 Free Software Foundation, Inc.
Contributed by Matthew Green (mrg@eterna.com.au).
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 TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("__HAIKU__"); \
if (TARGET_ARCH64) \
{ \
builtin_define ("__sparc64__"); \
builtin_define ("__sparc_v9__"); \
builtin_define ("__sparcv9"); \
} \
else \
builtin_define ("__sparc"); \
builtin_define ("__sparc__"); \
} \
while (0)
/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support
for the special GCC options -static and -shared, which allow us to
link things in one of these three modes by applying the appropriate
combinations of options at link-time. */
#undef LINK_SPEC
#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"
#undef PTRDIFF_TYPE
#define PTRDIFF_TYPE "long int"
/* This is the char to use for continuation (in case we need to turn
continuation back on). */
#undef DBX_CONTIN_CHAR
#define DBX_CONTIN_CHAR '?'
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
This is suitable for output with `assemble_name'. */
#undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
sprintf ((LABEL), "*.L%s%ld", (PREFIX), (long)(NUM))
#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX ""
#undef ASM_SPEC
#define ASM_SPEC "%{" FPIE_OR_FPIC_SPEC ":-K PIC} \
%(asm_cpu) %(asm_arch) %(asm_relax)"
#define HAVE_ENABLE_EXECUTE_STACK
#undef TARGET_DEFAULT
#define TARGET_DEFAULT \
(MASK_V9 + MASK_PTR64 + MASK_64BIT /* + MASK_HARD_QUAD */ \
+ MASK_STACK_BIAS + MASK_APP_REGS + MASK_FPU + MASK_LONG_DOUBLE_128)
#undef SPARC_DEFAULT_CMODEL
#define SPARC_DEFAULT_CMODEL CM_MEDANY
/* Build a compiler that supports -m32 and -m64? */
#undef LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE 128
/* We use GNU ld so undefine this so that attribute((init_priority)) works. */
#undef CTORS_SECTION_ASM_OP
#undef DTORS_SECTION_ASM_OP

View File

@@ -0,0 +1,5 @@
# Disable multilib for now, as we don't intend to support SPARC32.
#MULTILIB_OPTIONS = m32/m64
#MULTILIB_DIRNAMES = 32 64
#MULTILIB_MATCHES =

View File

@@ -1276,6 +1276,8 @@ sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux
fi
md_unwind_header=sparc/linux-unwind.h
;;
sparc64-*-haiku*)
;;
sparc64-*-netbsd*)
;;
spu-*-elf*)

19
gcc/mpfr/configure vendored
View File

@@ -13399,16 +13399,17 @@ fi
# Check whether --enable-lto was given.
enable_lto=no
if test "${enable_lto+set}" = set; then :
enableval=$enable_lto; case $enableval in
yes) if test "$enable_shared" != "no"; then
as_fn_error $? "--enable-lto can only work in static mode (--disable-shared)" "$LINENO" 5
fi
enable_lto=yes
;;
no) ;;
*) as_fn_error $? "bad value for --enable-lto: yes or no" "$LINENO" 5 ;;
esac
# enableval=$enable_lto; case $enableval in
# yes) if test "$enable_shared" != "no"; then
# as_fn_error $? "--enable-lto can only work in static mode (--disable-shared)" "$LINENO" 5
# fi
# enable_lto=yes
# ;;
# no) ;;
# *) as_fn_error $? "bad value for --enable-lto: yes or no" "$LINENO" 5 ;;
# esac
fi