escape @ symbols in the basename since they are illegal in macro names. (NicJA)
[AROS.git] / tools / crosstools / gcc-5.3.0-aros.diff
blob5e7cf57131b7373b2d497ae38e2c06a6f268fc31
1 diff -ruN gcc-5.3.0/boehm-gc/include/gc_amiga_redirects.h gcc-5.3.0.aros/boehm-gc/include/gc_amiga_redirects.h
2 --- gcc-5.3.0/boehm-gc/include/gc_amiga_redirects.h 2001-08-17 21:30:51.000000000 +0300
3 +++ gcc-5.3.0.aros/boehm-gc/include/gc_amiga_redirects.h 2016-01-15 09:15:34.462754465 +0200
4 @@ -2,7 +2,7 @@
6 # define GC_AMIGA_REDIRECTS_H
8 -# if ( defined(_AMIGA) && !defined(GC_AMIGA_MAKINGLIB) )
9 +# if !defined(__AROS__) && ( defined(_AMIGA) && !defined(GC_AMIGA_MAKINGLIB) )
10 extern void *GC_amiga_realloc(void *old_object,size_t new_size_in_bytes);
11 # define GC_realloc(a,b) GC_amiga_realloc(a,b)
12 extern void GC_amiga_set_toany(void (*func)(void));
13 diff -ruN gcc-5.3.0/boehm-gc/include/gc.h gcc-5.3.0.aros/boehm-gc/include/gc.h
14 --- gcc-5.3.0/boehm-gc/include/gc.h 2014-10-23 11:39:19.000000000 +0300
15 +++ gcc-5.3.0.aros/boehm-gc/include/gc.h 2016-01-15 09:15:34.462754465 +0200
16 @@ -1056,7 +1056,7 @@
17 GC_API void GC_win32_free_heap ();
18 #endif
20 -#if ( defined(_AMIGA) && !defined(GC_AMIGA_MAKINGLIB) )
21 +#if !defined(__AROS__) && ( defined(_AMIGA) && !defined(GC_AMIGA_MAKINGLIB) )
22 /* Allocation really goes through GC_amiga_allocwrapper_do */
23 # include "gc_amiga_redirects.h"
24 #endif
25 diff -ruN gcc-5.3.0/configure gcc-5.3.0.aros/configure
26 --- gcc-5.3.0/configure 2015-05-03 20:29:57.000000000 +0300
27 +++ gcc-5.3.0.aros/configure 2016-01-15 09:15:34.466754600 +0200
28 @@ -3851,6 +3851,9 @@
29 powerpcle-*-solaris*)
30 noconfigdirs="$noconfigdirs gdb sim tcl tk itcl"
32 + *-*-aros*)
33 + noconfigdirs="$noconfigdirs patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix gnuserv gdb"
34 + ;;
35 powerpc-*-beos*)
36 noconfigdirs="$noconfigdirs gdb"
38 @@ -3990,6 +3993,8 @@
39 rs6000-*-aix*)
40 host_makefile_frag="config/mh-ppc-aix"
42 + *-*-aros*)
43 + ;;
44 esac
47 diff -ruN gcc-5.3.0/configure.ac gcc-5.3.0.aros/configure.ac
48 --- gcc-5.3.0/configure.ac 2015-05-03 20:29:57.000000000 +0300
49 +++ gcc-5.3.0.aros/configure.ac 2016-01-15 09:15:34.467754634 +0200
50 @@ -1198,6 +1198,9 @@
51 powerpcle-*-solaris*)
52 noconfigdirs="$noconfigdirs gdb sim tcl tk itcl"
54 + *-*-aros*)
55 + noconfigdirs="$noconfigdirs patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix gnuserv gdb"
56 + ;;
57 powerpc-*-beos*)
58 noconfigdirs="$noconfigdirs gdb"
60 @@ -1318,6 +1321,8 @@
61 rs6000-*-aix*)
62 host_makefile_frag="config/mh-ppc-aix"
64 + *-*-aros*)
65 + ;;
66 esac
69 diff -ruN gcc-5.3.0/fixincludes/configure gcc-5.3.0.aros/fixincludes/configure
70 --- gcc-5.3.0/fixincludes/configure 2012-05-29 22:28:57.000000000 +0300
71 +++ gcc-5.3.0.aros/fixincludes/configure 2016-01-15 09:15:34.468754668 +0200
72 @@ -4712,6 +4712,7 @@
74 else
75 case $host in
76 + *-*-aros* | \
77 i?86-*-msdosdjgpp* | \
78 i?86-*-mingw32* | \
79 x86_64-*-mingw32* | \
80 diff -ruN gcc-5.3.0/fixincludes/configure.ac gcc-5.3.0.aros/fixincludes/configure.ac
81 --- gcc-5.3.0/fixincludes/configure.ac 2012-05-29 22:28:57.000000000 +0300
82 +++ gcc-5.3.0.aros/fixincludes/configure.ac 2016-01-15 09:15:34.469754701 +0200
83 @@ -50,6 +50,7 @@
84 TARGET=oneprocess
85 fi],
86 [case $host in
87 + *-*-aros* | \
88 i?86-*-msdosdjgpp* | \
89 i?86-*-mingw32* | \
90 x86_64-*-mingw32* | \
91 diff -ruN gcc-5.3.0/gcc/config/arm/aros.h gcc-5.3.0.aros/gcc/config/arm/aros.h
92 --- gcc-5.3.0/gcc/config/arm/aros.h 1970-01-01 02:00:00.000000000 +0200
93 +++ gcc-5.3.0.aros/gcc/config/arm/aros.h 2016-01-15 09:15:34.469754701 +0200
94 @@ -0,0 +1,82 @@
95 +/* Configuration file for ARM AROS EABI targets.
96 + Copyright (C) 2004, 2005, 2006, 2007, 2010
97 + Free Software Foundation, Inc.
98 + Contributed by Pavel Fedin
99 + Based on linux-eabi.h and other AROS targets
101 + This file is part of GCC.
103 + GCC is free software; you can redistribute it and/or modify it
104 + under the terms of the GNU General Public License as published
105 + by the Free Software Foundation; either version 3, or (at your
106 + option) any later version.
108 + GCC is distributed in the hope that it will be useful, but WITHOUT
109 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
110 + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
111 + License for more details.
113 + You should have received a copy of the GNU General Public License
114 + along with GCC; see the file COPYING3. If not see
115 + <http://www.gnu.org/licenses/>. */
117 +/* On EABI GNU/Linux, we want both the BPABI builtins and the
118 + GNU/Linux builtins. */
119 +#undef TARGET_OS_CPP_BUILTINS
120 +#define TARGET_OS_CPP_BUILTINS() \
121 + do \
122 + { \
123 + TARGET_BPABI_CPP_BUILTINS(); \
124 + builtin_define_std ("AROS"); \
125 + builtin_define ("AMIGA"); \
126 + builtin_define ("_AMIGA"); \
127 + builtin_assert ("system=posix"); \
128 + if (flag_pic) \
129 + { \
130 + builtin_define ("__PIC__"); \
131 + builtin_define ("__pic__"); \
132 + } \
133 + } \
134 + while (false)
136 +/* We default to a softfp ABI so that we are compatible
137 + with the Linux EABI (as used by the linker). */
138 +#undef TARGET_DEFAULT_FLOAT_ABI
139 +#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFTFP
141 +/* We default to the "aapcs-linux" ABI so that enums are int-sized by
142 + default. */
143 +#undef ARM_DEFAULT_ABI
144 +#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX
146 +/* Default to armv5t so that thumb shared libraries work.
147 + The ARM10TDMI core is the default for armv5t, so set
148 + SUBTARGET_CPU_DEFAULT to achieve this. */
149 +#undef SUBTARGET_CPU_DEFAULT
150 +#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
152 +/* TARGET_BIG_ENDIAN_DEFAULT is set in
153 + config.gcc for big endian configurations. */
154 +#undef TARGET_LINKER_EMULATION
155 +#if TARGET_BIG_ENDIAN_DEFAULT
156 +#define TARGET_LINKER_EMULATION "armelfb_aros"
157 +#else
158 +#define TARGET_LINKER_EMULATION "armelf_aros"
159 +#endif
161 +#undef SUBTARGET_CPP_SPEC
162 +#define SUBTARGET_CPP_SPEC "-D__ELF__ %{!nostdinc:-isystem %R/include%{!nostdc:%{!noposixc: -isystem %R/include/aros/posixc} -isystem %R/include/aros/stdc}}"
164 +#undef SUBTARGET_EXTRA_LINK_SPEC
165 +#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION
167 +/* Provide a LINK_SPEC appropriate for AROS. */
168 +#undef LINK_SPEC
169 +#define LINK_SPEC "-m armelf_aros -L %R/lib"
171 +/* Use own supplement to libgcc. */
172 +#undef LIBGCC_SPEC
173 +#define LIBGCC_SPEC "-laeabi -lgcc"
175 +/* FIXME: AROS doesn't support dw2 unwinding yet. */
176 +#undef MD_FALLBACK_FRAME_STATE_FOR
177 diff -ruN gcc-5.3.0/gcc/config/arm/t-aros gcc-5.3.0.aros/gcc/config/arm/t-aros
178 --- gcc-5.3.0/gcc/config/arm/t-aros 1970-01-01 02:00:00.000000000 +0200
179 +++ gcc-5.3.0.aros/gcc/config/arm/t-aros 2016-01-15 09:15:34.469754701 +0200
180 @@ -0,0 +1,22 @@
181 +# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
182 +# 2008, 2010 Free Software Foundation, Inc.
184 +# This file is part of GCC.
186 +# GCC is free software; you can redistribute it and/or modify
187 +# it under the terms of the GNU General Public License as published by
188 +# the Free Software Foundation; either version 3, or (at your option)
189 +# any later version.
191 +# GCC is distributed in the hope that it will be useful,
192 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
193 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
194 +# GNU General Public License for more details.
196 +# You should have received a copy of the GNU General Public License
197 +# along with GCC; see the file COPYING3. If not see
198 +# <http://www.gnu.org/licenses/>.
200 +MULTILIB_OPTIONS = marm mfloat-abi=hard/mfloat-abi=soft march=armv6/march=armv7-a
201 +MULTILIB_DIRNAMES = arm fpu soft armv6 armv7-a
203 diff -ruN gcc-5.3.0/gcc/config/aros.h gcc-5.3.0.aros/gcc/config/aros.h
204 --- gcc-5.3.0/gcc/config/aros.h 1970-01-01 02:00:00.000000000 +0200
205 +++ gcc-5.3.0.aros/gcc/config/aros.h 2016-01-15 09:15:34.470754735 +0200
206 @@ -0,0 +1,113 @@
207 +/* Definitions for AROS
208 + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
209 + Contributed by Fabio Alemagna
210 + Based upon linux.h, contributed by Eric Youngdale.
212 +This file is part of GNU CC.
214 +GNU CC is free software; you can redistribute it and/or modify
215 +it under the terms of the GNU General Public License as published by
216 +the Free Software Foundation; either version 2, or (at your option)
217 +any later version.
219 +GNU CC is distributed in the hope that it will be useful,
220 +but WITHOUT ANY WARRANTY; without even the implied warranty of
221 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
222 +GNU General Public License for more details.
224 +You should have received a copy of the GNU General Public License
225 +along with GNU CC; see the file COPYING. If not, write to
226 +the Free Software Foundation, 59 Temple Place - Suite 330,
227 +Boston, MA 02111-1307, USA. */
229 +/* Don't assume anything about the header files. */
230 +#define NO_IMPLICIT_EXTERN_C
232 +#undef SIZE_TYPE
233 +#define SIZE_TYPE "long unsigned int"
235 +#undef WCHAR_TYPE
236 +#define WCHAR_TYPE "char"
238 +#undef WCHAR_TYPE_SIZE
239 +#define WCHAR_TYPE_SIZE 8
241 +#undef PTRDIFF_TYPE
242 +#define PTRDIFF_TYPE "long int"
244 +#undef TARGET_OS_CPP_BUILTINS
245 +#define TARGET_OS_CPP_BUILTINS() \
246 + do \
247 + { \
248 + builtin_define_std ("AROS"); \
249 + builtin_define ("AMIGA"); \
250 + builtin_define ("_AMIGA"); \
251 + builtin_define ("__ELF__"); \
252 + builtin_assert ("system=posix"); \
253 + } \
254 + while (0)
256 +#undef ASM_APP_ON
257 +#define ASM_APP_ON "#APP\n"
259 +#undef ASM_APP_OFF
260 +#define ASM_APP_OFF "#NO_APP\n"
262 +#undef MD_EXEC_PREFIX
263 +#undef MD_STARTFILE_PREFIX
265 +/* Provide a STARTFILE_SPEC appropriate for AROS. AROS has its own
266 + set of startup files which also take care of handling C++
267 + constructors/destructors. */
269 +#undef STARTFILE_SPEC
270 +#define STARTFILE_SPEC \
271 + "startup%O%s %{detach:detach%O%s} %{nix:nixmain%O%s}"
273 +/* Provide a ENDFILE_SPEC appropriate for AROS. */
275 +#undef ENDFILE_SPEC
276 +#define ENDFILE_SPEC \
277 + "-lautoinit"
279 +/* The compiler is configured with ONLY the gcc/g++ standard headers.
280 + N.B-: NATIVE_SYSTEM_HEADER_DIR must come before GCC_INCLUDE_DIR on AROS */
281 +#undef INCLUDE_DEFAULTS
282 +#define INCLUDE_DEFAULTS \
283 +{ \
284 + { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
285 + { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
286 + { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
287 + { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 }, \
288 + { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \
289 + { 0, 0, 0, 0, 0, 0 } \
292 +#undef CPP_SPEC
293 +#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:-isystem %R/include/aros/posixc} -isystem %R/include/aros/stdc} -isystem %R/include}"
295 +/* This is for -profile to use -lc_p instead of -lc. */
296 +#ifndef CC1_SPEC
297 +#define CC1_SPEC "%{profile:-p}"
298 +#endif
300 +/* The GNU C++ standard library requires that these macros be defined. */
301 +#undef CPLUSPLUS_CPP_SPEC
302 +#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
304 +#undef LIB_SPEC
305 +#define LIB_SPEC \
306 + "--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"
308 +#undef LIBSTDCXX_STATIC
309 +#define LIBSTDCXX_STATIC "pthread"
311 +#if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR)
312 +#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
313 +#endif
315 +/* AROS uses its own collect-like program for the moment. */
316 +#undef LINKER_NAME
317 +#define LINKER_NAME "collect-aros"
319 +#define TARGET_HAS_F_SETLKW
320 diff -ruN gcc-5.3.0/gcc/config/aros.opt gcc-5.3.0.aros/gcc/config/aros.opt
321 --- gcc-5.3.0/gcc/config/aros.opt 1970-01-01 02:00:00.000000000 +0200
322 +++ gcc-5.3.0.aros/gcc/config/aros.opt 2016-01-15 09:15:34.470754735 +0200
323 @@ -0,0 +1,35 @@
324 +; Processor-independent options for AROS.
326 +; Copyright (C) 2015 Free Software Foundation, Inc.
328 +; This file is part of GCC.
330 +; GCC is free software; you can redistribute it and/or modify it under
331 +; the terms of the GNU General Public License as published by the Free
332 +; Software Foundation; either version 3, or (at your option) any later
333 +; version.
335 +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
336 +; WARRANTY; without even the implied warranty of MERCHANTABILITY or
337 +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
338 +; for more details.
340 +; You should have received a copy of the GNU General Public License
341 +; along with GCC; see the file COPYING3. If not see
342 +; <http://www.gnu.org/licenses/>.
344 +posix
345 +Driver
347 +noposixc
348 +Driver
350 +nostdc
351 +Driver
353 +nosysbase
354 +Driver
356 +nix
357 +Driver
359 diff -ruN gcc-5.3.0/gcc/config/i386/aros64.h gcc-5.3.0.aros/gcc/config/i386/aros64.h
360 --- gcc-5.3.0/gcc/config/i386/aros64.h 1970-01-01 02:00:00.000000000 +0200
361 +++ gcc-5.3.0.aros/gcc/config/i386/aros64.h 2016-01-15 09:15:34.470754735 +0200
362 @@ -0,0 +1,34 @@
363 +/* Definitions for AMD x86_64 running AROS systems with ELF64 format.
364 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002
365 + Free Software Foundation, Inc.
366 + Contributed by Stanislaw Szymczyk <sszymczy@gmail.com>. Based on aros.h.
368 +This file is part of GNU CC.
370 +GNU CC is free software; you can redistribute it and/or modify
371 +it under the terms of the GNU General Public License as published by
372 +the Free Software Foundation; either version 2, or (at your option)
373 +any later version.
375 +GNU CC is distributed in the hope that it will be useful,
376 +but WITHOUT ANY WARRANTY; without even the implied warranty of
377 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
378 +GNU General Public License for more details.
380 +You should have received a copy of the GNU General Public License
381 +along with GNU CC; see the file COPYING. If not, write to
382 +the Free Software Foundation, 59 Temple Place - Suite 330,
383 +Boston, MA 02111-1307, USA. */
385 +/* The svr4 ABI for the i386 says that records and unions are returned
386 + in memory. In the 64bit compilation we will turn this flag off in
387 + override_options, as we never do pcc_struct_return scheme on this target. */
388 +#undef DEFAULT_PCC_STRUCT_RETURN
389 +#define DEFAULT_PCC_STRUCT_RETURN 1
391 +/* Provide a LINK_SPEC appropriate for AROS. */
393 +#undef LINK_SPEC
394 +#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} -L %R/lib"
396 +/* FIXME: AROS doesn't support dw2 unwinding yet. */
397 diff -ruN gcc-5.3.0/gcc/config/i386/aros.h gcc-5.3.0.aros/gcc/config/i386/aros.h
398 --- gcc-5.3.0/gcc/config/i386/aros.h 1970-01-01 02:00:00.000000000 +0200
399 +++ gcc-5.3.0.aros/gcc/config/i386/aros.h 2016-01-15 09:15:34.470754735 +0200
400 @@ -0,0 +1,25 @@
401 +/* Definitions for Intel 386 running AROS systems with ELF format.
402 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002
403 + Free Software Foundation, Inc.
404 + Contributed by Fabio Alemagna.
405 + Based upon i386/linux.h by Eric Youngdale.
407 +This file is part of GNU CC.
409 +GNU CC is free software; you can redistribute it and/or modify
410 +it under the terms of the GNU General Public License as published by
411 +the Free Software Foundation; either version 2, or (at your option)
412 +any later version.
414 +GNU CC is distributed in the hope that it will be useful,
415 +but WITHOUT ANY WARRANTY; without even the implied warranty of
416 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
417 +GNU General Public License for more details.
419 +You should have received a copy of the GNU General Public License
420 +along with GNU CC; see the file COPYING. If not, write to
421 +the Free Software Foundation, 59 Temple Place - Suite 330,
422 +Boston, MA 02111-1307, USA. */
424 +#undef LINK_SPEC
425 +#define LINK_SPEC "-m elf_i386 -L%R/lib"
426 diff -ruN gcc-5.3.0/gcc/config/m68k/m68k.c gcc-5.3.0.aros/gcc/config/m68k/m68k.c
427 --- gcc-5.3.0/gcc/config/m68k/m68k.c 2015-01-15 15:28:42.000000000 +0200
428 +++ gcc-5.3.0.aros/gcc/config/m68k/m68k.c 2016-01-15 09:15:34.472754803 +0200
429 @@ -4469,7 +4469,7 @@
430 else if (letter == '/')
431 asm_fprintf (file, "%R");
432 else if (letter == '?')
433 - asm_fprintf (file, m68k_library_id_string);
434 + asm_fprintf (file, "%s", m68k_library_id_string);
435 else if (letter == 'p')
437 output_addr_const (file, op);
438 diff -ruN gcc-5.3.0/gcc/config/m68k/m68k.h gcc-5.3.0.aros/gcc/config/m68k/m68k.h
439 --- gcc-5.3.0/gcc/config/m68k/m68k.h 2015-01-05 14:33:28.000000000 +0200
440 +++ gcc-5.3.0.aros/gcc/config/m68k/m68k.h 2016-01-15 09:15:34.472754803 +0200
441 @@ -329,7 +329,9 @@
442 register elimination. */
443 #define FIRST_PSEUDO_REGISTER 25
445 -/* All m68k targets (except AmigaOS) use %a5 as the PIC register */
446 +/* All m68k targets (except AmigaOS) use %a5 as the PIC register.
447 + * On AmigaOS, we use %a4
448 + */
449 #define PIC_OFFSET_TABLE_REGNUM \
450 (!flag_pic ? INVALID_REGNUM \
451 : reload_completed ? REGNO (pic_offset_table_rtx) \
452 @@ -419,7 +421,8 @@
453 /* Most m68k targets use %a6 as a frame pointer. The AmigaOS
454 ABI uses %a6 for shared library calls, therefore the frame
455 pointer is shifted to %a5 on this target. */
456 -#define FRAME_POINTER_REGNUM A6_REG
457 +#define FRAME_POINTER_REGNUM A5_REG
458 +#define PIC_REG A4_REG
460 /* Base register for access to arguments of the function.
461 * This isn't a hardware register. It will be eliminated to the
462 diff -ruN gcc-5.3.0/gcc/config/m68k/m68k.md gcc-5.3.0.aros/gcc/config/m68k/m68k.md
463 --- gcc-5.3.0/gcc/config/m68k/m68k.md 2015-01-22 23:24:28.000000000 +0200
464 +++ gcc-5.3.0.aros/gcc/config/m68k/m68k.md 2016-01-15 09:15:34.474754870 +0200
465 @@ -133,7 +133,8 @@
466 [(D0_REG 0)
467 (A0_REG 8)
468 (A1_REG 9)
469 - (PIC_REG 13)
470 + (A4_REG 12)
471 + (A5_REG 13)
472 (A6_REG 14)
473 (SP_REG 15)
474 (FP0_REG 16)
475 @@ -7093,7 +7094,7 @@
477 if (TARGET_ID_SHARED_LIBRARY)
479 - operands[1] = gen_rtx_REG (Pmode, PIC_REG);
480 + operands[1] = gen_rtx_REG (Pmode, A4_REG);
481 return MOTOROLA ? "move.l %?(%1),%0" : "movel %1@(%?), %0";
483 else if (MOTOROLA)
484 diff -ruN gcc-5.3.0/gcc/config/m68k/t-aros gcc-5.3.0.aros/gcc/config/m68k/t-aros
485 --- gcc-5.3.0/gcc/config/m68k/t-aros 1970-01-01 02:00:00.000000000 +0200
486 +++ gcc-5.3.0.aros/gcc/config/m68k/t-aros 2016-01-15 09:15:34.474754870 +0200
487 @@ -0,0 +1,2 @@
488 +# Custom multilibs for AROS
489 +M68K_MLIB_CPU += && match(MLIB, "^68")
490 diff -ruN gcc-5.3.0/gcc/config/rs6000/aros.h gcc-5.3.0.aros/gcc/config/rs6000/aros.h
491 --- gcc-5.3.0/gcc/config/rs6000/aros.h 1970-01-01 02:00:00.000000000 +0200
492 +++ gcc-5.3.0.aros/gcc/config/rs6000/aros.h 2016-01-15 09:15:34.474754870 +0200
493 @@ -0,0 +1,151 @@
494 +/* Definitions for Powerpc running AROS systems with ELF format.
495 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002
496 + Free Software Foundation, Inc.
497 + Contributed by Markus Weiss.
498 + Based upon i386/aros.h by Fabio Alemagna.
500 +This file is part of GNU CC.
502 +GNU CC is free software; you can redistribute it and/or modify
503 +it under the terms of the GNU General Public License as published by
504 +the Free Software Foundation; either version 2, or (at your option)
505 +any later version.
507 +GNU CC is distributed in the hope that it will be useful,
508 +but WITHOUT ANY WARRANTY; without even the implied warranty of
509 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
510 +GNU General Public License for more details.
512 +You should have received a copy of the GNU General Public License
513 +along with GNU CC; see the file COPYING. If not, write to
514 +the Free Software Foundation, 59 Temple Place - Suite 330,
515 +Boston, MA 02111-1307, USA. */
517 +/* Symbols missing in comparison to i386/aros.h are either
518 + defined in elfos.h, rs6000/rs6000.h rs6000/sysv4.h
519 + or not needed for PowerPC.
522 +/* We need to define __powerpc__. */
524 +#undef TARGET_OS_CPP_BUILTINS
525 +#define TARGET_OS_CPP_BUILTINS() \
526 + do \
527 + { \
528 + builtin_define_std ("AROS"); \
529 + builtin_define ("AMIGA"); \
530 + builtin_define ("_AMIGA"); \
531 + builtin_define ("__powerpc__"); \
532 + builtin_define ("__ELF__"); \
533 + builtin_assert ("system=posix"); \
534 + if (flag_pic) \
535 + { \
536 + builtin_define ("__PIC__"); \
537 + builtin_define ("__pic__"); \
538 + } \
539 + } \
540 + while (0)
542 +/* This one taken from linux.h. */
543 +/* We are 32-bit all the time, so optimize a little. */
544 +#undef TARGET_64BIT
545 +#define TARGET_64BIT 0
547 +/* The svr4 ABI for the i386 says that records and unions are returned
548 + in memory. */
549 +/*#undef DEFAULT_PCC_STRUCT_RETURN
550 +#define DEFAULT_PCC_STRUCT_RETURN 1
551 +see rs6000/rs6000.h
555 +#undef ASM_COMMENT_START
556 +#define ASM_COMMENT_START "#"
557 +see rs6000/rs6000.h
561 +#undef DBX_REGISTER_NUMBER
562 +#define DBX_REGISTER_NUMBER(n) \
563 + (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
564 +see rs6000/sysv4.h
567 +/* Output assembler code to FILE to call the profiler.
568 + To the best of my knowledge, no Linux libc has required the label
569 + argument to mcount. */
572 +#define NO_PROFILE_COUNTERS 1
573 +not used by other similar ppc compilers
574 +only in darwin.h rs6000/linux64.h rs6000/rs6000.c
578 +#undef MCOUNT_NAME
579 +#define MCOUNT_NAME "mcount"
580 +see rs6000/sysv4.h RS6000_MCOUNT
583 +/* The GLIBC version of mcount for the x86 assumes that there is a
584 + frame, so we cannot allow profiling without a frame pointer. */
586 +#undef SUBTARGET_FRAME_POINTER_REQUIRED
587 +#define SUBTARGET_FRAME_POINTER_REQUIRED crtl->profile
588 +seems to be handled by rs6000/rs6000.h
591 +#undef CC1_SPEC
592 +#define CC1_SPEC "%(cc1_cpu) %{profile:-p}"
594 +/* Provide a LINK_SPEC appropriate for AROS. */
596 +#undef LINK_SPEC
597 +#define LINK_SPEC "-m elf32ppc -L %R/lib"
599 +/* A C statement (sans semicolon) to output to the stdio stream
600 + FILE the assembler definition of uninitialized global DECL named
601 + NAME whose size is SIZE bytes and alignment is ALIGN bytes.
602 + Try to use asm_output_aligned_bss to implement this macro. */
604 +#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
605 + asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
606 +see rs6000/sysv4.h
609 +/* A C statement to output to the stdio stream FILE an assembler
610 + command to advance the location counter to a multiple of 1<<LOG
611 + bytes if it is within MAX_SKIP bytes.
613 + This is used to align code labels according to Intel recommendations. */
615 +#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
616 +#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
617 + do { \
618 + if ((LOG) != 0) { \
619 + if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
620 + else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
621 + } \
622 + } while (0)
623 +#endif
624 +see rs6000/sysv4.h
627 +/* Handle special EH pointer encodings. Absolute, pc-relative, and
628 + indirect are handled automatically. */
630 +#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
631 + do { \
632 + if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel) \
633 + { \
634 + fputs (ASM_LONG, FILE); \
635 + assemble_name (FILE, XSTR (ADDR, 0)); \
636 + fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
637 + goto DONE; \
638 + } \
639 + } while (0)
640 +not used for PowerPC
643 +/* FIXME: AROS doesn't support dw2 unwinding yet. */
644 +#undef MD_FALLBACK_FRAME_STATE_FOR
645 diff -ruN gcc-5.3.0/gcc/config/rs6000/rs6000.c gcc-5.3.0.aros/gcc/config/rs6000/rs6000.c
646 --- gcc-5.3.0/gcc/config/rs6000/rs6000.c 2015-11-26 15:32:38.000000000 +0200
647 +++ gcc-5.3.0.aros/gcc/config/rs6000/rs6000.c 2016-01-15 09:15:34.481755107 +0200
648 @@ -1346,6 +1346,8 @@
649 false },
650 { "shortcall", 0, 0, false, true, true, rs6000_handle_longcall_attribute,
651 false },
652 + { "stackparm", 0, 0, false, true, true, rs6000_handle_longcall_attribute,
653 + false },
654 { "ms_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute,
655 false },
656 { "gcc_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute,
657 @@ -9375,6 +9377,9 @@
658 && !lookup_attribute ("shortcall", TYPE_ATTRIBUTES (fntype))))
659 cum->call_cookie |= CALL_LONG;
661 + cum->stackparm = fntype && lookup_attribute("stackparm",
662 + TYPE_ATTRIBUTES(fntype));
664 if (TARGET_DEBUG_ARG)
666 fprintf (stderr, "\ninit_cumulative_args:");
667 @@ -10510,6 +10515,9 @@
669 rs6000_discover_homogeneous_aggregate (mode, type, &elt_mode, &n_elts);
671 + if (cum->stackparm)
672 + return NULL_RTX;
674 if (TARGET_MACHO && rs6000_darwin64_struct_check_p (mode, type))
676 rtx rslt = rs6000_darwin64_record_arg (cum, type, named, /*retval= */false);
677 @@ -11112,6 +11120,9 @@
678 int first_reg_offset;
679 alias_set_type set;
681 + if (cum->stackparm)
682 + return;
684 /* Skip the last named argument. */
685 next_cum = *get_cumulative_args (cum);
686 rs6000_function_arg_advance_1 (&next_cum, mode, type, true, 0);
687 diff -ruN gcc-5.3.0/gcc/config/rs6000/rs6000.h gcc-5.3.0.aros/gcc/config/rs6000/rs6000.h
688 --- gcc-5.3.0/gcc/config/rs6000/rs6000.h 2015-05-05 17:22:33.000000000 +0300
689 +++ gcc-5.3.0.aros/gcc/config/rs6000/rs6000.h 2016-01-15 09:15:34.482755141 +0200
690 @@ -1766,6 +1766,7 @@
691 int nargs_prototype; /* # args left in the current prototype */
692 int prototype; /* Whether a prototype was defined */
693 int stdarg; /* Whether function is a stdarg function. */
694 + int stackparm; /* Whether function has all args on the stack */
695 int call_cookie; /* Do special things for this call */
696 int sysv_gregno; /* next available GP register */
697 int intoffset; /* running offset in struct (darwin64) */
698 diff -ruN gcc-5.3.0/gcc/config/t-aros gcc-5.3.0.aros/gcc/config/t-aros
699 --- gcc-5.3.0/gcc/config/t-aros 1970-01-01 02:00:00.000000000 +0200
700 +++ gcc-5.3.0.aros/gcc/config/t-aros 2016-01-15 09:15:34.482755141 +0200
701 @@ -0,0 +1,29 @@
702 +# In AROS, "/usr" is a four-letter word.
703 +# Must match NATIVE_SYSTEM_HEADER_COMPONENT in aros.h !
704 +NATIVE_SYSTEM_HEADER_DIR = /include
706 +# Don't add AROS target include path when compiling host compiler
707 +CPPFLAGS =
709 +# Copy AROS specific include replacement files
710 +LIBGCC_DEPS += stmp-aros-hrds
712 +EXTRA_AROS_HEADERS = aros/types/size_t.h aros/types/ptrdiff_t.h \
713 + aros/types/wchar_t.h aros/types/wint_t.h aros/types/null.h
715 +stmp-int-hdrs : | include/aros/types
717 +include/aros/types : $(addprefix $(srcdir)/ginclude/,$(EXTRA_AROS_HEADERS))
718 + -if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi
719 + -if [ -d include/aros/types ] ; \
720 + then true; \
721 + else \
722 + mkdir include/aros; chmod a+rx include/aros; \
723 + mkdir include/aros/types; chmod a+rx include/aros/types; \
724 + fi
725 + for file in $(EXTRA_AROS_HEADERS); do \
726 + $(STAMP) include/$$file; \
727 + rm -fr include/$$file; \
728 + cp $(srcdir)/ginclude/$$file include/$$file; \
729 + chmod a+r include/$$file; \
730 + done
731 diff -ruN gcc-5.3.0/gcc/config.build gcc-5.3.0.aros/gcc/config.build
732 --- gcc-5.3.0/gcc/config.build 2015-01-05 14:33:28.000000000 +0200
733 +++ gcc-5.3.0.aros/gcc/config.build 2016-01-15 09:15:34.482755141 +0200
734 @@ -102,6 +102,9 @@
735 # HP 9000 series 300
736 build_install_headers_dir=install-headers-cpio
738 + *-*-aros*)
739 + build_xm_file=xm-aros.h
740 + ;;
741 *-*-sysv*)
742 # All other System V variants.
743 build_install_headers_dir=install-headers-cpio
744 diff -ruN gcc-5.3.0/gcc/config.gcc gcc-5.3.0.aros/gcc/config.gcc
745 --- gcc-5.3.0/gcc/config.gcc 2015-09-10 17:17:53.000000000 +0300
746 +++ gcc-5.3.0.aros/gcc/config.gcc 2016-01-15 09:15:34.483755174 +0200
747 @@ -773,6 +773,15 @@
749 esac
751 +*-*-aros*)
752 + gas=yes
753 + gnu_ld=yes
754 + thread_file=posix
755 + use_collect2=no
756 + xm_defines='STDC_HEADERS=1'
757 + extra_options="${extra_options} aros.opt"
758 + ;;
760 *-*-openbsd*)
761 tmake_file="t-openbsd"
762 case ${enable_threads} in
763 @@ -961,6 +970,16 @@
764 tm_file="${tm_file} vms/vms.h alpha/vms.h"
765 tmake_file="${tmake_file} alpha/t-vms"
767 +arm*-*-aros*)
768 + tm_file="dbxelf.h elfos.h arm/elf.h arm/bpabi.h aros.h arm/aros.h arm/aout.h arm/arm.h"
769 + tm_file="$tm_file ../../libgcc/config/arm/bpabi-lib.h"
770 + tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-arm-softfp arm/t-bpabi arm/t-aros t-aros"
771 + xm_file="xm-aros.h"
772 + # The BPABI long long divmod functions return a 128-bit value in
773 + # registers r0-r3. Correctly modeling that requires the use of
774 + # TImode.
775 + need_64bit_hwint=yes
776 + ;;
777 arc*-*-elf*)
778 extra_headers="arc-simd.h"
779 tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
780 @@ -1546,6 +1565,16 @@
781 done
782 TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
784 +i[34567]86-*-aros*)
785 + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h aros.h i386/aros.h"
786 + xm_file=xm-aros.h
787 + tmake_file="${tmake_file} i386/t-i386elf t-aros"
788 + ;;
789 +x86_64-*-aros*)
790 + 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"
791 + tmake_file="${tmake_file} i386/t-i386elf t-aros"
792 + xm_file=xm-aros.h
793 + ;;
794 i[34567]86-pc-msdosdjgpp*)
795 xm_file=i386/xm-djgpp.h
796 tm_file="dbxcoff.h ${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h i386/djgpp-stdint.h"
797 @@ -1843,6 +1872,16 @@
798 thread_file='posix'
801 +m68k-*-aros*)
802 + default_m68k_cpu=68000
803 + default_cf_cpu=5206
804 + 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"
805 + tm_file="${tm_file} aros.h"
806 + tm_defines="${tm_defines} MOTOROLA=1"
807 + tmake_file="m68k/t-floatlib m68k/t-m68kbare m68k/t-m68kelf"
808 + tmake_file="$tmake_file m68k/t-aros m68k/t-mlibs t-aros"
809 + extra_parts="crtbegin.o crtend.o"
810 + ;;
811 m68k-*-elf* | fido-*-elf*)
812 case ${target} in
813 fido-*-elf*)
814 @@ -2342,6 +2381,13 @@
815 extra_options="${extra_options} rs6000/sysv4.opt"
816 tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems rs6000/t-ppccomm"
818 +powerpc-*-aros*)
819 + tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h aros.h"
820 + extra_options="${extra_options} rs6000/sysv4.opt"
821 + tm_file="${tm_file} rs6000/aros.h"
822 + xm_file=xm-aros.h
823 + tmake_file="$tmake_file t-aros"
824 + ;;
825 powerpc*-*-linux*)
826 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h"
827 extra_options="${extra_options} rs6000/sysv4.opt"
828 diff -ruN gcc-5.3.0/gcc/config.host gcc-5.3.0.aros/gcc/config.host
829 --- gcc-5.3.0/gcc/config.host 2015-01-09 16:06:02.000000000 +0200
830 +++ gcc-5.3.0.aros/gcc/config.host 2016-01-15 09:15:34.484755208 +0200
831 @@ -276,6 +276,10 @@
832 out_host_hook_obj=host-hpux.o
833 host_xmake_file="${host_xmake_file} x-hpux"
835 + *-*-aros*)
836 + host_can_use_collect2=no
837 + host_xm_file=xm-aros.h
838 + ;;
839 *-*-*vms*)
840 host_xm_file="vms/xm-vms.h"
841 host_xmake_file=vms/x-vms
842 diff -ruN gcc-5.3.0/gcc/ginclude/aros/types/null.h gcc-5.3.0.aros/gcc/ginclude/aros/types/null.h
843 --- gcc-5.3.0/gcc/ginclude/aros/types/null.h 1970-01-01 02:00:00.000000000 +0200
844 +++ gcc-5.3.0.aros/gcc/ginclude/aros/types/null.h 2016-01-15 09:15:34.484755208 +0200
845 @@ -0,0 +1,3 @@
846 +/* Replace AROS' NULL definition with gcc's one */
847 +#define __need_NULL
848 +#include <stddef.h>
849 diff -ruN gcc-5.3.0/gcc/ginclude/aros/types/ptrdiff_t.h gcc-5.3.0.aros/gcc/ginclude/aros/types/ptrdiff_t.h
850 --- gcc-5.3.0/gcc/ginclude/aros/types/ptrdiff_t.h 1970-01-01 02:00:00.000000000 +0200
851 +++ gcc-5.3.0.aros/gcc/ginclude/aros/types/ptrdiff_t.h 2016-01-15 09:15:34.485755242 +0200
852 @@ -0,0 +1,3 @@
853 +/* Replace AROS' ptrdiff_t definition with gcc's one */
854 +#define __need_ptrdiff_t
855 +#include <stddef.h>
856 diff -ruN gcc-5.3.0/gcc/ginclude/aros/types/size_t.h gcc-5.3.0.aros/gcc/ginclude/aros/types/size_t.h
857 --- gcc-5.3.0/gcc/ginclude/aros/types/size_t.h 1970-01-01 02:00:00.000000000 +0200
858 +++ gcc-5.3.0.aros/gcc/ginclude/aros/types/size_t.h 2016-01-15 09:15:34.485755242 +0200
859 @@ -0,0 +1,3 @@
860 +/* Replace AROS' size_t definition with gcc's one */
861 +#define __need_size_t
862 +#include <stddef.h>
863 diff -ruN gcc-5.3.0/gcc/ginclude/aros/types/wchar_t.h gcc-5.3.0.aros/gcc/ginclude/aros/types/wchar_t.h
864 --- gcc-5.3.0/gcc/ginclude/aros/types/wchar_t.h 1970-01-01 02:00:00.000000000 +0200
865 +++ gcc-5.3.0.aros/gcc/ginclude/aros/types/wchar_t.h 2016-01-15 09:15:34.485755242 +0200
866 @@ -0,0 +1,3 @@
867 +/* Replace AROS' wchar_t definition with gcc's one */
868 +#define __need_wchar_t
869 +#include <stddef.h>
870 diff -ruN gcc-5.3.0/gcc/ginclude/aros/types/wint_t.h gcc-5.3.0.aros/gcc/ginclude/aros/types/wint_t.h
871 --- gcc-5.3.0/gcc/ginclude/aros/types/wint_t.h 1970-01-01 02:00:00.000000000 +0200
872 +++ gcc-5.3.0.aros/gcc/ginclude/aros/types/wint_t.h 2016-01-15 09:15:34.485755242 +0200
873 @@ -0,0 +1,3 @@
874 +/* Replace AROS' wint_t definition with gcc's one */
875 +#define __need_wint_t
876 +#include <stddef.h>
877 diff -ruN gcc-5.3.0/gcc/ginclude/stddef.h gcc-5.3.0.aros/gcc/ginclude/stddef.h
878 --- gcc-5.3.0/gcc/ginclude/stddef.h 2015-01-05 14:33:28.000000000 +0200
879 +++ gcc-5.3.0.aros/gcc/ginclude/stddef.h 2016-01-15 09:15:34.485755242 +0200
880 @@ -131,6 +131,7 @@
881 #ifndef __PTRDIFF_T
882 #ifndef _PTRDIFF_T_
883 #ifndef _BSD_PTRDIFF_T_
884 +#ifndef _AROS_TYPES_PTRDIFF_T_H
885 #ifndef ___int_ptrdiff_t_h
886 #ifndef _GCC_PTRDIFF_T
887 #ifndef _PTRDIFF_T_DECLARED /* DragonFly */
888 @@ -140,6 +141,7 @@
889 #define __PTRDIFF_T
890 #define _PTRDIFF_T_
891 #define _BSD_PTRDIFF_T_
892 +#define _AROS_TYPES_PTRDIFF_T_H
893 #define ___int_ptrdiff_t_h
894 #define _GCC_PTRDIFF_T
895 #define _PTRDIFF_T_DECLARED
896 @@ -150,6 +152,7 @@
897 #endif /* _PTRDIFF_T_DECLARED */
898 #endif /* _GCC_PTRDIFF_T */
899 #endif /* ___int_ptrdiff_t_h */
900 +#endif /* _AROS_TYPES_PTRDIFF_T_H */
901 #endif /* _BSD_PTRDIFF_T_ */
902 #endif /* _PTRDIFF_T_ */
903 #endif /* __PTRDIFF_T */
904 @@ -176,6 +179,7 @@
905 #ifndef __SIZE_T
906 #ifndef _SIZE_T_
907 #ifndef _BSD_SIZE_T_
908 +#ifndef _AROS_TYPES_SIZE_T_H
909 #ifndef _SIZE_T_DEFINED_
910 #ifndef _SIZE_T_DEFINED
911 #ifndef _BSD_SIZE_T_DEFINED_ /* Darwin */
912 @@ -193,6 +197,7 @@
913 #define __SIZE_T
914 #define _SIZE_T_
915 #define _BSD_SIZE_T_
916 +#define _AROS_TYPES_SIZE_T_H
917 #define _SIZE_T_DEFINED_
918 #define _SIZE_T_DEFINED
919 #define _BSD_SIZE_T_DEFINED_ /* Darwin */
920 @@ -226,6 +231,7 @@
921 #endif /* _BSD_SIZE_T_DEFINED_ */
922 #endif /* _SIZE_T_DEFINED */
923 #endif /* _SIZE_T_DEFINED_ */
924 +#endif /* _AROS_TYPES_SIZE_T_H */
925 #endif /* _BSD_SIZE_T_ */
926 #endif /* _SIZE_T_ */
927 #endif /* __SIZE_T */
928 diff -ruN gcc-5.3.0/include/filenames.h gcc-5.3.0.aros/include/filenames.h
929 --- gcc-5.3.0/include/filenames.h 2014-11-12 01:33:25.000000000 +0200
930 +++ gcc-5.3.0.aros/include/filenames.h 2016-01-15 09:15:34.486755276 +0200
931 @@ -42,6 +42,10 @@
932 # define HAS_DRIVE_SPEC(f) HAS_DOS_DRIVE_SPEC (f)
933 # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c)
934 # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f)
935 +#elif defined __AROS__
936 +# define IS_DIR_SEPARATOR(c) ((c) == '/' || (c) == ':')
937 +# define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0]) || (strchr((f), ':')))
938 +# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM
939 #else /* not DOSish */
940 # if defined(__APPLE__)
941 # ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
942 diff -ruN gcc-5.3.0/libgcc/config.host gcc-5.3.0.aros/libgcc/config.host
943 --- gcc-5.3.0/libgcc/config.host 2015-10-01 15:01:18.000000000 +0300
944 +++ gcc-5.3.0.aros/libgcc/config.host 2016-01-15 09:15:34.486755276 +0200
945 @@ -786,7 +786,7 @@
946 m32rle-*-linux*)
947 tmake_file="$tmake_file m32r/t-linux t-fdpbit"
949 -m68k-*-elf* | fido-*-elf)
950 +m68k-*-elf* | fido-*-elf | m68k-*-aros*)
951 tmake_file="$tmake_file m68k/t-floatlib"
953 m68k*-*-netbsdelf*)
954 @@ -1296,6 +1296,9 @@
955 tmake_file="$tmake_file nvptx/t-nvptx"
956 extra_parts="crt0.o"
958 +*-*-aros*)
959 + tmake_file=
960 + ;;
962 echo "*** Configuration ${host} not supported" 1>&2
963 exit 1
964 diff -ruN gcc-5.3.0/libgcc/gthr.h gcc-5.3.0.aros/libgcc/gthr.h
965 --- gcc-5.3.0/libgcc/gthr.h 2015-01-05 14:33:28.000000000 +0200
966 +++ gcc-5.3.0.aros/libgcc/gthr.h 2016-01-15 09:15:34.487755310 +0200
967 @@ -141,6 +141,11 @@
968 #define GTHREAD_USE_WEAK 0
969 #endif
971 +#ifdef __AROS__
972 +#undef GTHREAD_USE_WEAK
973 +#define GTHREAD_USE_WEAK 0
974 +#endif
976 #ifndef GTHREAD_USE_WEAK
977 #define GTHREAD_USE_WEAK 1
978 #endif
979 diff -ruN gcc-5.3.0/libgcc/unwind-dw2.c gcc-5.3.0.aros/libgcc/unwind-dw2.c
980 --- gcc-5.3.0/libgcc/unwind-dw2.c 2015-01-05 14:33:28.000000000 +0200
981 +++ gcc-5.3.0.aros/libgcc/unwind-dw2.c 2016-01-15 09:15:34.487755310 +0200
982 @@ -1542,7 +1542,9 @@
983 static inline void
984 init_dwarf_reg_size_table (void)
986 +#ifdef MD_FALLBACK_FRAME_STATE_FOR
987 __builtin_init_dwarf_reg_size_table (dwarf_reg_size_table);
988 +#endif
991 static void __attribute__((noinline))
992 diff -ruN gcc-5.3.0/libgcc/unwind-dw2-fde.c gcc-5.3.0.aros/libgcc/unwind-dw2-fde.c
993 --- gcc-5.3.0/libgcc/unwind-dw2-fde.c 2015-01-05 14:33:28.000000000 +0200
994 +++ gcc-5.3.0.aros/libgcc/unwind-dw2-fde.c 2016-01-15 09:15:34.487755310 +0200
995 @@ -92,12 +92,16 @@
996 #endif
998 init_object_mutex_once ();
999 +#ifndef __AROS__ /* This is called when SysBase is not yet set up */
1000 __gthread_mutex_lock (&object_mutex);
1001 +#endif
1003 ob->next = unseen_objects;
1004 unseen_objects = ob;
1006 +#ifndef __AROS__
1007 __gthread_mutex_unlock (&object_mutex);
1008 +#endif
1011 void
1012 diff -ruN gcc-5.3.0/libiberty/filename_cmp.c gcc-5.3.0.aros/libiberty/filename_cmp.c
1013 --- gcc-5.3.0/libiberty/filename_cmp.c 2014-11-12 01:33:25.000000000 +0200
1014 +++ gcc-5.3.0.aros/libiberty/filename_cmp.c 2016-01-15 09:15:34.488755343 +0200
1015 @@ -55,9 +55,12 @@
1017 filename_cmp (const char *s1, const char *s2)
1019 -#if !defined(HAVE_DOS_BASED_FILE_SYSTEM) \
1020 - && !defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
1021 +#if !defined(HAVE_DOS_BASED_FILE_SYSTEM)
1022 +#if defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
1023 + return strcasecmp(s1, s2);
1024 +#else
1025 return strcmp(s1, s2);
1026 +#endif
1027 #else
1028 for (;;)
1030 diff -ruN gcc-5.3.0/libobjc/configure gcc-5.3.0.aros/libobjc/configure
1031 --- gcc-5.3.0/libobjc/configure 2015-12-04 12:47:52.000000000 +0200
1032 +++ gcc-5.3.0.aros/libobjc/configure 2016-01-15 09:15:34.490755411 +0200
1033 @@ -11256,214 +11256,7 @@
1034 # -----------
1036 # Check if we have thread-local storage
1039 - # Check whether --enable-tls was given.
1040 -if test "${enable_tls+set}" = set; then :
1041 - enableval=$enable_tls;
1042 - case "$enableval" in
1043 - yes|no) ;;
1044 - *) as_fn_error "Argument to enable/disable tls must be yes or no" "$LINENO" 5 ;;
1045 - esac
1047 -else
1048 - enable_tls=yes
1052 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports thread-local storage" >&5
1053 -$as_echo_n "checking whether the target supports thread-local storage... " >&6; }
1054 -if test "${gcc_cv_have_tls+set}" = set; then :
1055 - $as_echo_n "(cached) " >&6
1056 -else
1058 - if test "$cross_compiling" = yes; then :
1059 - if test x$gcc_no_link = xyes; then
1060 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1062 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1063 -/* end confdefs.h. */
1064 -__thread int a; int b; int main() { return a = b; }
1065 -_ACEOF
1066 -if ac_fn_c_try_link "$LINENO"; then :
1067 - chktls_save_LDFLAGS="$LDFLAGS"
1068 - case $host in
1069 - *-*-linux*)
1070 - LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
1071 - ;;
1072 - esac
1073 - chktls_save_CFLAGS="$CFLAGS"
1074 - CFLAGS="-fPIC $CFLAGS"
1075 - if test x$gcc_no_link = xyes; then
1076 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1078 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1079 -/* end confdefs.h. */
1080 -int f() { return 0; }
1081 -_ACEOF
1082 -if ac_fn_c_try_link "$LINENO"; then :
1083 - if test x$gcc_no_link = xyes; then
1084 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1086 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1087 -/* end confdefs.h. */
1088 -__thread int a; int b; int f() { return a = b; }
1089 -_ACEOF
1090 -if ac_fn_c_try_link "$LINENO"; then :
1091 - gcc_cv_have_tls=yes
1092 -else
1093 - gcc_cv_have_tls=no
1095 -rm -f core conftest.err conftest.$ac_objext \
1096 - conftest$ac_exeext conftest.$ac_ext
1097 -else
1098 - gcc_cv_have_tls=yes
1100 -rm -f core conftest.err conftest.$ac_objext \
1101 - conftest$ac_exeext conftest.$ac_ext
1102 - CFLAGS="$chktls_save_CFLAGS"
1103 - LDFLAGS="$chktls_save_LDFLAGS"
1104 -else
1105 - gcc_cv_have_tls=no
1107 -rm -f core conftest.err conftest.$ac_objext \
1108 - conftest$ac_exeext conftest.$ac_ext
1111 -else
1112 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1113 -/* end confdefs.h. */
1114 -__thread int a; int b; int main() { return a = b; }
1115 -_ACEOF
1116 -if ac_fn_c_try_run "$LINENO"; then :
1117 - chktls_save_LDFLAGS="$LDFLAGS"
1118 - LDFLAGS="-static $LDFLAGS"
1119 - if test x$gcc_no_link = xyes; then
1120 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1122 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1123 -/* end confdefs.h. */
1124 -int main() { return 0; }
1125 -_ACEOF
1126 -if ac_fn_c_try_link "$LINENO"; then :
1127 - if test "$cross_compiling" = yes; then :
1128 - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
1129 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1130 -as_fn_error "cannot run test program while cross compiling
1131 -See \`config.log' for more details." "$LINENO" 5; }
1132 -else
1133 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1134 -/* end confdefs.h. */
1135 -__thread int a; int b; int main() { return a = b; }
1136 -_ACEOF
1137 -if ac_fn_c_try_run "$LINENO"; then :
1138 - gcc_cv_have_tls=yes
1139 -else
1140 - gcc_cv_have_tls=no
1142 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1143 - conftest.$ac_objext conftest.beam conftest.$ac_ext
1146 -else
1147 - gcc_cv_have_tls=yes
1149 -rm -f core conftest.err conftest.$ac_objext \
1150 - conftest$ac_exeext conftest.$ac_ext
1151 - LDFLAGS="$chktls_save_LDFLAGS"
1152 - if test $gcc_cv_have_tls = yes; then
1153 - chktls_save_CFLAGS="$CFLAGS"
1154 - thread_CFLAGS=failed
1155 - for flag in '' '-pthread' '-lpthread'; do
1156 - CFLAGS="$flag $chktls_save_CFLAGS"
1157 - if test x$gcc_no_link = xyes; then
1158 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1160 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1161 -/* end confdefs.h. */
1162 -#include <pthread.h>
1163 - void *g(void *d) { return NULL; }
1164 -int
1165 -main ()
1167 -pthread_t t; pthread_create(&t,NULL,g,NULL);
1169 - return 0;
1171 -_ACEOF
1172 -if ac_fn_c_try_link "$LINENO"; then :
1173 - thread_CFLAGS="$flag"
1175 -rm -f core conftest.err conftest.$ac_objext \
1176 - conftest$ac_exeext conftest.$ac_ext
1177 - if test "X$thread_CFLAGS" != Xfailed; then
1178 - break
1179 - fi
1180 - done
1181 - CFLAGS="$chktls_save_CFLAGS"
1182 - if test "X$thread_CFLAGS" != Xfailed; then
1183 - CFLAGS="$thread_CFLAGS $chktls_save_CFLAGS"
1184 - if test "$cross_compiling" = yes; then :
1185 - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
1186 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1187 -as_fn_error "cannot run test program while cross compiling
1188 -See \`config.log' for more details." "$LINENO" 5; }
1189 -else
1190 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1191 -/* end confdefs.h. */
1192 -#include <pthread.h>
1193 - __thread int a;
1194 - static int *volatile a_in_other_thread;
1195 - static void *
1196 - thread_func (void *arg)
1198 - a_in_other_thread = &a;
1199 - return (void *)0;
1201 -int
1202 -main ()
1204 -pthread_t thread;
1205 - void *thread_retval;
1206 - int *volatile a_in_main_thread;
1207 - a_in_main_thread = &a;
1208 - if (pthread_create (&thread, (pthread_attr_t *)0,
1209 - thread_func, (void *)0))
1210 - return 0;
1211 - if (pthread_join (thread, &thread_retval))
1212 - return 0;
1213 - return (a_in_other_thread == a_in_main_thread);
1215 - return 0;
1217 -_ACEOF
1218 -if ac_fn_c_try_run "$LINENO"; then :
1219 - gcc_cv_have_tls=yes
1220 -else
1221 - gcc_cv_have_tls=no
1223 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1224 - conftest.$ac_objext conftest.beam conftest.$ac_ext
1227 - CFLAGS="$chktls_save_CFLAGS"
1228 - fi
1229 - fi
1230 -else
1231 - gcc_cv_have_tls=no
1233 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1234 - conftest.$ac_objext conftest.beam conftest.$ac_ext
1238 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_have_tls" >&5
1239 -$as_echo "$gcc_cv_have_tls" >&6; }
1240 - if test "$enable_tls $gcc_cv_have_tls" = "yes yes"; then
1242 -$as_echo "#define HAVE_TLS 1" >>confdefs.h
1244 - fi
1245 +#dnl GCC_ENABLE_TLS
1247 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exception model to use" >&5
1248 $as_echo_n "checking for exception model to use... " >&6; }
1249 diff -ruN gcc-5.3.0/libobjc/configure.ac gcc-5.3.0.aros/libobjc/configure.ac
1250 --- gcc-5.3.0/libobjc/configure.ac 2015-01-05 14:33:28.000000000 +0200
1251 +++ gcc-5.3.0.aros/libobjc/configure.ac 2016-01-15 09:15:34.491755445 +0200
1252 @@ -210,7 +210,7 @@
1253 # -----------
1255 # Check if we have thread-local storage
1256 -GCC_CHECK_TLS
1257 +dnl GCC_CHECK_TLS
1259 AC_MSG_CHECKING([for exception model to use])
1260 AC_LANG_PUSH(C)
1261 diff -ruN gcc-5.3.0/libobjc/thr.c gcc-5.3.0.aros/libobjc/thr.c
1262 --- gcc-5.3.0/libobjc/thr.c 2015-02-05 11:41:44.000000000 +0200
1263 +++ gcc-5.3.0.aros/libobjc/thr.c 2016-01-15 09:15:34.491755445 +0200
1264 @@ -35,6 +35,7 @@
1265 #include "objc/runtime.h"
1266 #include "objc-private/module-abi-8.h"
1267 #include "objc-private/runtime.h"
1268 +#define __typedef_BOOL /* Remove definition of BOOL */
1269 #include <gthr.h>
1271 #include <stdlib.h>
1272 diff -ruN gcc-5.3.0/libstdc++-v3/config/os/aros/ctype_base.h gcc-5.3.0.aros/libstdc++-v3/config/os/aros/ctype_base.h
1273 --- gcc-5.3.0/libstdc++-v3/config/os/aros/ctype_base.h 1970-01-01 02:00:00.000000000 +0200
1274 +++ gcc-5.3.0.aros/libstdc++-v3/config/os/aros/ctype_base.h 2016-01-15 09:15:34.491755445 +0200
1275 @@ -0,0 +1,30 @@
1276 +namespace std _GLIBCXX_VISIBILITY(default)
1278 +_GLIBCXX_BEGIN_NAMESPACE_VERSION
1280 +struct ctype_base {
1281 + /* Non-standard typedefs */
1282 + typedef int * __to_type;
1284 + /* NB: Offsets into ctype<char>::_M_table force a particular size
1285 + on the mask type. Because of this, we don't use an enum. */
1286 + typedef unsigned short int mask;
1288 + static const mask upper = _ISupper;
1289 + static const mask lower = _ISlower;
1290 + static const mask alpha = _ISalpha;
1291 + static const mask digit = _ISdigit;
1292 + static const mask xdigit = _ISxdigit;
1293 + static const mask space = _ISspace;
1294 + static const mask print = _ISprint;
1295 + static const mask graph = _ISgraph;
1296 + static const mask cntrl = _IScntrl;
1297 + static const mask punct = _ISpunct;
1298 + static const mask alnum = _ISalnum;
1299 +#if __cplusplus >= 201103L
1300 + static const mask blank = _ISblank;
1301 +#endif
1304 +_GLIBCXX_END_NAMESPACE_VERSION
1305 +} // namespace
1306 diff -ruN gcc-5.3.0/libstdc++-v3/config/os/aros/ctype_configure_char.cc gcc-5.3.0.aros/libstdc++-v3/config/os/aros/ctype_configure_char.cc
1307 --- gcc-5.3.0/libstdc++-v3/config/os/aros/ctype_configure_char.cc 1970-01-01 02:00:00.000000000 +0200
1308 +++ gcc-5.3.0.aros/libstdc++-v3/config/os/aros/ctype_configure_char.cc 2016-01-15 09:15:34.492755479 +0200
1309 @@ -0,0 +1,99 @@
1310 +// Locale support -*- C++ -*-
1312 +// Copyright (C) 2011-2013 Free Software Foundation, Inc.
1314 +// This file is part of the GNU ISO C++ Library. This library is free
1315 +// software; you can redistribute it and/or modify it under the
1316 +// terms of the GNU General Public License as published by the
1317 +// Free Software Foundation; either version 3, or (at your option)
1318 +// any later version.
1320 +// This library is distributed in the hope that it will be useful,
1321 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1322 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1323 +// GNU General Public License for more details.
1325 +// Under Section 7 of GPL version 3, you are granted additional
1326 +// permissions described in the GCC Runtime Library Exception, version
1327 +// 3.1, as published by the Free Software Foundation.
1329 +// You should have received a copy of the GNU General Public License and
1330 +// a copy of the GCC Runtime Library Exception along with this program;
1331 +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
1332 +// <http://www.gnu.org/licenses/>.
1334 +/** @file ctype_configure_char.cc */
1337 +// ISO C++ 14882: 22.1 Locales
1340 +#include <locale>
1341 +#include <cstdlib>
1342 +#include <cstring>
1344 +namespace std _GLIBCXX_VISIBILITY(default)
1346 +_GLIBCXX_BEGIN_NAMESPACE_VERSION
1348 +// Information as gleaned from /usr/include/ctype.h
1350 + const ctype_base::mask*
1351 + ctype<char>::classic_table() throw()
1352 + { return 0; }
1354 + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
1355 + size_t __refs)
1356 + : facet(__refs), _M_del(__table != 0 && __del),
1357 + _M_toupper(NULL), _M_tolower(NULL),
1358 + _M_table(__table ? __table : classic_table())
1359 + {
1360 + memset(_M_widen, 0, sizeof(_M_widen));
1361 + _M_widen_ok = 0;
1362 + memset(_M_narrow, 0, sizeof(_M_narrow));
1363 + _M_narrow_ok = 0;
1366 + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
1367 + : facet(__refs), _M_del(__table != 0 && __del),
1368 + _M_toupper(NULL), _M_tolower(NULL),
1369 + _M_table(__table ? __table : classic_table())
1370 + {
1371 + memset(_M_widen, 0, sizeof(_M_widen));
1372 + _M_widen_ok = 0;
1373 + memset(_M_narrow, 0, sizeof(_M_narrow));
1374 + _M_narrow_ok = 0;
1377 + char
1378 + ctype<char>::do_toupper(char __c) const
1379 + { return ::toupper((int) __c); }
1381 + const char*
1382 + ctype<char>::do_toupper(char* __low, const char* __high) const
1384 + while (__low < __high)
1386 + *__low = ::toupper((int) *__low);
1387 + ++__low;
1389 + return __high;
1392 + char
1393 + ctype<char>::do_tolower(char __c) const
1394 + { return ::tolower((int) __c); }
1396 + const char*
1397 + ctype<char>::do_tolower(char* __low, const char* __high) const
1399 + while (__low < __high)
1401 + *__low = ::tolower((int) *__low);
1402 + ++__low;
1404 + return __high;
1407 +_GLIBCXX_END_NAMESPACE_VERSION
1408 +} // namespace
1409 diff -ruN gcc-5.3.0/libstdc++-v3/config/os/aros/ctype_inline.h gcc-5.3.0.aros/libstdc++-v3/config/os/aros/ctype_inline.h
1410 --- gcc-5.3.0/libstdc++-v3/config/os/aros/ctype_inline.h 1970-01-01 02:00:00.000000000 +0200
1411 +++ gcc-5.3.0.aros/libstdc++-v3/config/os/aros/ctype_inline.h 2016-01-15 09:15:34.492755479 +0200
1412 @@ -0,0 +1,173 @@
1413 +// Locale support -*- C++ -*-
1415 +// Copyright (C) 2000, 2003 Free Software Foundation, Inc.
1417 +// This file is part of the GNU ISO C++ Library. This library is free
1418 +// software; you can redistribute it and/or modify it under the
1419 +// terms of the GNU General Public License as published by the
1420 +// Free Software Foundation; either version 2, or (at your option)
1421 +// any later version.
1423 +// This library is distributed in the hope that it will be useful,
1424 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1425 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1426 +// GNU General Public License for more details.
1428 +// You should have received a copy of the GNU General Public License along
1429 +// with this library; see the file COPYING. If not, write to the Free
1430 +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
1431 +// USA.
1433 +// As a special exception, you may use this file as part of a free software
1434 +// library without restriction. Specifically, if other files instantiate
1435 +// templates or use macros or inline functions from this file, or you compile
1436 +// this file and link it with other files to produce an executable, this
1437 +// file does not by itself cause the resulting executable to be covered by
1438 +// the GNU General Public License. This exception does not however
1439 +// invalidate any other reasons why the executable file might be covered by
1440 +// the GNU General Public License.
1442 +/** @file ctype_inline.h
1443 + * This is an internal header file, included by other library headers.
1444 + * You should not attempt to use it directly.
1445 + */
1448 +// ISO C++ 14882: 22.1 Locales
1451 +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
1452 +// functions go in ctype.cc
1454 +// The following definitions are portable, but insanely slow. If one
1455 +// cares at all about performance, then specialized ctype
1456 +// functionality should be added for the native os in question: see
1457 +// the config/os/bits/ctype_*.h files.
1459 +// Constructing a synthetic "C" table should be seriously considered...
1461 +namespace std _GLIBCXX_VISIBILITY(default)
1463 +_GLIBCXX_BEGIN_NAMESPACE_VERSION
1465 + bool
1466 + ctype<char>::
1467 + is(mask __m, char __c) const
1468 + {
1469 + if (_M_table)
1470 + return _M_table[static_cast<unsigned char>(__c)] & __m;
1471 + else
1473 + bool __ret = false;
1474 + const size_t __bitmasksize = 15;
1475 + size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0
1476 + for (; __bitcur <= __bitmasksize; ++__bitcur)
1478 + const mask __bit = static_cast<mask>(1 << __bitcur);
1479 + if (__m & __bit)
1481 + bool __testis;
1482 + switch (__bit)
1484 + case space:
1485 + __testis = isspace(__c);
1486 + break;
1487 + case print:
1488 + __testis = isprint(__c);
1489 + break;
1490 + case cntrl:
1491 + __testis = iscntrl(__c);
1492 + break;
1493 + case upper:
1494 + __testis = isupper(__c);
1495 + break;
1496 + case lower:
1497 + __testis = islower(__c);
1498 + break;
1499 + case alpha:
1500 + __testis = isalpha(__c);
1501 + break;
1502 + case digit:
1503 + __testis = isdigit(__c);
1504 + break;
1505 + case punct:
1506 + __testis = ispunct(__c);
1507 + break;
1508 + case xdigit:
1509 + __testis = isxdigit(__c);
1510 + break;
1511 + case alnum:
1512 + __testis = isalnum(__c);
1513 + break;
1514 + case graph:
1515 + __testis = isgraph(__c);
1516 + break;
1517 + default:
1518 + __testis = false;
1519 + break;
1521 + __ret |= __testis;
1524 + return __ret;
1528 + const char*
1529 + ctype<char>::
1530 + is(const char* __low, const char* __high, mask* __vec) const
1532 + if (_M_table)
1533 + while (__low < __high)
1534 + *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
1535 + else
1537 + // Highest bitmask in ctype_base == 10.
1538 + const size_t __bitmasksize = 15;
1539 + for (;__low < __high; ++__vec, ++__low)
1541 + mask __m = 0;
1542 + // Lowest bitmask in ctype_base == 0
1543 + size_t __i = 0;
1544 + for (;__i <= __bitmasksize; ++__i)
1546 + const mask __bit = static_cast<mask>(1 << __i);
1547 + if (this->is(__bit, *__low))
1548 + __m |= __bit;
1550 + *__vec = __m;
1553 + return __high;
1556 + const char*
1557 + ctype<char>::
1558 + scan_is(mask __m, const char* __low, const char* __high) const
1560 + if (_M_table)
1561 + while (__low < __high
1562 + && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
1563 + ++__low;
1564 + else
1565 + while (__low < __high && !this->is(__m, *__low))
1566 + ++__low;
1567 + return __low;
1570 + const char*
1571 + ctype<char>::
1572 + scan_not(mask __m, const char* __low, const char* __high) const
1574 + if (_M_table)
1575 + while (__low < __high
1576 + && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
1577 + ++__low;
1578 + else
1579 + while (__low < __high && this->is(__m, *__low) != 0)
1580 + ++__low;
1581 + return __low;
1584 +_GLIBCXX_END_NAMESPACE_VERSION
1585 +} // namespace
1586 diff -ruN gcc-5.3.0/libstdc++-v3/config/os/aros/ctype_noninline.h gcc-5.3.0.aros/libstdc++-v3/config/os/aros/ctype_noninline.h
1587 --- gcc-5.3.0/libstdc++-v3/config/os/aros/ctype_noninline.h 1970-01-01 02:00:00.000000000 +0200
1588 +++ gcc-5.3.0.aros/libstdc++-v3/config/os/aros/ctype_noninline.h 2016-01-15 09:15:34.492755479 +0200
1589 @@ -0,0 +1,56 @@
1590 + const ctype_base::mask*
1591 + ctype<char>::classic_table() throw()
1592 + { return *__ctype_b_ptr; }
1594 + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
1595 + size_t __refs)
1596 + : facet(__refs), _M_del(__table != 0 && __del),
1597 + _M_toupper(NULL), _M_tolower(NULL),
1598 + _M_table(__table ? __table : classic_table())
1599 + {
1600 + memset(_M_widen, 0, sizeof(_M_widen));
1601 + _M_widen_ok = 0;
1602 + memset(_M_narrow, 0, sizeof(_M_narrow));
1603 + _M_narrow_ok = 0;
1606 + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
1607 + : facet(__refs), _M_del(__table != 0 && __del),
1608 + _M_toupper(NULL), _M_tolower(NULL),
1609 + _M_table(__table ? __table : classic_table())
1610 + {
1611 + memset(_M_widen, 0, sizeof(_M_widen));
1612 + _M_widen_ok = 0;
1613 + memset(_M_narrow, 0, sizeof(_M_narrow));
1614 + _M_narrow_ok = 0;
1617 + char
1618 + ctype<char>::do_toupper(char __c) const
1619 + { return ::toupper((int) __c); }
1621 + const char*
1622 + ctype<char>::do_toupper(char* __low, const char* __high) const
1624 + while (__low < __high)
1626 + *__low = ::toupper((int) *__low);
1627 + ++__low;
1629 + return __high;
1632 + char
1633 + ctype<char>::do_tolower(char __c) const
1634 + { return ::tolower((int) __c); }
1636 + const char*
1637 + ctype<char>::do_tolower(char* __low, const char* __high) const
1639 + while (__low < __high)
1641 + *__low = ::tolower((int) *__low);
1642 + ++__low;
1644 + return __high;
1646 diff -ruN gcc-5.3.0/libstdc++-v3/config/os/aros/os_defines.h gcc-5.3.0.aros/libstdc++-v3/config/os/aros/os_defines.h
1647 --- gcc-5.3.0/libstdc++-v3/config/os/aros/os_defines.h 1970-01-01 02:00:00.000000000 +0200
1648 +++ gcc-5.3.0.aros/libstdc++-v3/config/os/aros/os_defines.h 2016-01-15 09:15:34.492755479 +0200
1649 @@ -0,0 +1,6 @@
1650 +#ifndef _GLIBCXX_OS_DEFINES
1651 +#define _GLIBCXX_OS_DEFINES
1653 +#define __off64_t off_t
1655 +#endif
1656 diff -ruN gcc-5.3.0/libstdc++-v3/configure gcc-5.3.0.aros/libstdc++-v3/configure
1657 --- gcc-5.3.0/libstdc++-v3/configure 2015-11-26 15:51:04.000000000 +0200
1658 +++ gcc-5.3.0.aros/libstdc++-v3/configure 2016-01-15 09:15:34.503755850 +0200
1659 @@ -5367,12 +5367,12 @@
1662 # Libtool setup.
1663 -if test "x${with_newlib}" != "xyes"; then
1664 - enable_dlopen=yes
1669 +#if test "x${with_newlib}" != "xyes"; then
1670 +# AC_LIBTOOL_DLOPEN
1674 +#fi
1675 case `pwd` in
1676 *\ * | *\ *)
1677 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
1678 @@ -8103,6 +8103,8 @@
1682 + enable_dlopen=no
1685 enable_win32_dll=no
1687 @@ -18800,6 +18802,7 @@
1689 struct iovec iov[2];
1690 writev(0, iov, 0);
1691 +#error be sure to fail
1693 return 0;
1695 @@ -18822,6 +18825,7 @@
1697 struct iovec iov[2];
1698 writev(0, iov, 0);
1699 +#error be sure to fail
1701 return 0;
1703 @@ -27998,6 +28002,58 @@
1705 # Base decisions on target environment.
1706 case "${host}" in
1707 + *-aros*)
1708 + for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
1709 + machine/param.h sys/machine.h sys/types.h fp.h locale.h float.h inttypes.h
1710 +do :
1711 + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
1712 +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
1713 +eval as_val=\$$as_ac_Header
1714 + if test "x$as_val" = x""yes; then :
1715 + cat >>confdefs.h <<_ACEOF
1716 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
1717 +_ACEOF
1721 +done
1724 + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
1725 + GLIBCXX_CHECK_WCHAR_T_SUPPORT
1727 + $as_echo "#define HAVE_FINITE 1" >>confdefs.h
1729 + $as_echo "#define HAVE_FINITEF 1" >>confdefs.h
1731 + $as_echo "#define HAVE_FREXPF 1" >>confdefs.h
1733 + $as_echo "#define HAVE_HYPOTF 1" >>confdefs.h
1735 + $as_echo "#define HAVE_ISINF 1" >>confdefs.h
1737 + $as_echo "#define HAVE_ISINFF 1" >>confdefs.h
1739 + $as_echo "#define HAVE_ISNAN 1" >>confdefs.h
1741 + $as_echo "#define HAVE_ISNANF 1" >>confdefs.h
1743 + $as_echo "#define HAVE_SINCOS 1" >>confdefs.h
1745 + $as_echo "#define HAVE_SINCOSF 1" >>confdefs.h
1747 + if test x"long_double_math_on_this_cpu" = x"yes"; then
1748 + $as_echo "#define HAVE_FINITEL 1" >>confdefs.h
1750 + $as_echo "#define HAVE_HYPOTL 1" >>confdefs.h
1752 + $as_echo "#define HAVE_ISINFL 1" >>confdefs.h
1754 + $as_echo "#define HAVE_ISNANL 1" >>confdefs.h
1756 + fi
1757 + ;;
1759 arm*-*-symbianelf*)
1760 # This is a freestanding configuration; there is nothing to do here.
1762 diff -ruN gcc-5.3.0/libstdc++-v3/configure.ac gcc-5.3.0.aros/libstdc++-v3/configure.ac
1763 --- gcc-5.3.0/libstdc++-v3/configure.ac 2015-11-24 15:25:07.000000000 +0200
1764 +++ gcc-5.3.0.aros/libstdc++-v3/configure.ac 2016-01-15 09:15:34.504755884 +0200
1765 @@ -89,9 +89,9 @@
1766 GLIBCXX_CONFIGURE
1768 # Libtool setup.
1769 -if test "x${with_newlib}" != "xyes"; then
1770 - AC_LIBTOOL_DLOPEN
1772 +#if test "x${with_newlib}" != "xyes"; then
1773 +# AC_LIBTOOL_DLOPEN
1774 +#fi
1775 AM_PROG_LIBTOOL
1776 ACX_LT_HOST_FLAGS
1777 AC_SUBST(enable_shared)
1778 diff -ruN gcc-5.3.0/libstdc++-v3/configure.host gcc-5.3.0.aros/libstdc++-v3/configure.host
1779 --- gcc-5.3.0/libstdc++-v3/configure.host 2015-06-24 12:59:28.000000000 +0300
1780 +++ gcc-5.3.0.aros/libstdc++-v3/configure.host 2016-01-15 09:15:34.504755884 +0200
1781 @@ -237,6 +237,9 @@
1782 os_include_dir="os/generic"
1783 atomicity_dir="cpu/generic"
1785 + aros*)
1786 + os_include_dir="os/aros"
1787 + ;;
1788 bsd*)
1789 # Plain BSD attempts to share FreeBSD files.
1790 os_include_dir="os/bsd/freebsd"
1791 diff -ruN gcc-5.3.0/libstdc++-v3/crossconfig.m4 gcc-5.3.0.aros/libstdc++-v3/crossconfig.m4
1792 --- gcc-5.3.0/libstdc++-v3/crossconfig.m4 2014-04-22 15:30:59.000000000 +0300
1793 +++ gcc-5.3.0.aros/libstdc++-v3/crossconfig.m4 2016-01-15 09:15:34.504755884 +0200
1794 @@ -5,6 +5,31 @@
1795 AC_DEFUN([GLIBCXX_CROSSCONFIG],[
1796 # Base decisions on target environment.
1797 case "${host}" in
1798 + *-aros*)
1799 + AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
1800 + machine/param.h sys/machine.h sys/types.h fp.h locale.h float.h inttypes.h])
1802 + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
1803 + GLIBCXX_CHECK_WCHAR_T_SUPPORT
1805 + AC_DEFINE(HAVE_FINITE)
1806 + AC_DEFINE(HAVE_FINITEF)
1807 + AC_DEFINE(HAVE_FREXPF)
1808 + AC_DEFINE(HAVE_HYPOTF)
1809 + AC_DEFINE(HAVE_ISINF)
1810 + AC_DEFINE(HAVE_ISINFF)
1811 + AC_DEFINE(HAVE_ISNAN)
1812 + AC_DEFINE(HAVE_ISNANF)
1813 + AC_DEFINE(HAVE_SINCOS)
1814 + AC_DEFINE(HAVE_SINCOSF)
1815 + if test x"long_double_math_on_this_cpu" = x"yes"; then
1816 + AC_DEFINE(HAVE_FINITEL)
1817 + AC_DEFINE(HAVE_HYPOTL)
1818 + AC_DEFINE(HAVE_ISINFL)
1819 + AC_DEFINE(HAVE_ISNANL)
1820 + fi
1821 + ;;
1823 arm*-*-symbianelf*)
1824 # This is a freestanding configuration; there is nothing to do here.
1826 diff -ruN gcc-5.3.0/libstdc++-v3/include/Makefile.in gcc-5.3.0.aros/libstdc++-v3/include/Makefile.in
1827 --- gcc-5.3.0/libstdc++-v3/include/Makefile.in 2015-08-18 20:58:22.000000000 +0300
1828 +++ gcc-5.3.0.aros/libstdc++-v3/include/Makefile.in 2016-01-15 09:15:34.505755917 +0200
1829 @@ -1635,6 +1635,7 @@
1830 -e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
1831 -e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
1832 -e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \
1833 + -e 's/_GLIBCXX___AROS__/__AROS__/g' \
1834 -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
1835 < $< > $@
1837 diff -ruN gcc-5.3.0/libstdc++-v3/include/std/ratio gcc-5.3.0.aros/libstdc++-v3/include/std/ratio
1838 --- gcc-5.3.0/libstdc++-v3/include/std/ratio 2015-01-05 14:33:28.000000000 +0200
1839 +++ gcc-5.3.0.aros/libstdc++-v3/include/std/ratio 2016-01-15 09:15:34.505755917 +0200
1840 @@ -211,10 +211,10 @@
1842 private:
1843 static_assert(__d != 0, "Internal library error");
1844 - static_assert(sizeof (uintmax_t) == sizeof (unsigned long long),
1845 - "This library calls __builtin_clzll on uintmax_t, which "
1846 - "is unsafe on your platform. Please complain to "
1847 - "http://gcc.gnu.org/bugzilla/");
1848 +// static_assert(sizeof (uintmax_t) == sizeof (unsigned long long),
1849 +// "This library calls __builtin_clzll on uintmax_t, which "
1850 +// "is unsafe on your platform. Please complain to "
1851 +// "http://gcc.gnu.org/bugzilla/");
1852 static constexpr int __shift = __builtin_clzll(__d);
1853 static constexpr int __coshift_ = sizeof(uintmax_t) * 8 - __shift;
1854 static constexpr int __coshift = (__shift != 0) ? __coshift_ : 0;