Merge changes from HaikuPorts patches.

This commit is contained in:
Augustin Cavalier 2021-12-06 14:57:24 -05:00
parent 19aaa79362
commit de507584b8
26 changed files with 249 additions and 155 deletions

View File

@ -161,8 +161,8 @@ if test "$with_gnu_ld" = yes; then
;;
netbsd*)
;;
haiku*)
;;
haiku*)
;;
solaris* | sysv5*)
if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no

5
gcc/configure vendored
View File

@ -3161,7 +3161,7 @@ if test x$enable_libgomp = x ; then
;;
*-*-solaris2* | *-*-hpux11*)
;;
*-*-darwin* | *-*-aix*)
*-*-darwin* | *-*-aix* | *-*-haiku*)
;;
nvptx*-*-*)
;;
@ -3381,6 +3381,9 @@ case "${target}" in
*-*-darwin*)
noconfigdirs="$noconfigdirs target-libffi"
;;
*-*-haiku*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
*-*-netware*)
noconfigdirs="$noconfigdirs target-libffi"
;;

View File

@ -513,7 +513,7 @@ if test x$enable_libgomp = x ; then
;;
*-*-solaris2* | *-*-hpux11*)
;;
*-*-darwin* | *-*-aix*)
*-*-darwin* | *-*-aix* | *-*-haiku*)
;;
nvptx*-*-*)
;;
@ -712,6 +712,9 @@ case "${target}" in
*-*-darwin*)
noconfigdirs="$noconfigdirs target-libffi"
;;
*-*-haiku*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
*-*-netware*)
noconfigdirs="$noconfigdirs target-libffi"
;;
@ -878,7 +881,7 @@ case "${target}" in
*-*-aix*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
*-*-haiku*)
*-*-beos*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
*-*-chorusos)
@ -890,6 +893,9 @@ case "${target}" in
*-*-freebsd*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
*-*-haiku*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
*-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;

View File

@ -2819,7 +2819,7 @@ $(genprogerr:%=build/gen%$(build_exeext)): $(BUILD_ERRORS)
genprog = $(genprogerr) check checksum condmd match
# These programs need libs over and above what they get from the above list.
build/genautomata$(build_exeext) : BUILD_LIBS += -lm
build/genautomata$(build_exeext) : BUILD_LIBS += @build_math_library@
build/genrecog$(build_exeext) : build/hash-table.o build/inchash.o
build/gencfn-macros$(build_exeext) : build/hash-table.o build/vec.o \

View File

@ -759,6 +759,8 @@ case ${target} in
"" | yes | posix) thread_file='posix' ;;
esac
default_use_cxa_atexit=yes
tm_p_file="${tm_p_file} haiku-protos.h"
extra_objs="${extra_objs} haiku.o"
;;
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
extra_options="$extra_options gnu-user.opt"
@ -1151,15 +1153,15 @@ arm*-*-netbsdelf*)
target_cpu_cname="arm6"
;;
arm*-*-haiku*)
tmake_file="${tmake_file} t-haiku arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-haiku"
tm_file="dbxelf.h elfos.h haiku.h arm/elf.h arm/bpabi.h arm/haiku.h haiku-stdint.h"
# The BPABI long long divmod functions return a 128-bit value in
# registers r0-r3. Correctly modeling that requires the use of
# TImode.
need_64bit_hwint=yes
default_use_cxa_atexit=yes
tm_file="${tm_file} arm/aout.h arm/arm.h"
;;
tmake_file="${tmake_file} t-haiku arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-haiku"
tm_file="dbxelf.h elfos.h haiku.h arm/elf.h arm/bpabi.h arm/haiku.h haiku-stdint.h"
# The BPABI long long divmod functions return a 128-bit value in
# registers r0-r3. Correctly modeling that requires the use of
# TImode.
need_64bit_hwint=yes
default_use_cxa_atexit=yes
tm_file="${tm_file} arm/aout.h arm/arm.h"
;;
arm*-*-linux-*) # ARM GNU/Linux with ELF
tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
extra_options="${extra_options} linux-android.opt"
@ -2047,12 +2049,12 @@ m68k-*-rtems*)
tm_defines="${tm_defines} MOTOROLA=1"
;;
m68k-*-haiku*)
default_m68k_cpu=68020
default_cf_cpu=5206
tmake_file="${tmake_file} m68k/t-m68kbare m68k/t-crtstuff t-haiku" #??
tm_file="${tm_file} dbxelf.h elfos.h haiku.h m68k/haiku.h haiku-stdint.h"
tm_defines="${tm_defines} MOTOROLA=1"
;;
default_m68k_cpu=68020
default_cf_cpu=5206
tmake_file="${tmake_file} m68k/t-m68kbare m68k/t-crtstuff t-haiku" #??
tm_file="${tm_file} dbxelf.h elfos.h haiku.h m68k/haiku.h"
tm_defines="${tm_defines} MOTOROLA=1"
;;
mcore-*-elf)
tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h"
tmake_file=mcore/t-mcore
@ -2181,10 +2183,10 @@ mips*-mti-linux*)
gas=yes
;;
mipsel-*-haiku*)
target_cpu_default="MASK_ABICALLS"
tm_file="elfos.h ${tm_file} haiku.h mips/haiku.h haiku-stdint.h"
tmake_file="${tmake_file} mips/t-elf t-haiku"
;;
target_cpu_default="MASK_ABICALLS"
tm_file="elfos.h ${tm_file} haiku.h mips/haiku.h"
tmake_file="${tmake_file} mips/t-elf t-haiku"
;;
mips*-*-linux*) # Linux MIPS, either endian.
tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h"
extra_options="${extra_options} linux-android.opt"

