Compare commits

...

4 Commits

Author SHA1 Message Date
Jaroslaw Pelczar
f420f1565f GCC: Fix missing haiku in config.host for ARM64
This allows bootstrap-raw target to build GCC for ARM64

Signed-off-by: Jaroslaw Pelczar <jarek@jpelczar.com>
Change-Id: Id64b8c041b3488a78219b8a2b633a3fedc9ee4f0
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/1821
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-09-15 16:01:04 +00:00
Jaroslaw Pelczar
e4426fc38a gcc: Add initial support for AArch64 Haiku
Signed-off-by: Jaroslaw Pelczar <jarek@jpelczar.com>
Change-Id: I8bd362b61ded01ae1b15d0a999d0db947204aeb7
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/1797
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-09-01 03:06:22 +00:00
Jaroslaw Pelczar
e97614541b binutils: Add support for Haiku ARM64 target
Signed-off-by: Jaroslaw Pelczar <jarek@jpelczar.com>
Change-Id: Iebbfba7285429bded988ed0f80a574c471fa9f7d
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/1796
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-09-01 03:06:22 +00:00
Simon South
18e01e2af6 jam: jcache: Accept empty input files
Make new_string_list() initialize the buffer it creates to hold a file's
contents, preventing a segfault later on should jam attempt to parse the
contents of an empty file.

Fixes #15250.

Change-Id: I907dccd26e1ca35fbe07ed6d624b0144487134fe
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/1716
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-08-13 20:22:35 +00:00
12 changed files with 253 additions and 11 deletions

View File

@@ -255,6 +255,11 @@ case "${targ}" in
targ_selvecs=aarch64_elf64_be_cloudabi_vec
want64=true
;;
aarch64-*-haiku*)
targ_defvec=aarch64_elf64_le_vec
targ_selvecs="aarch64_elf64_be_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_le_vec arm_elf32_be_vec"
want64=true
;;
aarch64-*-linux*)
targ_defvec=aarch64_elf64_le_vec
targ_selvecs="aarch64_elf64_be_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_le_vec arm_elf32_be_vec"

View File

