From d85e70a35bffa755fd3e9f4ccc6bf6c64953e85d Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Thu, 2 Sep 2021 12:19:14 +0100 Subject: Add support for the haiku operating system. These are the os support patches we have been grooming and maintaining for quite a few years over on git.haiku-os.org. All of these architectures are working and most have been stable for quite some time. --- gas/config/tc-i386.c | 1 + gas/config/te-haiku.h | 30 ++++++++++++++++++++++++++++++ gas/configure | 2 +- gas/configure.tgt | 8 ++++++++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 gas/config/te-haiku.h (limited to 'gas') diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 7148c07..339f969 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -478,6 +478,7 @@ const char extra_symbol_chars[] = "*%-([{}" #if ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) \ && !defined (TE_GNU) \ && !defined (TE_LINUX) \ + && !defined (TE_Haiku) \ && !defined (TE_FreeBSD) \ && !defined (TE_DragonFly) \ && !defined (TE_NetBSD)) diff --git a/gas/config/te-haiku.h b/gas/config/te-haiku.h new file mode 100644 index 0000000..4455717 --- /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_Haiku 1 + +#define LOCAL_LABELS_DOLLAR 1 +#define LOCAL_LABELS_FB 1 + +#include "obj-format.h" diff --git a/gas/configure b/gas/configure index 7a528fd..a63c6ff 100755 --- a/gas/configure +++ b/gas/configure @@ -9860,7 +9860,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/gas/configure.tgt b/gas/configure.tgt index 68ee046..550fa40 100644 --- a/gas/configure.tgt +++ b/gas/configure.tgt @@ -125,6 +125,7 @@ generic_target=${cpu_type}-$vendor-$os case ${generic_target} in aarch64*-*-elf*) fmt=elf;; aarch64*-*-fuchsia*) fmt=elf;; + aarch64*-*-haiku*) fmt=elf em=haiku ;; aarch64*-*-genode*) fmt=elf;; aarch64*-*-linux*) fmt=elf em=linux case ${cpu}-${os} in @@ -161,6 +162,7 @@ case ${generic_target} in fmt=coff em=wince-pe ;; arm-*-pe) fmt=coff em=pe ;; arm-*-fuchsia*) fmt=elf ;; + arm-*-haiku*) fmt=elf em=haiku ;; avr-*-*) fmt=elf bfd_gas=yes ;; @@ -222,6 +224,7 @@ case ${generic_target} in i386-*-elfiamcu) fmt=elf arch=iamcu ;; i386-*-elf*) fmt=elf ;; i386-*-fuchsia*) fmt=elf ;; + i386-*-haiku*) fmt=elf em=haiku ;; i386-*-genode*) fmt=elf ;; i386-*-bsd*) fmt=aout em=386bsd ;; i386-*-netbsd*-gnu* | \ @@ -288,6 +291,7 @@ case ${generic_target} in m68k-*-uclinux*) fmt=elf em=uclinux ;; m68k-*-gnu*) fmt=elf ;; m68k-*-netbsd*) fmt=elf em=nbsd ;; + m68k-*-haiku*) fmt=elf em=haiku ;; s12z-*-*) fmt=elf ;; @@ -309,6 +313,7 @@ case ${generic_target} in mips-*-sysv4* | mips-*-gnu*) fmt=elf em=tmips ;; mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*) fmt=elf em=tmips ;; + mips-*-haiku*) fmt=elf em=haiku ;; mips-*-elf*) fmt=elf ;; mips-*-netbsd*) fmt=elf em=tmips ;; mips-*-openbsd*) fmt=elf em=tmips ;; @@ -351,6 +356,7 @@ case ${generic_target} in ppc-*-beos*) fmt=coff ;; 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 ;; @@ -359,6 +365,7 @@ case ${generic_target} in pru-*-*) fmt=elf ;; + riscv*-*-haiku*) fmt=elf endian=little em=haiku ;; riscv*-*-*) fmt=elf ;; rx-*-linux*) fmt=elf em=linux ;; @@ -386,6 +393,7 @@ case ${generic_target} in sh-*-kaos*) fmt=elf ;; shle*-*-kaos*) fmt=elf ;; + sparc-*-haiku*) fmt=elf em=haiku ;; sparc-*-linux-*) fmt=elf em=linux ;; sparc-*-solaris*) fmt=elf em=solaris ;; sparc-*-freebsd*) fmt=elf em=freebsd ;; -- cgit v1.1