View File

@ -0,0 +1,21 @@
/* Operating system specific prototypes to be used when targeting GCC for Haiku.
Copyright (C) 2021 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
/* In haiku.c. */
extern void haiku_override_options (void);

View File

@ -1,38 +0,0 @@
#define HAIKU_TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("__HAIKU__"); \
builtin_define ("__stdcall=__attribute__((__stdcall__))"); \
builtin_define ("__cdecl=__attribute__((__cdecl__))"); \
builtin_assert ("system=haiku"); \
/* Haiku apparently doesn't support merging of symbols across shared \
object boundaries. Hence we need to explicitly specify that \
type_infos are not merged, so that they get compared by name \
instead of by pointer. */ \
builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \
HAIKU_TARGET_CPU_CPP_BUILTINS(); \
} \
while (0)
/* Define the default Haiku-specific per-CPU hook code. */
#define HAIKU_TARGET_CPU_CPP_BUILTINS() do {} while (0)
/* Provide a CPP_SPEC appropriate for Haiku. We just deal with the GCC
option `-posix', and PIC issues. */
#define HAIKU_CPP_SPEC " \
%(cpp_cpu) \
%(cpp_arch) \
%{posix:-D_POSIX_SOURCE}"
#define HAIKU_STARTFILE_SPEC \
"crti.o%s crtbeginS.o%s %{!shared:%{!nostart:start_dyn.o%s}} init_term_dyn.o%s"
#define HAIKU_ENDFILE_SPEC \
"crtendS.o%s crtn.o%s"
#define HAIKU_LIB_SPEC \
"-lroot"
#define HAIKU_DYNAMIC_LINKER \
"/system/runtime_loader"

32
gcc/gcc/config/haiku.c Normal file
View File

@ -0,0 +1,32 @@
/* General Haiku system support.
Copyright (C) 2021 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "target.h"
void
haiku_override_options (void)
{
if (!global_options_set.x_dwarf_strict)
dwarf_strict = 1;
if (!global_options_set.x_dwarf_version)
dwarf_version = 4;
}

View File

@ -53,6 +53,11 @@ Boston, MA 02111-1307, USA. */
#undef CC1PLUS_SPEC
#define CC1PLUS_SPEC "%{!Wctor-dtor-privacy:-Wno-ctor-dtor-privacy}"
#define SUBTARGET_OVERRIDE_OPTIONS \
do { \
haiku_override_options (); \
} while (0)
/* LIB_SPEC for Haiku */
#undef LIB_SPEC
#define LIB_SPEC "-lroot"
@ -205,13 +210,9 @@ Boston, MA 02111-1307, USA. */
/* Haiku headers are C++-aware (and often use C++). */
#define NO_IMPLICIT_EXTERN_C
/* Only allow -lssp for SSP, as -lssp_nonshared is problematic in Haiku */
#ifndef TARGET_LIBC_PROVIDES_SSP
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp}"
#endif
/* Do not use JCR_SECTION_NAME default definition for Haiku */
#define TARGET_NO_JCR_SECTION_NAME 1
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
"|fstack-protector-strong|fstack-protector-explicit" \
":-lssp_nonshared}"
/* Do not use TM clone registry in Haiku for now */
#define USE_TM_CLONE_REGISTRY 0