@@ -398,6 +398,7 @@ ALL_64_EMULATION_SOURCES = \
eaarch64cloudabib.c \
eaarch64fbsd.c \
eaarch64fbsdb.c \
eaarch64haiku.c \
eaarch64linux.c \
eaarch64linuxb.c \
eaarch64linux32.c \
@@ -1561,6 +1562,10 @@ eaarch64fbsdb.c: $(srcdir)/emulparams/aarch64fbsdb.sh $(srcdir)/emulparams/aarch
$(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eaarch64haiku.c: $(srcdir)/emulparams/aarch64haiku.sh \
$(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eaarch64linux.c: $(srcdir)/emulparams/aarch64linux.sh \
$(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}

View File

@@ -521,6 +521,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -749,8 +750,8 @@ ALL_EMULATION_SOURCES = \
eelf32or1k_linux.c \
eelf32ppc.c \
eelf32ppc_fbsd.c \
eelf32ppchaiku.c \
eelf32ppclinux.c \
eelf32ppchaiku.c \
eelf32ppcnto.c \
eelf32ppcsim.c \
eelf32ppcvxworks.c \
@@ -779,6 +780,7 @@ ALL_EMULATION_SOURCES = \
eelf_i386_nacl.c \
eelf_i386_sol2.c \
eelf_i386_vxworks.c \
eelf_mipsel_haiku.c \
eelf_iamcu.c \
eelf_s390.c \
eh8300elf.c \
@@ -882,6 +884,7 @@ ALL_64_EMULATION_SOURCES = \
eaarch64cloudabib.c \
eaarch64fbsd.c \
eaarch64fbsdb.c \
eaarch64haiku.c \
eaarch64linux.c \
eaarch64linuxb.c \
eaarch64linux32.c \
@@ -943,8 +946,8 @@ ALL_64_EMULATION_SOURCES = \
eelf_k1om_fbsd.c \
eelf_x86_64.c \
eelf_x86_64_cloudabi.c \
eelf_x86_64_fbsd.c \
eelf_x86_64_haiku.c \
eelf_x86_64_fbsd.c \
eelf_x86_64_nacl.c \
eelf_x86_64_sol2.c \
ehppa64linux.c \
@@ -1203,6 +1206,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64elfb.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64fbsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64fbsdb.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64haiku.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linux.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linux32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linux32b.Po@am__quote@
@@ -1224,6 +1228,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_fbsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_fuchsia.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_haiku.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_linux.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_linux_eabi.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_linux_fdpiceabi.Po@am__quote@
@@ -1342,6 +1347,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32or1k_linux.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppc_fbsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppchaiku.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppclinux.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppcnto.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppcsim.Po@am__quote@
@@ -1390,6 +1396,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_be.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_chaos.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_fbsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_haiku.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_ldso.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_nacl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_sol2.Po@am__quote@
@@ -1399,10 +1406,12 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_k1om_fbsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_l1om.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_l1om_fbsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_mipsel_haiku.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_s390.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_cloudabi.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_fbsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_haiku.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_nacl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_sol2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eh8300elf.Po@am__quote@
@@ -2933,13 +2942,13 @@ eelf_i386_sol2.c: $(srcdir)/emulparams/elf_i386_sol2.sh \
$(srcdir)/emultempl/solaris2.em \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf_mipsel_haiku.c: $(srcdir)/emulparams/elf_mipsel_haiku.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf_i386_vxworks.c: $(srcdir)/emulparams/elf_i386_vxworks.sh \
$(srcdir)/emulparams/vxworks.sh $(srcdir)/emultempl/vxworks.em \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf_mipsel_haiku.c: $(srcdir)/emulparams/elf_mipsel_haiku.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf_iamcu.c: $(srcdir)/emulparams/elf_iamcu.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -3164,6 +3173,10 @@ eaarch64fbsdb.c: $(srcdir)/emulparams/aarch64fbsdb.sh $(srcdir)/emulparams/aarch
$(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eaarch64haiku.c: $(srcdir)/emulparams/aarch64haiku.sh \
$(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eaarch64linux.c: $(srcdir)/emulparams/aarch64linux.sh \
$(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -3321,6 +3334,10 @@ ez8002.c: $(srcdir)/emulparams/z8002.sh \
eelf32_x86_64.c: $(srcdir)/emulparams/elf32_x86_64.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf_x86_64_haiku.c: $(srcdir)/emulparams/elf_x86_64_haiku.sh \
$(srcdir)/emulparams/elf_x86_64.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf32_x86_64_nacl.c: $(srcdir)/emulparams/elf32_x86_64_nacl.sh \
$(srcdir)/emulparams/elf32_x86_64.sh \
$(srcdir)/emulparams/elf_nacl.sh \
@@ -3481,10 +3498,6 @@ eelf_x86_64_fbsd.c: $(srcdir)/emulparams/elf_x86_64_fbsd.sh \
$(srcdir)/emulparams/elf_x86_64.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf_x86_64_haiku.c: $(srcdir)/emulparams/elf_x86_64_haiku.sh \
$(srcdir)/emulparams/elf_x86_64.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf_x86_64_nacl.c: $(srcdir)/emulparams/elf_x86_64_nacl.sh \
$(srcdir)/emulparams/elf_x86_64.sh \
$(srcdir)/emulparams/elf_nacl.sh \

View File

@@ -70,6 +70,8 @@ aarch64_be-*-linux*) targ_emul=aarch64linuxb
aarch64-*-linux*) targ_emul=aarch64linux
targ_extra_libpath="aarch64linuxb aarch64linux32 aarch64linux32b armelfb_linux_eabi armelf_linux_eabi"
targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb $targ_extra_libpath" ;;
aarch64-*-haiku*) targ_emul=aarch64haiku
targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb armelf_haiku $targ_extra_libpath" ;;
alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
targ_emul=elf64alpha_fbsd
targ_extra_emuls="elf64alpha alpha"

View File

@@ -0,0 +1,39 @@
ARCH=aarch64
MACHINE=
NOP=0x1f2003d5
SCRIPT_NAME=elf
ELFSIZE=64
OUTPUT_FORMAT="elf64-littleaarch64"
BIG_OUTPUT_FORMAT="elf64-bigaarch64"
LITTLE_OUTPUT_FORMAT="elf64-littleaarch64"
NO_REL_RELOCS=yes
TEMPLATE_NAME=elf32
EXTRA_EM_FILE=aarch64elf
GENERATE_SHLIB_SCRIPT=yes
GENERATE_PIE_SCRIPT=yes
MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
SEPARATE_GOTPLT=24
IREL_IN_PLT=
TEXT_START_ADDR=0x400000
DATA_START_SYMBOLS='PROVIDE (__data_start = .);';
# AArch64 does not support .s* sections.
NO_SMALL_DATA=yes
OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__bss_start__ = .${CREATE_SHLIB+)};"
OTHER_BSS_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_bss_end__ = .${CREATE_SHLIB+)}; ${CREATE_SHLIB+PROVIDE (}__bss_end__ = .${CREATE_SHLIB+)};"
OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};"
OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }'
# Ensure each PLT entry is aligned to a cache line.
PLT=".plt ${RELOCATING-0} : ALIGN(16) { *(.plt)${RELOCATING+${IREL_IN_PLT+ *(.iplt)}} }"
. ${srcdir}/emulparams/elf_haiku.sh

