binutils: add recipes for versions 2.27, 2.28.1, 2.29.

This commit is contained in:
Jerome Duval
2017-08-05 14:25:39 +02:00
parent 4861bf414c
commit b1952334d7
6 changed files with 2645 additions and 0 deletions

View File

@@ -0,0 +1,189 @@
SUMMARY="Assembler, linker and binary tools for target ${targetMachineTriple}"
DESCRIPTION="The GNU Binutils are a collection of binary tools.
The main ones are:
- ld - the GNU linker.
- as - the GNU assembler.
But they also include:
- addr2line - converts addresses into filenames and line numbers.
- ar - a utility for creating, modifying and extracting of archives.
- c++filt - filter to demangle encoded C++ symbols.
- nm - lists symbols from object files.
- objcopy - copys and translates object files.
- objdump - displays information from object files.
- ranlib - generates an index to the contents of an archive.
- readelf - displays information from any ELF format object file.
- size - lists the section sizes of an object or archive file.
- strings - lists printable strings from files.
- strip - discards symbols.
The tools of this package can be used for cross-builds to \
$effectiveTargetMachineTriple."
HOMEPAGE="http://www.gnu.org/software/binutils"
COPYRIGHT="1988-2016 Free Software Foundation, Inc."
LICENSE="GNU GPL v3
GNU LGPL v3"
REVISION="1"
binutilsVersion="2.27"
SOURCE_URI="https://ftp.gnu.org/gnu/binutils/binutils-$binutilsVersion.tar.bz2"
CHECKSUM_SHA256="369737ce51587f92466041a97ab7d2358c6d9e1b6490b3940eb09fb0a9a6ac88"
SOURCE_DIR="binutils-$binutilsVersion"
PATCHES="binutils-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64 ?arm"
SECONDARY_ARCHITECTURES="?x86"
PROVIDES="
binutils$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:addr2line$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:ar$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:as$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:c++filt$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:elfedit$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:gprof$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:ld$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:ld.bfd$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:nm$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:objcopy$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:objdump$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:ranlib$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:readelf$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:size$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:strings$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:strip$secondaryArchSuffix = $portVersion compat >= 2.23
lib:libbfd_$binutilsVersion$secondaryArchSuffix = $portVersion compat >= 2.23
lib:libopcodes_$binutilsVersion$secondaryArchSuffix = $portVersion compat >= 2.23
"
REQUIRES="
haiku$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
cmd:find
cmd:xargs
"
BUILD_PREREQUIRES="
cmd:autoconf
cmd:awk
cmd:bison
cmd:find
cmd:flex
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
cmd:makeinfo
cmd:sed
cmd:strip
cmd:tar
cmd:xargs
"
BUILD_PACKAGE_ACTIVATION_PHASE=INSTALL
sourceDir=$(pwd)
relativeInstallDir="develop/tools$secondaryArchSubDir"
installDir="$prefix/$relativeInstallDir"
objectsDir=$(pwd)/../${portVersionedName}-obj
BUILD()
{
rm -rf $objectsDir
# Touch all *.info files, as newer texinfos don't like their format
(cd $sourceDir; find . -name \*.info | xargs touch)
# Touch all *.y files, ensure they get generated; without this, the
# PE targets would fail to link
(cd $sourceDir; find . -name \*.y | xargs touch)
mkdir -p $objectsDir
cd $objectsDir
binUtilsTargets=$effectiveTargetMachineTriple
if [ $effectiveTargetArchitecture == x86_64 ]; then
binUtilsTargets="$binUtilsTargets,i386-efi-pe,x86_64-efi-pe"
fi
CFLAGS=-O2 CXXFLAGS=-O2 runConfigure "$sourceDir/configure" \
--exec-prefix=$installDir \
--includedir=$includeDir/binutils \
--docdir=$docDir --enable-deterministic-archives \
--disable-nls --enable-shared=yes --disable-initfini-array \
--enable-targets=$binUtilsTargets \
--with-sysroot=/
# Note: The sysroot option is normally superfluous. We have to specify
# it, however, since these binutils may be used by the bootstrap-gcc,
# which passes --sysroot=<path> to ld.
make $jobArgs LEXLIB=
}
INSTALL()
{
cd $objectsDir
make install
make install-html
# Remove the development libraries and headers. Nobody uses those anyway.
rm $libDir/*.a $libDir/*.la $libDir/libbfd.so $libDir/libopcodes.so
rm -r $developDir/headers
### HTML documentation ####################################
echo "Organizing HTML documentation..."
cd $docDir
# beautify HTML docs and remove stuff we don't need
mv as.html as
ln -sf as/index.html as.html
mv bfd.html bfd
ln -sf bfd/index.html bfd.html
mv binutils.html binutils
ln -sf binutils/index.html binutils.html
mv gprof.html gprof
ln -sf gprof/index.html gprof.html
mv ld.html ld
ln -sf ld/index.html ld.html
rm libiberty.html
# no info documentation
rm -r $infoDir
### Strip #################################################
echo "Strip debug info"
strip --strip-debug $binDir/*
### Symlinks ##############################################
echo "Creating required symlinks"
# There are copies of a subset of the commands below installDir. We
# overwrite those with symlinks to the ones in binDir.
for file in $installDir/$effectiveTargetMachineTriple/bin/*; do
symlinkRelative -sfn $binDir/$(basename $file) $file
done
### Cleanup #################################################
echo "Cleanup"
# delete commands we aren't including
cd $binDir
for cmd in dlltool dllwrap windmc windres; do
rm -f $cmd
rm -f $installDir/$effectiveTargetMachineTriple/bin/$cmd
done
# delete man pages for commands that we aren't including
cd $manDir
for cmd in dlltool nlmconv windmc windres; do
rm -f man1/$cmd.1
done
}

View File

@@ -0,0 +1,189 @@
SUMMARY="Assembler, linker and binary tools for target ${targetMachineTriple}"
DESCRIPTION="The GNU Binutils are a collection of binary tools.
The main ones are:
- ld - the GNU linker.
- as - the GNU assembler.
But they also include:
- addr2line - converts addresses into filenames and line numbers.
- ar - a utility for creating, modifying and extracting of archives.
- c++filt - filter to demangle encoded C++ symbols.
- nm - lists symbols from object files.
- objcopy - copys and translates object files.
- objdump - displays information from object files.
- ranlib - generates an index to the contents of an archive.
- readelf - displays information from any ELF format object file.
- size - lists the section sizes of an object or archive file.
- strings - lists printable strings from files.
- strip - discards symbols.
The tools of this package can be used for cross-builds to \
$effectiveTargetMachineTriple."
HOMEPAGE="http://www.gnu.org/software/binutils"
COPYRIGHT="1988-2016 Free Software Foundation, Inc."
LICENSE="GNU GPL v3
GNU LGPL v3"
REVISION="1"
binutilsVersion="2.28.1"
SOURCE_URI="https://ftp.gnu.org/gnu/binutils/binutils-$binutilsVersion.tar.xz"
CHECKSUM_SHA256="16328a906e55a3c633854beec8e9e255a639b366436470b4f6245eb0d2fde942"
SOURCE_DIR="binutils-$binutilsVersion"
PATCHES="binutils-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64 ?arm"
SECONDARY_ARCHITECTURES="?x86"
PROVIDES="
binutils$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:addr2line$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:ar$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:as$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:c++filt$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:elfedit$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:gprof$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:ld$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:ld.bfd$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:nm$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:objcopy$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:objdump$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:ranlib$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:readelf$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:size$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:strings$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:strip$secondaryArchSuffix = $portVersion compat >= 2.23
lib:libbfd_$binutilsVersion$secondaryArchSuffix = $portVersion compat >= 2.23
lib:libopcodes_$binutilsVersion$secondaryArchSuffix = $portVersion compat >= 2.23
"
REQUIRES="
haiku$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
cmd:find
cmd:xargs
"
BUILD_PREREQUIRES="
cmd:autoconf
cmd:awk
cmd:bison
cmd:find
cmd:flex
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
cmd:makeinfo
cmd:sed
cmd:strip
cmd:tar
cmd:xargs
"
BUILD_PACKAGE_ACTIVATION_PHASE=INSTALL
sourceDir=$(pwd)
relativeInstallDir="develop/tools$secondaryArchSubDir"
installDir="$prefix/$relativeInstallDir"
objectsDir=$(pwd)/../${portVersionedName}-obj
BUILD()
{
rm -rf $objectsDir
# Touch all *.info files, as newer texinfos don't like their format
(cd $sourceDir; find . -name \*.info | xargs touch)
# Touch all *.y files, ensure they get generated; without this, the
# PE targets would fail to link
(cd $sourceDir; find . -name \*.y | xargs touch)
mkdir -p $objectsDir
cd $objectsDir
binUtilsTargets=$effectiveTargetMachineTriple
if [ $effectiveTargetArchitecture == x86_64 ]; then
binUtilsTargets="$binUtilsTargets,i386-efi-pe,x86_64-efi-pe"
fi
CFLAGS=-O2 CXXFLAGS=-O2 runConfigure "$sourceDir/configure" \
--exec-prefix=$installDir \
--includedir=$includeDir/binutils \
--docdir=$docDir --enable-deterministic-archives \
--disable-nls --enable-shared=yes --disable-initfini-array \
--enable-targets=$binUtilsTargets \
--with-sysroot=/
# Note: The sysroot option is normally superfluous. We have to specify
# it, however, since these binutils may be used by the bootstrap-gcc,
# which passes --sysroot=<path> to ld.
make $jobArgs LEXLIB=
}
INSTALL()
{
cd $objectsDir
make install
make install-html
# Remove the development libraries and headers. Nobody uses those anyway.
rm $libDir/*.a $libDir/*.la $libDir/libbfd.so $libDir/libopcodes.so
rm -r $developDir/headers
### HTML documentation ####################################
echo "Organizing HTML documentation..."
cd $docDir
# beautify HTML docs and remove stuff we don't need
mv as.html as
ln -sf as/index.html as.html
mv bfd.html bfd
ln -sf bfd/index.html bfd.html
mv binutils.html binutils
ln -sf binutils/index.html binutils.html
mv gprof.html gprof
ln -sf gprof/index.html gprof.html
mv ld.html ld
ln -sf ld/index.html ld.html
rm libiberty.html
# no info documentation
rm -r $infoDir
### Strip #################################################
echo "Strip debug info"
strip --strip-debug $binDir/*
### Symlinks ##############################################
echo "Creating required symlinks"
# There are copies of a subset of the commands below installDir. We
# overwrite those with symlinks to the ones in binDir.
for file in $installDir/$effectiveTargetMachineTriple/bin/*; do
symlinkRelative -sfn $binDir/$(basename $file) $file
done
### Cleanup #################################################
echo "Cleanup"
# delete commands we aren't including
cd $binDir
for cmd in dlltool dllwrap windmc windres; do
rm -f $cmd
rm -f $installDir/$effectiveTargetMachineTriple/bin/$cmd
done
# delete man pages for commands that we aren't including
cd $manDir
for cmd in dlltool nlmconv windmc windres; do
rm -f man1/$cmd.1
done
}

View File

@@ -0,0 +1,189 @@
SUMMARY="Assembler, linker and binary tools for target ${targetMachineTriple}"
DESCRIPTION="The GNU Binutils are a collection of binary tools.
The main ones are:
- ld - the GNU linker.
- as - the GNU assembler.
But they also include:
- addr2line - converts addresses into filenames and line numbers.
- ar - a utility for creating, modifying and extracting of archives.
- c++filt - filter to demangle encoded C++ symbols.
- nm - lists symbols from object files.
- objcopy - copys and translates object files.
- objdump - displays information from object files.
- ranlib - generates an index to the contents of an archive.
- readelf - displays information from any ELF format object file.
- size - lists the section sizes of an object or archive file.
- strings - lists printable strings from files.
- strip - discards symbols.
The tools of this package can be used for cross-builds to \
$effectiveTargetMachineTriple."
HOMEPAGE="http://www.gnu.org/software/binutils"
COPYRIGHT="1988-2016 Free Software Foundation, Inc."
LICENSE="GNU GPL v3
GNU LGPL v3"
REVISION="1"
binutilsVersion="2.29"
SOURCE_URI="https://ftp.gnu.org/gnu/binutils/binutils-$binutilsVersion.tar.xz"
CHECKSUM_SHA256="0b871e271c4c620444f8264f72143b4d224aa305306d85dd77ab8dce785b1e85"
SOURCE_DIR="binutils-$binutilsVersion"
PATCHES="binutils-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64 ?arm"
SECONDARY_ARCHITECTURES="?x86"
PROVIDES="
binutils$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:addr2line$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:ar$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:as$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:c++filt$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:elfedit$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:gprof$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:ld$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:ld.bfd$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:nm$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:objcopy$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:objdump$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:ranlib$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:readelf$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:size$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:strings$secondaryArchSuffix = $portVersion compat >= 2.23
cmd:strip$secondaryArchSuffix = $portVersion compat >= 2.23
lib:libbfd_$binutilsVersion$secondaryArchSuffix = $portVersion compat >= 2.23
lib:libopcodes_$binutilsVersion$secondaryArchSuffix = $portVersion compat >= 2.23
"
REQUIRES="
haiku$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
cmd:find
cmd:xargs
"
BUILD_PREREQUIRES="
cmd:autoconf
cmd:awk
cmd:bison
cmd:find
cmd:flex
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
cmd:makeinfo
cmd:sed
cmd:strip
cmd:tar
cmd:xargs
"
BUILD_PACKAGE_ACTIVATION_PHASE=INSTALL
sourceDir=$(pwd)
relativeInstallDir="develop/tools$secondaryArchSubDir"
installDir="$prefix/$relativeInstallDir"
objectsDir=$(pwd)/../${portVersionedName}-obj
BUILD()
{
rm -rf $objectsDir
# Touch all *.info files, as newer texinfos don't like their format
(cd $sourceDir; find . -name \*.info | xargs touch)
# Touch all *.y files, ensure they get generated; without this, the
# PE targets would fail to link
(cd $sourceDir; find . -name \*.y | xargs touch)
mkdir -p $objectsDir
cd $objectsDir
binUtilsTargets=$effectiveTargetMachineTriple
if [ $effectiveTargetArchitecture == x86_64 ]; then
binUtilsTargets="$binUtilsTargets,i386-efi-pe,x86_64-efi-pe"
fi
CFLAGS=-O2 CXXFLAGS=-O2 runConfigure "$sourceDir/configure" \
--exec-prefix=$installDir \
--includedir=$includeDir/binutils \
--docdir=$docDir --enable-deterministic-archives \
--disable-nls --enable-shared=yes --disable-initfini-array \
--enable-targets=$binUtilsTargets \
--with-sysroot=/
# Note: The sysroot option is normally superfluous. We have to specify
# it, however, since these binutils may be used by the bootstrap-gcc,
# which passes --sysroot=<path> to ld.
make $jobArgs LEXLIB=
}
INSTALL()
{
cd $objectsDir
make install
make install-html
# Remove the development libraries and headers. Nobody uses those anyway.
rm $libDir/*.a $libDir/*.la $libDir/libbfd.so $libDir/libopcodes.so
rm -r $developDir/headers
### HTML documentation ####################################
echo "Organizing HTML documentation..."
cd $docDir
# beautify HTML docs and remove stuff we don't need
mv as.html as
ln -sf as/index.html as.html
mv bfd.html bfd
ln -sf bfd/index.html bfd.html
mv binutils.html binutils
ln -sf binutils/index.html binutils.html
mv gprof.html gprof
ln -sf gprof/index.html gprof.html
mv ld.html ld
ln -sf ld/index.html ld.html
rm libiberty.html
# no info documentation
rm -r $infoDir
### Strip #################################################
echo "Strip debug info"
strip --strip-debug $binDir/*
### Symlinks ##############################################
echo "Creating required symlinks"
# There are copies of a subset of the commands below installDir. We
# overwrite those with symlinks to the ones in binDir.
for file in $installDir/$effectiveTargetMachineTriple/bin/*; do
symlinkRelative -sfn $binDir/$(basename $file) $file
done
### Cleanup #################################################
echo "Cleanup"
# delete commands we aren't including
cd $binDir
for cmd in dlltool dllwrap windmc windres; do
rm -f $cmd
rm -f $installDir/$effectiveTargetMachineTriple/bin/$cmd
done
# delete man pages for commands that we aren't including
cd $manDir
for cmd in dlltool nlmconv windmc windres; do
rm -f man1/$cmd.1
done
}

View File

@@ -0,0 +1,676 @@
From b53fdd78959f52c2d28ae11a32462155ba2a0f2c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
Date: Sat, 5 Aug 2017 11:54:22 +0200
Subject: Haiku patch
diff --git a/bfd/config.bfd b/bfd/config.bfd
index b998830..a0699bb 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -367,7 +367,7 @@ case "${targ}" in
;;
arm-*-elf | arm*-*-freebsd* | arm*-*-linux-* | arm*-*-conix* | \
arm*-*-uclinux* | arm-*-kfreebsd*-gnu | \
- arm*-*-eabi* )
+ arm*-*-eabi* | arm*-*-haiku*)
targ_defvec=arm_elf32_le_vec
targ_selvecs=arm_elf32_be_vec
;;
@@ -718,6 +718,11 @@ case "${targ}" in
targ_selvecs="i386_elf32_vec iamcu_elf32_vec x86_64_elf32_vec i386_aout_linux_vec i386_pei_vec x86_64_pei_vec l1om_elf64_vec k1om_elf64_vec"
want64=true
;;
+ x86_64-*-haiku*)
+ targ_defvec=x86_64_elf64_vec
+ targ_selvecs="i386_elf32_vec"
+ want64=true
+ ;;
x86_64-*-nacl*)
targ_defvec=x86_64_elf32_nacl_vec
targ_selvecs="i386_elf32_nacl_vec x86_64_elf64_nacl_vec arm_elf32_nacl_be_vec arm_elf32_nacl_le_vec"
@@ -767,6 +772,9 @@ case "${targ}" in
targ_defvec=i386_elf32_vec
targ_selvecs="iamcu_elf32_vec i386_pe_vec i386_pei_vec"
;;
+ i[3-7]86-*-haiku*)
+ targ_defvec=i386_elf32_vec
+ ;;
i[3-7]86-*-interix*)
targ_defvec=i386_pei_vec
targ_selvecs="i386_pe_vec"
@@ -958,7 +966,10 @@ case "${targ}" in
targ_selvecs=ieee_vec
targ_underscore=yes
;;
-
+ m68*-*-haiku*)
+ targ_defvec=m68k_elf32_vec
+ targ_selvecs="m68k_coff_vec ieee_vec"
+ ;;
m88*-harris-cxux* | m88*-*-dgux* | m88*-*-sysv4*)
targ_defvec=m88k_elf32_vec
targ_selvecs=m88k_coff_bcs_vec
@@ -1014,6 +1025,10 @@ case "${targ}" in
targ_defvec=mips_elf32_trad_le_vec
targ_selvecs="mips_elf32_trad_be_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_le_vec mips_ecoff_be_vec"
;;
+ mips*el-*-haiku*)
+ targ_defvec=mips_elf32_le_vec
+ targ_selvecs="mips_elf32_be_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_le_vec mips_ecoff_be_vec"
+ ;;
mips*-*-netbsd*)
targ_defvec=mips_elf32_trad_be_vec
targ_selvecs="mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
@@ -1318,6 +1333,11 @@ case "${targ}" in
targ_selvecs="mach_o_be_vec mach_o_le_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec"
targ_archs="$targ_archs bfd_i386_arch"
;;
+ powerpc-*-haiku*)
+ targ_defvec=powerpc_elf32_vec
+ targ_selvecs="rs6000_xcoff_vec powerpc_elf32_le_vec pef_vec pef_xlib_vec powerpc_xcoff_vec powerpc_boot_vec"
+ targ_cflags=-D__HAIKU_TARGET__
+ ;;
powerpc-*-macos*)
targ_defvec=powerpc_xcoff_vec
;;
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 95ce1dc..682258b 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -10766,7 +10766,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
#define ELF_ARCH bfd_arch_powerpc
#define ELF_TARGET_ID PPC32_ELF_DATA
#define ELF_MACHINE_CODE EM_PPC
-#ifdef __QNXTARGET__
+#if defined(__QNXTARGET__) || defined(__HAIKU_TARGET__)
#define ELF_MAXPAGESIZE 0x1000
#define ELF_COMMONPAGESIZE 0x1000
#else
diff --git a/configure.ac b/configure.ac
index 8e02b12..b7407e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -335,7 +335,7 @@ case "${ENABLE_GOLD}" in
is_elf=no
case "${target}" in
*-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
- | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
+ | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* | *-*-haiku* \
| *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
| *-*-solaris2* | *-*-nto* | *-*-nacl*)
case "${target}" in
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 4ba05ba..4880efd 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -420,7 +420,8 @@ const char extra_symbol_chars[] = "*%-([{"
&& !defined (TE_NETWARE) \
&& !defined (TE_FreeBSD) \
&& !defined (TE_DragonFly) \
- && !defined (TE_NetBSD)))
+ && !defined (TE_NetBSD) \
+ && !defined (TE_BeOS)))
/* This array holds the chars that always start a comment. If the
pre-processor is disabled, these aren't very useful. The option
--divide will remove '/' from this list. */
diff --git a/gas/config/te-beos.h b/gas/config/te-beos.h
new file mode 100644
index 0000000..23eea6a
--- /dev/null
+++ b/gas/config/te-beos.h
@@ -0,0 +1,30 @@
+/* te-beos.h -- BeOS target environment declarations.
+ Copyright 2013 Free Software Foundation, Inc.
+
+ This file is part of GAS, the GNU Assembler.
+
+ GAS 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.
+
+ GAS 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 GAS; see the file COPYING. If not, write to
+ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+/* Target environment for BeOS/Haiku. It is the same as the generic
+ target, except that it arranges via the TE_BeOS define to
+ suppress the use of "/" as a comment character. Some code in the
+ haiku kernel uses "/" to mean division. (What a concept!) */
+#define TE_BeOS 1
+
+#define LOCAL_LABELS_DOLLAR 1
+#define LOCAL_LABELS_FB 1
+
+#include "obj-format.h"
diff --git a/gas/config/te-haiku.h b/gas/config/te-haiku.h
new file mode 100644
index 0000000..5578046
--- /dev/null
+++ b/gas/config/te-haiku.h
@@ -0,0 +1,30 @@
+/* te-haiku.h -- Haiku target environment declarations.
+ Copyright 2013 Free Software Foundation, Inc.
+
+ This file is part of GAS, the GNU Assembler.
+
+ GAS 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.
+
+ GAS 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 GAS; see the file COPYING. If not, write to
+ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+/* Target environment for BeOS/Haiku. It is the same as the generic
+ target, except that it arranges via the TE_BeOS define to
+ suppress the use of "/" as a comment character. Some code in the
+ haiku kernel uses "/" to mean division. (What a concept!) */
+#define TE_BeOS 1
+
+#define LOCAL_LABELS_DOLLAR 1
+#define LOCAL_LABELS_FB 1
+
+#include "obj-format.h"
diff --git a/gas/configure.tgt b/gas/configure.tgt
index e2df659..93e926d 100644
--- a/gas/configure.tgt
+++ b/gas/configure.tgt
@@ -159,6 +159,7 @@ case ${generic_target} in
fmt=coff em=wince-pe ;;
arm-*-pe) fmt=coff em=pe ;;
arm-*-riscix*) fmt=aout em=riscix ;;
+ arm-*-haiku*) fmt=elf em=haiku ;;
avr-*-*) fmt=elf bfd_gas=yes ;;
@@ -215,10 +216,11 @@ case ${generic_target} in
i386-ibm-aix*) fmt=coff em=i386aix ;;
i386-sequent-bsd*) fmt=aout em=dynix ;;
i386-*-beospe*) fmt=coff em=pe ;;
- i386-*-beos*) fmt=elf ;;
+ i386-*-beos*) fmt=elf em=beos ;;
i386-*-coff) fmt=coff ;;
i386-*-elfiamcu) fmt=elf arch=iamcu ;;
- i386-*-elf*) fmt=elf ;;
+ i386-*-elf) fmt=elf ;;
+ i386-*-haiku*) fmt=elf em=haiku ;;
i386-*-kaos*) fmt=elf ;;
i386-*-bsd*) fmt=aout em=386bsd ;;
i386-*-nacl*) fmt=elf em=nacl
@@ -320,6 +322,7 @@ case ${generic_target} in
m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
m68k-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
m68k-*-psos*) fmt=elf em=psos;;
+ m68k-*-haiku*) fmt=elf em=haiku ;;
mep-*-elf) fmt=elf ;;
@@ -342,6 +345,7 @@ case ${generic_target} in
mips-*-elf* | mips-*-rtems*) fmt=elf ;;
mips-*-netbsd*) fmt=elf em=tmips ;;
mips-*-openbsd*) fmt=elf em=tmips ;;
+ mips*-*-haiku*) fmt=elf endian=little em=haiku ;;
mmix-*-*) fmt=elf ;;
@@ -380,9 +384,10 @@ case ${generic_target} in
ppc-*-aix5.[01]) fmt=coff em=aix5 ;;
ppc-*-aix[5-9].*) fmt=coff em=aix5 ;;
ppc-*-aix*) fmt=coff em=aix ;;
- ppc-*-beos*) fmt=coff ;;
+ ppc-*-beos*) fmt=coff em=beos ;;
ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
+ ppc-*-haiku*) fmt=elf em=haiku ;;
ppc-*-linux-*) fmt=elf em=linux ;;
ppc-*-solaris*) fmt=elf em=solaris ;;
ppc-*-rtems*) fmt=elf ;;
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 0598923..b02941c 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -175,6 +175,7 @@ ALL_EMULATION_SOURCES = \
earmcoff.c \
earmelf.c \
earmelf_fbsd.c \
+ earmelf_haiku.c \
earmelf_linux.c \
earmelf_linux_eabi.c \
earmelf_nacl.c \
@@ -269,6 +270,7 @@ ALL_EMULATION_SOURCES = \
eelf32or1k_linux.c \
eelf32ppc.c \
eelf32ppc_fbsd.c \
+ eelf32ppchaiku.c \
eelf32ppclinux.c \
eelf32ppcnto.c \
eelf32ppcsim.c \
@@ -290,11 +292,13 @@ ALL_EMULATION_SOURCES = \
eelf_i386_be.c \
eelf_i386_chaos.c \
eelf_i386_fbsd.c \
+ eelf_i386_haiku.c \
eelf_i386_ldso.c \
eelf_i386_nacl.c \
eelf_i386_sol2.c \
eelf_i386_vxworks.c \
eelf_iamcu.c \
+ eelf_mipsel_haiku.c \
eelf_s390.c \
egld960.c \
egld960coff.c \
@@ -505,6 +509,7 @@ ALL_64_EMULATION_SOURCES = \
eelf_x86_64.c \
eelf_x86_64_cloudabi.c \
eelf_x86_64_fbsd.c \
+ eelf_x86_64_haiku.c \
eelf_x86_64_nacl.c \
eelf_x86_64_sol2.c \
ehppa64linux.c \
@@ -757,6 +762,10 @@ earmelf_fbsd.c: $(srcdir)/emulparams/armelf_fbsd.sh \
$(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+earmelf_haiku.c: $(srcdir)/emulparams/armelf_haiku.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \
$(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -1240,6 +1249,12 @@ eelf32ppc_fbsd.c: $(srcdir)/emulparams/elf32ppc_fbsd.sh \
$(srcdir)/emultempl/ppc32elf.em ldemul-list.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+eelf32ppchaiku.c: $(srcdir)/emulparams/elf32ppchaiku.sh \
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
+ $(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \
+ ldemul-list.h \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
eelf32ppclinux.c: $(srcdir)/emulparams/elf32ppclinux.sh \
$(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
$(srcdir)/emultempl/ppc32elf.em ldemul-list.h \
@@ -1322,6 +1337,9 @@ eelf_i386_fbsd.c: $(srcdir)/emulparams/elf_i386_fbsd.sh \
$(srcdir)/emulparams/elf_i386.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+eelf_i386_haiku.c: $(srcdir)/emulparams/elf_i386_haiku.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -1335,6 +1353,9 @@ 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}
@@ -2013,6 +2034,10 @@ 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 \
diff --git a/ld/configure.tgt b/ld/configure.tgt
index a3db909..6a4da5e 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -150,6 +150,7 @@ arm*-*-uclinux*) targ_emul=armelf_linux
;;
arm-*-vxworks) targ_emul=armelf_vxworks ;;
arm*-*-conix*) targ_emul=armelf ;;
+arm*-*-haiku*) targ_emul=armelf_haiku; targ_extra_emuls=armelf ;;
avr-*-*) targ_emul=avr2
targ_extra_emuls="avr1 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega1 avrxmega2 avrxmega3 avrxmega4 avrxmega5 avrxmega6 avrxmega7 avrtiny"
;;
@@ -372,6 +373,9 @@ i[3-7]86-*-interix*) targ_emul=i386pe_posix;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
i[3-7]86-*-beospe*) targ_emul=i386beos ;;
i[3-7]86-*-beos*) targ_emul=elf_i386_be ;;
+i[3-7]86-*-haiku*) targ_emul=elf_i386_haiku ;;
+x86_64-*-haiku*) targ_emul=elf_x86_64_haiku
+ targ_extra_emuls="elf_x86_64 elf_i386_haiku" ;;
i[3-7]86-*-vxworks*) targ_emul=elf_i386_vxworks ;;
i[3-7]86-*-chaos) targ_emul=elf_i386_chaos
;;
@@ -455,7 +459,9 @@ m68*-*-netbsdaout* | m68*-*-netbsd*)
targ_extra_emuls="m68kelfnbsd m68k4knbsd" ;;
m68*-*-psos*) targ_emul=m68kpsos ;;
m68*-*-rtemscoff*) targ_emul=m68kcoff ;;
-m68*-*-rtems*) targ_emul=m68kelf
+m68*-*-rtems*) targ_emul=m68kelf ;;
+m68*-*-haiku*) targ_emul=m68kelf
+ targ_extra_emuls=m68kcoff
;;
m8*-*-*) targ_emul=m88kbcs
;;
@@ -484,6 +490,9 @@ mips*-sgi-irix6*) targ_emul=elf32bmipn32
mips*el-*-netbsd*) targ_emul=elf32ltsmip
targ_extra_emuls="elf32btsmip elf64ltsmip elf64btsmip"
;;
+mips*el-*-haiku*) targ_emul=elf_mipsel_haiku
+ targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
+ ;;
mips*-*-netbsd*) targ_emul=elf32btsmip
targ_extra_emuls="elf32ltsmip elf64btsmip elf64ltsmip"
;;
@@ -642,6 +651,7 @@ powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin*)
powerpc-*-aix[5-9]*) targ_emul=aix5ppc ;;
powerpc-*-aix*) targ_emul=aixppc ;;
powerpc-*-beos*) targ_emul=aixppc ;;
+powerpc-*-haiku*) targ_emul=elf32ppchaiku ;;
powerpc-*-windiss*) targ_emul=elf32ppcwindiss ;;
powerpc-*-lynxos*) targ_emul=ppclynx ;;
rs6000-*-aix[5-9]*) targ_emul=aix5rs6 ;;
diff --git a/ld/emulparams/armelf_haiku.sh b/ld/emulparams/armelf_haiku.sh
new file mode 100644
index 0000000..9dcdf54
--- /dev/null
+++ b/ld/emulparams/armelf_haiku.sh
@@ -0,0 +1,26 @@
+ARCH=arm
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-littlearm"
+BIG_OUTPUT_FORMAT="elf32-bigarm"
+LITTLE_OUTPUT_FORMAT="elf32-littlearm"
+MAXPAGESIZE=0x8000
+COMMONPAGESIZE=0x1000
+TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=armelf
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
+
+DATA_START_SYMBOLS='__data_start = . ;';
+OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)'
+OTHER_BSS_SYMBOLS='__bss_start__ = .;'
+OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;'
+OTHER_END_SYMBOLS='__end__ = . ;'
+OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
+
+TEXT_START_ADDR=0x00008000
+TARGET2_TYPE=got-rel
+
+# ARM does not support .s* sections.
+NO_SMALL_DATA=yes
+
+. ${srcdir}/emulparams/elf_haiku.sh
diff --git a/ld/emulparams/elf32ppchaiku.sh b/ld/emulparams/elf32ppchaiku.sh
new file mode 100644
index 0000000..547e5c8
--- /dev/null
+++ b/ld/emulparams/elf32ppchaiku.sh
@@ -0,0 +1,7 @@
+. ${srcdir}/emulparams/elf32ppc.sh
+. ${srcdir}/emulparams/elf_haiku.sh
+TEXT_START_ADDR=0x200000
+MAXPAGESIZE=0x1000
+GENERATE_SHLIB_SCRIPT=yes
+BSS_PLT=
+LIBPATH_SUFFIX=
diff --git a/ld/emulparams/elf_haiku.sh b/ld/emulparams/elf_haiku.sh
new file mode 100644
index 0000000..401eedc
--- /dev/null
+++ b/ld/emulparams/elf_haiku.sh
@@ -0,0 +1 @@
+ELF_INTERPRETER_NAME=\"/system/runtime_loader\"
diff --git a/ld/emulparams/elf_i386_haiku.sh b/ld/emulparams/elf_i386_haiku.sh
new file mode 100644
index 0000000..b70da86
--- /dev/null
+++ b/ld/emulparams/elf_i386_haiku.sh
@@ -0,0 +1,12 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-i386"
+TEXT_START_ADDR=0x200000
+NONPAGED_TEXT_START_ADDR=0x200000
+MAXPAGESIZE=0x1000
+ARCH=i386
+MACHINE=
+NOP=0x90909090
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+NO_SMALL_DATA=yes
+. ${srcdir}/emulparams/elf_haiku.sh
diff --git a/ld/emulparams/elf_mipsel_haiku.sh b/ld/emulparams/elf_mipsel_haiku.sh
new file mode 100644
index 0000000..ab38e23
--- /dev/null
+++ b/ld/emulparams/elf_mipsel_haiku.sh
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/elf32lmip.sh
+. ${srcdir}/emulparams/elf_haiku.sh
+
diff --git a/ld/emulparams/elf_x86_64_haiku.sh b/ld/emulparams/elf_x86_64_haiku.sh
new file mode 100644
index 0000000..f049559
--- /dev/null
+++ b/ld/emulparams/elf_x86_64_haiku.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/elf_x86_64.sh
+. ${srcdir}/emulparams/elf_haiku.sh
diff --git a/libtool.m4 b/libtool.m4
index 24d13f3..84d70b8 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -2342,7 +2342,7 @@ haiku*)
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
--
2.13.1
From 4a1925b857b1fb1e48480c6e0f20add37aaf7040 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
Date: Sat, 5 Aug 2017 12:27:13 +0200
Subject: Haiku: regenerate configure and Makefile.in.
diff --git a/binutils/configure b/binutils/configure
index ea013d1..36d3aed 100755
--- a/binutils/configure
+++ b/binutils/configure
@@ -10429,7 +10429,7 @@ haiku*)
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
diff --git a/gprof/configure b/gprof/configure
index 4c17248..63d73e7 100755
--- a/gprof/configure
+++ b/gprof/configure
@@ -10105,7 +10105,7 @@ haiku*)
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 7c78198..0c2657e 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -543,6 +543,7 @@ ALL_EMULATION_SOURCES = \
earmcoff.c \
earmelf.c \
earmelf_fbsd.c \
+ earmelf_haiku.c \
earmelf_linux.c \
earmelf_linux_eabi.c \
earmelf_nacl.c \
@@ -637,6 +638,7 @@ ALL_EMULATION_SOURCES = \
eelf32or1k_linux.c \
eelf32ppc.c \
eelf32ppc_fbsd.c \
+ eelf32ppchaiku.c \
eelf32ppclinux.c \
eelf32ppcnto.c \
eelf32ppcsim.c \
@@ -658,11 +660,13 @@ ALL_EMULATION_SOURCES = \
eelf_i386_be.c \
eelf_i386_chaos.c \
eelf_i386_fbsd.c \
+ eelf_i386_haiku.c \
eelf_i386_ldso.c \
eelf_i386_nacl.c \
eelf_i386_sol2.c \
eelf_i386_vxworks.c \
eelf_iamcu.c \
+ eelf_mipsel_haiku.c \
eelf_s390.c \
egld960.c \
egld960coff.c \
@@ -872,6 +876,7 @@ ALL_64_EMULATION_SOURCES = \
eelf_x86_64.c \
eelf_x86_64_cloudabi.c \
eelf_x86_64_fbsd.c \
+ eelf_x86_64_haiku.c \
eelf_x86_64_nacl.c \
eelf_x86_64_sol2.c \
ehppa64linux.c \
@@ -1180,6 +1185,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmcoff.Po@am__quote@
@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_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_nacl.Po@am__quote@
@@ -1297,6 +1303,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@
@@ -1342,6 +1349,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@
@@ -1351,10 +1359,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)/egld960.Po@am__quote@
@@ -2345,6 +2355,10 @@ earmelf_fbsd.c: $(srcdir)/emulparams/armelf_fbsd.sh \
$(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+earmelf_haiku.c: $(srcdir)/emulparams/armelf_haiku.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \
$(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -2828,6 +2842,12 @@ eelf32ppc_fbsd.c: $(srcdir)/emulparams/elf32ppc_fbsd.sh \
$(srcdir)/emultempl/ppc32elf.em ldemul-list.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+eelf32ppchaiku.c: $(srcdir)/emulparams/elf32ppchaiku.sh \
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
+ $(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \
+ ldemul-list.h \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
eelf32ppclinux.c: $(srcdir)/emulparams/elf32ppclinux.sh \
$(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
$(srcdir)/emultempl/ppc32elf.em ldemul-list.h \
@@ -2910,6 +2930,9 @@ eelf_i386_fbsd.c: $(srcdir)/emulparams/elf_i386_fbsd.sh \
$(srcdir)/emulparams/elf_i386.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+eelf_i386_haiku.c: $(srcdir)/emulparams/elf_i386_haiku.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -2923,6 +2946,9 @@ 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}
@@ -3601,6 +3627,10 @@ 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 \
diff --git a/opcodes/configure b/opcodes/configure
index 5a4da06..b7cb0c3 100755
--- a/opcodes/configure
+++ b/opcodes/configure
@@ -10354,7 +10354,7 @@ haiku*)
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
--
2.13.1

View File

@@ -0,0 +1,702 @@
From 9fe7ea465a5ca2715a2f90a91784192ef44a352e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
Date: Sat, 5 Aug 2017 11:54:22 +0200
Subject: Haiku patch
diff --git a/bfd/config.bfd b/bfd/config.bfd
index c031216..ee202b2 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -449,7 +449,7 @@ case "${targ}" in
;;
arm-*-elf | arm*-*-freebsd* | arm*-*-linux-* | arm*-*-conix* | \
arm*-*-uclinux* | arm-*-kfreebsd*-gnu | \
- arm*-*-eabi* )
+ arm*-*-eabi* | arm*-*-haiku*)
targ_defvec=arm_elf32_le_vec
targ_selvecs=arm_elf32_be_vec
;;
@@ -800,6 +800,11 @@ case "${targ}" in
targ_selvecs="i386_elf32_vec iamcu_elf32_vec x86_64_elf32_vec i386_aout_linux_vec i386_pei_vec x86_64_pei_vec l1om_elf64_vec k1om_elf64_vec"
want64=true
;;
+ x86_64-*-haiku*)
+ targ_defvec=x86_64_elf64_vec
+ targ_selvecs="i386_elf32_vec"
+ want64=true
+ ;;
x86_64-*-nacl*)
targ_defvec=x86_64_elf32_nacl_vec
targ_selvecs="i386_elf32_nacl_vec x86_64_elf64_nacl_vec arm_elf32_nacl_be_vec arm_elf32_nacl_le_vec"
@@ -849,6 +854,9 @@ case "${targ}" in
targ_defvec=i386_elf32_vec
targ_selvecs="iamcu_elf32_vec i386_pe_vec i386_pei_vec"
;;
+ i[3-7]86-*-haiku*)
+ targ_defvec=i386_elf32_vec
+ ;;
i[3-7]86-*-interix*)
targ_defvec=i386_pei_vec
targ_selvecs="i386_pe_vec"
@@ -1040,7 +1048,10 @@ case "${targ}" in
targ_selvecs=ieee_vec
targ_underscore=yes
;;
-
+ m68*-*-haiku*)
+ targ_defvec=m68k_elf32_vec
+ targ_selvecs="m68k_coff_vec ieee_vec"
+ ;;
m88*-harris-cxux* | m88*-*-dgux* | m88*-*-sysv4*)
targ_defvec=m88k_elf32_vec
targ_selvecs=m88k_coff_bcs_vec
@@ -1096,6 +1107,10 @@ case "${targ}" in
targ_defvec=mips_elf32_trad_le_vec
targ_selvecs="mips_elf32_trad_be_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_le_vec mips_ecoff_be_vec"
;;
+ mips*el-*-haiku*)
+ targ_defvec=mips_elf32_le_vec
+ targ_selvecs="mips_elf32_be_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_le_vec mips_ecoff_be_vec"
+ ;;
mips*-*-netbsd*)
targ_defvec=mips_elf32_trad_be_vec
targ_selvecs="mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
@@ -1400,6 +1415,11 @@ case "${targ}" in
targ_selvecs="mach_o_be_vec mach_o_le_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec"
targ_archs="$targ_archs bfd_i386_arch"
;;
+ powerpc-*-haiku*)
+ targ_defvec=powerpc_elf32_vec
+ targ_selvecs="rs6000_xcoff_vec powerpc_elf32_le_vec pef_vec pef_xlib_vec powerpc_xcoff_vec powerpc_boot_vec"
+ targ_cflags=-D__HAIKU_TARGET__
+ ;;
powerpc-*-macos*)
targ_defvec=powerpc_xcoff_vec
;;
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 10caa8a..cc41774 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -10886,7 +10886,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
#define ELF_ARCH bfd_arch_powerpc
#define ELF_TARGET_ID PPC32_ELF_DATA
#define ELF_MACHINE_CODE EM_PPC
-#ifdef __QNXTARGET__
+#if defined(__QNXTARGET__) || defined(__HAIKU_TARGET__)
#define ELF_MAXPAGESIZE 0x1000
#define ELF_COMMONPAGESIZE 0x1000
#else
diff --git a/configure.ac b/configure.ac
index 7a87f17..9357476 100644
--- a/configure.ac
+++ b/configure.ac
@@ -335,7 +335,7 @@ case "${ENABLE_GOLD}" in
is_elf=no
case "${target}" in
*-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
- | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
+ | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* | *-*-haiku* \
| *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
| *-*-solaris2* | *-*-nto* | *-*-nacl* | *-*-fuchsia*)
case "${target}" in
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 80812cf..078245d 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -420,7 +420,8 @@ const char extra_symbol_chars[] = "*%-([{"
&& !defined (TE_NETWARE) \
&& !defined (TE_FreeBSD) \
&& !defined (TE_DragonFly) \
- && !defined (TE_NetBSD)))
+ && !defined (TE_NetBSD) \
+ && !defined (TE_BeOS)))
/* This array holds the chars that always start a comment. If the
pre-processor is disabled, these aren't very useful. The option
--divide will remove '/' from this list. */
diff --git a/gas/config/te-beos.h b/gas/config/te-beos.h
new file mode 100644
index 0000000..23eea6a
--- /dev/null
+++ b/gas/config/te-beos.h
@@ -0,0 +1,30 @@
+/* te-beos.h -- BeOS target environment declarations.
+ Copyright 2013 Free Software Foundation, Inc.
+
+ This file is part of GAS, the GNU Assembler.
+
+ GAS 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.
+
+ GAS 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 GAS; see the file COPYING. If not, write to
+ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+/* Target environment for BeOS/Haiku. It is the same as the generic
+ target, except that it arranges via the TE_BeOS define to
+ suppress the use of "/" as a comment character. Some code in the
+ haiku kernel uses "/" to mean division. (What a concept!) */
+#define TE_BeOS 1
+
+#define LOCAL_LABELS_DOLLAR 1
+#define LOCAL_LABELS_FB 1
+
+#include "obj-format.h"
diff --git a/gas/config/te-haiku.h b/gas/config/te-haiku.h
new file mode 100644
index 0000000..5578046
--- /dev/null
+++ b/gas/config/te-haiku.h
@@ -0,0 +1,30 @@
+/* te-haiku.h -- Haiku target environment declarations.
+ Copyright 2013 Free Software Foundation, Inc.
+
+ This file is part of GAS, the GNU Assembler.
+
+ GAS 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.
+
+ GAS 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 GAS; see the file COPYING. If not, write to
+ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+/* Target environment for BeOS/Haiku. It is the same as the generic
+ target, except that it arranges via the TE_BeOS define to
+ suppress the use of "/" as a comment character. Some code in the
+ haiku kernel uses "/" to mean division. (What a concept!) */
+#define TE_BeOS 1
+
+#define LOCAL_LABELS_DOLLAR 1
+#define LOCAL_LABELS_FB 1
+
+#include "obj-format.h"
diff --git a/gas/configure.tgt b/gas/configure.tgt
index 711d537..cfa330e 100644
--- a/gas/configure.tgt
+++ b/gas/configure.tgt
@@ -163,6 +163,7 @@ case ${generic_target} in
arm-*-pe) fmt=coff em=pe ;;
arm-*-riscix*) fmt=aout em=riscix ;;
arm-*-fuchsia*) fmt=elf ;;
+ arm-*-haiku*) fmt=elf em=haiku ;;
avr-*-*) fmt=elf bfd_gas=yes ;;
@@ -219,11 +220,12 @@ case ${generic_target} in
i386-ibm-aix*) fmt=coff em=i386aix ;;
i386-sequent-bsd*) fmt=aout em=dynix ;;
i386-*-beospe*) fmt=coff em=pe ;;
- i386-*-beos*) fmt=elf ;;
+ i386-*-beos*) fmt=elf em=beos ;;
i386-*-coff) fmt=coff ;;
i386-*-elfiamcu) fmt=elf arch=iamcu ;;
i386-*-elf*) fmt=elf ;;
i386-*-fuchsia*) fmt=elf ;;
+ i386-*-haiku*) fmt=elf em=haiku ;;
i386-*-kaos*) fmt=elf ;;
i386-*-bsd*) fmt=aout em=386bsd ;;
i386-*-nacl*) fmt=elf em=nacl
@@ -325,6 +327,7 @@ case ${generic_target} in
m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
m68k-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
m68k-*-psos*) fmt=elf em=psos;;
+ m68k-*-haiku*) fmt=elf em=haiku ;;
mep-*-elf) fmt=elf ;;
@@ -347,6 +350,7 @@ case ${generic_target} in
mips-*-elf* | mips-*-rtems*) fmt=elf ;;
mips-*-netbsd*) fmt=elf em=tmips ;;
mips-*-openbsd*) fmt=elf em=tmips ;;
+ mips*-*-haiku*) fmt=elf endian=little em=haiku ;;
mmix-*-*) fmt=elf ;;
@@ -385,9 +389,10 @@ case ${generic_target} in
ppc-*-aix5.[01]) fmt=coff em=aix5 ;;
ppc-*-aix[5-9].*) fmt=coff em=aix5 ;;
ppc-*-aix*) fmt=coff em=aix ;;
- ppc-*-beos*) fmt=coff ;;
+ ppc-*-beos*) fmt=coff em=beos ;;
ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
+ ppc-*-haiku*) fmt=elf em=haiku ;;
ppc-*-linux-*) fmt=elf em=linux ;;
ppc-*-solaris*) fmt=elf em=solaris ;;
ppc-*-rtems*) fmt=elf ;;
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 15beaa7..559800d 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -180,6 +180,7 @@ ALL_EMULATION_SOURCES = \
earmelf.c \
earmelf_fbsd.c \
earmelf_fuchsia.c \
+ earmelf_haiku.c \
earmelf_linux.c \
earmelf_linux_eabi.c \
earmelf_nacl.c \
@@ -275,6 +276,7 @@ ALL_EMULATION_SOURCES = \
eelf32or1k_linux.c \
eelf32ppc.c \
eelf32ppc_fbsd.c \
+ eelf32ppchaiku.c \
eelf32ppclinux.c \
eelf32ppcnto.c \
eelf32ppcsim.c \
@@ -297,11 +299,13 @@ ALL_EMULATION_SOURCES = \
eelf_i386_be.c \
eelf_i386_chaos.c \
eelf_i386_fbsd.c \
+ eelf_i386_haiku.c \
eelf_i386_ldso.c \
eelf_i386_nacl.c \
eelf_i386_sol2.c \
eelf_i386_vxworks.c \
eelf_iamcu.c \
+ eelf_mipsel_haiku.c \
eelf_s390.c \
egld960.c \
egld960coff.c \
@@ -513,6 +517,7 @@ ALL_64_EMULATION_SOURCES = \
eelf_x86_64.c \
eelf_x86_64_cloudabi.c \
eelf_x86_64_fbsd.c \
+ eelf_x86_64_haiku.c \
eelf_x86_64_nacl.c \
eelf_x86_64_sol2.c \
ehppa64linux.c \
@@ -769,6 +774,10 @@ earmelf_fuchsia.c: $(srcdir)/emulparams/armelf_fuchsia.sh \
$(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+earmelf_haiku.c: $(srcdir)/emulparams/armelf_haiku.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \
$(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -1261,6 +1270,12 @@ eelf32ppc_fbsd.c: $(srcdir)/emulparams/elf32ppc_fbsd.sh \
$(srcdir)/emultempl/ppc32elf.em ldemul-list.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+eelf32ppchaiku.c: $(srcdir)/emulparams/elf32ppchaiku.sh \
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
+ $(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \
+ ldemul-list.h \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
eelf32ppclinux.c: $(srcdir)/emulparams/elf32ppclinux.sh \
$(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
$(srcdir)/emultempl/ppc32elf.em ldemul-list.h \
@@ -1343,6 +1358,9 @@ eelf_i386_fbsd.c: $(srcdir)/emulparams/elf_i386_fbsd.sh \
$(srcdir)/emulparams/elf_i386.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+eelf_i386_haiku.c: $(srcdir)/emulparams/elf_i386_haiku.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -1356,6 +1374,9 @@ 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}
@@ -2040,6 +2061,10 @@ 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 \
diff --git a/ld/configure.tgt b/ld/configure.tgt
index b85c6bb..30b35af 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -155,6 +155,7 @@ arm*-*-conix*) targ_emul=armelf ;;
arm*-*-fuchsia*) targ_emul=armelf_fuchsia
targ_extra_emuls="armelfb_fuchsia armelf armelfb"
;;
+arm*-*-haiku*) targ_emul=armelf_haiku; targ_extra_emuls=armelf ;;
avr-*-*) targ_emul=avr2
targ_extra_emuls="avr1 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega1 avrxmega2 avrxmega3 avrxmega4 avrxmega5 avrxmega6 avrxmega7 avrtiny"
;;
@@ -377,6 +378,9 @@ i[3-7]86-*-interix*) targ_emul=i386pe_posix;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
i[3-7]86-*-beospe*) targ_emul=i386beos ;;
i[3-7]86-*-beos*) targ_emul=elf_i386_be ;;
+i[3-7]86-*-haiku*) targ_emul=elf_i386_haiku ;;
+x86_64-*-haiku*) targ_emul=elf_x86_64_haiku
+ targ_extra_emuls="elf_x86_64 elf_i386_haiku" ;;
i[3-7]86-*-vxworks*) targ_emul=elf_i386_vxworks ;;
i[3-7]86-*-chaos) targ_emul=elf_i386_chaos
;;
@@ -460,7 +464,9 @@ m68*-*-netbsdaout* | m68*-*-netbsd*)
targ_extra_emuls="m68kelfnbsd m68k4knbsd" ;;
m68*-*-psos*) targ_emul=m68kpsos ;;
m68*-*-rtemscoff*) targ_emul=m68kcoff ;;
-m68*-*-rtems*) targ_emul=m68kelf
+m68*-*-rtems*) targ_emul=m68kelf ;;
+m68*-*-haiku*) targ_emul=m68kelf
+ targ_extra_emuls=m68kcoff
;;
m8*-*-*) targ_emul=m88kbcs
;;
@@ -489,6 +495,9 @@ mips*-sgi-irix6*) targ_emul=elf32bmipn32
mips*el-*-netbsd*) targ_emul=elf32ltsmip
targ_extra_emuls="elf32btsmip elf64ltsmip elf64btsmip"
;;
+mips*el-*-haiku*) targ_emul=elf_mipsel_haiku
+ targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
+ ;;
mips*-*-netbsd*) targ_emul=elf32btsmip
targ_extra_emuls="elf32ltsmip elf64btsmip elf64ltsmip"
;;
@@ -682,6 +691,7 @@ powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin*)
powerpc-*-aix[5-9]*) targ_emul=aix5ppc ;;
powerpc-*-aix*) targ_emul=aixppc ;;
powerpc-*-beos*) targ_emul=aixppc ;;
+powerpc-*-haiku*) targ_emul=elf32ppchaiku ;;
powerpc-*-windiss*) targ_emul=elf32ppcwindiss ;;
powerpc-*-lynxos*) targ_emul=ppclynx ;;
riscv32*-*-*) targ_emul=elf32lriscv
diff --git a/ld/emulparams/armelf_haiku.sh b/ld/emulparams/armelf_haiku.sh
new file mode 100644
index 0000000..9dcdf54
--- /dev/null
+++ b/ld/emulparams/armelf_haiku.sh
@@ -0,0 +1,26 @@
+ARCH=arm
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-littlearm"
+BIG_OUTPUT_FORMAT="elf32-bigarm"
+LITTLE_OUTPUT_FORMAT="elf32-littlearm"
+MAXPAGESIZE=0x8000
+COMMONPAGESIZE=0x1000
+TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=armelf
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
+
+DATA_START_SYMBOLS='__data_start = . ;';
+OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)'
+OTHER_BSS_SYMBOLS='__bss_start__ = .;'
+OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;'
+OTHER_END_SYMBOLS='__end__ = . ;'
+OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
+
+TEXT_START_ADDR=0x00008000
+TARGET2_TYPE=got-rel
+
+# ARM does not support .s* sections.
+NO_SMALL_DATA=yes
+
+. ${srcdir}/emulparams/elf_haiku.sh
diff --git a/ld/emulparams/elf32ppchaiku.sh b/ld/emulparams/elf32ppchaiku.sh
new file mode 100644
index 0000000..547e5c8
--- /dev/null
+++ b/ld/emulparams/elf32ppchaiku.sh
@@ -0,0 +1,7 @@
+. ${srcdir}/emulparams/elf32ppc.sh
+. ${srcdir}/emulparams/elf_haiku.sh
+TEXT_START_ADDR=0x200000
+MAXPAGESIZE=0x1000
+GENERATE_SHLIB_SCRIPT=yes
+BSS_PLT=
+LIBPATH_SUFFIX=
diff --git a/ld/emulparams/elf_haiku.sh b/ld/emulparams/elf_haiku.sh
new file mode 100644
index 0000000..401eedc
--- /dev/null
+++ b/ld/emulparams/elf_haiku.sh
@@ -0,0 +1 @@
+ELF_INTERPRETER_NAME=\"/system/runtime_loader\"
diff --git a/ld/emulparams/elf_i386_haiku.sh b/ld/emulparams/elf_i386_haiku.sh
new file mode 100644
index 0000000..b70da86
--- /dev/null
+++ b/ld/emulparams/elf_i386_haiku.sh
@@ -0,0 +1,12 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-i386"
+TEXT_START_ADDR=0x200000
+NONPAGED_TEXT_START_ADDR=0x200000
+MAXPAGESIZE=0x1000
+ARCH=i386
+MACHINE=
+NOP=0x90909090
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+NO_SMALL_DATA=yes
+. ${srcdir}/emulparams/elf_haiku.sh
diff --git a/ld/emulparams/elf_mipsel_haiku.sh b/ld/emulparams/elf_mipsel_haiku.sh
new file mode 100644
index 0000000..ab38e23
--- /dev/null
+++ b/ld/emulparams/elf_mipsel_haiku.sh
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/elf32lmip.sh
+. ${srcdir}/emulparams/elf_haiku.sh
+
diff --git a/ld/emulparams/elf_x86_64_haiku.sh b/ld/emulparams/elf_x86_64_haiku.sh
new file mode 100644
index 0000000..f049559
--- /dev/null
+++ b/ld/emulparams/elf_x86_64_haiku.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/elf_x86_64.sh
+. ${srcdir}/emulparams/elf_haiku.sh
diff --git a/libtool.m4 b/libtool.m4
index 24d13f3..84d70b8 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -2342,7 +2342,7 @@ haiku*)
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
--
2.13.1
From cc4c78e10331c30afd91bd80f2ffc63731b4084b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
Date: Sat, 5 Aug 2017 12:34:41 +0200
Subject: Haiku: regenerate configure and Makefile.in.
diff --git a/bfd/configure b/bfd/configure
index 48d2bde..d9266b8 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -10632,7 +10632,7 @@ haiku*)
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
diff --git a/binutils/configure b/binutils/configure
index 2032de1..858bbdc 100755
--- a/binutils/configure
+++ b/binutils/configure
@@ -10430,7 +10430,7 @@ haiku*)
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
diff --git a/configure b/configure
index f6d12b8..d62e1ef 100755
--- a/configure
+++ b/configure
@@ -2957,7 +2957,7 @@ case "${ENABLE_GOLD}" in
is_elf=no
case "${target}" in
*-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
- | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
+ | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* | *-*-haiku* \
| *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
| *-*-solaris2* | *-*-nto* | *-*-nacl* | *-*-fuchsia*)
case "${target}" in
diff --git a/gas/configure b/gas/configure
index 5aa6dcb..87d36ca 100755
--- a/gas/configure
+++ b/gas/configure
@@ -10191,7 +10191,7 @@ haiku*)
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 042b690..9110faa 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -549,6 +549,7 @@ ALL_EMULATION_SOURCES = \
earmelf.c \
earmelf_fbsd.c \
earmelf_fuchsia.c \
+ earmelf_haiku.c \
earmelf_linux.c \
earmelf_linux_eabi.c \
earmelf_nacl.c \
@@ -644,6 +645,7 @@ ALL_EMULATION_SOURCES = \
eelf32or1k_linux.c \
eelf32ppc.c \
eelf32ppc_fbsd.c \
+ eelf32ppchaiku.c \
eelf32ppclinux.c \
eelf32ppcnto.c \
eelf32ppcsim.c \
@@ -666,11 +668,13 @@ ALL_EMULATION_SOURCES = \
eelf_i386_be.c \
eelf_i386_chaos.c \
eelf_i386_fbsd.c \
+ eelf_i386_haiku.c \
eelf_i386_ldso.c \
eelf_i386_nacl.c \
eelf_i386_sol2.c \
eelf_i386_vxworks.c \
eelf_iamcu.c \
+ eelf_mipsel_haiku.c \
eelf_s390.c \
egld960.c \
egld960coff.c \
@@ -881,6 +885,7 @@ ALL_64_EMULATION_SOURCES = \
eelf_x86_64.c \
eelf_x86_64_cloudabi.c \
eelf_x86_64_fbsd.c \
+ eelf_x86_64_haiku.c \
eelf_x86_64_nacl.c \
eelf_x86_64_sol2.c \
ehppa64linux.c \
@@ -1190,6 +1195,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_nacl.Po@am__quote@
@@ -1309,6 +1315,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@
@@ -1355,6 +1362,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@
@@ -1364,10 +1372,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)/egld960.Po@am__quote@
@@ -2362,6 +2372,10 @@ earmelf_fuchsia.c: $(srcdir)/emulparams/armelf_fuchsia.sh \
$(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+earmelf_haiku.c: $(srcdir)/emulparams/armelf_haiku.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \
$(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -2854,6 +2868,12 @@ eelf32ppc_fbsd.c: $(srcdir)/emulparams/elf32ppc_fbsd.sh \
$(srcdir)/emultempl/ppc32elf.em ldemul-list.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+eelf32ppchaiku.c: $(srcdir)/emulparams/elf32ppchaiku.sh \
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
+ $(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \
+ ldemul-list.h \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
eelf32ppclinux.c: $(srcdir)/emulparams/elf32ppclinux.sh \
$(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
$(srcdir)/emultempl/ppc32elf.em ldemul-list.h \
@@ -2936,6 +2956,9 @@ eelf_i386_fbsd.c: $(srcdir)/emulparams/elf_i386_fbsd.sh \
$(srcdir)/emulparams/elf_i386.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+eelf_i386_haiku.c: $(srcdir)/emulparams/elf_i386_haiku.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -2949,6 +2972,9 @@ 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}
@@ -3633,6 +3659,10 @@ 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 \
diff --git a/opcodes/configure b/opcodes/configure
index a1c7cd0..aec2bac 100755
--- a/opcodes/configure
+++ b/opcodes/configure
@@ -10355,7 +10355,7 @@ haiku*)
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
--
2.13.1

View File

@@ -0,0 +1,700 @@
From 15be9c95677ad5c5e7dd287d8c261407e21845ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
Date: Sat, 5 Aug 2017 11:54:22 +0200
Subject: Haiku patch
diff --git a/bfd/config.bfd b/bfd/config.bfd
index dc24aab..4e09a6c 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -444,7 +444,7 @@ case "${targ}" in
;;
arm-*-elf | arm*-*-freebsd* | arm*-*-linux-* | arm*-*-conix* | \
arm*-*-uclinux* | arm-*-kfreebsd*-gnu | \
- arm*-*-eabi* | arm-*-rtems*)
+ arm*-*-eabi* | arm-*-rtems | arm*-*-haiku*)
targ_defvec=arm_elf32_le_vec
targ_selvecs=arm_elf32_be_vec
;;
@@ -795,6 +795,11 @@ case "${targ}" in
targ_selvecs="i386_elf32_vec iamcu_elf32_vec x86_64_elf32_vec i386_aout_linux_vec i386_pei_vec x86_64_pei_vec l1om_elf64_vec k1om_elf64_vec"
want64=true
;;
+ x86_64-*-haiku*)
+ targ_defvec=x86_64_elf64_vec
+ targ_selvecs="i386_elf32_vec"
+ want64=true
+ ;;
x86_64-*-nacl*)
targ_defvec=x86_64_elf32_nacl_vec
targ_selvecs="i386_elf32_nacl_vec x86_64_elf64_nacl_vec arm_elf32_nacl_be_vec arm_elf32_nacl_le_vec"
@@ -849,6 +854,9 @@ case "${targ}" in
targ_defvec=i386_elf32_vec
targ_selvecs="iamcu_elf32_vec i386_pe_vec i386_pei_vec"
;;
+ i[3-7]86-*-haiku*)
+ targ_defvec=i386_elf32_vec
+ ;;
i[3-7]86-*-interix*)
targ_defvec=i386_pei_vec
targ_selvecs="i386_pe_vec"
@@ -1043,7 +1051,10 @@ case "${targ}" in
targ_selvecs=ieee_vec
targ_underscore=yes
;;
-
+ m68*-*-haiku*)
+ targ_defvec=m68k_elf32_vec
+ targ_selvecs="m68k_coff_vec ieee_vec"
+ ;;
m88*-harris-cxux* | m88*-*-dgux* | m88*-*-sysv4*)
targ_defvec=m88k_elf32_vec
targ_selvecs=m88k_coff_bcs_vec
@@ -1099,6 +1110,10 @@ case "${targ}" in
targ_defvec=mips_elf32_trad_le_vec
targ_selvecs="mips_elf32_trad_be_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_le_vec mips_ecoff_be_vec"
;;
+ mips*el-*-haiku*)
+ targ_defvec=mips_elf32_le_vec
+ targ_selvecs="mips_elf32_be_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_le_vec mips_ecoff_be_vec"
+ ;;
mips*-*-netbsd*)
targ_defvec=mips_elf32_trad_be_vec
targ_selvecs="mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
@@ -1404,6 +1419,11 @@ case "${targ}" in
targ_selvecs="mach_o_be_vec mach_o_le_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec"
targ_archs="$targ_archs bfd_i386_arch"
;;
+ powerpc-*-haiku*)
+ targ_defvec=powerpc_elf32_vec
+ targ_selvecs="rs6000_xcoff_vec powerpc_elf32_le_vec pef_vec pef_xlib_vec powerpc_xcoff_vec powerpc_boot_vec"
+ targ_cflags=-D__HAIKU_TARGET__
+ ;;
powerpc-*-macos*)
targ_defvec=powerpc_xcoff_vec
;;
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 8a00fb4..dd64d75 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -10892,7 +10892,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
#define ELF_ARCH bfd_arch_powerpc
#define ELF_TARGET_ID PPC32_ELF_DATA
#define ELF_MACHINE_CODE EM_PPC
-#ifdef __QNXTARGET__
+#if defined(__QNXTARGET__) || defined(__HAIKU_TARGET__)
#define ELF_MAXPAGESIZE 0x1000
#define ELF_COMMONPAGESIZE 0x1000
#else
diff --git a/configure.ac b/configure.ac
index c59e75c..a0c1443 100644
--- a/configure.ac
+++ b/configure.ac
@@ -329,7 +329,7 @@ case "${ENABLE_GOLD}" in
is_elf=no
case "${target}" in
*-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
- | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
+ | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* | *-*-haiku* \
| *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
| *-*-solaris2* | *-*-nto* | *-*-nacl* | *-*-fuchsia*)
case "${target}" in
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 456be9e..79d8bd7 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -437,7 +437,8 @@ const char extra_symbol_chars[] = "*%-([{}"
&& !defined (TE_NETWARE) \
&& !defined (TE_FreeBSD) \
&& !defined (TE_DragonFly) \
- && !defined (TE_NetBSD)))
+ && !defined (TE_NetBSD) \
+ && !defined (TE_BeOS)))
/* This array holds the chars that always start a comment. If the
pre-processor is disabled, these aren't very useful. The option
--divide will remove '/' from this list. */
diff --git a/gas/config/te-beos.h b/gas/config/te-beos.h
new file mode 100644
index 0000000..23eea6a
--- /dev/null
+++ b/gas/config/te-beos.h
@@ -0,0 +1,30 @@
+/* te-beos.h -- BeOS target environment declarations.
+ Copyright 2013 Free Software Foundation, Inc.
+
+ This file is part of GAS, the GNU Assembler.
+
+ GAS 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.
+
+ GAS 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 GAS; see the file COPYING. If not, write to
+ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+/* Target environment for BeOS/Haiku. It is the same as the generic
+ target, except that it arranges via the TE_BeOS define to
+ suppress the use of "/" as a comment character. Some code in the
+ haiku kernel uses "/" to mean division. (What a concept!) */
+#define TE_BeOS 1
+
+#define LOCAL_LABELS_DOLLAR 1
+#define LOCAL_LABELS_FB 1
+
+#include "obj-format.h"
diff --git a/gas/config/te-haiku.h b/gas/config/te-haiku.h
new file mode 100644
index 0000000..5578046
--- /dev/null
+++ b/gas/config/te-haiku.h
@@ -0,0 +1,30 @@
+/* te-haiku.h -- Haiku target environment declarations.
+ Copyright 2013 Free Software Foundation, Inc.
+
+ This file is part of GAS, the GNU Assembler.
+
+ GAS 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.
+
+ GAS 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 GAS; see the file COPYING. If not, write to
+ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+/* Target environment for BeOS/Haiku. It is the same as the generic
+ target, except that it arranges via the TE_BeOS define to
+ suppress the use of "/" as a comment character. Some code in the
+ haiku kernel uses "/" to mean division. (What a concept!) */
+#define TE_BeOS 1
+
+#define LOCAL_LABELS_DOLLAR 1
+#define LOCAL_LABELS_FB 1
+
+#include "obj-format.h"
diff --git a/gas/configure.tgt b/gas/configure.tgt
index 9d5e781..9c7c46b 100644
--- a/gas/configure.tgt
+++ b/gas/configure.tgt
@@ -167,6 +167,7 @@ case ${generic_target} in
arm-*-pe) fmt=coff em=pe ;;
arm-*-riscix*) fmt=aout em=riscix ;;
arm-*-fuchsia*) fmt=elf ;;
+ arm-*-haiku*) fmt=elf em=haiku ;;
avr-*-*) fmt=elf bfd_gas=yes ;;
@@ -222,11 +223,12 @@ case ${generic_target} in
i386-ibm-aix*) fmt=coff em=i386aix ;;
i386-sequent-bsd*) fmt=aout em=dynix ;;
i386-*-beospe*) fmt=coff em=pe ;;
- i386-*-beos*) fmt=elf ;;
+ i386-*-beos*) fmt=elf em=beos ;;
i386-*-coff) fmt=coff ;;
i386-*-elfiamcu) fmt=elf arch=iamcu ;;
i386-*-elf*) fmt=elf ;;
i386-*-fuchsia*) fmt=elf ;;
+ i386-*-haiku*) fmt=elf em=haiku ;;
i386-*-kaos*) fmt=elf ;;
i386-*-bsd*) fmt=aout em=386bsd ;;
i386-*-nacl*) fmt=elf em=nacl
@@ -329,6 +331,7 @@ case ${generic_target} in
m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
m68k-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
m68k-*-psos*) fmt=elf em=psos;;
+ m68k-*-haiku*) fmt=elf em=haiku ;;
mep-*-elf) fmt=elf ;;
@@ -351,6 +354,7 @@ case ${generic_target} in
mips-*-elf*) fmt=elf ;;
mips-*-netbsd*) fmt=elf em=tmips ;;
mips-*-openbsd*) fmt=elf em=tmips ;;
+ mips*-*-haiku*) fmt=elf endian=little em=haiku ;;
mmix-*-*) fmt=elf ;;
@@ -388,9 +392,10 @@ case ${generic_target} in
ppc-*-aix5.[01]) fmt=coff em=aix5 ;;
ppc-*-aix[5-9].*) fmt=coff em=aix5 ;;
ppc-*-aix*) fmt=coff em=aix ;;
- ppc-*-beos*) fmt=coff ;;
+ ppc-*-beos*) fmt=coff em=beos ;;
ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
+ ppc-*-haiku*) fmt=elf em=haiku ;;
ppc-*-linux-*) fmt=elf em=linux ;;
ppc-*-solaris*) fmt=elf em=solaris ;;
ppc-*-macos*) fmt=coff em=macos ;;
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 625347f..4c032b1 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -174,6 +174,7 @@ ALL_EMULATION_SOURCES = \
earmelf.c \
earmelf_fbsd.c \
earmelf_fuchsia.c \
+ earmelf_haiku.c \
earmelf_linux.c \
earmelf_linux_eabi.c \
earmelf_nacl.c \
@@ -269,6 +270,7 @@ ALL_EMULATION_SOURCES = \
eelf32or1k_linux.c \
eelf32ppc.c \
eelf32ppc_fbsd.c \
+ eelf32ppchaiku.c \
eelf32ppclinux.c \
eelf32ppcnto.c \
eelf32ppcsim.c \
@@ -291,11 +293,13 @@ ALL_EMULATION_SOURCES = \
eelf_i386_be.c \
eelf_i386_chaos.c \
eelf_i386_fbsd.c \
+ eelf_i386_haiku.c \
eelf_i386_ldso.c \
eelf_i386_nacl.c \
eelf_i386_sol2.c \
eelf_i386_vxworks.c \
eelf_iamcu.c \
+ eelf_mipsel_haiku.c \
eelf_s390.c \
egld960.c \
egld960coff.c \
@@ -508,6 +512,7 @@ ALL_64_EMULATION_SOURCES = \
eelf_x86_64.c \
eelf_x86_64_cloudabi.c \
eelf_x86_64_fbsd.c \
+ eelf_x86_64_haiku.c \
eelf_x86_64_nacl.c \
eelf_x86_64_sol2.c \
ehppa64linux.c \
@@ -770,6 +775,10 @@ earmelf_fuchsia.c: $(srcdir)/emulparams/armelf_fuchsia.sh \
$(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+earmelf_haiku.c: $(srcdir)/emulparams/armelf_haiku.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \
$(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -1268,6 +1277,12 @@ eelf32ppc_fbsd.c: $(srcdir)/emulparams/elf32ppc_fbsd.sh \
$(srcdir)/emultempl/ppc32elf.em ldemul-list.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+eelf32ppchaiku.c: $(srcdir)/emulparams/elf32ppchaiku.sh \
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
+ $(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \
+ ldemul-list.h \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
eelf32ppclinux.c: $(srcdir)/emulparams/elf32ppclinux.sh \
$(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
$(srcdir)/emulparams/dynamic_undefined_weak.sh \
@@ -1354,6 +1369,9 @@ eelf_i386_fbsd.c: $(srcdir)/emulparams/elf_i386_fbsd.sh \
$(srcdir)/emulparams/elf_i386.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+eelf_i386_haiku.c: $(srcdir)/emulparams/elf_i386_haiku.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -1367,6 +1385,9 @@ 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}
@@ -2059,6 +2080,10 @@ 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 \
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 47c719c..a8e9ba3 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -169,6 +169,7 @@ arm*-*-conix*) targ_emul=armelf ;;
arm*-*-fuchsia*) targ_emul=armelf_fuchsia
targ_extra_emuls="armelfb_fuchsia armelf armelfb"
;;
+arm*-*-haiku*) targ_emul=armelf_haiku; targ_extra_emuls=armelf ;;
avr-*-*) targ_emul=avr2
targ_extra_emuls="avr1 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega1 avrxmega2 avrxmega3 avrxmega4 avrxmega5 avrxmega6 avrxmega7 avrtiny"
;;
@@ -391,6 +392,9 @@ i[3-7]86-*-interix*) targ_emul=i386pe_posix;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
i[3-7]86-*-beospe*) targ_emul=i386beos ;;
i[3-7]86-*-beos*) targ_emul=elf_i386_be ;;
+i[3-7]86-*-haiku*) targ_emul=elf_i386_haiku ;;
+x86_64-*-haiku*) targ_emul=elf_x86_64_haiku
+ targ_extra_emuls="elf_x86_64 elf_i386_haiku" ;;
i[3-7]86-*-vxworks*) targ_emul=elf_i386_vxworks ;;
i[3-7]86-*-chaos) targ_emul=elf_i386_chaos
;;
@@ -474,6 +478,8 @@ m68*-*-netbsdaout* | m68*-*-netbsd*)
targ_emul=m68knbsd
targ_extra_emuls="m68kelfnbsd m68k4knbsd" ;;
m68*-*-psos*) targ_emul=m68kpsos ;;
+m68*-*-haiku*) targ_emul=m68kelf
+ targ_extra_emuls=m68kcoff ;;
m8*-*-*) targ_emul=m88kbcs
;;
mcore-*-pe) targ_emul=mcorepe ;
@@ -501,6 +507,9 @@ mips*-sgi-irix6*) targ_emul=elf32bmipn32
mips*el-*-netbsd*) targ_emul=elf32ltsmip
targ_extra_emuls="elf32btsmip elf64ltsmip elf64btsmip"
;;
+mips*el-*-haiku*) targ_emul=elf_mipsel_haiku
+ targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
+ ;;
mips*-*-netbsd*) targ_emul=elf32btsmip
targ_extra_emuls="elf32ltsmip elf64btsmip elf64ltsmip"
;;
@@ -693,6 +702,7 @@ powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin*)
powerpc-*-aix[5-9]*) targ_emul=aix5ppc ;;
powerpc-*-aix*) targ_emul=aixppc ;;
powerpc-*-beos*) targ_emul=aixppc ;;
+powerpc-*-haiku*) targ_emul=elf32ppchaiku ;;
powerpc-*-windiss*) targ_emul=elf32ppcwindiss ;;
powerpc-*-lynxos*) targ_emul=ppclynx ;;
pru*-*-*) targ_emul=pruelf ;;
diff --git a/ld/emulparams/armelf_haiku.sh b/ld/emulparams/armelf_haiku.sh
new file mode 100644
index 0000000..9dcdf54
--- /dev/null
+++ b/ld/emulparams/armelf_haiku.sh
@@ -0,0 +1,26 @@
+ARCH=arm
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-littlearm"
+BIG_OUTPUT_FORMAT="elf32-bigarm"
+LITTLE_OUTPUT_FORMAT="elf32-littlearm"
+MAXPAGESIZE=0x8000
+COMMONPAGESIZE=0x1000
+TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=armelf
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
+
+DATA_START_SYMBOLS='__data_start = . ;';
+OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)'
+OTHER_BSS_SYMBOLS='__bss_start__ = .;'
+OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;'
+OTHER_END_SYMBOLS='__end__ = . ;'
+OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
+
+TEXT_START_ADDR=0x00008000
+TARGET2_TYPE=got-rel
+
+# ARM does not support .s* sections.
+NO_SMALL_DATA=yes
+
+. ${srcdir}/emulparams/elf_haiku.sh
diff --git a/ld/emulparams/elf32ppchaiku.sh b/ld/emulparams/elf32ppchaiku.sh
new file mode 100644
index 0000000..547e5c8
--- /dev/null
+++ b/ld/emulparams/elf32ppchaiku.sh
@@ -0,0 +1,7 @@
+. ${srcdir}/emulparams/elf32ppc.sh
+. ${srcdir}/emulparams/elf_haiku.sh
+TEXT_START_ADDR=0x200000
+MAXPAGESIZE=0x1000
+GENERATE_SHLIB_SCRIPT=yes
+BSS_PLT=
+LIBPATH_SUFFIX=
diff --git a/ld/emulparams/elf_haiku.sh b/ld/emulparams/elf_haiku.sh
new file mode 100644
index 0000000..401eedc
--- /dev/null
+++ b/ld/emulparams/elf_haiku.sh
@@ -0,0 +1 @@
+ELF_INTERPRETER_NAME=\"/system/runtime_loader\"
diff --git a/ld/emulparams/elf_i386_haiku.sh b/ld/emulparams/elf_i386_haiku.sh
new file mode 100644
index 0000000..b70da86
--- /dev/null
+++ b/ld/emulparams/elf_i386_haiku.sh
@@ -0,0 +1,12 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-i386"
+TEXT_START_ADDR=0x200000
+NONPAGED_TEXT_START_ADDR=0x200000
+MAXPAGESIZE=0x1000
+ARCH=i386
+MACHINE=
+NOP=0x90909090
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+NO_SMALL_DATA=yes
+. ${srcdir}/emulparams/elf_haiku.sh
diff --git a/ld/emulparams/elf_mipsel_haiku.sh b/ld/emulparams/elf_mipsel_haiku.sh
new file mode 100644
index 0000000..ab38e23
--- /dev/null
+++ b/ld/emulparams/elf_mipsel_haiku.sh
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/elf32lmip.sh
+. ${srcdir}/emulparams/elf_haiku.sh
+
diff --git a/ld/emulparams/elf_x86_64_haiku.sh b/ld/emulparams/elf_x86_64_haiku.sh
new file mode 100644
index 0000000..f049559
--- /dev/null
+++ b/ld/emulparams/elf_x86_64_haiku.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/elf_x86_64.sh
+. ${srcdir}/emulparams/elf_haiku.sh
diff --git a/libtool.m4 b/libtool.m4
index 24d13f3..84d70b8 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -2342,7 +2342,7 @@ haiku*)
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
--
2.13.1
From 51083bbbd6eb8cbd7b2a9a1ce328dc8757593a2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
Date: Sat, 5 Aug 2017 12:39:53 +0200
Subject: Haiku: regenerate configure and Makefile.in.
diff --git a/bfd/configure b/bfd/configure
index 7c8ebb1..01cc462 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -10632,7 +10632,7 @@ haiku*)
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
diff --git a/binutils/configure b/binutils/configure
index e903709..49d41ef 100755
--- a/binutils/configure
+++ b/binutils/configure
@@ -10430,7 +10430,7 @@ haiku*)
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
diff --git a/configure b/configure
index be9dd89..d363241 100755
--- a/configure
+++ b/configure
@@ -2955,7 +2955,7 @@ case "${ENABLE_GOLD}" in
is_elf=no
case "${target}" in
*-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
- | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
+ | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* | *-*-haiku* \
| *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
| *-*-solaris2* | *-*-nto* | *-*-nacl* | *-*-fuchsia*)
case "${target}" in
diff --git a/gas/configure b/gas/configure
index e78136c..ec294a3 100755
--- a/gas/configure
+++ b/gas/configure
@@ -10191,7 +10191,7 @@ haiku*)
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
diff --git a/ld/Makefile.in b/ld/Makefile.in
index ba25177..7ec088d 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -543,6 +543,7 @@ ALL_EMULATION_SOURCES = \
earmelf.c \
earmelf_fbsd.c \
earmelf_fuchsia.c \
+ earmelf_haiku.c \
earmelf_linux.c \
earmelf_linux_eabi.c \
earmelf_nacl.c \
@@ -638,6 +639,7 @@ ALL_EMULATION_SOURCES = \
eelf32or1k_linux.c \
eelf32ppc.c \
eelf32ppc_fbsd.c \
+ eelf32ppchaiku.c \
eelf32ppclinux.c \
eelf32ppcnto.c \
eelf32ppcsim.c \
@@ -660,11 +662,13 @@ ALL_EMULATION_SOURCES = \
eelf_i386_be.c \
eelf_i386_chaos.c \
eelf_i386_fbsd.c \
+ eelf_i386_haiku.c \
eelf_i386_ldso.c \
eelf_i386_nacl.c \
eelf_i386_sol2.c \
eelf_i386_vxworks.c \
eelf_iamcu.c \
+ eelf_mipsel_haiku.c \
eelf_s390.c \
egld960.c \
egld960coff.c \
@@ -876,6 +880,7 @@ ALL_64_EMULATION_SOURCES = \
eelf_x86_64.c \
eelf_x86_64_cloudabi.c \
eelf_x86_64_fbsd.c \
+ eelf_x86_64_haiku.c \
eelf_x86_64_nacl.c \
eelf_x86_64_sol2.c \
ehppa64linux.c \
@@ -1156,6 +1161,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_nacl.Po@am__quote@
@@ -1275,6 +1281,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@
@@ -1321,6 +1328,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@
@@ -1330,10 +1338,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)/egld960.Po@am__quote@
@@ -2334,6 +2344,10 @@ earmelf_fuchsia.c: $(srcdir)/emulparams/armelf_fuchsia.sh \
$(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+earmelf_haiku.c: $(srcdir)/emulparams/armelf_haiku.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \
$(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -2832,6 +2846,12 @@ eelf32ppc_fbsd.c: $(srcdir)/emulparams/elf32ppc_fbsd.sh \
$(srcdir)/emultempl/ppc32elf.em ldemul-list.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+eelf32ppchaiku.c: $(srcdir)/emulparams/elf32ppchaiku.sh \
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
+ $(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \
+ ldemul-list.h \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
eelf32ppclinux.c: $(srcdir)/emulparams/elf32ppclinux.sh \
$(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
$(srcdir)/emulparams/dynamic_undefined_weak.sh \
@@ -2918,6 +2938,9 @@ eelf_i386_fbsd.c: $(srcdir)/emulparams/elf_i386_fbsd.sh \
$(srcdir)/emulparams/elf_i386.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+eelf_i386_haiku.c: $(srcdir)/emulparams/elf_i386_haiku.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -2931,6 +2954,9 @@ 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}
@@ -3623,6 +3649,10 @@ 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 \
diff --git a/opcodes/configure b/opcodes/configure
index 2bedc8d..fcc6e51 100755
--- a/opcodes/configure
+++ b/opcodes/configure
@@ -10355,7 +10355,7 @@ haiku*)
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
--
2.13.1