View File

@ -113,7 +113,7 @@ Boston, MA 02111-1307, USA. */
%{Wa,*:%*} %{" SPEC_32 ":--32} %{" SPEC_64 ":--64}"
#undef ASM_OUTPUT_ALIGNED_DECL_COMMON
#define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \
#define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \
x86_elf_aligned_decl_common (FILE, DECL, NAME, SIZE, ALIGN);

View File

@ -1,4 +1,9 @@
# There are system headers elsewhere, but these are the ones that
# we are most likely to want to apply any fixes to.
NATIVE_SYSTEM_HEADER_DIR = /boot/system/develop/headers
LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/posix/limits.h ]
LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/posix/limits.h ]
# Haiku-specific attributes
haiku.o: $(srcdir)/config/haiku.c
$(COMPILE) $<
$(POSTCOMPILE)

17
gcc/gcc/configure vendored
View File

@ -15565,8 +15565,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
haiku*)
# PIC is the default for Haiku.
# The "-static" flag exists, but is broken.
lt_prog_compiler_static=
;;
hpux*)
@ -17678,8 +17676,9 @@ 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'
hardcode_into_libs=yes
sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib'
sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib'
hardcode_into_libs=no
;;
hpux9* | hpux10* | hpux11*)
@ -18196,7 +18195,7 @@ else
lt_cv_dlopen_libs=
case $host_os in
beos* | haiku*)
beos* | haiku* )
lt_cv_dlopen="load_add_on"
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
@ -20394,7 +20393,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
;;
esac
;;
beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
@ -20416,8 +20414,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
;;
haiku*)
# PIC is the default for Haiku.
# The "-static" flag exists, but is broken.
lt_prog_compiler_static_CXX=
;;
interix[3-9]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
@ -21338,8 +21334,9 @@ 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'
hardcode_into_libs=yes
sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib'
sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib'
hardcode_into_libs=no
;;
hpux9* | hpux10* | hpux11*)

View File

@ -94,7 +94,7 @@ typedef __gnuc_va_list va_list;
#ifndef _VA_LIST
/* The macro _VA_LIST_T_H is used in the Bull dpx2 */
#ifndef _VA_LIST_T_H
/* The macro __va_list__ is used by BeOS. */
/* The macro __va_list__ is used by BeOS and Haiku. */
#ifndef __va_list__
typedef __gnuc_va_list va_list;
#endif /* not __va_list__ */

View File

@ -167,7 +167,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
/* Define this type if we are doing the whole job,
or if we want this type in particular. */
#if defined (_STDDEF_H) || defined (__need_size_t)
#ifndef __size_t__ /* BeOS */
#ifndef __size_t__ /* BeOS, Haiku */
#ifndef __SIZE_T__ /* Cray Unicos/Mk */
#ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
#ifndef _SYS_SIZE_T_H
@ -184,7 +184,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
#ifndef _GCC_SIZE_T
#ifndef _SIZET_
#ifndef __size_t
#define __size_t__ /* BeOS */
#define __size_t__ /* BeOS, Haiku */
#define __SIZE_T__ /* Cray Unicos/Mk */
#define _SIZE_T
#define _SYS_SIZE_T_H
@ -214,7 +214,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
#endif
#if !(defined (__GNUG__) && defined (size_t))
typedef __SIZE_TYPE__ size_t;
#ifdef __BEOS__
#if defined(__BEOS__)
typedef long ssize_t;
#endif /* __BEOS__ */
#endif /* !(defined (__GNUG__) && defined (size_t)) */
@ -247,7 +247,7 @@ typedef long ssize_t;
/* Define this type if we are doing the whole job,
or if we want this type in particular. */
#if defined (_STDDEF_H) || defined (__need_wchar_t)
#ifndef __wchar_t__ /* BeOS */
#ifndef __wchar_t__ /* BeOS, Haiku */
#ifndef __WCHAR_T__ /* Cray Unicos/Mk */
#ifndef _WCHAR_T
#ifndef _T_WCHAR_
@ -264,7 +264,7 @@ typedef long ssize_t;
#ifndef ___int_wchar_t_h
#ifndef __INT_WCHAR_T_H
#ifndef _GCC_WCHAR_T
#define __wchar_t__ /* BeOS */
#define __wchar_t__ /* BeOS, Haiku */
#define __WCHAR_T__ /* Cray Unicos/Mk */
#define _WCHAR_T
#define _T_WCHAR_