View File

@@ -993,6 +993,11 @@ aarch64*-*-freebsd*)
tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-freebsd.h"
tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-freebsd"
;;
aarch64*-*-haiku*)
tm_file="${tm_file} dbxelf.h elfos.h haiku.h haiku-stdint.h"
tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-haiku.h"
tmake_file="${tmake_file} t-haiku aarch64/t-aarch64 aarch64/t-aarch64-haiku"
;;
aarch64*-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h"
tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-linux.h"

View File

@@ -99,7 +99,7 @@ case ${host} in
esac
case ${host} in
aarch64*-*-freebsd* | aarch64*-*-linux* | aarch64*-*-fuchsia*)
aarch64*-*-freebsd* | aarch64*-*-linux* | aarch64*-*-fuchsia* | aarch64*-*-haiku*)
case ${target} in
aarch64*-*-*)
host_extra_gcc_objs="driver-aarch64.o"

View File

@@ -0,0 +1,94 @@
/* Machine description for AArch64 architecture.
Copyright (C) 2009-2018 Free Software Foundation, Inc.
Contributed by ARM Ltd.
Updated for Haiku by Jaroslaw Pelczar <jarek@jpelczar.com>
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/>. */
#ifndef GCC_AARCH64_HAIKU_H
#define GCC_AARCH64_HAIKU_H
#define HAIKU_DYNAMIC_LINKER "/system/runtime_loader"
#define CPP_SPEC "%{pthread:-D_REENTRANT}"
#if TARGET_BIG_ENDIAN_DEFAULT
#define TARGET_LINKER_EMULATION "aarch64haikub"
#else
#define TARGET_LINKER_EMULATION "aarch64haiku"
#endif
#undef SUBTARGET_EXTRA_LINK_SPEC
#define SUBTARGET_EXTRA_LINK_SPEC " -m" TARGET_LINKER_EMULATION
#undef HAIKU_TARGET_LINK_SPEC
#define HAIKU_TARGET_LINK_SPEC " \
%{p:%nconsider using `-pg' instead of `-p' with gprof (1) } \
%{v:-V} \
%{assert*} %{R*} %{rpath*} %{defsym*} \
%{shared:-Bshareable %{h*} %{soname*}} \
%{symbolic:-Bsymbolic} \
%{static:-Bstatic} \
%{!static: \
%{rdynamic:-export-dynamic} \
%{!shared:-dynamic-linker " HAIKU_DYNAMIC_LINKER " }} \
-X" SUBTARGET_EXTRA_LINK_SPEC " \
%{mbig-endian:-EB} %{mlittle-endian:-EL}"
#if TARGET_FIX_ERR_A53_835769_DEFAULT
#define CA53_ERR_835769_SPEC \
" %{!mno-fix-cortex-a53-835769:--fix-cortex-a53-835769}"
#else
#define CA53_ERR_835769_SPEC \
" %{mfix-cortex-a53-835769:--fix-cortex-a53-835769}"
#endif
#if TARGET_FIX_ERR_A53_843419_DEFAULT
#define CA53_ERR_843419_SPEC \
" %{!mno-fix-cortex-a53-843419:--fix-cortex-a53-843419}"
#else
#define CA53_ERR_843419_SPEC \
" %{mfix-cortex-a53-843419:--fix-cortex-a53-843419}"
#endif
#define LINK_SPEC HAIKU_TARGET_LINK_SPEC \
CA53_ERR_835769_SPEC \
CA53_ERR_843419_SPEC
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("__HAIKU__"); \
builtin_define ("__stdcall=__attribute__((__stdcall__))"); \
builtin_define ("__cdecl=__attribute__((__cdecl__))"); \
builtin_define ("__STDC_ISO_10646__=201103L"); \
builtin_assert ("system=haiku"); \
} \
while (0)
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
/* Uninitialized common symbols in non-PIE executables, even with
strong definitions in dependent shared libraries, will resolve
to COPY relocated symbol in the executable. See PR65780. */
#undef TARGET_BINDS_LOCAL_P
#define TARGET_BINDS_LOCAL_P default_binds_local_p_2
/* Define this to be nonzero if static stack checking is supported. */
#define STACK_CHECK_STATIC_BUILTIN 1
#endif /* GCC_AARCH64_HAIKU_H */

