Compare commits

...

9 Commits

Author SHA1 Message Date
Augustin Cavalier
2ebb811a77 Force libiberty to consider all filesystems as potentially case-sensitive.
Whose idea was this?!

Fixes #14963.
2020-05-03 15:47:38 -04:00
Augustin Cavalier
5720e0c88e Remove obsolete installation guides. 2020-05-03 15:47:00 -04:00
François Revol
32f9366f9e gcc: fix m68k for GCC 8.3 2019-11-02 03:47:32 +01:00
François Revol
f91439b9da binutils: don't require coff, we don't need it anyway
binutils dropped support for COFF and a.out so it won't build anyway.
2019-11-02 02:57:15 +01:00
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
Simon South
86f02e2a45 gcc: Use correct linker emulation on arm
Among other things this ensures the TARGET2_TYPE linker option is set
correctly, preventing "unresolvable R_ARM_REL32 relocation" errors at
link time.

Fixes #15122.

Change-Id: Id4c6e97cc1739ecfac0f7cd0ec93927750f1b313
Reviewed-on: https://review.haiku-os.org/c/1702
Reviewed-by: Rene Gollent <rene@gollent.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-08-11 19:01:15 +00:00
21 changed files with 264 additions and 521 deletions

View File

@@ -1,20 +0,0 @@
How to create a cross-compiler on LINUX (or any other supported build platform)
for haiku (information is copied from haiku's README):
Please chdir into haiku's base directory (the one where Jamrules and README live).
If you want to build the default (legacy, 2.95.3) gcc, do this:
$ ./configure --build-cross-tools ../buildtools
One of the last output lines should tell you that the tools have been built
successfully.
If you're not interested in binary compatibility (or want to build for the PowerPC architecture), you can build gcc5 instead by doing this:
$ ./configure --build-cross-tools <arch> ../buildtools
Replace "<arch>" with either "x86" or "ppc", depending on which of the two
architectures you want to build for.

View File

@@ -1,52 +0,0 @@
How to build gcc-2.95.3 for Haiku:
cd into the buildtools/legacy folder
declare the current gcc-version-date like this:
export GCCDATE=100818
(just use the current date instead of '100818', ie. 'yymmdd')
If your GCC version includes new features, make sure you also alter the
version in gcc/gcc/version.c.
compile binutils:
mkdir binutils-obj
cd binutils-obj
LC_ALL=POSIX CFLAGS="-O2" CXXFLAGS="-O2" ../binutils/configure \
--prefix=/boot/common/develop/tools/gcc-2.95.3-${GCCDATE} \
--disable-nls --enable-shared=yes
LC_ALL=POSIX make
cd ..
compile gcc:
mkdir gcc-obj
cd gcc-obj
LC_ALL=POSIX CFLAGS="-O2" CXXFLAGS="-O2" ../gcc/configure \
--prefix=/boot/common/develop/tools/gcc-2.95.3-${GCCDATE} \
--disable-nls --enable-shared=yes --enable-languages=c,c++
LC_ALL=POSIX make bootstrap
# the above will fail when compiling builtinbuf.cc, but we can ignore that
# since it's trying to build libstdc++.so, which haiku provides anyway
cd ..
Ok, now everything is compiled and ready, waiting to be packaged:
mkdir /boot/develop/abi/x86/gcc2/tools/gcc-2.95.3-haiku-${GCCDATE}
cd binutils-obj
make install
cd ..
cd gcc-obj
make install
cd ..
ln -sfn gcc-2.95.3-haiku-${GCCDATE} /boot/develop/abi/x86/gcc2/tools/current
To build the binutils HTML documentation (needed by the GCC2 package build
script):
cd binutils-obj
make install-html
cd ..
Please send questions & bug-reports to: Oliver Tappe <gcc@hirschkaefer.de>

View File

@@ -1,44 +0,0 @@
How to build gcc-4.5 natively on Haiku:
checkout the buildtools from the haiku repository
cd into the buildtools folder (where this file lives)
declare the current gcc-version-date like this:
export GCCDATE=110631
export GCCVERSION=gcc-4.5.3-haiku-${GCCDATE}
(just use the current date instead of '110631' and the current gcc version
instead of '4.5.3')
compile binutils:
mkdir binutils-obj
cd binutils-obj
LC_ALL=POSIX CFLAGS="-O2" CXXFLAGS="-O2" ../binutils/configure \
--prefix=/boot/develop/abi/x86/gcc4/tools/${GCCVERSION} \
--disable-nls --enable-shared=yes \
--with-htmldir=html-docs
LC_ALL=POSIX make -j2
cd ..
compile gcc:
mkdir gcc-obj
cd gcc-obj
LC_ALL=POSIX CFLAGS="-O2" CXXFLAGS="-O2" ../gcc/configure \
--prefix=/boot/develop/abi/x86/gcc4/tools/${GCCVERSION} \
--enable-shared --enable-languages=c,c++ \
--disable-nls --without-libiconv-prefix --disable-libstdcxx-pch \
--with-htmldir=html-docs
LC_ALL=POSIX make -j2 bootstrap
cd ..
Ok, now everything is compiled and ready, waiting to be installed:
mkdir /boot/develop/abi/x86/gcc4/tools/${GCCVERSION}
cd binutils-obj
make install install-html
cd ../gcc-obj
make install install-html
ln -sfn ${GCCVERSION} /boot/develop/abi/x86/gcc4/tools/current
Please send questions & bug-reports to: Oliver Tappe <gcc@hirschkaefer.de>

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"
@@ -823,7 +828,6 @@ case "${targ}" in
m68*-*-haiku*)
targ_defvec=m68k_elf32_vec
targ_selvecs="m68k_coff_vec ieee_vec"
;;
m68hc11-*-* | m6811-*-*)