View File

@ -8211,8 +8211,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
haiku*)
# PIC is the default for Haiku.
# The "-static" flag exists, but is broken.
lt_prog_compiler_static=
;;
hpux*)
@ -10324,8 +10322,9 @@ 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'
hardcode_into_libs=yes
sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib'
sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib'
hardcode_into_libs=no
;;
hpux9* | hpux10* | hpux11*)
@ -10842,7 +10841,7 @@ else
lt_cv_dlopen_libs=
case $host_os in
beos*)
beos* | haiku* )
lt_cv_dlopen="load_add_on"
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
@ -11120,7 +11119,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11123 "configure"
#line 11122 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11226,7 +11225,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11229 "configure"
#line 11228 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -14609,7 +14608,6 @@ _ACEOF
case " $config_path " in
*" posix "*)
XPCFLAGS=""
CFLAGS="$CFLAGS -pthread"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <pthread.h>
@ -14623,13 +14621,29 @@ pthread_t t; pthread_create(&t,NULL,g,NULL);
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
XPCFLAGS=" -pthread"
else
CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS"
CFLAGS="$CFLAGS -pthread"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <pthread.h>
void *g(void *d) { return NULL; }
void *g(void *d) { return NULL; }
int
main ()
{
pthread_t t; pthread_create(&t,NULL,g,NULL);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
XPCFLAGS=" -pthread"
else
CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <pthread.h>
void *g(void *d) { return NULL; }
int
main ()
{
@ -14646,6 +14660,9 @@ fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS="$save_CFLAGS $XPCFLAGS"

View File

@ -209,21 +209,27 @@ LIBAT_WORDSIZE
case " $config_path " in
*" posix "*)
XPCFLAGS=""
CFLAGS="$CFLAGS -pthread"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[#include <pthread.h>
void *g(void *d) { return NULL; }],
[pthread_t t; pthread_create(&t,NULL,g,NULL);])],
[XPCFLAGS=" -pthread"],
[CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS"
[],
[CFLAGS="$CFLAGS -pthread"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[#include <pthread.h>
void *g(void *d) { return NULL; }],
[pthread_t t; pthread_create(&t,NULL,g,NULL);])],
[],
[AC_MSG_ERROR([Pthreads are required to build libatomic])])])
[AC_LANG_PROGRAM(
[#include <pthread.h>
void *g(void *d) { return NULL; }],
[pthread_t t; pthread_create(&t,NULL,g,NULL);])],
[XPCFLAGS=" -pthread"],
[CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[#include <pthread.h>
void *g(void *d) { return NULL; }],
[pthread_t t; pthread_create(&t,NULL,g,NULL);])],
[],
[AC_MSG_ERROR([Pthreads are required to build libatomic])])])])
CFLAGS="$save_CFLAGS $XPCFLAGS"
;;
esac

View File

@ -137,7 +137,7 @@ case "${target}" in
*-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu \
| *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly* \
| *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \
| *-*-darwin* | *-*-aix* | *-*-cygwin*)
| *-*-darwin* | *-*-aix* | *-*-cygwin* | *-*-haiku*)
# POSIX system. The OS is supported.
config_path="${config_path} posix"
;;

View File