View File

@@ -0,0 +1,21 @@
# Machine description for AArch64 architecture.
# Copyright (C) 2016-2018 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/>.
LIB1ASMSRC = aarch64/lib1funcs.asm
LIB1ASMFUNCS = _aarch64_sync_cache_range

View File

@@ -354,6 +354,11 @@ aarch64*-*-fuchsia*)
tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp"
;;
aarch64*-*-haiku*)
tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp"
md_unwind_header=aarch64/haiku-unwind.h
;;
aarch64*-*-linux*)
extra_parts="$extra_parts crtfastmath.o"
md_unwind_header=aarch64/linux-unwind.h

View File

@@ -0,0 +1,51 @@
/* DWARF2 EH unwinding support for FreeBSD/ARM64 (aarch64).
Copyright (C) 2017-2018 Free Software Foundation, Inc.
Contributed by John Marino <gnugcc@marino.st>
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.
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
/* Identify a signal frame, and set the frame state data appropriately.
See unwind-dw2.c for the structs. */
/* Always include AArch64 unwinder header file. */
#include "config/aarch64/aarch64-unwind.h"
#include <sys/types.h>
#include <signal.h>
#include <unistd.h>
#include <signal.h>
#define REG_NAME(reg) mc_gpregs.gp_## reg
#define XREG(num) mc_gpregs.gp_x[num]
#define DARC __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__
#define MD_FALLBACK_FRAME_STATE_FOR aarch64_haiku_fallback_frame_state
static _Unwind_Reason_Code
aarch64_haiku_fallback_frame_state
(struct _Unwind_Context *context, _Unwind_FrameState *fs)
{
// For now just signal end of stack. Once the Haiku implementation
// for AArch64 is more mature we can consider writing something similar
// to Linux or FreeBSD support.
return _URC_END_OF_STACK;
}

View File

@@ -112,7 +112,9 @@ new_string_list(int block_size)
if (block_size <= 0)
block_size = 5;
list->block_size = block_size;
if (!resize_string_list(list, 0)) {
if (resize_string_list(list, 0))
*list->strings = 0;
else {
free(list);
list = 0;
}