View File

@@ -36,17 +36,21 @@ extern "C" {
# ifndef HAVE_DOS_BASED_FILE_SYSTEM
# define HAVE_DOS_BASED_FILE_SYSTEM 1
# endif
/*
# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1
# endif
*/
# define HAS_DRIVE_SPEC(f) HAS_DOS_DRIVE_SPEC (f)
# define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c)
# define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f)
#else /* not DOSish */
# if defined(__APPLE__)
/*
# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1
# endif
*/
# endif /* __APPLE__ */
# define HAS_DRIVE_SPEC(f) (0)
# define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c)

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"
@@ -409,9 +411,7 @@ m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf
m68hc12-*-*|m6812-*-*) targ_emul=m68hc12elf
targ_extra_emuls="m68hc12elfb m68hc11elf m68hc11elfb" ;;
m68*-*-netbsdelf*) targ_emul=m68kelfnbsd ;;
m68*-*-haiku*) targ_emul=m68kelf
targ_extra_emuls=m68kcoff
;;
m68*-*-haiku*) targ_emul=m68kelf ;;
m68*-*-*) targ_emul=m68kelf ;;
s12z-*-*) targ_emul=m9s12zelf
;;

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

@@ -1,180 +0,0 @@
#!/bin/sh
# Builds a GCC package from the sources.
#
# Usage: build-gcc2-package-Haiku.sh <version date> <release>
# <version date> must be version date string formatted YYMMDD.
# <release> must be a number between 1 and 99.
# get version date and release parameters
if [ $# -ne 2 ]; then
echo "Usage: $0 <version date YYMMDD> <release>" >&2
exit 1
fi
export GCCDATE=$1
release=$2
# get current dir and buildtools dir
currentDir="$(pwd)/build-gcc-package"
rm -rf "$currentDir"
mkdir "$currentDir"
cd "$(dirname $0)"
buildtoolsDir="$(pwd)/legacy"
cd "$currentDir"
# prepare an install dir with a .PackageInfo
installDir="$currentDir/install"
rm -rf "$installDir"
mkdir "$installDir"
version=2.95.3_${GCCDATE}
packageInfoFile="package-info"
cat > "$packageInfoFile" << ENDOFHERE
name gcc
version $version-$release
architecture x86_gcc2
summary "c/c++ compiler"
description "standard compiler for x86_gcc2 platform, ABI-compatible with BeOS R5"
packager "Oliver Tappe <zooey@hirschkaefer.de>"
vendor "Haiku Project"
copyrights "1988-2000 Free Software Foundation, Inc."
licenses {
"GNU GPL v2"
"GNU LGPL v2"
}
provides {
gcc = $version compat >= 2.95.3
binutils = 2.17_$GCCDATE compat >= 2.17
}
requires {
haiku >= r1-alpha3
haiku-devel >= r1-alpha3
}
ENDOFHERE
# create a build package
versionedPackageName=gcc-$version-$release
packageFileName="$versionedPackageName-x86_gcc2.hpkg"
packageFile="$currentDir/$packageFileName"
echo "Creating build package..."
package create -b -I "$installDir" -i "$packageInfoFile" $packageFile ||
exit 1
# activate the package
rm -f /boot/common/packages/$packageFileName
ln -s "$packageFile" /boot/common/packages
finalInstallDir="/packages/$versionedPackageName/.self"
sleep 1
if [ ! -e "$finalInstallDir" ]; then
echo "Activating the build package failed!"
exit 1
fi
gccInstallDir="$finalInstallDir/develop/tools/gcc-2.95.3-${GCCDATE}"
mkdir -p "$gccInstallDir"
# build binutils
mkdir binutils-obj
cd binutils-obj
CFLAGS="-O2" CXXFLAGS="-O2" "$buildtoolsDir/binutils/configure" \
--prefix=$gccInstallDir \
--disable-nls --enable-shared=yes || exit 1
make || exit 1
make install || exit 1
cd ..
# build gcc
mkdir gcc-obj
cd gcc-obj
CFLAGS="-O2" CXXFLAGS="-O2" "$buildtoolsDir/gcc/configure" \
--prefix=$gccInstallDir \
--disable-nls --enable-shared=yes --enable-languages=c,c++ || exit 1
make bootstrap
# the above will fail when compiling builtinbuf.cc, but we can ignore that
# since it's trying to build libstdc++.so, which haiku provides anyway
make install || exit 1
cd ..
base=$gccInstallDir
### HTML documentation ####################################
html_base=$base/html-docs
if [ ! -d "$html_base" ]; then
echo "Building HTML documentation..."
mkdir $html_base
cd $html_base
makeinfo --html "$buildtoolsDir/gcc/gcc/cpp.texi"
makeinfo --html "$buildtoolsDir/gcc/gcc/gcc.texi"
makeinfo --html "$buildtoolsDir/binutils/libiberty/libiberty.texi"
makeinfo --force --html "$buildtoolsDir/gcc/libio/iostream.texi"
ln -sf cpp/index.html $html_base/cpp.html
ln -sf gcc/index.html $html_base/gcc.html
ln -sf libiberty/index.html $html_base/libiberty.html
ln -sf iostream/index.html $html_base/iostream.html
fi
if [ -d "$base/share/doc" ]; then
echo "Adding binutils HTML documentation..."
mv $base/share/doc/as.html $html_base/as
mv $base/share/doc/binutils.html $html_base/binutils
mv $base/share/doc/gprof.html $html_base/gprof
mv $base/share/doc/ld.html $html_base/ld
#mv $base/share/doc/configure.html $html_base/
ln -sf as/index.html $html_base/as.html
ln -sf binutils/index.html $html_base/binutils.html
ln -sf gprof/index.html $html_base/gprof.html
ln -sf ld/index.html $html_base/ld.html
fi
if [ ! -e "$html_base/as.html" ]; then
echo "binutils HTML documentation missing, see" \
"INSTALL-gcc2-from-source-Haiku."
fi
### Cleanup ###############################################
echo "Cleanup"
cd $base/bin
for binary in ../i586-pc-haiku/bin/*; do
ln -sfn $binary .
done
if [ -d $base/man -o -d $base/info -o -d $base/share ]; then
rm -rf $base/man
rm -rf $base/info
rm -rf $base/share
fi
rm -f $base/lib/gcc-lib/i586-pc-haiku/2.95.3-haiku-$GCCDATE/include/math.h
### C++ includes ######################################
echo "Install C++ includes & library"
rm -rf $base/include/g++
ln -snf /boot/system/develop/headers/c++/2.95.3 $base/include/g++
ln -snf /boot/system/lib/libstdc++.r4.so $base/lib/
ln -snf /boot/system/lib/libstdc++.so $base/lib/
### package ###########################################
echo "Building package ..."
cd "$currentDir"
mimeset -F "$installDir"
package create -C "$installDir" -i "$packageInfoFile" $packageFile || exit 1
echo "Built package $packageInfoFile successfully."

View File

@@ -1,208 +0,0 @@
#!/bin/sh
#
# Builds an GCC (optional) package from the sources.
usage()
{
echo "Usage: $0 [ <options> ] <gcc date>"
}
# get the relevant directories
currentDir=`pwd`
cd `dirname "$0"`
buildtoolsDir=`pwd`
cd "$currentDir"
binutilsSources="$buildtoolsDir/binutils"
gccSources="$buildtoolsDir/gcc"
buildDir="$currentDir/gcc-objects"
binutilsBuildDir="$buildDir/binutils"
gccBuildDir="$buildDir/gcc"
targetArch=x86
gccMakeTarget=bootstrap
gccConfigureArgs="--enable-shared"
binutilsConfigureArgs="--enable-shared"
# parse the arguments
jobArgs=
while [ $# -gt 0 ]; do
case "$1" in
-h|--help) usage; exit 0;;
-j*) jobArgs="$1"; shift 1;;
--arch)
case "$2" in
x86) HAIKU_GCC_MACHINE=i586-pc-haiku;;
x86_64) HAIKU_GCC_MACHINE=x86_64-unknown-haiku; targetArch=x86_64;;
ppc) HAIKU_GCC_MACHINE=powerpc-apple-haiku; targetArch=ppc;
gccMakeTarget= gccConfigureArgs="--disable-shared --disable-multilib"
binutilsConfigureArgs="--disable-shared --disable-multilib" ;;
m68k) HAIKU_GCC_MACHINE=m68k-unknown-haiku; targetArch=m68k;
gccMakeTarget= gccConfigureArgs="--disable-shared --disable-multilib"
binutilsConfigureArgs="--disable-shared --disable-multilib" ;;
arm) HAIKU_GCC_MACHINE=arm-unknown-haiku; targetArch=arm;
gccMakeTarget= gccConfigureArgs="--disable-shared --disable-multilib"
binutilsConfigureArgs="--disable-shared --disable-multilib" ;;
mipsel) HAIKU_GCC_MACHINE=mipsel-unknown-haiku; targetArch=mips;
gccMakeTarget= gccConfigureArgs="--disable-shared --disable-multilib"
binutilsConfigureArgs="--disable-shared --disable-multilib" ;;
*) echo "Unsupported target architecture: $2"
exit 1;;
esac
shift 2
targetCrossToolsMachine="--target=${HAIKU_GCC_MACHINE}";;
--source-dir) haikuSourceDir="$2"; shift 2;;
*) break;;
esac
done
# get the GCC date
if [ $# -ne 1 ]; then
usage >&2
exit 1
fi
gccDate=$1
case "$gccDate" in
[0-9][0-9][0-9][0-9][0-9][0-9]) true;;
*) echo "Invalid GCC date string '$gccDate'." >&2; exit 1;;
esac
# get the GCC version
gccVersion=`cat $gccSources/gcc/BASE-VER`
if [ -z "$gccVersion" ]; then
echo "Failed to get GCC version." >&2
exit 1
fi
gccVersionedName=gcc-${gccVersion}-haiku-${gccDate}
# check whether the installation dir does already exit
installDir=/boot/develop/abi/$targetArch/gcc4/tools/$gccVersionedName
if [ -e "$installDir" ]; then
echo "The installation directory '$installDir' does already exist." >&2
echo "Remove it first." >&2
exit 1
fi
# print some info before we start the action
echo "Building binutils and gcc optional packages from the source."
echo "sources: $buildtoolsDir"
echo "build dir: $buildDir"
echo "target arch: $targetArch"
echo "GCC date: $gccDate"
echo "GCC version: $gccVersion"
echo "install dir: $installDir"
echo
echo "This is going to take a while ..."
sleep 3
# From now on fail, if anything goes wrong.
set -o errexit
# forcefeed the POSIX locale, as the build (makeinfo) might choke otherwise
export LC_ALL=POSIX
# remove and recreate the build directories
rm -rf "$buildDir"
mkdir -p "$binutilsBuildDir" "$gccBuildDir"
# build and install the binutils
cd "$binutilsBuildDir"
CFLAGS="-O2" CXXFLAGS="-O2" "$binutilsSources/configure" \
--prefix="$installDir" $targetCrossToolsMachine --disable-nls \
$binutilsConfigureArgs --with-htmldir=html-docs
make $jobArgs
make install install-html
# prepare the include files
copy_headers()
{
sourceDir=$1
targetDir=$2
headers="$(find $sourceDir -name \*\.h | grep -v /.svn)"
headers="$(echo $headers | sed -e s@$sourceDir/@@g)"
for f in $headers; do
headerTargetDir=$targetDir/$(dirname $f)
mkdir -p $headerTargetDir
cp $sourceDir/$f $headerTargetDir
done
}
if [ -n "$haikuSourceDir" ]; then
tmpIncludeDir=$currentDir/sysincludes
tmpLibDir=$currentDir/syslibs
mkdir -p $tmpIncludeDir $tmpLibDir
copy_headers $haikuSourceDir/headers/config $tmpIncludeDir/config
copy_headers $haikuSourceDir/headers/os $tmpIncludeDir/os
copy_headers $haikuSourceDir/headers/posix $tmpIncludeDir/posix
headersLibsArgs="--with-headers=$tmpIncludeDir --with-libs=$tmpLibDir"
fi
# build and install gcc
cd "$gccBuildDir"
CFLAGS="-O2" CXXFLAGS="-O2" "$gccSources/configure" \
--prefix="$installDir" $gccConfigureArgs --enable-languages=c,c++ \
$targetCrossToolsMachine --disable-nls --without-libiconv-prefix \
--disable-libstdcxx-pch --with-htmldir=html-docs --enable-lto \
--enable-frame-pointer $headersLibsArgs
make $jobArgs $gccMakeTarget
make install-strip install-html
# remove installed stuff we don't want
rm -rf "$installDir/info" "$installDir/man" "$installDir/share" \
"$installDir/lib/libstdc++.so"
# strip the executables of debug info (somewhat crude heuristics to identify
# actual executables: files >= 20 kiB with execute permission and not in a "lib"
# directory)
strip --strip-debug \
`find "$installDir" -type f -a -perm -u=x -a -size +20k | grep -v /lib/`
# add C++ header symlink
ln -s c++/$gccVersion $installDir/include/g++
# zip everything up
gccVersionYear=20$(echo $gccDate | cut -c1-2)
gccVersionMonth=$(echo $gccDate | cut -c3-4)
gccVersionDay=$(echo $gccDate | cut -c5-6)
packageFile="$currentDir/gcc-${gccVersion}-${targetArch}-gcc4-${gccVersionYear}-${gccVersionMonth}-${gccVersionDay}.zip"
cd /boot
zip -ry "$packageFile" `echo $installDir | cut -d/ -f3-`
# add the "current" version symlink
cd "$buildDir"
mkdir -p develop/abi/$targetArch/gcc4/tools/
ln -s $gccVersionedName develop/abi/$targetArch/gcc4/tools/current
zip -y "$packageFile" develop/abi/$targetArch/gcc4/tools/current
# add the optional package description
cd "$buildDir"
echo "Package: GCC
Version: ${gccVersion}-${targetArch}-haiku-${gccDate}
Copyright: 1988-2012 Free Software Foundation, Inc.
License: GNU GPL v3
License: GNU LGPL v3
URL: http://www.gnu.org/software/gcc/
" > .OptionalPackageDescription
zip "$packageFile" .OptionalPackageDescription
# clean up
cd "$currentDir"
rm -rf "$buildDir"

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

@@ -68,6 +68,6 @@
/* If ELF is the default format, we should not use /lib/elf. */
#undef LINK_SPEC
#define LINK_SPEC "%{!o*:-o %b} -m armelf %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}\
#define LINK_SPEC "%{!o*:-o %b} -m armelf_haiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}\
%{mbig-endian:-EB} %{mlittle-endian:-EL} -X"

View File

@@ -243,7 +243,7 @@ do { \
#undef FINALIZE_TRAMPOLINE
#define FINALIZE_TRAMPOLINE(TRAMP) \
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \
LCT_NORMAL, VOIDmode, 2, TRAMP, Pmode, \
LCT_NORMAL, VOIDmode, TRAMP, Pmode, \
plus_constant (Pmode, TRAMP, TRAMPOLINE_SIZE), \
Pmode);

View File

@@ -36,17 +36,21 @@ extern "C" {
# ifndef HAVE_DOS_BASED_FILE_SYSTEM
# define HAVE_DOS_BASED_FILE_SYSTEM 1
# endif
/*
# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1
# endif
*/
# define HAS_DRIVE_SPEC(f) HAS_DOS_DRIVE_SPEC (f)
# define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c)
# define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f)
#else /* not DOSish */
# if defined(__APPLE__)
/*
# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1
# endif
*/
# endif /* __APPLE__ */
# define HAS_DRIVE_SPEC(f) (0)
# define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c)

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;
}