@ -231,14 +231,18 @@ case ${host} in
;;
esac
;;
*-*-haiku*)
tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-slibgcc-nolc-override t-haiku"
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
;;
*-*-fuchsia*)
tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-fuchsia"
extra_parts="crtbegin.o crtend.o"
;;
*-*-haiku*)
# This is the generic ELF configuration of Haiku. Later
# machine-specific sections may refine and add to this
# configuration.
tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-haiku t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver"
tmake_file="$tmake_file t-slibgcc-libgcc t-slibgcc-nolc-override"
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
;;
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux"
extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
@ -421,13 +425,6 @@ arm*-*-freebsd*) # ARM FreeBSD EABI
unwind_header=config/arm/unwind-arm.h
tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
;;
arm*-*-haiku*)
tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix arm/t-elf"
tmake_file="${tmake_file} arm/t-bpabi"
tm_file="${tm_file} arm/bpabi-lib.h"
unwind_header=config/arm/unwind-arm.h
tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
;;
arm*-*-fuchsia*)
tmake_file="${tmake_file} arm/t-arm arm/t-elf arm/t-bpabi"
tmake_file="${tmake_file} arm/tsoftfp t-softfp"
@ -437,6 +434,12 @@ arm*-*-fuchsia*)
arm*-*-netbsdelf*)
tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover"
;;
arm-*-haiku*)
tmake_file="${tmake_file} arm/t-arm arm/t-elf arm/t-bpabi"
tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
tm_file="${tm_file} arm/bpabi-lib.h"
unwind_header=config/arm/unwind-arm.h
;;
arm*-*-linux*) # ARM GNU/Linux with ELF
tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix t-crtfm"
tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc"

View File

@ -108,7 +108,9 @@ call_ ## FUNC (void) \
&& defined(HAVE_LD_EH_FRAME_HDR) \
&& !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
&& defined(__GLIBC__) && __GLIBC__ >= 2
#ifndef __HAIKU__
#include <link.h>
#endif
/* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */
# if !defined(__UCLIBC__) \

44
gcc/libgomp/configure vendored
View File

@ -8248,8 +8248,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
haiku*)
# PIC is the default for Haiku.
# The "-static" flag exists, but is broken.
lt_prog_compiler_static=
;;
hpux*)
@ -10361,8 +10359,9 @@ 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'
hardcode_into_libs=yes
sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib'
sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib'
hardcode_into_libs=no
;;
hpux9* | hpux10* | hpux11*)
@ -10879,7 +10878,7 @@ else
lt_cv_dlopen_libs=
case $host_os in
beos*)
beos* | haiku* )
lt_cv_dlopen="load_add_on"
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
@ -11157,7 +11156,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11160 "configure"
#line 11159 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11263,7 +11262,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11266 "configure"
#line 11265 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -12123,8 +12122,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
haiku*)
# PIC is the default for Haiku.
# The "-static" flag exists, but is broken.
lt_prog_compiler_static_FC=
;;
hpux*)
@ -14001,8 +13998,9 @@ 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'
hardcode_into_libs=yes
sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib'
sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib'
hardcode_into_libs=no
;;
hpux9* | hpux10* | hpux11*)
@ -15086,7 +15084,6 @@ case "$host" in
*)
# Check to see if -pthread or -lpthread is needed. Prefer the former.
# In case the pthread.h system header is not found, this test will fail.
CFLAGS="$CFLAGS -pthread"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <pthread.h>
@ -15100,9 +15097,9 @@ pthread_t t; pthread_create(&t,NULL,g,NULL);
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
XPCFLAGS=" -Wc,-pthread"
else
CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS"
CFLAGS="$CFLAGS -pthread"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <pthread.h>
@ -15115,6 +15112,22 @@ pthread_t t; pthread_create(&t,NULL,g,NULL);
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
XPCFLAGS=" -Wc,-pthread"
else
CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <pthread.h>
void *g(void *d) { return NULL; }
int
main ()
{
pthread_t t; pthread_create(&t,NULL,g,NULL);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
else
@ -15123,6 +15136,9 @@ fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
esac

View File

@ -188,21 +188,27 @@ case "$host" in
*)
# Check to see if -pthread or -lpthread is needed. Prefer the former.
# In case the pthread.h system header is not found, this test will fail.
CFLAGS="$CFLAGS -pthread"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[#include <pthread.h>
void *g(void *d) { return NULL; }],
[pthread_t t; pthread_create(&t,NULL,g,NULL);])],
[XPCFLAGS=" -Wc,-pthread"],
[CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS"
[],
[CFLAGS="$CFLAGS -pthread"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[#include <pthread.h>
void *g(void *d) { return NULL; }],
[pthread_t t; pthread_create(&t,NULL,g,NULL);])],
[],
[AC_MSG_ERROR([Pthreads are required to build libgomp])])])
[XPCFLAGS=" -Wc,-pthread"],
[CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[#include <pthread.h>
void *g(void *d) { return NULL; }],
[pthread_t t; pthread_create(&t,NULL,g,NULL);])],
[],
[AC_MSG_ERROR([Pthreads are required to build libgomp])])])])
esac
if test x$libgomp_use_pthreads != xno; then

