From 84055cacec5049592c394f11ec91c95d8ae4d675 Mon Sep 17 00:00:00 2001 From: wawa Date: Thu, 14 Feb 2019 00:42:40 +0000 Subject: [PATCH] gcc-6.5.0 diff (NicJA) git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@55682 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- tools/crosstools/gcc-6.5.0-aros.diff | 2277 ++++++++++++++++++++++++++++++++++ 1 file changed, 2277 insertions(+) create mode 100644 tools/crosstools/gcc-6.5.0-aros.diff diff --git a/tools/crosstools/gcc-6.5.0-aros.diff b/tools/crosstools/gcc-6.5.0-aros.diff new file mode 100644 index 0000000000..e857c1b1bb --- /dev/null +++ b/tools/crosstools/gcc-6.5.0-aros.diff @@ -0,0 +1,2277 @@ +diff -ruN gcc-6.5.0/boehm-gc/include/gc.h gcc-6.5.0.aros/boehm-gc/include/gc.h +--- gcc-6.5.0/boehm-gc/include/gc.h 2014-10-23 09:39:19.000000000 +0100 ++++ gcc-6.5.0.aros/boehm-gc/include/gc.h 2019-02-13 12:20:35.215061500 +0000 +@@ -1056,7 +1056,7 @@ + GC_API void GC_win32_free_heap (); + #endif + +-#if ( defined(_AMIGA) && !defined(GC_AMIGA_MAKINGLIB) ) ++#if !defined(__AROS__) && ( defined(_AMIGA) && !defined(GC_AMIGA_MAKINGLIB) ) + /* Allocation really goes through GC_amiga_allocwrapper_do */ + # include "gc_amiga_redirects.h" + #endif +diff -ruN gcc-6.5.0/boehm-gc/include/gc_amiga_redirects.h gcc-6.5.0.aros/boehm-gc/include/gc_amiga_redirects.h +--- gcc-6.5.0/boehm-gc/include/gc_amiga_redirects.h 2001-08-17 18:30:51.000000000 +0000 ++++ gcc-6.5.0.aros/boehm-gc/include/gc_amiga_redirects.h 2019-02-13 12:20:35.215061500 +0000 +@@ -2,7 +2,7 @@ + + # define GC_AMIGA_REDIRECTS_H + +-# if ( defined(_AMIGA) && !defined(GC_AMIGA_MAKINGLIB) ) ++# if !defined(__AROS__) && ( defined(_AMIGA) && !defined(GC_AMIGA_MAKINGLIB) ) + extern void *GC_amiga_realloc(void *old_object,size_t new_size_in_bytes); + # define GC_realloc(a,b) GC_amiga_realloc(a,b) + extern void GC_amiga_set_toany(void (*func)(void)); +diff -ruN gcc-6.5.0/configure gcc-6.5.0.aros/configure +--- gcc-6.5.0/configure 2017-01-09 21:01:26.000000000 +0000 ++++ gcc-6.5.0.aros/configure 2019-02-13 12:20:35.215061500 +0000 +@@ -3899,6 +3899,9 @@ + powerpcle-*-solaris*) + noconfigdirs="$noconfigdirs gdb sim tcl tk itcl" + ;; ++ *-*-aros*) ++ noconfigdirs="$noconfigdirs patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix gnuserv gdb" ++ ;; + powerpc-*-beos*) + noconfigdirs="$noconfigdirs gdb" + ;; +@@ -4037,6 +4040,8 @@ + rs6000-*-aix*) + host_makefile_frag="config/mh-ppc-aix" + ;; ++ *-*-aros*) ++ ;; + esac + fi + +diff -ruN gcc-6.5.0/configure.ac gcc-6.5.0.aros/configure.ac +--- gcc-6.5.0/configure.ac 2017-01-09 21:01:26.000000000 +0000 ++++ gcc-6.5.0.aros/configure.ac 2019-02-13 12:20:35.215061500 +0000 +@@ -1235,6 +1235,9 @@ + powerpcle-*-solaris*) + noconfigdirs="$noconfigdirs gdb sim tcl tk itcl" + ;; ++ *-*-aros*) ++ noconfigdirs="$noconfigdirs patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix gnuserv gdb" ++ ;; + powerpc-*-beos*) + noconfigdirs="$noconfigdirs gdb" + ;; +@@ -1354,6 +1357,8 @@ + rs6000-*-aix*) + host_makefile_frag="config/mh-ppc-aix" + ;; ++ *-*-aros*) ++ ;; + esac + fi + +diff -ruN gcc-6.5.0/fixincludes/configure gcc-6.5.0.aros/fixincludes/configure +--- gcc-6.5.0/fixincludes/configure 2018-10-26 10:56:36.000000000 +0100 ++++ gcc-6.5.0.aros/fixincludes/configure 2019-02-13 12:20:35.215061500 +0000 +@@ -4712,6 +4712,7 @@ + fi + else + case $host in ++ *-*-aros* | \ + i?86-*-msdosdjgpp* | \ + i?86-*-mingw32* | \ + x86_64-*-mingw32* | \ +diff -ruN gcc-6.5.0/fixincludes/configure.ac gcc-6.5.0.aros/fixincludes/configure.ac +--- gcc-6.5.0/fixincludes/configure.ac 2012-05-29 20:28:57.000000000 +0100 ++++ gcc-6.5.0.aros/fixincludes/configure.ac 2019-02-13 12:20:35.215061500 +0000 +@@ -50,6 +50,7 @@ + TARGET=oneprocess + fi], + [case $host in ++ *-*-aros* | \ + i?86-*-msdosdjgpp* | \ + i?86-*-mingw32* | \ + x86_64-*-mingw32* | \ +diff -ruN gcc-6.5.0/gcc/config/aarch64/aros.h gcc-6.5.0.aros/gcc/config/aarch64/aros.h +--- gcc-6.5.0/gcc/config/aarch64/aros.h 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/config/aarch64/aros.h 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,67 @@ ++/* Configuration file for ARM AROS EABI targets. ++ Copyright (C) 2004, 2005, 2006, 2007, 2010 ++ Free Software Foundation, Inc. ++ Contributed by Pavel Fedin ++ Based on linux-eabi.h and other AROS targets ++ ++ 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 ++ . */ ++ ++/* On EABI GNU/Linux, we want both the BPABI builtins and the ++ GNU/Linux builtins. */ ++#undef TARGET_OS_CPP_BUILTINS ++#define TARGET_OS_CPP_BUILTINS() \ ++ do \ ++ { \ ++ builtin_define_std ("AROS"); \ ++ builtin_define ("AMIGA"); \ ++ builtin_define ("_AMIGA"); \ ++ builtin_assert ("system=posix"); \ ++ if (flag_pic) \ ++ { \ ++ builtin_define ("__PIC__"); \ ++ builtin_define ("__pic__"); \ ++ } \ ++ } \ ++ while (false) ++ ++/* TARGET_BIG_ENDIAN_DEFAULT is set in ++ config.gcc for big endian configurations. */ ++#undef TARGET_LINKER_EMULATION ++#if TARGET_BIG_ENDIAN_DEFAULT ++#define TARGET_LINKER_EMULATION "aarch64elfb_aros" ++#else ++#define TARGET_LINKER_EMULATION "aarch64elf_aros" ++#endif ++ ++#undef SUBTARGET_CPP_SPEC ++#define SUBTARGET_CPP_SPEC "-D__ELF__ %{!nostdinc:%{!nostdc:%{!noposixc: -idirafter %R/include/aros/posixc} -idirafter %R/include/aros/stdc}}" ++ ++#undef SUBTARGET_EXTRA_LINK_SPEC ++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION ++ ++/* Provide a LINK_SPEC appropriate for AROS. */ ++#undef LINK_SPEC ++#if TARGET_BIG_ENDIAN_DEFAULT ++#define LINK_SPEC "-m aarch64elfb_aros -L %R/lib" ++#else ++#define LINK_SPEC "-m aarch64elf_aros -L %R/lib" ++#endif ++ ++/* Use own supplement to libgcc. */ ++#undef LIBGCC_SPEC ++#define LIBGCC_SPEC "-lgcc" ++ +diff -ruN gcc-6.5.0/gcc/config/aarch64/t-aros gcc-6.5.0.aros/gcc/config/aarch64/t-aros +--- gcc-6.5.0/gcc/config/aarch64/t-aros 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/config/aarch64/t-aros 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,21 @@ ++# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, ++# 2008, 2010 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 ++# . ++ ++ ++ +diff -ruN gcc-6.5.0/gcc/config/arm/aros.h gcc-6.5.0.aros/gcc/config/arm/aros.h +--- gcc-6.5.0/gcc/config/arm/aros.h 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/config/arm/aros.h 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,82 @@ ++/* Configuration file for ARM AROS EABI targets. ++ Copyright (C) 2004, 2005, 2006, 2007, 2010 ++ Free Software Foundation, Inc. ++ Contributed by Pavel Fedin ++ Based on linux-eabi.h and other AROS targets ++ ++ 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 ++ . */ ++ ++/* On EABI GNU/Linux, we want both the BPABI builtins and the ++ GNU/Linux builtins. */ ++#undef TARGET_OS_CPP_BUILTINS ++#define TARGET_OS_CPP_BUILTINS() \ ++ do \ ++ { \ ++ TARGET_BPABI_CPP_BUILTINS(); \ ++ builtin_define_std ("AROS"); \ ++ builtin_define ("AMIGA"); \ ++ builtin_define ("_AMIGA"); \ ++ builtin_assert ("system=posix"); \ ++ if (flag_pic) \ ++ { \ ++ builtin_define ("__PIC__"); \ ++ builtin_define ("__pic__"); \ ++ } \ ++ } \ ++ while (false) ++ ++/* We default to a softfp ABI so that we are compatible ++ with the Linux EABI (as used by the linker). */ ++#undef TARGET_DEFAULT_FLOAT_ABI ++#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFTFP ++ ++/* We default to the "aapcs-linux" ABI so that enums are int-sized by ++ default. */ ++#undef ARM_DEFAULT_ABI ++#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX ++ ++/* Default to armv5t so that thumb shared libraries work. ++ The ARM10TDMI core is the default for armv5t, so set ++ SUBTARGET_CPU_DEFAULT to achieve this. */ ++#undef SUBTARGET_CPU_DEFAULT ++#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi ++ ++/* TARGET_BIG_ENDIAN_DEFAULT is set in ++ config.gcc for big endian configurations. */ ++#undef TARGET_LINKER_EMULATION ++#if TARGET_BIG_ENDIAN_DEFAULT ++#define TARGET_LINKER_EMULATION "armelfb_aros" ++#else ++#define TARGET_LINKER_EMULATION "armelf_aros" ++#endif ++ ++#undef SUBTARGET_CPP_SPEC ++#define SUBTARGET_CPP_SPEC "-D__ELF__ %{!nostdinc:%{!nostdc:%{!noposixc: -idirafter %R/include/aros/posixc} -idirafter %R/include/aros/stdc}}" ++ ++#undef SUBTARGET_EXTRA_LINK_SPEC ++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION ++ ++/* Provide a LINK_SPEC appropriate for AROS. */ ++#undef LINK_SPEC ++#define LINK_SPEC SUBTARGET_EXTRA_LINK_SPEC " -L %R/lib" ++ ++/* Use own supplement to libgcc. */ ++#undef LIBGCC_SPEC ++#define LIBGCC_SPEC "-laeabi -lgcc" ++ ++/* FIXME: AROS doesn't support dw2 unwinding yet. */ ++#undef MD_FALLBACK_FRAME_STATE_FOR +diff -ruN gcc-6.5.0/gcc/config/arm/t-aros gcc-6.5.0.aros/gcc/config/arm/t-aros +--- gcc-6.5.0/gcc/config/arm/t-aros 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/config/arm/t-aros 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,26 @@ ++# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, ++# 2008, 2010 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 ++# . ++ ++MULTILIB_OPTIONS = marm mfloat-abi=hard/mfloat-abi=soft march=armv6/march=armv7-a ++MULTILIB_DIRNAMES = arm fpu soft armv6 armv7-a ++MULTILIB_EXCEPTIONS = ++MULTILIB_MATCHES = ++MULTILIB_OSDIRNAMES = ++MULTILIB_REQUIRED = ++ +diff -ruN gcc-6.5.0/gcc/config/aros.h gcc-6.5.0.aros/gcc/config/aros.h +--- gcc-6.5.0/gcc/config/aros.h 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/config/aros.h 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,115 @@ ++/* Definitions for AROS ++ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. ++ Contributed by Fabio Alemagna ++ Based upon linux.h, contributed by Eric Youngdale. ++ ++This file is part of GNU CC. ++ ++GNU CC 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 2, or (at your option) ++any later version. ++ ++GNU CC 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 GNU CC; see the file COPYING. If not, write to ++the Free Software Foundation, 59 Temple Place - Suite 330, ++Boston, MA 02111-1307, USA. */ ++ ++/* Don't assume anything about the header files. */ ++#define NO_IMPLICIT_EXTERN_C ++ ++#undef SIZE_TYPE ++#define SIZE_TYPE "long unsigned int" ++ ++#undef WCHAR_TYPE ++#define WCHAR_TYPE "char" ++ ++#undef WCHAR_TYPE_SIZE ++#define WCHAR_TYPE_SIZE 8 ++ ++#undef PTRDIFF_TYPE ++#define PTRDIFF_TYPE "long int" ++ ++#undef TARGET_OS_CPP_BUILTINS ++#define TARGET_OS_CPP_BUILTINS() \ ++ do \ ++ { \ ++ builtin_define_std ("AROS"); \ ++ builtin_define ("AMIGA"); \ ++ builtin_define ("_AMIGA"); \ ++ builtin_define ("__ELF__"); \ ++ builtin_assert ("system=posix"); \ ++ } \ ++ while (0) ++ ++#undef ASM_APP_ON ++#define ASM_APP_ON "#APP\n" ++ ++#undef ASM_APP_OFF ++#define ASM_APP_OFF "#NO_APP\n" ++ ++#undef MD_EXEC_PREFIX ++#undef MD_STARTFILE_PREFIX ++ ++/* Provide a STARTFILE_SPEC appropriate for AROS. AROS has its own ++ set of startup files which also take care of handling C++ ++ constructors/destructors. */ ++ ++#undef STARTFILE_SPEC ++#define STARTFILE_SPEC \ ++ "startup%O%s %{detach:detach%O%s} %{nix:nixmain%O%s}" ++ ++/* Provide a ENDFILE_SPEC appropriate for AROS. */ ++ ++#undef ENDFILE_SPEC ++#define ENDFILE_SPEC \ ++ "-lautoinit" ++ ++/* The compiler is configured with ONLY the gcc/g++ standard headers. ++ N.B-: NATIVE_SYSTEM_HEADER_DIR must come after GCC_INCLUDE_DIR with gcc6!! */ ++#undef INCLUDE_DEFAULTS ++#define INCLUDE_DEFAULTS \ ++{ \ ++ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \ ++ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \ ++ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \ ++ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ ++ { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 }, \ ++ { 0, 0, 0, 0, 0, 0 } \ ++}; ++ ++#undef CPP_SPEC ++#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT} %{nix:-D__NIX__} %{!nostdinc:%{!nostdc:%{!noposixc:-idirafter %R/include/aros/posixc} -idirafter %R/include/aros/stdc}}" ++ ++/* This is for -profile to use -lc_p instead of -lc. */ ++#ifndef CC1_SPEC ++#define CC1_SPEC "%{profile:-p}" ++#endif ++ ++/* The GNU C++ standard library requires that these macros be defined. */ ++#undef CPLUSPLUS_CPP_SPEC ++#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" ++ ++#undef LIB_SPEC ++#define LIB_SPEC \ ++ "--start-group -lmui -larossupport -lamiga %{!nostartfiles:%{!static:%{!nostdc:%{!noposixc:-lposixc} -lstdcio -lstdc}}%{static:%{!nostdc:-lstdc.static}}} -lcodesets -lkeymap -lexpansion -lcommodities -ldiskfont -lasl -lmuimaster -ldatatypes -lcybergraphics -lworkbench -licon -lintuition -lgadtools -llayers -laros -lpartition -liffparse -lgraphics -llocale -ldos -lutility -loop %{!nosysbase:-lexec} -lautoinit -llibinit %{nostartfiles:%{static:-lstdc.static}} --end-group" ++ ++#undef LIBSTDCXX_STATIC ++#define LIBSTDCXX_STATIC "pthread" ++ ++#if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR) ++#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " ++#endif ++ ++/* AROS uses its own collect-like program for the moment. */ ++#undef LINKER_NAME ++#define LINKER_NAME "collect-aros" ++ ++#define TARGET_HAS_F_SETLKW ++ ++#define TARGET_POSIX_IO +diff -ruN gcc-6.5.0/gcc/config/aros.opt gcc-6.5.0.aros/gcc/config/aros.opt +--- gcc-6.5.0/gcc/config/aros.opt 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/config/aros.opt 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,35 @@ ++; Processor-independent options for AROS. ++ ++; Copyright (C) 2015 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 ++; . ++ ++posix ++Driver ++ ++noposixc ++Driver ++ ++nostdc ++Driver ++ ++nosysbase ++Driver ++ ++nix ++Driver ++ +diff -ruN gcc-6.5.0/gcc/config/i386/aros.h gcc-6.5.0.aros/gcc/config/i386/aros.h +--- gcc-6.5.0/gcc/config/i386/aros.h 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/config/i386/aros.h 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,25 @@ ++/* Definitions for Intel 386 running AROS systems with ELF format. ++ Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002 ++ Free Software Foundation, Inc. ++ Contributed by Fabio Alemagna. ++ Based upon i386/linux.h by Eric Youngdale. ++ ++This file is part of GNU CC. ++ ++GNU CC 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 2, or (at your option) ++any later version. ++ ++GNU CC 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 GNU CC; see the file COPYING. If not, write to ++the Free Software Foundation, 59 Temple Place - Suite 330, ++Boston, MA 02111-1307, USA. */ ++ ++#undef LINK_SPEC ++#define LINK_SPEC "-m elf_i386 -L%R/lib" +diff -ruN gcc-6.5.0/gcc/config/i386/aros64.h gcc-6.5.0.aros/gcc/config/i386/aros64.h +--- gcc-6.5.0/gcc/config/i386/aros64.h 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/config/i386/aros64.h 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,34 @@ ++/* Definitions for AMD x86_64 running AROS systems with ELF64 format. ++ Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002 ++ Free Software Foundation, Inc. ++ Contributed by Stanislaw Szymczyk . Based on aros.h. ++ ++This file is part of GNU CC. ++ ++GNU CC 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 2, or (at your option) ++any later version. ++ ++GNU CC 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 GNU CC; see the file COPYING. If not, write to ++the Free Software Foundation, 59 Temple Place - Suite 330, ++Boston, MA 02111-1307, USA. */ ++ ++/* The svr4 ABI for the i386 says that records and unions are returned ++ in memory. In the 64bit compilation we will turn this flag off in ++ override_options, as we never do pcc_struct_return scheme on this target. */ ++#undef DEFAULT_PCC_STRUCT_RETURN ++#define DEFAULT_PCC_STRUCT_RETURN 1 ++ ++/* Provide a LINK_SPEC appropriate for AROS. */ ++ ++#undef LINK_SPEC ++#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} -L %R/lib" ++ ++/* FIXME: AROS doesn't support dw2 unwinding yet. */ +diff -ruN gcc-6.5.0/gcc/config/m68k/m68k.c gcc-6.5.0.aros/gcc/config/m68k/m68k.c +--- gcc-6.5.0/gcc/config/m68k/m68k.c 2016-01-04 14:30:50.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/config/m68k/m68k.c 2019-02-13 12:20:35.215061500 +0000 +@@ -4452,7 +4452,7 @@ + else if (letter == '/') + asm_fprintf (file, "%R"); + else if (letter == '?') +- asm_fprintf (file, m68k_library_id_string); ++ asm_fprintf (file, "%s", m68k_library_id_string); + else if (letter == 'p') + { + output_addr_const (file, op); +diff -ruN gcc-6.5.0/gcc/config/m68k/m68k.h gcc-6.5.0.aros/gcc/config/m68k/m68k.h +--- gcc-6.5.0/gcc/config/m68k/m68k.h 2016-01-04 14:30:50.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/config/m68k/m68k.h 2019-02-13 12:20:35.215061500 +0000 +@@ -330,7 +330,9 @@ + register elimination. */ + #define FIRST_PSEUDO_REGISTER 25 + +-/* All m68k targets (except AmigaOS) use %a5 as the PIC register */ ++/* All m68k targets (except AmigaOS) use %a5 as the PIC register. ++ * On AmigaOS, we use %a4 ++ */ + #define PIC_OFFSET_TABLE_REGNUM \ + (!flag_pic ? INVALID_REGNUM \ + : reload_completed ? REGNO (pic_offset_table_rtx) \ +@@ -420,7 +422,8 @@ + /* Most m68k targets use %a6 as a frame pointer. The AmigaOS + ABI uses %a6 for shared library calls, therefore the frame + pointer is shifted to %a5 on this target. */ +-#define FRAME_POINTER_REGNUM A6_REG ++#define FRAME_POINTER_REGNUM A5_REG ++#define PIC_REG A4_REG + + /* Base register for access to arguments of the function. + * This isn't a hardware register. It will be eliminated to the +diff -ruN gcc-6.5.0/gcc/config/m68k/m68k.md gcc-6.5.0.aros/gcc/config/m68k/m68k.md +--- gcc-6.5.0/gcc/config/m68k/m68k.md 2016-02-22 14:22:07.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/config/m68k/m68k.md 2019-02-13 12:20:35.215061500 +0000 +@@ -133,7 +133,8 @@ + [(D0_REG 0) + (A0_REG 8) + (A1_REG 9) +- (PIC_REG 13) ++ (A4_REG 12) ++ (A5_REG 13) + (A6_REG 14) + (SP_REG 15) + (FP0_REG 16) +@@ -7089,7 +7090,7 @@ + { + if (TARGET_ID_SHARED_LIBRARY) + { +- operands[1] = gen_rtx_REG (Pmode, PIC_REG); ++ operands[1] = gen_rtx_REG (Pmode, A4_REG); + return MOTOROLA ? "move.l %?(%1),%0" : "movel %1@(%?), %0"; + } + else if (MOTOROLA) +diff -ruN gcc-6.5.0/gcc/config/m68k/t-aros gcc-6.5.0.aros/gcc/config/m68k/t-aros +--- gcc-6.5.0/gcc/config/m68k/t-aros 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/config/m68k/t-aros 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,2 @@ ++# Custom multilibs for AROS ++M68K_MLIB_CPU += && match(MLIB, "^68") +diff -ruN gcc-6.5.0/gcc/config/rs6000/aros.h gcc-6.5.0.aros/gcc/config/rs6000/aros.h +--- gcc-6.5.0/gcc/config/rs6000/aros.h 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/config/rs6000/aros.h 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,151 @@ ++/* Definitions for Powerpc running AROS systems with ELF format. ++ Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002 ++ Free Software Foundation, Inc. ++ Contributed by Markus Weiss. ++ Based upon i386/aros.h by Fabio Alemagna. ++ ++This file is part of GNU CC. ++ ++GNU CC 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 2, or (at your option) ++any later version. ++ ++GNU CC 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 GNU CC; see the file COPYING. If not, write to ++the Free Software Foundation, 59 Temple Place - Suite 330, ++Boston, MA 02111-1307, USA. */ ++ ++/* Symbols missing in comparison to i386/aros.h are either ++ defined in elfos.h, rs6000/rs6000.h rs6000/sysv4.h ++ or not needed for PowerPC. ++*/ ++ ++/* We need to define __powerpc__. */ ++ ++#undef TARGET_OS_CPP_BUILTINS ++#define TARGET_OS_CPP_BUILTINS() \ ++ do \ ++ { \ ++ builtin_define_std ("AROS"); \ ++ builtin_define ("AMIGA"); \ ++ builtin_define ("_AMIGA"); \ ++ builtin_define ("__powerpc__"); \ ++ builtin_define ("__ELF__"); \ ++ builtin_assert ("system=posix"); \ ++ if (flag_pic) \ ++ { \ ++ builtin_define ("__PIC__"); \ ++ builtin_define ("__pic__"); \ ++ } \ ++ } \ ++ while (0) ++ ++/* This one taken from linux.h. */ ++/* We are 32-bit all the time, so optimize a little. */ ++#undef TARGET_64BIT ++#define TARGET_64BIT 0 ++ ++/* The svr4 ABI for the i386 says that records and unions are returned ++ in memory. */ ++/*#undef DEFAULT_PCC_STRUCT_RETURN ++#define DEFAULT_PCC_STRUCT_RETURN 1 ++see rs6000/rs6000.h ++*/ ++ ++/* ++#undef ASM_COMMENT_START ++#define ASM_COMMENT_START "#" ++see rs6000/rs6000.h ++*/ ++ ++/* ++#undef DBX_REGISTER_NUMBER ++#define DBX_REGISTER_NUMBER(n) \ ++ (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n]) ++see rs6000/sysv4.h ++*/ ++ ++/* Output assembler code to FILE to call the profiler. ++ To the best of my knowledge, no Linux libc has required the label ++ argument to mcount. */ ++ ++/* ++#define NO_PROFILE_COUNTERS 1 ++not used by other similar ppc compilers ++only in darwin.h rs6000/linux64.h rs6000/rs6000.c ++*/ ++ ++/* ++#undef MCOUNT_NAME ++#define MCOUNT_NAME "mcount" ++see rs6000/sysv4.h RS6000_MCOUNT ++*/ ++ ++/* The GLIBC version of mcount for the x86 assumes that there is a ++ frame, so we cannot allow profiling without a frame pointer. */ ++/* ++#undef SUBTARGET_FRAME_POINTER_REQUIRED ++#define SUBTARGET_FRAME_POINTER_REQUIRED crtl->profile ++seems to be handled by rs6000/rs6000.h ++*/ ++ ++#undef CC1_SPEC ++#define CC1_SPEC "%(cc1_cpu) %{profile:-p}" ++ ++/* Provide a LINK_SPEC appropriate for AROS. */ ++ ++#undef LINK_SPEC ++#define LINK_SPEC "-m elf32ppc -L %R/lib" ++ ++/* A C statement (sans semicolon) to output to the stdio stream ++ FILE the assembler definition of uninitialized global DECL named ++ NAME whose size is SIZE bytes and alignment is ALIGN bytes. ++ Try to use asm_output_aligned_bss to implement this macro. */ ++/* ++#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ ++ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) ++see rs6000/sysv4.h ++*/ ++ ++/* A C statement to output to the stdio stream FILE an assembler ++ command to advance the location counter to a multiple of 1<call_cookie |= CALL_LONG; + ++ cum->stackparm = fntype && lookup_attribute("stackparm", ++ TYPE_ATTRIBUTES(fntype)); ++ + if (TARGET_DEBUG_ARG) + { + fprintf (stderr, "\ninit_cumulative_args:"); +@@ -11749,6 +11754,9 @@ + + rs6000_discover_homogeneous_aggregate (mode, type, &elt_mode, &n_elts); + ++ if (cum->stackparm) ++ return NULL_RTX; ++ + if (TARGET_MACHO && rs6000_darwin64_struct_check_p (mode, type)) + { + rtx rslt = rs6000_darwin64_record_arg (cum, type, named, /*retval= */false); +@@ -12355,6 +12363,8 @@ + + /* Skip the last named argument. */ + next_cum = *get_cumulative_args (cum); ++ if (next_cum.stackparm) ++ return; + rs6000_function_arg_advance_1 (&next_cum, mode, type, true, 0); + + if (DEFAULT_ABI == ABI_V4) +diff -ruN gcc-6.5.0/gcc/config/rs6000/rs6000.h gcc-6.5.0.aros/gcc/config/rs6000/rs6000.h +--- gcc-6.5.0/gcc/config/rs6000/rs6000.h 2018-06-07 15:03:35.000000000 +0100 ++++ gcc-6.5.0.aros/gcc/config/rs6000/rs6000.h 2019-02-13 12:20:35.215061500 +0000 +@@ -1881,6 +1881,7 @@ + int nargs_prototype; /* # args left in the current prototype */ + int prototype; /* Whether a prototype was defined */ + int stdarg; /* Whether function is a stdarg function. */ ++ int stackparm; /* Whether function has all args on the stack */ + int call_cookie; /* Do special things for this call */ + int sysv_gregno; /* next available GP register */ + int intoffset; /* running offset in struct (darwin64) */ +diff -ruN gcc-6.5.0/gcc/config/t-aros gcc-6.5.0.aros/gcc/config/t-aros +--- gcc-6.5.0/gcc/config/t-aros 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/config/t-aros 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,29 @@ ++# In AROS, "/usr" is a four-letter word. ++# Must match NATIVE_SYSTEM_HEADER_COMPONENT in aros.h ! ++NATIVE_SYSTEM_HEADER_DIR = /include ++ ++# Don't add AROS target include path when compiling host compiler ++CPPFLAGS = ++ ++# Copy AROS specific include replacement files ++LIBGCC_DEPS += stmp-aros-hrds ++ ++EXTRA_AROS_HEADERS = aros/types/size_t.h aros/types/ptrdiff_t.h \ ++ aros/types/wchar_t.h aros/types/wint_t.h aros/types/null.h ++ ++stmp-int-hdrs : | include/aros/types ++ ++include/aros/types : $(addprefix $(srcdir)/ginclude/,$(EXTRA_AROS_HEADERS)) ++ -if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi ++ -if [ -d include/aros/types ] ; \ ++ then true; \ ++ else \ ++ mkdir include/aros; chmod a+rx include/aros; \ ++ mkdir include/aros/types; chmod a+rx include/aros/types; \ ++ fi ++ for file in $(EXTRA_AROS_HEADERS); do \ ++ $(STAMP) include/$$file; \ ++ rm -fr include/$$file; \ ++ cp $(srcdir)/ginclude/$$file include/$$file; \ ++ chmod a+r include/$$file; \ ++ done +diff -ruN gcc-6.5.0/gcc/config.build gcc-6.5.0.aros/gcc/config.build +--- gcc-6.5.0/gcc/config.build 2016-01-04 14:30:50.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/config.build 2019-02-13 12:20:35.215061500 +0000 +@@ -73,6 +73,9 @@ + build_xm_file=i386/xm-djgpp.h + build_exeext=.exe + ;; ++ *-*-aros*) ++ build_xm_file=xm-aros.h ++ ;; + *-*-sysv*) + # All other System V variants. + build_install_headers_dir=install-headers-cpio +diff -ruN gcc-6.5.0/gcc/config.gcc gcc-6.5.0.aros/gcc/config.gcc +--- gcc-6.5.0/gcc/config.gcc 2017-11-21 09:41:34.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/config.gcc 2019-02-13 12:20:35.215061500 +0000 +@@ -798,6 +798,15 @@ + ;; + esac + ;; ++*-*-aros*) ++ gas=yes ++ gnu_ld=yes ++ thread_file=posix ++ use_collect2=no ++ xm_defines='STDC_HEADERS=1' ++ extra_options="${extra_options} aros.opt" ++ ;; ++ + *-*-openbsd*) + tmake_file="t-openbsd" + case ${enable_threads} in +@@ -912,6 +921,16 @@ + esac + + case ${target} in ++aarch64*-*-aros*) ++ tm_file="${tm_file} dbxelf.h elfos.h aarch64/aarch64-elf.h aros.h aarch64/aros.h" ++ tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aros t-aros" ++ xm_file="xm-aros.h" ++ case $target in ++ aarch64_be-*) ++ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" ++ ;; ++ esac ++ ;; + aarch64*-*-elf | aarch64*-*-rtems*) + tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h" + tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-elf-raw.h" +@@ -1003,6 +1022,21 @@ + tm_file="${tm_file} vms/vms.h alpha/vms.h" + tmake_file="${tmake_file} alpha/t-vms" + ;; ++arm*-*-aros*) ++ tm_file="dbxelf.h elfos.h arm/elf.h arm/bpabi.h aros.h arm/aros.h arm/aout.h arm/arm.h" ++ tm_file="$tm_file ../../libgcc/config/arm/bpabi-lib.h" ++ tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-arm-softfp arm/t-bpabi arm/t-aros t-aros" ++ xm_file="xm-aros.h" ++ # The BPABI long long divmod functions return a 128-bit value in ++ # registers r0-r3. Correctly modeling that requires the use of ++ # TImode. ++ case $target in ++ arm*b-*-aros*) ++ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" ++ ;; ++ esac ++ need_64bit_hwint=yes ++ ;; + arc*-*-elf*) + extra_headers="arc-simd.h" + tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}" +@@ -1612,6 +1646,16 @@ + done + TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'` + ;; ++i[34567]86-*-aros*) ++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h aros.h i386/aros.h" ++ xm_file=xm-aros.h ++ tmake_file="${tmake_file} i386/t-i386elf t-aros" ++ ;; ++x86_64-*-aros*) ++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h i386/x86-64.h aros.h i386/aros64.h" ++ tmake_file="${tmake_file} i386/t-i386elf t-aros" ++ xm_file=xm-aros.h ++ ;; + i[34567]86-pc-msdosdjgpp*) + xm_file=i386/xm-djgpp.h + tm_file="dbxcoff.h ${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h i386/djgpp-stdint.h" +@@ -1909,6 +1953,16 @@ + thread_file='posix' + fi + ;; ++m68k-*-aros*) ++ default_m68k_cpu=68000 ++ default_cf_cpu=5206 ++ tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h newlib-stdint.h m68k/m68kemb.h m68k/m68020-elf.h" ++ tm_file="${tm_file} aros.h" ++ tm_defines="${tm_defines} MOTOROLA=1" ++ tmake_file="m68k/t-floatlib m68k/t-m68kbare m68k/t-m68kelf" ++ tmake_file="$tmake_file m68k/t-aros m68k/t-mlibs t-aros" ++ extra_parts="crtbegin.o crtend.o" ++ ;; + m68k-*-elf* | fido-*-elf*) + case ${target} in + fido-*-elf*) +@@ -2409,6 +2463,13 @@ + extra_options="${extra_options} rs6000/sysv4.opt" + tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems rs6000/t-ppccomm" + ;; ++powerpc-*-aros*) ++ tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h aros.h" ++ extra_options="${extra_options} rs6000/sysv4.opt" ++ tm_file="${tm_file} rs6000/aros.h" ++ xm_file=xm-aros.h ++ tmake_file="$tmake_file t-aros" ++ ;; + powerpc*-*-linux*) + tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h" + extra_options="${extra_options} rs6000/sysv4.opt" +diff -ruN gcc-6.5.0/gcc/config.host gcc-6.5.0.aros/gcc/config.host +--- gcc-6.5.0/gcc/config.host 2017-01-09 21:01:26.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/config.host 2019-02-13 12:20:35.215061500 +0000 +@@ -281,6 +281,10 @@ + out_host_hook_obj=host-hpux.o + host_xmake_file="${host_xmake_file} x-hpux" + ;; ++ *-*-aros*) ++ host_can_use_collect2=no ++ host_xm_file=xm-aros.h ++ ;; + *-*-*vms*) + host_xm_file="vms/xm-vms.h" + host_xmake_file=vms/x-vms +diff -ruN gcc-6.5.0/gcc/ginclude/aros/types/null.h gcc-6.5.0.aros/gcc/ginclude/aros/types/null.h +--- gcc-6.5.0/gcc/ginclude/aros/types/null.h 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/ginclude/aros/types/null.h 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,3 @@ ++/* Replace AROS' NULL definition with gcc's one */ ++#define __need_NULL ++#include +diff -ruN gcc-6.5.0/gcc/ginclude/aros/types/ptrdiff_t.h gcc-6.5.0.aros/gcc/ginclude/aros/types/ptrdiff_t.h +--- gcc-6.5.0/gcc/ginclude/aros/types/ptrdiff_t.h 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/ginclude/aros/types/ptrdiff_t.h 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,3 @@ ++/* Replace AROS' ptrdiff_t definition with gcc's one */ ++#define __need_ptrdiff_t ++#include +diff -ruN gcc-6.5.0/gcc/ginclude/aros/types/size_t.h gcc-6.5.0.aros/gcc/ginclude/aros/types/size_t.h +--- gcc-6.5.0/gcc/ginclude/aros/types/size_t.h 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/ginclude/aros/types/size_t.h 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,3 @@ ++/* Replace AROS' size_t definition with gcc's one */ ++#define __need_size_t ++#include +diff -ruN gcc-6.5.0/gcc/ginclude/aros/types/wchar_t.h gcc-6.5.0.aros/gcc/ginclude/aros/types/wchar_t.h +--- gcc-6.5.0/gcc/ginclude/aros/types/wchar_t.h 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/ginclude/aros/types/wchar_t.h 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,3 @@ ++/* Replace AROS' wchar_t definition with gcc's one */ ++#define __need_wchar_t ++#include +diff -ruN gcc-6.5.0/gcc/ginclude/aros/types/wint_t.h gcc-6.5.0.aros/gcc/ginclude/aros/types/wint_t.h +--- gcc-6.5.0/gcc/ginclude/aros/types/wint_t.h 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/ginclude/aros/types/wint_t.h 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,3 @@ ++/* Replace AROS' wint_t definition with gcc's one */ ++#define __need_wint_t ++#include +diff -ruN gcc-6.5.0/gcc/ginclude/stddef.h gcc-6.5.0.aros/gcc/ginclude/stddef.h +--- gcc-6.5.0/gcc/ginclude/stddef.h 2016-01-04 14:30:50.000000000 +0000 ++++ gcc-6.5.0.aros/gcc/ginclude/stddef.h 2019-02-13 12:20:35.215061500 +0000 +@@ -131,6 +131,7 @@ + #ifndef __PTRDIFF_T + #ifndef _PTRDIFF_T_ + #ifndef _BSD_PTRDIFF_T_ ++#ifndef _AROS_TYPES_PTRDIFF_T_H + #ifndef ___int_ptrdiff_t_h + #ifndef _GCC_PTRDIFF_T + #ifndef _PTRDIFF_T_DECLARED /* DragonFly */ +@@ -140,6 +141,7 @@ + #define __PTRDIFF_T + #define _PTRDIFF_T_ + #define _BSD_PTRDIFF_T_ ++#define _AROS_TYPES_PTRDIFF_T_H + #define ___int_ptrdiff_t_h + #define _GCC_PTRDIFF_T + #define _PTRDIFF_T_DECLARED +@@ -150,6 +152,7 @@ + #endif /* _PTRDIFF_T_DECLARED */ + #endif /* _GCC_PTRDIFF_T */ + #endif /* ___int_ptrdiff_t_h */ ++#endif /* _AROS_TYPES_PTRDIFF_T_H */ + #endif /* _BSD_PTRDIFF_T_ */ + #endif /* _PTRDIFF_T_ */ + #endif /* __PTRDIFF_T */ +@@ -176,6 +179,7 @@ + #ifndef __SIZE_T + #ifndef _SIZE_T_ + #ifndef _BSD_SIZE_T_ ++#ifndef _AROS_TYPES_SIZE_T_H + #ifndef _SIZE_T_DEFINED_ + #ifndef _SIZE_T_DEFINED + #ifndef _BSD_SIZE_T_DEFINED_ /* Darwin */ +@@ -193,6 +197,7 @@ + #define __SIZE_T + #define _SIZE_T_ + #define _BSD_SIZE_T_ ++#define _AROS_TYPES_SIZE_T_H + #define _SIZE_T_DEFINED_ + #define _SIZE_T_DEFINED + #define _BSD_SIZE_T_DEFINED_ /* Darwin */ +@@ -226,6 +231,7 @@ + #endif /* _BSD_SIZE_T_DEFINED_ */ + #endif /* _SIZE_T_DEFINED */ + #endif /* _SIZE_T_DEFINED_ */ ++#endif /* _AROS_TYPES_SIZE_T_H */ + #endif /* _BSD_SIZE_T_ */ + #endif /* _SIZE_T_ */ + #endif /* __SIZE_T */ +diff -ruN gcc-6.5.0/include/filenames.h gcc-6.5.0.aros/include/filenames.h +--- gcc-6.5.0/include/filenames.h 2015-07-14 17:08:59.000000000 +0100 ++++ gcc-6.5.0.aros/include/filenames.h 2019-02-13 12:20:35.215061500 +0000 +@@ -42,6 +42,13 @@ + # define HAS_DRIVE_SPEC(f) HAS_DOS_DRIVE_SPEC (f) + # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) + # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) ++#elif defined(__AROS__) ++# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM ++# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 ++# endif ++# define HAS_DRIVE_SPEC(f) (0) ++# define IS_DIR_SEPARATOR(c) ((c) == '/' || (c) == ':') ++# define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0]) || (strchr((f), ':'))) + #else /* not DOSish */ + # if defined(__APPLE__) + # ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM +diff -ruN gcc-6.5.0/libgcc/config/arm/t-aros gcc-6.5.0.aros/libgcc/config/arm/t-aros +--- gcc-6.5.0/libgcc/config/arm/t-aros 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/libgcc/config/arm/t-aros 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,2 @@ ++LIB1ASMFUNCS += _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls ++ +diff -ruN gcc-6.5.0/libgcc/config/m68k/aros-atomic.c gcc-6.5.0.aros/libgcc/config/m68k/aros-atomic.c +--- gcc-6.5.0/libgcc/config/m68k/aros-atomic.c 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/libgcc/config/m68k/aros-atomic.c 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,204 @@ ++/* AROS-specific atomic operations for m68k AROS. ++ Copyright (C) 2019 Free Software Foundation, Inc. ++ Based on code contributed by CodeSourcery for ARM EABI Linux. ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify it under ++the terms of the GNU General Public License as published by the Free ++Software Foundation; either version 3, or (at your option) any later ++version. ++ ++GCC is distributed in the hope that it will be useful, but WITHOUT ANY ++WARRANTY; without even the implied warranty of MERCHANTABILITY or ++FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++for more details. ++ ++Under Section 7 of GPL version 3, you are granted additional ++permissions described in the GCC Runtime Library Exception, version ++3.1, as published by the Free Software Foundation. ++ ++You should have received a copy of the GNU General Public License and ++a copy of the GCC Runtime Library Exception along with this program; ++see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++. */ ++ ++/*We implement byte, short and int versions of each atomic operation ++ using the helper defined below. There is no support for ++ 64-bit operations yet. */ ++ ++#include ++ ++/* Helper to compare-and-exchange a 32-bit value. */ ++#define __aros_atomic_m68k_cmpxchg(mem, oldval, newval, result) \ ++ __asm__ __volatile__("casl %0,%2,%1" \ ++ : "=d" (result), "=m" (*mem) \ ++ : "d" (newval), "0" (oldval), "m" (*mem)) ++ ++static inline unsigned ++__aros_atomic_cmpxchg (unsigned *mem, unsigned oldval, unsigned newval) ++{ ++ unsigned curval, result; ++ ++ for (;;) { ++ curval = *mem; ++ if (curval != oldval) ++ return curval; ++ __aros_atomic_m68k_cmpxchg(mem, curval, newval, result); ++ if (result == newval) ++ return curval; ++ } ++} ++ ++#define HIDDEN __attribute__ ((visibility ("hidden"))) ++ ++/* Big endian masks */ ++#define INVERT_MASK_1 24 ++#define INVERT_MASK_2 16 ++ ++#define MASK_1 0xffu ++#define MASK_2 0xffffu ++ ++#define NAME_oldval(OP, WIDTH) __sync_fetch_and_##OP##_##WIDTH ++#define NAME_newval(OP, WIDTH) __sync_##OP##_and_fetch_##WIDTH ++ ++#define WORD_SYNC_OP(OP, PFX_OP, INF_OP, RETURN) \ ++ unsigned HIDDEN \ ++ NAME##_##RETURN (OP, 4) (unsigned *ptr, unsigned val) \ ++ { \ ++ unsigned oldval, newval, cmpval = *ptr; \ ++ \ ++ do { \ ++ oldval = cmpval; \ ++ newval = PFX_OP (oldval INF_OP val); \ ++ cmpval = __aros_atomic_cmpxchg (ptr, oldval, newval); \ ++ } while (__builtin_expect (oldval != cmpval, 0)); \ ++ \ ++ return RETURN; \ ++ } ++ ++#define SUBWORD_SYNC_OP(OP, PFX_OP, INF_OP, TYPE, WIDTH, RETURN) \ ++ TYPE HIDDEN \ ++ NAME##_##RETURN (OP, WIDTH) (TYPE *ptr, TYPE sval) \ ++ { \ ++ unsigned *wordptr = (unsigned *) ((unsigned long) ptr & ~3); \ ++ unsigned int mask, shift, oldval, newval, cmpval, wval; \ ++ \ ++ shift = (((unsigned long) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH; \ ++ mask = MASK_##WIDTH << shift; \ ++ wval = (sval & MASK_##WIDTH) << shift; \ ++ \ ++ cmpval = *wordptr; \ ++ do { \ ++ oldval = cmpval; \ ++ newval = PFX_OP (oldval INF_OP wval); \ ++ newval = (newval & mask) | (oldval & ~mask); \ ++ cmpval = __aros_atomic_cmpxchg (wordptr, oldval, newval); \ ++ } while (__builtin_expect (oldval != cmpval, 0)); \ ++ \ ++ return (RETURN >> shift) & MASK_##WIDTH; \ ++ } ++ ++WORD_SYNC_OP (add, , +, oldval) ++WORD_SYNC_OP (sub, , -, oldval) ++WORD_SYNC_OP (or, , |, oldval) ++WORD_SYNC_OP (and, , &, oldval) ++WORD_SYNC_OP (xor, , ^, oldval) ++WORD_SYNC_OP (nand, ~, &, oldval) ++ ++SUBWORD_SYNC_OP (add, , +, unsigned short, 2, oldval) ++SUBWORD_SYNC_OP (sub, , -, unsigned short, 2, oldval) ++SUBWORD_SYNC_OP (or, , |, unsigned short, 2, oldval) ++SUBWORD_SYNC_OP (and, , &, unsigned short, 2, oldval) ++SUBWORD_SYNC_OP (xor, , ^, unsigned short, 2, oldval) ++SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, oldval) ++ ++SUBWORD_SYNC_OP (add, , +, unsigned char, 1, oldval) ++SUBWORD_SYNC_OP (sub, , -, unsigned char, 1, oldval) ++SUBWORD_SYNC_OP (or, , |, unsigned char, 1, oldval) ++SUBWORD_SYNC_OP (and, , &, unsigned char, 1, oldval) ++SUBWORD_SYNC_OP (xor, , ^, unsigned char, 1, oldval) ++SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, oldval) ++ ++WORD_SYNC_OP (add, , +, newval) ++WORD_SYNC_OP (sub, , -, newval) ++WORD_SYNC_OP (or, , |, newval) ++WORD_SYNC_OP (and, , &, newval) ++WORD_SYNC_OP (xor, , ^, newval) ++WORD_SYNC_OP (nand, ~, &, newval) ++ ++SUBWORD_SYNC_OP (add, , +, unsigned short, 2, newval) ++SUBWORD_SYNC_OP (sub, , -, unsigned short, 2, newval) ++SUBWORD_SYNC_OP (or, , |, unsigned short, 2, newval) ++SUBWORD_SYNC_OP (and, , &, unsigned short, 2, newval) ++SUBWORD_SYNC_OP (xor, , ^, unsigned short, 2, newval) ++SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, newval) ++ ++SUBWORD_SYNC_OP (add, , +, unsigned char, 1, newval) ++SUBWORD_SYNC_OP (sub, , -, unsigned char, 1, newval) ++SUBWORD_SYNC_OP (or, , |, unsigned char, 1, newval) ++SUBWORD_SYNC_OP (and, , &, unsigned char, 1, newval) ++SUBWORD_SYNC_OP (xor, , ^, unsigned char, 1, newval) ++SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, newval) ++ ++unsigned HIDDEN ++__sync_val_compare_and_swap_4 (unsigned *ptr, unsigned oldval, unsigned newval) ++{ ++ return __aros_atomic_cmpxchg (ptr, oldval, newval); ++} ++ ++bool HIDDEN ++__sync_bool_compare_and_swap_4 (unsigned *ptr, unsigned oldval, ++ unsigned newval) ++{ ++ return __aros_atomic_cmpxchg (ptr, oldval, newval) == oldval; ++} ++ ++#define SUBWORD_VAL_CAS(TYPE, WIDTH) \ ++ TYPE HIDDEN \ ++ __sync_val_compare_and_swap_##WIDTH (TYPE *ptr, TYPE soldval, \ ++ TYPE snewval) \ ++ { \ ++ unsigned *wordptr = (unsigned *)((unsigned long) ptr & ~3); \ ++ unsigned int mask, shift, woldval, wnewval; \ ++ unsigned oldval, newval, cmpval; \ ++ \ ++ shift = (((unsigned long) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH; \ ++ mask = MASK_##WIDTH << shift; \ ++ woldval = (soldval & MASK_##WIDTH) << shift; \ ++ wnewval = (snewval & MASK_##WIDTH) << shift; \ ++ cmpval = *wordptr; \ ++ \ ++ do { \ ++ oldval = cmpval; \ ++ if ((oldval & mask) != woldval) \ ++ break; \ ++ newval = (oldval & ~mask) | wnewval; \ ++ cmpval = __aros_atomic_cmpxchg (wordptr, oldval, newval); \ ++ } while (__builtin_expect (oldval != cmpval, 0)); \ ++ \ ++ return (oldval >> shift) & MASK_##WIDTH; \ ++ } ++ ++SUBWORD_VAL_CAS (unsigned short, 2) ++SUBWORD_VAL_CAS (unsigned char, 1) ++ ++#define SUBWORD_BOOL_CAS(TYPE, WIDTH) \ ++ bool HIDDEN \ ++ __sync_bool_compare_and_swap_##WIDTH (TYPE *ptr, TYPE oldval, \ ++ TYPE newval) \ ++ { \ ++ return (__sync_val_compare_and_swap_##WIDTH (ptr, oldval, newval) \ ++ == oldval); \ ++ } ++ ++SUBWORD_BOOL_CAS (unsigned short, 2) ++SUBWORD_BOOL_CAS (unsigned char, 1) ++ ++#undef NAME_oldval ++#define NAME_oldval(OP, WIDTH) __sync_lock_##OP##_##WIDTH ++#define COMMA , ++ ++WORD_SYNC_OP (test_and_set, , COMMA, oldval) ++SUBWORD_SYNC_OP (test_and_set, , COMMA, unsigned char, 1, oldval) ++SUBWORD_SYNC_OP (test_and_set, , COMMA, unsigned short, 2, oldval) +diff -ruN gcc-6.5.0/libgcc/config/m68k/lb1sf68.S gcc-6.5.0.aros/libgcc/config/m68k/lb1sf68.S +--- gcc-6.5.0/libgcc/config/m68k/lb1sf68.S 2016-01-04 14:30:50.000000000 +0000 ++++ gcc-6.5.0.aros/libgcc/config/m68k/lb1sf68.S 2019-02-13 12:20:35.215061500 +0000 +@@ -3123,9 +3123,9 @@ + | Now comes the check for +/-INFINITY. We know that both are (maybe not + | finite) numbers, but we have to check if both are infinite whether we + | are adding or subtracting them. +- eorl d3,d2 | to check sign bits ++ movel d2,d7 | save sign bit ++ eorl d3,d2 | check sign bits + bmi 1f +- movel d0,d7 + andl IMM (0x80000000),d7 | get (common) sign bit + bra Lf$infty + 1: +@@ -3135,7 +3135,6 @@ + cmpl d1,d0 | are both infinite? + beq Lf$inop | if so return NaN + +- movel d0,d7 + andl IMM (0x80000000),d7 | get a's sign bit ' + cmpl d4,d0 | test now for infinity + beq Lf$infty | if a is INFINITY return with this sign +diff -ruN gcc-6.5.0/libgcc/config/m68k/t-aros gcc-6.5.0.aros/libgcc/config/m68k/t-aros +--- gcc-6.5.0/libgcc/config/m68k/t-aros 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/libgcc/config/m68k/t-aros 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,4 @@ ++ ++aros-atomic.o: $(srcdir)/config/m68k/aros-atomic.c ++ $(gcc_compile) -mcpu=68020 -c $< ++libgcc-objects += aros-atomic.o +diff -ruN gcc-6.5.0/libgcc/config.host gcc-6.5.0.aros/libgcc/config.host +--- gcc-6.5.0/libgcc/config.host 2017-11-21 09:41:34.000000000 +0000 ++++ gcc-6.5.0.aros/libgcc/config.host 2019-02-13 12:20:35.215061500 +0000 +@@ -201,6 +201,9 @@ + + # Common parts for widely ported systems. + case ${host} in ++*-*-aros*) ++ tmake_file="$tmake_file" ++ ;; + *-*-darwin*) + asm_hidden_op=.private_extern + tmake_file="$tmake_file t-darwin ${cpu_type}/t-darwin t-libgcc-pic t-slibgcc-darwin" +@@ -381,6 +384,12 @@ + tmake_file="$tmake_file arm/t-arm arm/t-elf t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp" + extra_parts="$extra_parts crti.o crtn.o" + ;; ++arm*-*-aros*) # ARM AROS ++ tmake_file="${tmake_file} arm/t-arm arm/t-aros t-fixedpoint-gnu-prefix arm/t-bpabi t-crtfm" ++ tmake_file="${tmake_file} arm/t-softfp t-softfp" ++ tm_file="${tm_file} arm/bpabi-lib.h" ++ unwind_header=config/arm/unwind-arm.h ++ ;; + arm*-*-freebsd*) # ARM FreeBSD EABI + tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix arm/t-elf" + tmake_file="${tmake_file} arm/t-bpabi arm/t-freebsd" +@@ -816,6 +825,9 @@ + m32rle-*-linux*) + tmake_file="$tmake_file m32r/t-linux t-fdpbit" + ;; ++m68k-*-aros*) ++ tmake_file="$tmake_file m68k/t-floatlib m68k/t-aros" ++ ;; + m68k-*-elf* | fido-*-elf) + tmake_file="$tmake_file m68k/t-floatlib" + ;; +@@ -1340,6 +1352,9 @@ + tmake_file="$tmake_file nvptx/t-nvptx" + extra_parts="crt0.o" + ;; ++*-*-aros*) ++ tmake_file="$tmake_file" ++ ;; + *) + echo "*** Configuration ${host} not supported" 1>&2 + exit 1 +diff -ruN gcc-6.5.0/libgcc/gthr.h gcc-6.5.0.aros/libgcc/gthr.h +--- gcc-6.5.0/libgcc/gthr.h 2016-01-04 14:30:50.000000000 +0000 ++++ gcc-6.5.0.aros/libgcc/gthr.h 2019-02-13 12:20:35.215061500 +0000 +@@ -141,6 +141,11 @@ + #define GTHREAD_USE_WEAK 0 + #endif + ++#ifdef __AROS__ ++#undef GTHREAD_USE_WEAK ++#define GTHREAD_USE_WEAK 0 ++#endif ++ + #ifndef GTHREAD_USE_WEAK + #define GTHREAD_USE_WEAK 1 + #endif +diff -ruN gcc-6.5.0/libgcc/unwind-dw2-fde.c gcc-6.5.0.aros/libgcc/unwind-dw2-fde.c +--- gcc-6.5.0/libgcc/unwind-dw2-fde.c 2016-01-04 14:30:50.000000000 +0000 ++++ gcc-6.5.0.aros/libgcc/unwind-dw2-fde.c 2019-02-13 12:20:35.215061500 +0000 +@@ -92,12 +92,16 @@ + #endif + + init_object_mutex_once (); ++#ifndef __AROS__ /* This is called when SysBase is not yet set up */ + __gthread_mutex_lock (&object_mutex); ++#endif + + ob->next = unseen_objects; + unseen_objects = ob; + ++#ifndef __AROS__ + __gthread_mutex_unlock (&object_mutex); ++#endif + } + + void +diff -ruN gcc-6.5.0/libgcc/unwind-dw2.c gcc-6.5.0.aros/libgcc/unwind-dw2.c +--- gcc-6.5.0/libgcc/unwind-dw2.c 2016-01-04 14:30:50.000000000 +0000 ++++ gcc-6.5.0.aros/libgcc/unwind-dw2.c 2019-02-13 12:20:35.215061500 +0000 +@@ -1542,7 +1542,9 @@ + static inline void + init_dwarf_reg_size_table (void) + { ++#ifdef MD_FALLBACK_FRAME_STATE_FOR + __builtin_init_dwarf_reg_size_table (dwarf_reg_size_table); ++#endif + } + + static void __attribute__((noinline)) +diff -ruN gcc-6.5.0/libiberty/filename_cmp.c gcc-6.5.0.aros/libiberty/filename_cmp.c +--- gcc-6.5.0/libiberty/filename_cmp.c 2014-11-11 23:33:25.000000000 +0000 ++++ gcc-6.5.0.aros/libiberty/filename_cmp.c 2019-02-13 12:20:35.215061500 +0000 +@@ -55,9 +55,12 @@ + int + filename_cmp (const char *s1, const char *s2) + { +-#if !defined(HAVE_DOS_BASED_FILE_SYSTEM) \ +- && !defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM) ++#if !defined(HAVE_DOS_BASED_FILE_SYSTEM) ++#if defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM) ++ return strcasecmp(s1, s2); ++#else + return strcmp(s1, s2); ++#endif + #else + for (;;) + { +diff -ruN gcc-6.5.0/libobjc/configure gcc-6.5.0.aros/libobjc/configure +--- gcc-6.5.0/libobjc/configure 2018-10-26 10:56:36.000000000 +0100 ++++ gcc-6.5.0.aros/libobjc/configure 2019-02-13 12:20:35.215061500 +0000 +@@ -11253,214 +11253,7 @@ + # ----------- + + # Check if we have thread-local storage +- +- +- # Check whether --enable-tls was given. +-if test "${enable_tls+set}" = set; then : +- enableval=$enable_tls; +- case "$enableval" in +- yes|no) ;; +- *) as_fn_error "Argument to enable/disable tls must be yes or no" "$LINENO" 5 ;; +- esac +- +-else +- enable_tls=yes +-fi +- +- +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports thread-local storage" >&5 +-$as_echo_n "checking whether the target supports thread-local storage... " >&6; } +-if test "${gcc_cv_have_tls+set}" = set; then : +- $as_echo_n "(cached) " >&6 +-else +- +- if test "$cross_compiling" = yes; then : +- if test x$gcc_no_link = xyes; then +- as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +-fi +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-__thread int a; int b; int main() { return a = b; } +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- chktls_save_LDFLAGS="$LDFLAGS" +- case $host in +- *-*-linux*) +- LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" +- ;; +- esac +- chktls_save_CFLAGS="$CFLAGS" +- CFLAGS="-fPIC $CFLAGS" +- if test x$gcc_no_link = xyes; then +- as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +-fi +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-int f() { return 0; } +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- if test x$gcc_no_link = xyes; then +- as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +-fi +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-__thread int a; int b; int f() { return a = b; } +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- gcc_cv_have_tls=yes +-else +- gcc_cv_have_tls=no +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-else +- gcc_cv_have_tls=yes +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +- CFLAGS="$chktls_save_CFLAGS" +- LDFLAGS="$chktls_save_LDFLAGS" +-else +- gcc_cv_have_tls=no +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +- +- +-else +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-__thread int a; int b; int main() { return a = b; } +-_ACEOF +-if ac_fn_c_try_run "$LINENO"; then : +- chktls_save_LDFLAGS="$LDFLAGS" +- LDFLAGS="-static $LDFLAGS" +- if test x$gcc_no_link = xyes; then +- as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +-fi +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-int main() { return 0; } +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- if test "$cross_compiling" = yes; then : +- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +-as_fn_error "cannot run test program while cross compiling +-See \`config.log' for more details." "$LINENO" 5; } +-else +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-__thread int a; int b; int main() { return a = b; } +-_ACEOF +-if ac_fn_c_try_run "$LINENO"; then : +- gcc_cv_have_tls=yes +-else +- gcc_cv_have_tls=no +-fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ +- conftest.$ac_objext conftest.beam conftest.$ac_ext +-fi +- +-else +- gcc_cv_have_tls=yes +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +- LDFLAGS="$chktls_save_LDFLAGS" +- if test $gcc_cv_have_tls = yes; then +- chktls_save_CFLAGS="$CFLAGS" +- thread_CFLAGS=failed +- for flag in '' '-pthread' '-lpthread'; do +- CFLAGS="$flag $chktls_save_CFLAGS" +- if test x$gcc_no_link = xyes; then +- as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +-fi +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +- 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 : +- thread_CFLAGS="$flag" +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +- if test "X$thread_CFLAGS" != Xfailed; then +- break +- fi +- done +- CFLAGS="$chktls_save_CFLAGS" +- if test "X$thread_CFLAGS" != Xfailed; then +- CFLAGS="$thread_CFLAGS $chktls_save_CFLAGS" +- if test "$cross_compiling" = yes; then : +- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +-as_fn_error "cannot run test program while cross compiling +-See \`config.log' for more details." "$LINENO" 5; } +-else +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +- __thread int a; +- static int *volatile a_in_other_thread; +- static void * +- thread_func (void *arg) +- { +- a_in_other_thread = &a; +- return (void *)0; +- } +-int +-main () +-{ +-pthread_t thread; +- void *thread_retval; +- int *volatile a_in_main_thread; +- a_in_main_thread = &a; +- if (pthread_create (&thread, (pthread_attr_t *)0, +- thread_func, (void *)0)) +- return 0; +- if (pthread_join (thread, &thread_retval)) +- return 0; +- return (a_in_other_thread == a_in_main_thread); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_run "$LINENO"; then : +- gcc_cv_have_tls=yes +-else +- gcc_cv_have_tls=no +-fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ +- conftest.$ac_objext conftest.beam conftest.$ac_ext +-fi +- +- CFLAGS="$chktls_save_CFLAGS" +- fi +- fi +-else +- gcc_cv_have_tls=no +-fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ +- conftest.$ac_objext conftest.beam conftest.$ac_ext +-fi +- +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_have_tls" >&5 +-$as_echo "$gcc_cv_have_tls" >&6; } +- if test "$enable_tls $gcc_cv_have_tls" = "yes yes"; then +- +-$as_echo "#define HAVE_TLS 1" >>confdefs.h +- +- fi ++#dnl GCC_ENABLE_TLS + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the type of bitfields matters" >&5 +diff -ruN gcc-6.5.0/libobjc/configure.ac gcc-6.5.0.aros/libobjc/configure.ac +--- gcc-6.5.0/libobjc/configure.ac 2016-01-04 14:30:50.000000000 +0000 ++++ gcc-6.5.0.aros/libobjc/configure.ac 2019-02-13 12:20:35.215061500 +0000 +@@ -210,7 +210,7 @@ + # ----------- + + # Check if we have thread-local storage +-GCC_CHECK_TLS ++dnl GCC_CHECK_TLS + + gt_BITFIELD_TYPE_MATTERS + +diff -ruN gcc-6.5.0/libobjc/thr.c gcc-6.5.0.aros/libobjc/thr.c +--- gcc-6.5.0/libobjc/thr.c 2016-01-04 14:30:50.000000000 +0000 ++++ gcc-6.5.0.aros/libobjc/thr.c 2019-02-13 12:20:35.215061500 +0000 +@@ -35,6 +35,7 @@ + #include "objc/runtime.h" + #include "objc-private/module-abi-8.h" + #include "objc-private/runtime.h" ++#define __typedef_BOOL /* Remove definition of BOOL */ + #include + + #include +diff -ruN gcc-6.5.0/libstdc++-v3/config/os/aros/ctype_base.h gcc-6.5.0.aros/libstdc++-v3/config/os/aros/ctype_base.h +--- gcc-6.5.0/libstdc++-v3/config/os/aros/ctype_base.h 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/libstdc++-v3/config/os/aros/ctype_base.h 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,30 @@ ++namespace std _GLIBCXX_VISIBILITY(default) ++{ ++_GLIBCXX_BEGIN_NAMESPACE_VERSION ++ ++struct ctype_base { ++ /* Non-standard typedefs */ ++ typedef int * __to_type; ++ ++ /* NB: Offsets into ctype::_M_table force a particular size ++ on the mask type. Because of this, we don't use an enum. */ ++ typedef unsigned short int mask; ++ ++ static const mask upper = _ISupper; ++ static const mask lower = _ISlower; ++ static const mask alpha = _ISalpha; ++ static const mask digit = _ISdigit; ++ static const mask xdigit = _ISxdigit; ++ static const mask space = _ISspace; ++ static const mask print = _ISprint; ++ static const mask graph = _ISgraph; ++ static const mask cntrl = _IScntrl; ++ static const mask punct = _ISpunct; ++ static const mask alnum = _ISalnum; ++#if __cplusplus >= 201103L ++ static const mask blank = _ISblank; ++#endif ++}; ++ ++_GLIBCXX_END_NAMESPACE_VERSION ++} // namespace +diff -ruN gcc-6.5.0/libstdc++-v3/config/os/aros/ctype_configure_char.cc gcc-6.5.0.aros/libstdc++-v3/config/os/aros/ctype_configure_char.cc +--- gcc-6.5.0/libstdc++-v3/config/os/aros/ctype_configure_char.cc 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/libstdc++-v3/config/os/aros/ctype_configure_char.cc 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,99 @@ ++// Locale support -*- C++ -*- ++ ++// Copyright (C) 2011-2013 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 ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// Under Section 7 of GPL version 3, you are granted additional ++// permissions described in the GCC Runtime Library Exception, version ++// 3.1, as published by the Free Software Foundation. ++ ++// You should have received a copy of the GNU General Public License and ++// a copy of the GCC Runtime Library Exception along with this program; ++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++// . ++ ++/** @file ctype_configure_char.cc */ ++ ++// ++// ISO C++ 14882: 22.1 Locales ++// ++ ++#include ++#include ++#include ++ ++namespace std _GLIBCXX_VISIBILITY(default) ++{ ++_GLIBCXX_BEGIN_NAMESPACE_VERSION ++ ++// Information as gleaned from /usr/include/ctype.h ++ ++ const ctype_base::mask* ++ ctype::classic_table() throw() ++ { return 0; } ++ ++ ctype::ctype(__c_locale, const mask* __table, bool __del, ++ size_t __refs) ++ : facet(__refs), _M_del(__table != 0 && __del), ++ _M_toupper(NULL), _M_tolower(NULL), ++ _M_table(__table ? __table : classic_table()) ++ { ++ memset(_M_widen, 0, sizeof(_M_widen)); ++ _M_widen_ok = 0; ++ memset(_M_narrow, 0, sizeof(_M_narrow)); ++ _M_narrow_ok = 0; ++ } ++ ++ ctype::ctype(const mask* __table, bool __del, size_t __refs) ++ : facet(__refs), _M_del(__table != 0 && __del), ++ _M_toupper(NULL), _M_tolower(NULL), ++ _M_table(__table ? __table : classic_table()) ++ { ++ memset(_M_widen, 0, sizeof(_M_widen)); ++ _M_widen_ok = 0; ++ memset(_M_narrow, 0, sizeof(_M_narrow)); ++ _M_narrow_ok = 0; ++ } ++ ++ char ++ ctype::do_toupper(char __c) const ++ { return ::toupper((int) __c); } ++ ++ const char* ++ ctype::do_toupper(char* __low, const char* __high) const ++ { ++ while (__low < __high) ++ { ++ *__low = ::toupper((int) *__low); ++ ++__low; ++ } ++ return __high; ++ } ++ ++ char ++ ctype::do_tolower(char __c) const ++ { return ::tolower((int) __c); } ++ ++ const char* ++ ctype::do_tolower(char* __low, const char* __high) const ++ { ++ while (__low < __high) ++ { ++ *__low = ::tolower((int) *__low); ++ ++__low; ++ } ++ return __high; ++ } ++ ++_GLIBCXX_END_NAMESPACE_VERSION ++} // namespace +diff -ruN gcc-6.5.0/libstdc++-v3/config/os/aros/ctype_inline.h gcc-6.5.0.aros/libstdc++-v3/config/os/aros/ctype_inline.h +--- gcc-6.5.0/libstdc++-v3/config/os/aros/ctype_inline.h 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/libstdc++-v3/config/os/aros/ctype_inline.h 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,173 @@ ++// Locale support -*- C++ -*- ++ ++// Copyright (C) 2000, 2003 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 ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This library 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 this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++/** @file ctype_inline.h ++ * This is an internal header file, included by other library headers. ++ * You should not attempt to use it directly. ++ */ ++ ++// ++// ISO C++ 14882: 22.1 Locales ++// ++ ++// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) ++// functions go in ctype.cc ++ ++// The following definitions are portable, but insanely slow. If one ++// cares at all about performance, then specialized ctype ++// functionality should be added for the native os in question: see ++// the config/os/bits/ctype_*.h files. ++ ++// Constructing a synthetic "C" table should be seriously considered... ++ ++namespace std _GLIBCXX_VISIBILITY(default) ++{ ++_GLIBCXX_BEGIN_NAMESPACE_VERSION ++ ++ bool ++ ctype:: ++ is(mask __m, char __c) const ++ { ++ if (_M_table) ++ return _M_table[static_cast(__c)] & __m; ++ else ++ { ++ bool __ret = false; ++ const size_t __bitmasksize = 15; ++ size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0 ++ for (; __bitcur <= __bitmasksize; ++__bitcur) ++ { ++ const mask __bit = static_cast(1 << __bitcur); ++ if (__m & __bit) ++ { ++ bool __testis; ++ switch (__bit) ++ { ++ case space: ++ __testis = isspace(__c); ++ break; ++ case print: ++ __testis = isprint(__c); ++ break; ++ case cntrl: ++ __testis = iscntrl(__c); ++ break; ++ case upper: ++ __testis = isupper(__c); ++ break; ++ case lower: ++ __testis = islower(__c); ++ break; ++ case alpha: ++ __testis = isalpha(__c); ++ break; ++ case digit: ++ __testis = isdigit(__c); ++ break; ++ case punct: ++ __testis = ispunct(__c); ++ break; ++ case xdigit: ++ __testis = isxdigit(__c); ++ break; ++ case alnum: ++ __testis = isalnum(__c); ++ break; ++ case graph: ++ __testis = isgraph(__c); ++ break; ++ default: ++ __testis = false; ++ break; ++ } ++ __ret |= __testis; ++ } ++ } ++ return __ret; ++ } ++ } ++ ++ const char* ++ ctype:: ++ is(const char* __low, const char* __high, mask* __vec) const ++ { ++ if (_M_table) ++ while (__low < __high) ++ *__vec++ = _M_table[static_cast(*__low++)]; ++ else ++ { ++ // Highest bitmask in ctype_base == 10. ++ const size_t __bitmasksize = 15; ++ for (;__low < __high; ++__vec, ++__low) ++ { ++ mask __m = 0; ++ // Lowest bitmask in ctype_base == 0 ++ size_t __i = 0; ++ for (;__i <= __bitmasksize; ++__i) ++ { ++ const mask __bit = static_cast(1 << __i); ++ if (this->is(__bit, *__low)) ++ __m |= __bit; ++ } ++ *__vec = __m; ++ } ++ } ++ return __high; ++ } ++ ++ const char* ++ ctype:: ++ scan_is(mask __m, const char* __low, const char* __high) const ++ { ++ if (_M_table) ++ while (__low < __high ++ && !(_M_table[static_cast(*__low)] & __m)) ++ ++__low; ++ else ++ while (__low < __high && !this->is(__m, *__low)) ++ ++__low; ++ return __low; ++ } ++ ++ const char* ++ ctype:: ++ scan_not(mask __m, const char* __low, const char* __high) const ++ { ++ if (_M_table) ++ while (__low < __high ++ && (_M_table[static_cast(*__low)] & __m) != 0) ++ ++__low; ++ else ++ while (__low < __high && this->is(__m, *__low) != 0) ++ ++__low; ++ return __low; ++ } ++ ++_GLIBCXX_END_NAMESPACE_VERSION ++} // namespace +diff -ruN gcc-6.5.0/libstdc++-v3/config/os/aros/ctype_noninline.h gcc-6.5.0.aros/libstdc++-v3/config/os/aros/ctype_noninline.h +--- gcc-6.5.0/libstdc++-v3/config/os/aros/ctype_noninline.h 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/libstdc++-v3/config/os/aros/ctype_noninline.h 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,56 @@ ++ const ctype_base::mask* ++ ctype::classic_table() throw() ++ { return *__ctype_b_ptr; } ++ ++ ctype::ctype(__c_locale, const mask* __table, bool __del, ++ size_t __refs) ++ : facet(__refs), _M_del(__table != 0 && __del), ++ _M_toupper(NULL), _M_tolower(NULL), ++ _M_table(__table ? __table : classic_table()) ++ { ++ memset(_M_widen, 0, sizeof(_M_widen)); ++ _M_widen_ok = 0; ++ memset(_M_narrow, 0, sizeof(_M_narrow)); ++ _M_narrow_ok = 0; ++ } ++ ++ ctype::ctype(const mask* __table, bool __del, size_t __refs) ++ : facet(__refs), _M_del(__table != 0 && __del), ++ _M_toupper(NULL), _M_tolower(NULL), ++ _M_table(__table ? __table : classic_table()) ++ { ++ memset(_M_widen, 0, sizeof(_M_widen)); ++ _M_widen_ok = 0; ++ memset(_M_narrow, 0, sizeof(_M_narrow)); ++ _M_narrow_ok = 0; ++ } ++ ++ char ++ ctype::do_toupper(char __c) const ++ { return ::toupper((int) __c); } ++ ++ const char* ++ ctype::do_toupper(char* __low, const char* __high) const ++ { ++ while (__low < __high) ++ { ++ *__low = ::toupper((int) *__low); ++ ++__low; ++ } ++ return __high; ++ } ++ ++ char ++ ctype::do_tolower(char __c) const ++ { return ::tolower((int) __c); } ++ ++ const char* ++ ctype::do_tolower(char* __low, const char* __high) const ++ { ++ while (__low < __high) ++ { ++ *__low = ::tolower((int) *__low); ++ ++__low; ++ } ++ return __high; ++ } +diff -ruN gcc-6.5.0/libstdc++-v3/config/os/aros/os_defines.h gcc-6.5.0.aros/libstdc++-v3/config/os/aros/os_defines.h +--- gcc-6.5.0/libstdc++-v3/config/os/aros/os_defines.h 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-6.5.0.aros/libstdc++-v3/config/os/aros/os_defines.h 2019-02-13 12:20:35.215061500 +0000 +@@ -0,0 +1,11 @@ ++// Specific definitions for AROS -*- C++ -*- ++ ++#ifndef _GLIBCXX_OS_DEFINES ++#define _GLIBCXX_OS_DEFINES ++ ++#define __off64_t off_t ++ ++// No support for referencing weak symbols without a definition. ++#define _GLIBCXX_USE_WEAK_REF 0 ++ ++#endif +diff -ruN gcc-6.5.0/libstdc++-v3/configure gcc-6.5.0.aros/libstdc++-v3/configure +--- gcc-6.5.0/libstdc++-v3/configure 2018-02-19 17:02:38.000000000 +0000 ++++ gcc-6.5.0.aros/libstdc++-v3/configure 2019-02-13 12:20:35.215061500 +0000 +@@ -5367,12 +5367,12 @@ + + + # Libtool setup. +-if test "x${with_newlib}" != "xyes"; then +- enable_dlopen=yes +- +- +- +-fi ++#if test "x${with_newlib}" != "xyes"; then ++# AC_LIBTOOL_DLOPEN ++# ++# ++# ++#fi + case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +@@ -8103,6 +8103,8 @@ + + + ++ enable_dlopen=no ++ + + enable_win32_dll=no + +@@ -19643,6 +19645,7 @@ + { + struct iovec iov[2]; + writev(0, iov, 0); ++#error be sure to fail + ; + return 0; + } +@@ -19665,6 +19668,7 @@ + { + struct iovec iov[2]; + writev(0, iov, 0); ++#error be sure to fail + ; + return 0; + } +@@ -28885,6 +28889,58 @@ + + # Base decisions on target environment. + case "${host}" in ++ *-aros*) ++ for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \ ++ machine/param.h sys/machine.h sys/types.h fp.h locale.h float.h inttypes.h ++do : ++ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ++ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" ++eval as_val=\$$as_ac_Header ++ if test "x$as_val" = x""yes; then : ++ cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++ ++done ++ ++ ++ GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT ++ GLIBCXX_CHECK_WCHAR_T_SUPPORT ++ ++ $as_echo "#define HAVE_FINITE 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_FINITEF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_FREXPF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_HYPOTF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_ISINF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_ISINFF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_ISNAN 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_ISNANF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_SINCOS 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_SINCOSF 1" >>confdefs.h ++ ++ if test x"long_double_math_on_this_cpu" = x"yes"; then ++ $as_echo "#define HAVE_FINITEL 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_HYPOTL 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_ISINFL 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_ISNANL 1" >>confdefs.h ++ ++ fi ++ ;; ++ + arm*-*-symbianelf*) + # This is a freestanding configuration; there is nothing to do here. + ;; +diff -ruN gcc-6.5.0/libstdc++-v3/configure.ac gcc-6.5.0.aros/libstdc++-v3/configure.ac +--- gcc-6.5.0/libstdc++-v3/configure.ac 2018-02-19 17:02:38.000000000 +0000 ++++ gcc-6.5.0.aros/libstdc++-v3/configure.ac 2019-02-13 12:20:35.215061500 +0000 +@@ -89,9 +89,9 @@ + GLIBCXX_CONFIGURE + + # Libtool setup. +-if test "x${with_newlib}" != "xyes"; then +- AC_LIBTOOL_DLOPEN +-fi ++#if test "x${with_newlib}" != "xyes"; then ++# AC_LIBTOOL_DLOPEN ++#fi + AM_PROG_LIBTOOL + ACX_LT_HOST_FLAGS + AC_SUBST(enable_shared) +diff -ruN gcc-6.5.0/libstdc++-v3/configure.host gcc-6.5.0.aros/libstdc++-v3/configure.host +--- gcc-6.5.0/libstdc++-v3/configure.host 2016-09-27 07:11:15.000000000 +0100 ++++ gcc-6.5.0.aros/libstdc++-v3/configure.host 2019-02-13 12:20:35.215061500 +0000 +@@ -226,6 +226,9 @@ + os_include_dir="os/generic" + atomicity_dir="cpu/generic" + ;; ++ aros*) ++ os_include_dir="os/aros" ++ ;; + bsd*) + # Plain BSD attempts to share FreeBSD files. + os_include_dir="os/bsd/freebsd" +diff -ruN gcc-6.5.0/libstdc++-v3/crossconfig.m4 gcc-6.5.0.aros/libstdc++-v3/crossconfig.m4 +--- gcc-6.5.0/libstdc++-v3/crossconfig.m4 2015-10-11 23:34:28.000000000 +0100 ++++ gcc-6.5.0.aros/libstdc++-v3/crossconfig.m4 2019-02-13 12:20:35.215061500 +0000 +@@ -5,6 +5,31 @@ + AC_DEFUN([GLIBCXX_CROSSCONFIG],[ + # Base decisions on target environment. + case "${host}" in ++ *-aros*) ++ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \ ++ machine/param.h sys/machine.h sys/types.h fp.h locale.h float.h inttypes.h]) ++ ++ GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT ++ GLIBCXX_CHECK_WCHAR_T_SUPPORT ++ ++ AC_DEFINE(HAVE_FINITE) ++ AC_DEFINE(HAVE_FINITEF) ++ AC_DEFINE(HAVE_FREXPF) ++ AC_DEFINE(HAVE_HYPOTF) ++ AC_DEFINE(HAVE_ISINF) ++ AC_DEFINE(HAVE_ISINFF) ++ AC_DEFINE(HAVE_ISNAN) ++ AC_DEFINE(HAVE_ISNANF) ++ AC_DEFINE(HAVE_SINCOS) ++ AC_DEFINE(HAVE_SINCOSF) ++ if test x"long_double_math_on_this_cpu" = x"yes"; then ++ AC_DEFINE(HAVE_FINITEL) ++ AC_DEFINE(HAVE_HYPOTL) ++ AC_DEFINE(HAVE_ISINFL) ++ AC_DEFINE(HAVE_ISNANL) ++ fi ++ ;; ++ + arm*-*-symbianelf*) + # This is a freestanding configuration; there is nothing to do here. + ;; +diff -ruN gcc-6.5.0/libstdc++-v3/include/Makefile.in gcc-6.5.0.aros/libstdc++-v3/include/Makefile.in +--- gcc-6.5.0/libstdc++-v3/include/Makefile.in 2018-02-19 17:02:38.000000000 +0000 ++++ gcc-6.5.0.aros/libstdc++-v3/include/Makefile.in 2019-02-13 12:20:35.215061500 +0000 +@@ -1687,6 +1687,7 @@ + -e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \ + -e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \ + -e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \ ++ -e 's/_GLIBCXX___AROS__/__AROS__/g' \ + -e 's,^#include "\(.*\)",#include ,g' \ + < $< > $@ + +diff -ruN gcc-6.5.0/libstdc++-v3/include/c_global/cstdint gcc-6.5.0.aros/libstdc++-v3/include/c_global/cstdint +--- gcc-6.5.0/libstdc++-v3/include/c_global/cstdint 2016-01-04 14:30:50.000000000 +0000 ++++ gcc-6.5.0.aros/libstdc++-v3/include/c_global/cstdint 2019-02-13 12:20:35.215061500 +0000 +@@ -41,7 +41,7 @@ + # include + #endif + +-#ifdef _GLIBCXX_USE_C99_STDINT_TR1 ++#if defined(_GLIBCXX_USE_C99_STDINT_TR1) + + namespace std + { +@@ -74,8 +74,10 @@ + using ::uint_fast64_t; + + using ::uint_least8_t; ++#if !defined (__UINT_LEAST16_TYPE__) || !defined(__UINT_LEAST32_TYPE__) + using ::uint_least16_t; + using ::uint_least32_t; ++#endif + using ::uint_least64_t; + + using ::uintmax_t; +diff -ruN gcc-6.5.0/libstdc++-v3/include/std/ratio gcc-6.5.0.aros/libstdc++-v3/include/std/ratio +--- gcc-6.5.0/libstdc++-v3/include/std/ratio 2016-01-04 14:30:50.000000000 +0000 ++++ gcc-6.5.0.aros/libstdc++-v3/include/std/ratio 2019-02-13 12:20:35.215061500 +0000 +@@ -211,10 +211,10 @@ + { + private: + static_assert(__d != 0, "Internal library error"); +- static_assert(sizeof (uintmax_t) == sizeof (unsigned long long), +- "This library calls __builtin_clzll on uintmax_t, which " +- "is unsafe on your platform. Please complain to " +- "http://gcc.gnu.org/bugzilla/"); ++// static_assert(sizeof (uintmax_t) == sizeof (unsigned long long), ++// "This library calls __builtin_clzll on uintmax_t, which " ++// "is unsafe on your platform. Please complain to " ++// "http://gcc.gnu.org/bugzilla/"); + static constexpr int __shift = __builtin_clzll(__d); + static constexpr int __coshift_ = sizeof(uintmax_t) * 8 - __shift; + static constexpr int __coshift = (__shift != 0) ? __coshift_ : 0; -- 2.11.4.GIT