View File

@ -4299,6 +4299,9 @@ AC_DEFUN([GLIBCXX_ENABLE_FILESYSTEM_TS], [
solaris*)
enable_libstdcxx_filesystem_ts=yes
;;
haiku*)
enable_libstdcxx_filesystem_ts=yes
;;
*)
enable_libstdcxx_filesystem_ts=no
;;

View File

@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000-2013 Free Software Foundation, Inc.
// Copyright (C) 2000-2015 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -97,6 +97,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
case graph:
__testis = isgraph(__c);
break;
#if __cplusplus >= 201103L
case blank:
__testis = isblank(__c);
break;
#endif
default:
__testis = false;
break;
@ -117,7 +122,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
else
{
// Highest bitmask in ctype_base == 10.
// Highest bitmask in ctype_base == 11.
const size_t __bitmasksize = 15;
for (;__low < __high; ++__vec, ++__low)
{

View File

@ -8672,8 +8672,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
haiku*)
# PIC is the default for Haiku.
# The "-static" flag exists, but is broken.
lt_prog_compiler_static=
;;
hpux*)
@ -10794,8 +10792,9 @@ 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'
hardcode_into_libs=yes
sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib'
sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib'
hardcode_into_libs=no
;;
hpux9* | hpux10* | hpux11*)
@ -13556,8 +13555,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
;;
haiku*)
# PIC is the default for Haiku.
# The "-static" flag exists, but is broken.
lt_prog_compiler_static_CXX=
;;
interix[3-9]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
@ -14478,8 +14475,9 @@ 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'
hardcode_into_libs=yes
sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib'
sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib'
hardcode_into_libs=no
;;
hpux9* | hpux10* | hpux11*)
@ -80144,6 +80142,9 @@ $as_echo_n "checking whether to build Filesystem TS support... " >&6; }
solaris*)
enable_libstdcxx_filesystem_ts=yes
;;
haiku*)
enable_libstdcxx_filesystem_ts=yes
;;
*)
enable_libstdcxx_filesystem_ts=no
;;

View File

@ -30,6 +30,15 @@ std::type_info::
~type_info ()
{ }
#ifdef __HAIKU__
#ifndef __GXX_MERGED_TYPEINFO_NAMES
#define __GXX_MERGED_TYPEINFO_NAMES 0
#endif
#ifndef __GXX_TYPEINFO_EQUALITY_INLINE
#define __GXX_TYPEINFO_EQUALITY_INLINE 0
#endif
#endif
#if !__GXX_TYPEINFO_EQUALITY_INLINE
// We can't rely on common symbols being shared between shared objects.

9
gcc/libtool.m4 vendored
View File

@ -2342,8 +2342,9 @@ 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'
hardcode_into_libs=yes
sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib'
sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib'
hardcode_into_libs=no
;;
hpux9* | hpux10* | hpux11*)
@ -3626,8 +3627,6 @@ m4_if([$1], [CXX], [
;;
haiku*)
# PIC is the default for Haiku.
# The "-static" flag exists, but is broken.
_LT_TAGVAR(lt_prog_compiler_static, $1)=
;;
interix[[3-9]]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
@ -3937,8 +3936,6 @@ m4_if([$1], [CXX], [
haiku*)
# PIC is the default for Haiku.
# The "-static" flag exists, but is broken.
_LT_TAGVAR(lt_prog_compiler_static, $1)=
;;
hpux*)