handle USER_INCLUDES via the CPPFLAGS
[AROS.git] / tools / crosstools / gcc-4.8.3-aros.diff
blob44825066ffd94e88f06f6a1481afafd857eacc78
1 diff -ruN gcc-4.8.3/boehm-gc/include/gc_amiga_redirects.h gcc-4.8.3.aros/boehm-gc/include/gc_amiga_redirects.h
2 --- gcc-4.8.3/boehm-gc/include/gc_amiga_redirects.h 2001-08-17 19:30:51.000000000 +0100
3 +++ gcc-4.8.3.aros/boehm-gc/include/gc_amiga_redirects.h 2015-02-26 16:39:08.879698333 +0000
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-4.8.3/boehm-gc/include/gc.h gcc-4.8.3.aros/boehm-gc/include/gc.h
14 --- gcc-4.8.3/boehm-gc/include/gc.h 2007-04-23 22:10:09.000000000 +0100
15 +++ gcc-4.8.3.aros/boehm-gc/include/gc.h 2015-02-26 16:39:08.879698333 +0000
16 @@ -1063,7 +1063,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-4.8.3/configure gcc-4.8.3.aros/configure
26 --- gcc-4.8.3/configure 2013-09-03 13:13:42.000000000 +0100
27 +++ gcc-4.8.3.aros/configure 2015-02-26 16:39:08.879698333 +0000
28 @@ -3730,6 +3730,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 @@ -3852,6 +3855,8 @@
39 rs6000-*-aix*)
40 host_makefile_frag="config/mh-ppc-aix"
42 + *-*-aros*)
43 + ;;
44 esac
47 diff -ruN gcc-4.8.3/configure.ac gcc-4.8.3.aros/configure.ac
48 --- gcc-4.8.3/configure.ac 2013-09-03 13:13:42.000000000 +0100
49 +++ gcc-4.8.3.aros/configure.ac 2015-02-26 16:39:08.879698333 +0000
50 @@ -1069,6 +1069,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 @@ -1172,6 +1175,8 @@
61 rs6000-*-aix*)
62 host_makefile_frag="config/mh-ppc-aix"
64 + *-*-aros*)
65 + ;;
66 esac
69 diff -ruN gcc-4.8.3/fixincludes/configure gcc-4.8.3.aros/fixincludes/configure
70 --- gcc-4.8.3/fixincludes/configure 2012-05-29 20:28:57.000000000 +0100
71 +++ gcc-4.8.3.aros/fixincludes/configure 2015-02-26 16:39:08.879698333 +0000
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-4.8.3/fixincludes/configure.ac gcc-4.8.3.aros/fixincludes/configure.ac
81 --- gcc-4.8.3/fixincludes/configure.ac 2012-05-29 20:28:57.000000000 +0100
82 +++ gcc-4.8.3.aros/fixincludes/configure.ac 2015-02-26 16:39:08.879698333 +0000
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-4.8.3/gcc/config/arm/aros.h gcc-4.8.3.aros/gcc/config/arm/aros.h
92 --- gcc-4.8.3/gcc/config/arm/aros.h 1970-01-01 01:00:00.000000000 +0100
93 +++ gcc-4.8.3.aros/gcc/config/arm/aros.h 2015-02-26 16:39:08.879698333 +0000
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-4.8.3/gcc/config/arm/t-aros gcc-4.8.3.aros/gcc/config/arm/t-aros
178 --- gcc-4.8.3/gcc/config/arm/t-aros 1970-01-01 01:00:00.000000000 +0100
179 +++ gcc-4.8.3.aros/gcc/config/arm/t-aros 2015-02-26 16:39:08.879698333 +0000
180 @@ -0,0 +1,21 @@
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
201 +MULTILIB_DIRNAMES = arm fpu
202 diff -ruN gcc-4.8.3/gcc/config/aros.h gcc-4.8.3.aros/gcc/config/aros.h
203 --- gcc-4.8.3/gcc/config/aros.h 1970-01-01 01:00:00.000000000 +0100
204 +++ gcc-4.8.3.aros/gcc/config/aros.h 2015-02-26 16:39:08.879698333 +0000
205 @@ -0,0 +1,113 @@
206 +/* Definitions for AROS
207 + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
208 + Contributed by Fabio Alemagna
209 + Based upon linux.h, contributed by Eric Youngdale.
211 +This file is part of GNU CC.
213 +GNU CC is free software; you can redistribute it and/or modify
214 +it under the terms of the GNU General Public License as published by
215 +the Free Software Foundation; either version 2, or (at your option)
216 +any later version.
218 +GNU CC is distributed in the hope that it will be useful,
219 +but WITHOUT ANY WARRANTY; without even the implied warranty of
220 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
221 +GNU General Public License for more details.
223 +You should have received a copy of the GNU General Public License
224 +along with GNU CC; see the file COPYING. If not, write to
225 +the Free Software Foundation, 59 Temple Place - Suite 330,
226 +Boston, MA 02111-1307, USA. */
228 +/* Don't assume anything about the header files. */
229 +#define NO_IMPLICIT_EXTERN_C
231 +#undef SIZE_TYPE
232 +#define SIZE_TYPE "long unsigned int"
234 +#undef WCHAR_TYPE
235 +#define WCHAR_TYPE "char"
237 +#undef WCHAR_TYPE_SIZE
238 +#define WCHAR_TYPE_SIZE 8
240 +#undef PTRDIFF_TYPE
241 +#define PTRDIFF_TYPE "long int"
243 +#undef TARGET_OS_CPP_BUILTINS
244 +#define TARGET_OS_CPP_BUILTINS() \
245 + do \
246 + { \
247 + builtin_define_std ("AROS"); \
248 + builtin_define ("AMIGA"); \
249 + builtin_define ("_AMIGA"); \
250 + builtin_define ("__ELF__"); \
251 + builtin_assert ("system=posix"); \
252 + } \
253 + while (0)
255 +#undef ASM_APP_ON
256 +#define ASM_APP_ON "#APP\n"
258 +#undef ASM_APP_OFF
259 +#define ASM_APP_OFF "#NO_APP\n"
261 +#undef MD_EXEC_PREFIX
262 +#undef MD_STARTFILE_PREFIX
264 +/* Provide a STARTFILE_SPEC appropriate for AROS. AROS has its own
265 + set of startup files which also take care of handling C++
266 + constructors/destructors. */
268 +#undef STARTFILE_SPEC
269 +#define STARTFILE_SPEC \
270 + "startup.o%s %{detach:detach.o%s} %{nix:nixmain.o%s}"
272 +/* Provide a ENDFILE_SPEC appropriate for AROS. */
274 +#undef ENDFILE_SPEC
275 +#define ENDFILE_SPEC \
276 + "-lautoinit"
278 +/* The compiler is configured with ONLY the gcc/g++ standard headers.
279 + N.B-: NATIVE_SYSTEM_HEADER_DIR must come before GCC_INCLUDE_DIR on AROS */
280 +#undef INCLUDE_DEFAULTS
281 +#define INCLUDE_DEFAULTS \
282 +{ \
283 + { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
284 + { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
285 + { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
286 + { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 }, \
287 + { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \
288 + { 0, 0, 0, 0, 0, 0 } \
291 +#undef CPP_SPEC
292 +#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}"
294 +/* This is for -profile to use -lc_p instead of -lc. */
295 +#ifndef CC1_SPEC
296 +#define CC1_SPEC "%{profile:-p}"
297 +#endif
299 +/* The GNU C++ standard library requires that these macros be defined. */
300 +#undef CPLUSPLUS_CPP_SPEC
301 +#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
303 +#undef LIB_SPEC
304 +#define LIB_SPEC \
305 + "--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"
307 +#undef LIBSTDCXX_STATIC
308 +#define LIBSTDCXX_STATIC "pthread"
310 +#if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR)
311 +#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
312 +#endif
314 +/* AROS uses its own collect-like program for the moment. */
315 +#undef LINKER_NAME
316 +#define LINKER_NAME "collect-aros"
318 +#define TARGET_HAS_F_SETLKW
319 diff -ruN gcc-4.8.3/gcc/config/aros.opt gcc-4.8.3.aros/gcc/config/aros.opt
320 --- gcc-4.8.3/gcc/config/aros.opt 1970-01-01 01:00:00.000000000 +0100
321 +++ gcc-4.8.3.aros/gcc/config/aros.opt 2015-02-26 16:39:08.879698333 +0000
322 @@ -0,0 +1,35 @@
323 +; Processor-independent options for AROS.
325 +; Copyright (C) 2015 Free Software Foundation, Inc.
327 +; This file is part of GCC.
329 +; GCC is free software; you can redistribute it and/or modify it under
330 +; the terms of the GNU General Public License as published by the Free
331 +; Software Foundation; either version 3, or (at your option) any later
332 +; version.
334 +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
335 +; WARRANTY; without even the implied warranty of MERCHANTABILITY or
336 +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
337 +; for more details.
339 +; You should have received a copy of the GNU General Public License
340 +; along with GCC; see the file COPYING3. If not see
341 +; <http://www.gnu.org/licenses/>.
343 +posix
344 +Driver
346 +noposixc
347 +Driver
349 +nostdc
350 +Driver
352 +nosysbase
353 +Driver
355 +nix
356 +Driver
358 diff -ruN gcc-4.8.3/gcc/config/i386/aros64.h gcc-4.8.3.aros/gcc/config/i386/aros64.h
359 --- gcc-4.8.3/gcc/config/i386/aros64.h 1970-01-01 01:00:00.000000000 +0100
360 +++ gcc-4.8.3.aros/gcc/config/i386/aros64.h 2015-02-26 16:39:08.879698333 +0000
361 @@ -0,0 +1,34 @@
362 +/* Definitions for AMD x86_64 running AROS systems with ELF64 format.
363 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002
364 + Free Software Foundation, Inc.
365 + Contributed by Stanislaw Szymczyk <sszymczy@gmail.com>. Based on aros.h.
367 +This file is part of GNU CC.
369 +GNU CC is free software; you can redistribute it and/or modify
370 +it under the terms of the GNU General Public License as published by
371 +the Free Software Foundation; either version 2, or (at your option)
372 +any later version.
374 +GNU CC is distributed in the hope that it will be useful,
375 +but WITHOUT ANY WARRANTY; without even the implied warranty of
376 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
377 +GNU General Public License for more details.
379 +You should have received a copy of the GNU General Public License
380 +along with GNU CC; see the file COPYING. If not, write to
381 +the Free Software Foundation, 59 Temple Place - Suite 330,
382 +Boston, MA 02111-1307, USA. */
384 +/* The svr4 ABI for the i386 says that records and unions are returned
385 + in memory. In the 64bit compilation we will turn this flag off in
386 + override_options, as we never do pcc_struct_return scheme on this target. */
387 +#undef DEFAULT_PCC_STRUCT_RETURN
388 +#define DEFAULT_PCC_STRUCT_RETURN 1
390 +/* Provide a LINK_SPEC appropriate for AROS. */
392 +#undef LINK_SPEC
393 +#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} -L %R/lib"
395 +/* FIXME: AROS doesn't support dw2 unwinding yet. */
396 diff -ruN gcc-4.8.3/gcc/config/i386/aros.h gcc-4.8.3.aros/gcc/config/i386/aros.h
397 --- gcc-4.8.3/gcc/config/i386/aros.h 1970-01-01 01:00:00.000000000 +0100
398 +++ gcc-4.8.3.aros/gcc/config/i386/aros.h 2015-02-26 16:39:08.879698333 +0000
399 @@ -0,0 +1,25 @@
400 +/* Definitions for Intel 386 running AROS systems with ELF format.
401 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002
402 + Free Software Foundation, Inc.
403 + Contributed by Fabio Alemagna.
404 + Based upon i386/linux.h by Eric Youngdale.
406 +This file is part of GNU CC.
408 +GNU CC is free software; you can redistribute it and/or modify
409 +it under the terms of the GNU General Public License as published by
410 +the Free Software Foundation; either version 2, or (at your option)
411 +any later version.
413 +GNU CC is distributed in the hope that it will be useful,
414 +but WITHOUT ANY WARRANTY; without even the implied warranty of
415 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
416 +GNU General Public License for more details.
418 +You should have received a copy of the GNU General Public License
419 +along with GNU CC; see the file COPYING. If not, write to
420 +the Free Software Foundation, 59 Temple Place - Suite 330,
421 +Boston, MA 02111-1307, USA. */
423 +#undef LINK_SPEC
424 +#define LINK_SPEC "-m elf_i386 -L%R/lib"
425 diff -ruN gcc-4.8.3/gcc/config/m68k/m68k.c gcc-4.8.3.aros/gcc/config/m68k/m68k.c
426 --- gcc-4.8.3/gcc/config/m68k/m68k.c 2014-01-03 14:06:22.000000000 +0000
427 +++ gcc-4.8.3.aros/gcc/config/m68k/m68k.c 2015-02-26 16:39:08.879698333 +0000
428 @@ -4437,7 +4437,7 @@
429 else if (letter == '/')
430 asm_fprintf (file, "%R");
431 else if (letter == '?')
432 - asm_fprintf (file, m68k_library_id_string);
433 + asm_fprintf (file, "%s", m68k_library_id_string);
434 else if (letter == 'p')
436 output_addr_const (file, op);
437 diff -ruN gcc-4.8.3/gcc/config/m68k/m68k.h gcc-4.8.3.aros/gcc/config/m68k/m68k.h
438 --- gcc-4.8.3/gcc/config/m68k/m68k.h 2013-01-10 20:38:27.000000000 +0000
439 +++ gcc-4.8.3.aros/gcc/config/m68k/m68k.h 2015-02-26 16:39:08.879698333 +0000
440 @@ -337,7 +337,9 @@
441 register elimination. */
442 #define FIRST_PSEUDO_REGISTER 25
444 -/* All m68k targets (except AmigaOS) use %a5 as the PIC register */
445 +/* All m68k targets (except AmigaOS) use %a5 as the PIC register.
446 + * On AmigaOS, we use %a4
447 + */
448 #define PIC_OFFSET_TABLE_REGNUM \
449 (!flag_pic ? INVALID_REGNUM \
450 : reload_completed ? REGNO (pic_offset_table_rtx) \
451 @@ -427,7 +429,8 @@
452 /* Most m68k targets use %a6 as a frame pointer. The AmigaOS
453 ABI uses %a6 for shared library calls, therefore the frame
454 pointer is shifted to %a5 on this target. */
455 -#define FRAME_POINTER_REGNUM A6_REG
456 +#define FRAME_POINTER_REGNUM A5_REG
457 +#define PIC_REG A4_REG
459 /* Base register for access to arguments of the function.
460 * This isn't a hardware register. It will be eliminated to the
461 diff -ruN gcc-4.8.3/gcc/config/m68k/m68k.md gcc-4.8.3.aros/gcc/config/m68k/m68k.md
462 --- gcc-4.8.3/gcc/config/m68k/m68k.md 2013-01-10 20:38:27.000000000 +0000
463 +++ gcc-4.8.3.aros/gcc/config/m68k/m68k.md 2015-02-26 16:39:08.879698333 +0000
464 @@ -133,7 +133,8 @@
465 [(D0_REG 0)
466 (A0_REG 8)
467 (A1_REG 9)
468 - (PIC_REG 13)
469 + (A4_REG 12)
470 + (A5_REG 13)
471 (A6_REG 14)
472 (SP_REG 15)
473 (FP0_REG 16)
474 @@ -7078,7 +7079,7 @@
476 if (TARGET_ID_SHARED_LIBRARY)
478 - operands[1] = gen_rtx_REG (Pmode, PIC_REG);
479 + operands[1] = gen_rtx_REG (Pmode, A4_REG);
480 return MOTOROLA ? "move.l %?(%1),%0" : "movel %1@(%?), %0";
482 else if (MOTOROLA)
483 diff -ruN gcc-4.8.3/gcc/config/m68k/t-aros gcc-4.8.3.aros/gcc/config/m68k/t-aros
484 --- gcc-4.8.3/gcc/config/m68k/t-aros 1970-01-01 01:00:00.000000000 +0100
485 +++ gcc-4.8.3.aros/gcc/config/m68k/t-aros 2015-02-26 16:39:08.879698333 +0000
486 @@ -0,0 +1,2 @@
487 +# Custom multilibs for AROS
488 +M68K_MLIB_CPU += && match(MLIB, "^68")
489 diff -ruN gcc-4.8.3/gcc/config/rs6000/aros.h gcc-4.8.3.aros/gcc/config/rs6000/aros.h
490 --- gcc-4.8.3/gcc/config/rs6000/aros.h 1970-01-01 01:00:00.000000000 +0100
491 +++ gcc-4.8.3.aros/gcc/config/rs6000/aros.h 2015-02-26 16:39:08.879698333 +0000
492 @@ -0,0 +1,151 @@
493 +/* Definitions for Powerpc running AROS systems with ELF format.
494 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002
495 + Free Software Foundation, Inc.
496 + Contributed by Markus Weiss.
497 + Based upon i386/aros.h by Fabio Alemagna.
499 +This file is part of GNU CC.
501 +GNU CC is free software; you can redistribute it and/or modify
502 +it under the terms of the GNU General Public License as published by
503 +the Free Software Foundation; either version 2, or (at your option)
504 +any later version.
506 +GNU CC is distributed in the hope that it will be useful,
507 +but WITHOUT ANY WARRANTY; without even the implied warranty of
508 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
509 +GNU General Public License for more details.
511 +You should have received a copy of the GNU General Public License
512 +along with GNU CC; see the file COPYING. If not, write to
513 +the Free Software Foundation, 59 Temple Place - Suite 330,
514 +Boston, MA 02111-1307, USA. */
516 +/* Symbols missing in comparison to i386/aros.h are either
517 + defined in elfos.h, rs6000/rs6000.h rs6000/sysv4.h
518 + or not needed for PowerPC.
521 +/* We need to define __powerpc__. */
523 +#undef TARGET_OS_CPP_BUILTINS
524 +#define TARGET_OS_CPP_BUILTINS() \
525 + do \
526 + { \
527 + builtin_define_std ("AROS"); \
528 + builtin_define ("AMIGA"); \
529 + builtin_define ("_AMIGA"); \
530 + builtin_define ("__powerpc__"); \
531 + builtin_define ("__ELF__"); \
532 + builtin_assert ("system=posix"); \
533 + if (flag_pic) \
534 + { \
535 + builtin_define ("__PIC__"); \
536 + builtin_define ("__pic__"); \
537 + } \
538 + } \
539 + while (0)
541 +/* This one taken from linux.h. */
542 +/* We are 32-bit all the time, so optimize a little. */
543 +#undef TARGET_64BIT
544 +#define TARGET_64BIT 0
546 +/* The svr4 ABI for the i386 says that records and unions are returned
547 + in memory. */
548 +/*#undef DEFAULT_PCC_STRUCT_RETURN
549 +#define DEFAULT_PCC_STRUCT_RETURN 1
550 +see rs6000/rs6000.h
554 +#undef ASM_COMMENT_START
555 +#define ASM_COMMENT_START "#"
556 +see rs6000/rs6000.h
560 +#undef DBX_REGISTER_NUMBER
561 +#define DBX_REGISTER_NUMBER(n) \
562 + (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
563 +see rs6000/sysv4.h
566 +/* Output assembler code to FILE to call the profiler.
567 + To the best of my knowledge, no Linux libc has required the label
568 + argument to mcount. */
571 +#define NO_PROFILE_COUNTERS 1
572 +not used by other similar ppc compilers
573 +only in darwin.h rs6000/linux64.h rs6000/rs6000.c
577 +#undef MCOUNT_NAME
578 +#define MCOUNT_NAME "mcount"
579 +see rs6000/sysv4.h RS6000_MCOUNT
582 +/* The GLIBC version of mcount for the x86 assumes that there is a
583 + frame, so we cannot allow profiling without a frame pointer. */
585 +#undef SUBTARGET_FRAME_POINTER_REQUIRED
586 +#define SUBTARGET_FRAME_POINTER_REQUIRED crtl->profile
587 +seems to be handled by rs6000/rs6000.h
590 +#undef CC1_SPEC
591 +#define CC1_SPEC "%(cc1_cpu) %{profile:-p}"
593 +/* Provide a LINK_SPEC appropriate for AROS. */
595 +#undef LINK_SPEC
596 +#define LINK_SPEC "-m elf32ppc -L %R/lib"
598 +/* A C statement (sans semicolon) to output to the stdio stream
599 + FILE the assembler definition of uninitialized global DECL named
600 + NAME whose size is SIZE bytes and alignment is ALIGN bytes.
601 + Try to use asm_output_aligned_bss to implement this macro. */
603 +#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
604 + asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
605 +see rs6000/sysv4.h
608 +/* A C statement to output to the stdio stream FILE an assembler
609 + command to advance the location counter to a multiple of 1<<LOG
610 + bytes if it is within MAX_SKIP bytes.
612 + This is used to align code labels according to Intel recommendations. */
614 +#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
615 +#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
616 + do { \
617 + if ((LOG) != 0) { \
618 + if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
619 + else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
620 + } \
621 + } while (0)
622 +#endif
623 +see rs6000/sysv4.h
626 +/* Handle special EH pointer encodings. Absolute, pc-relative, and
627 + indirect are handled automatically. */
629 +#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
630 + do { \
631 + if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel) \
632 + { \
633 + fputs (ASM_LONG, FILE); \
634 + assemble_name (FILE, XSTR (ADDR, 0)); \
635 + fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
636 + goto DONE; \
637 + } \
638 + } while (0)
639 +not used for PowerPC
642 +/* FIXME: AROS doesn't support dw2 unwinding yet. */
643 +#undef MD_FALLBACK_FRAME_STATE_FOR
644 diff -ruN gcc-4.8.3/gcc/config/rs6000/rs6000.c gcc-4.8.3.aros/gcc/config/rs6000/rs6000.c
645 --- gcc-4.8.3/gcc/config/rs6000/rs6000.c 2014-05-05 03:18:35.000000000 +0100
646 +++ gcc-4.8.3.aros/gcc/config/rs6000/rs6000.c 2015-02-26 16:39:08.879698333 +0000
647 @@ -1246,6 +1246,8 @@
648 false },
649 { "shortcall", 0, 0, false, true, true, rs6000_handle_longcall_attribute,
650 false },
651 + { "stackparm", 0, 0, false, true, true, rs6000_handle_longcall_attribute,
652 + false },
653 { "ms_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute,
654 false },
655 { "gcc_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute,
656 @@ -9026,6 +9028,9 @@
657 && !lookup_attribute ("shortcall", TYPE_ATTRIBUTES (fntype))))
658 cum->call_cookie |= CALL_LONG;
660 + cum->stackparm = fntype && lookup_attribute("stackparm",
661 + TYPE_ATTRIBUTES(fntype));
663 if (TARGET_DEBUG_ARG)
665 fprintf (stderr, "\ninit_cumulative_args:");
666 @@ -10104,6 +10109,9 @@
668 rs6000_discover_homogeneous_aggregate (mode, type, &elt_mode, &n_elts);
670 + if (cum->stackparm)
671 + return NULL_RTX;
673 if (TARGET_MACHO && rs6000_darwin64_struct_check_p (mode, type))
675 rtx rslt = rs6000_darwin64_record_arg (cum, type, named, /*retval= */false);
676 @@ -10619,6 +10627,9 @@
677 int first_reg_offset;
678 alias_set_type set;
680 + if (cum->stackparm)
681 + return;
683 /* Skip the last named argument. */
684 next_cum = *get_cumulative_args (cum);
685 rs6000_function_arg_advance_1 (&next_cum, mode, type, true, 0);
686 diff -ruN gcc-4.8.3/gcc/config/rs6000/rs6000.h gcc-4.8.3.aros/gcc/config/rs6000/rs6000.h
687 --- gcc-4.8.3/gcc/config/rs6000/rs6000.h 2014-05-05 03:18:35.000000000 +0100
688 +++ gcc-4.8.3.aros/gcc/config/rs6000/rs6000.h 2015-02-26 16:39:08.879698333 +0000
689 @@ -1717,6 +1717,7 @@
690 int nargs_prototype; /* # args left in the current prototype */
691 int prototype; /* Whether a prototype was defined */
692 int stdarg; /* Whether function is a stdarg function. */
693 + int stackparm; /* Whether function has all args on the stack */
694 int call_cookie; /* Do special things for this call */
695 int sysv_gregno; /* next available GP register */
696 int intoffset; /* running offset in struct (darwin64) */
697 diff -ruN gcc-4.8.3/gcc/config/t-aros gcc-4.8.3.aros/gcc/config/t-aros
698 --- gcc-4.8.3/gcc/config/t-aros 1970-01-01 01:00:00.000000000 +0100
699 +++ gcc-4.8.3.aros/gcc/config/t-aros 2015-02-26 16:39:08.879698333 +0000
700 @@ -0,0 +1,29 @@
701 +# In AROS, "/usr" is a four-letter word.
702 +# Must match NATIVE_SYSTEM_HEADER_COMPONENT in aros.h !
703 +NATIVE_SYSTEM_HEADER_DIR = /include
705 +# Don't add AROS target include path when compiling host compiler
706 +CPPFLAGS =
708 +# Copy AROS specific include replacement files
709 +LIBGCC_DEPS += stmp-aros-hrds
711 +EXTRA_AROS_HEADERS = aros/types/size_t.h aros/types/ptrdiff_t.h \
712 + aros/types/wchar_t.h aros/types/wint_t.h aros/types/null.h
714 +stmp-int-hdrs : | include/aros/types
716 +include/aros/types : $(addprefix $(srcdir)/ginclude/,$(EXTRA_AROS_HEADERS))
717 + -if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi
718 + -if [ -d include/aros/types ] ; \
719 + then true; \
720 + else \
721 + mkdir include/aros; chmod a+rx include/aros; \
722 + mkdir include/aros/types; chmod a+rx include/aros/types; \
723 + fi
724 + for file in $(EXTRA_AROS_HEADERS); do \
725 + $(STAMP) include/$$file; \
726 + rm -fr include/$$file; \
727 + cp $(srcdir)/ginclude/$$file include/$$file; \
728 + chmod a+r include/$$file; \
729 + done
730 diff -ruN gcc-4.8.3/gcc/config.build gcc-4.8.3.aros/gcc/config.build
731 --- gcc-4.8.3/gcc/config.build 2013-01-10 20:38:27.000000000 +0000
732 +++ gcc-4.8.3.aros/gcc/config.build 2015-02-26 16:39:08.879698333 +0000
733 @@ -102,6 +102,9 @@
734 # HP 9000 series 300
735 build_install_headers_dir=install-headers-cpio
737 + *-*-aros*)
738 + build_xm_file=xm-aros.h
739 + ;;
740 *-*-sysv*)
741 # All other System V variants.
742 build_install_headers_dir=install-headers-cpio
743 diff -ruN gcc-4.8.3/gcc/config.gcc gcc-4.8.3.aros/gcc/config.gcc
744 --- gcc-4.8.3/gcc/config.gcc 2014-05-06 16:29:04.000000000 +0100
745 +++ gcc-4.8.3.aros/gcc/config.gcc 2015-02-26 16:39:08.879698333 +0000
746 @@ -713,6 +713,15 @@
748 esac
750 +*-*-aros*)
751 + gas=yes
752 + gnu_ld=yes
753 + thread_file=posix
754 + use_collect2=no
755 + xm_defines='STDC_HEADERS=1'
756 + extra_options="${extra_options} aros.opt"
757 + ;;
759 *-*-openbsd*)
760 tmake_file="t-openbsd"
761 case ${enable_threads} in
762 @@ -860,6 +869,16 @@
763 tm_file="${tm_file} vms/vms.h alpha/vms.h"
764 tmake_file="${tmake_file} alpha/t-vms"
766 +arm*-*-aros*)
767 + tm_file="dbxelf.h elfos.h arm/elf.h arm/bpabi.h aros.h arm/aros.h arm/aout.h arm/arm.h"
768 + tm_file="$tm_file ../../libgcc/config/arm/bpabi-lib.h"
769 + tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-arm-softfp arm/t-bpabi arm/t-aros t-aros"
770 + xm_file="xm-aros.h"
771 + # The BPABI long long divmod functions return a 128-bit value in
772 + # registers r0-r3. Correctly modeling that requires the use of
773 + # TImode.
774 + need_64bit_hwint=yes
775 + ;;
776 arm-wrs-vxworks)
777 tm_file="elfos.h arm/elf.h arm/aout.h ${tm_file} vx-common.h vxworks.h arm/vxworks.h"
778 extra_options="${extra_options} arm/vxworks.opt"
779 @@ -1361,6 +1380,16 @@
780 done
781 TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
783 +i[34567]86-*-aros*)
784 + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h aros.h i386/aros.h"
785 + xm_file=xm-aros.h
786 + tmake_file="${tmake_file} i386/t-i386elf t-aros"
787 + ;;
788 +x86_64-*-aros*)
789 + 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"
790 + tmake_file="${tmake_file} i386/t-i386elf t-aros"
791 + xm_file=xm-aros.h
792 + ;;
793 i[34567]86-pc-msdosdjgpp*)
794 xm_file=i386/xm-djgpp.h
795 tm_file="dbxcoff.h ${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h i386/djgpp-stdint.h"
796 @@ -1651,6 +1680,16 @@
797 thread_file='posix'
800 +m68k-*-aros*)
801 + default_m68k_cpu=68000
802 + default_cf_cpu=5206
803 + 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"
804 + tm_file="${tm_file} aros.h"
805 + tm_defines="${tm_defines} MOTOROLA=1"
806 + tmake_file="m68k/t-floatlib m68k/t-m68kbare m68k/t-m68kelf"
807 + tmake_file="$tmake_file m68k/t-aros m68k/t-mlibs t-aros"
808 + extra_parts="crtbegin.o crtend.o"
809 + ;;
810 m68k-*-elf* | fido-*-elf*)
811 case ${target} in
812 fido-*-elf*)
813 @@ -2075,6 +2114,13 @@
814 extra_options="${extra_options} rs6000/sysv4.opt"
815 tmake_file="rs6000/t-fprules rs6000/t-rtems t-rtems rs6000/t-ppccomm"
817 +powerpc-*-aros*)
818 + tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h aros.h"
819 + extra_options="${extra_options} rs6000/sysv4.opt"
820 + tm_file="${tm_file} rs6000/aros.h"
821 + xm_file=xm-aros.h
822 + tmake_file="$tmake_file t-aros"
823 + ;;
824 powerpc*-*-linux*)
825 tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h"
826 extra_options="${extra_options} rs6000/sysv4.opt"
827 diff -ruN gcc-4.8.3/gcc/config.host gcc-4.8.3.aros/gcc/config.host
828 --- gcc-4.8.3/gcc/config.host 2013-01-10 20:38:27.000000000 +0000
829 +++ gcc-4.8.3.aros/gcc/config.host 2015-02-26 16:39:08.879698333 +0000
830 @@ -276,6 +276,10 @@
831 out_host_hook_obj=host-hpux.o
832 host_xmake_file="${host_xmake_file} x-hpux"
834 + *-*-aros*)
835 + host_can_use_collect2=no
836 + host_xm_file=xm-aros.h
837 + ;;
838 *-*-*vms*)
839 host_xm_file="vms/xm-vms.h"
840 host_xmake_file=vms/x-vms
841 diff -ruN gcc-4.8.3/gcc/ginclude/aros/types/null.h gcc-4.8.3.aros/gcc/ginclude/aros/types/null.h
842 --- gcc-4.8.3/gcc/ginclude/aros/types/null.h 1970-01-01 01:00:00.000000000 +0100
843 +++ gcc-4.8.3.aros/gcc/ginclude/aros/types/null.h 2015-02-26 16:39:08.879698333 +0000
844 @@ -0,0 +1,3 @@
845 +/* Replace AROS' NULL definition with gcc's one */
846 +#define __need_NULL
847 +#include <stddef.h>
848 diff -ruN gcc-4.8.3/gcc/ginclude/aros/types/ptrdiff_t.h gcc-4.8.3.aros/gcc/ginclude/aros/types/ptrdiff_t.h
849 --- gcc-4.8.3/gcc/ginclude/aros/types/ptrdiff_t.h 1970-01-01 01:00:00.000000000 +0100
850 +++ gcc-4.8.3.aros/gcc/ginclude/aros/types/ptrdiff_t.h 2015-02-26 16:39:08.879698333 +0000
851 @@ -0,0 +1,3 @@
852 +/* Replace AROS' ptrdiff_t definition with gcc's one */
853 +#define __need_ptrdiff_t
854 +#include <stddef.h>
855 diff -ruN gcc-4.8.3/gcc/ginclude/aros/types/size_t.h gcc-4.8.3.aros/gcc/ginclude/aros/types/size_t.h
856 --- gcc-4.8.3/gcc/ginclude/aros/types/size_t.h 1970-01-01 01:00:00.000000000 +0100
857 +++ gcc-4.8.3.aros/gcc/ginclude/aros/types/size_t.h 2015-02-26 16:39:08.879698333 +0000
858 @@ -0,0 +1,3 @@
859 +/* Replace AROS' size_t definition with gcc's one */
860 +#define __need_size_t
861 +#include <stddef.h>
862 diff -ruN gcc-4.8.3/gcc/ginclude/aros/types/wchar_t.h gcc-4.8.3.aros/gcc/ginclude/aros/types/wchar_t.h
863 --- gcc-4.8.3/gcc/ginclude/aros/types/wchar_t.h 1970-01-01 01:00:00.000000000 +0100
864 +++ gcc-4.8.3.aros/gcc/ginclude/aros/types/wchar_t.h 2015-02-26 16:39:08.879698333 +0000
865 @@ -0,0 +1,3 @@
866 +/* Replace AROS' wchar_t definition with gcc's one */
867 +#define __need_wchar_t
868 +#include <stddef.h>
869 diff -ruN gcc-4.8.3/gcc/ginclude/aros/types/wint_t.h gcc-4.8.3.aros/gcc/ginclude/aros/types/wint_t.h
870 --- gcc-4.8.3/gcc/ginclude/aros/types/wint_t.h 1970-01-01 01:00:00.000000000 +0100
871 +++ gcc-4.8.3.aros/gcc/ginclude/aros/types/wint_t.h 2015-02-26 16:39:08.879698333 +0000
872 @@ -0,0 +1,3 @@
873 +/* Replace AROS' wint_t definition with gcc's one */
874 +#define __need_wint_t
875 +#include <stddef.h>
876 diff -ruN gcc-4.8.3/gcc/ginclude/stddef.h gcc-4.8.3.aros/gcc/ginclude/stddef.h
877 --- gcc-4.8.3/gcc/ginclude/stddef.h 2013-01-10 20:38:27.000000000 +0000
878 +++ gcc-4.8.3.aros/gcc/ginclude/stddef.h 2015-02-26 16:39:08.879698333 +0000
879 @@ -131,6 +131,7 @@
880 #ifndef __PTRDIFF_T
881 #ifndef _PTRDIFF_T_
882 #ifndef _BSD_PTRDIFF_T_
883 +#ifndef _AROS_TYPES_PTRDIFF_T_H
884 #ifndef ___int_ptrdiff_t_h
885 #ifndef _GCC_PTRDIFF_T
886 #define _PTRDIFF_T
887 @@ -139,6 +140,7 @@
888 #define __PTRDIFF_T
889 #define _PTRDIFF_T_
890 #define _BSD_PTRDIFF_T_
891 +#define _AROS_TYPES_PTRDIFF_T_H
892 #define ___int_ptrdiff_t_h
893 #define _GCC_PTRDIFF_T
894 #ifndef __PTRDIFF_TYPE__
895 @@ -147,6 +149,7 @@
896 typedef __PTRDIFF_TYPE__ ptrdiff_t;
897 #endif /* _GCC_PTRDIFF_T */
898 #endif /* ___int_ptrdiff_t_h */
899 +#endif /* _AROS_TYPES_PTRDIFF_T_H */
900 #endif /* _BSD_PTRDIFF_T_ */
901 #endif /* _PTRDIFF_T_ */
902 #endif /* __PTRDIFF_T */
903 @@ -173,6 +176,7 @@
904 #ifndef __SIZE_T
905 #ifndef _SIZE_T_
906 #ifndef _BSD_SIZE_T_
907 +#ifndef _AROS_TYPES_SIZE_T_H
908 #ifndef _SIZE_T_DEFINED_
909 #ifndef _SIZE_T_DEFINED
910 #ifndef _BSD_SIZE_T_DEFINED_ /* Darwin */
911 @@ -190,6 +194,7 @@
912 #define __SIZE_T
913 #define _SIZE_T_
914 #define _BSD_SIZE_T_
915 +#define _AROS_TYPES_SIZE_T_H
916 #define _SIZE_T_DEFINED_
917 #define _SIZE_T_DEFINED
918 #define _BSD_SIZE_T_DEFINED_ /* Darwin */
919 @@ -222,6 +227,7 @@
920 #endif /* _BSD_SIZE_T_DEFINED_ */
921 #endif /* _SIZE_T_DEFINED */
922 #endif /* _SIZE_T_DEFINED_ */
923 +#endif /* _AROS_TYPES_SIZE_T_H */
924 #endif /* _BSD_SIZE_T_ */
925 #endif /* _SIZE_T_ */
926 #endif /* __SIZE_T */
927 diff -ruN gcc-4.8.3/include/filenames.h gcc-4.8.3.aros/include/filenames.h
928 --- gcc-4.8.3/include/filenames.h 2012-07-13 23:12:28.000000000 +0100
929 +++ gcc-4.8.3.aros/include/filenames.h 2015-02-26 16:39:08.879698333 +0000
930 @@ -42,6 +42,10 @@
931 # define HAS_DRIVE_SPEC(f) HAS_DOS_DRIVE_SPEC (f)
932 # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c)
933 # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f)
934 +#elif defined __AROS__
935 +# define IS_DIR_SEPARATOR(c) ((c) == '/' || (c) == ':')
936 +# define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0]) || (strchr((f), ':')))
937 +# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM
938 #else /* not DOSish */
939 # if defined(__APPLE__)
940 # ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
941 diff -ruN gcc-4.8.3/libcpp/configure gcc-4.8.3.aros/libcpp/configure
942 --- gcc-4.8.3/libcpp/configure 2014-05-22 10:13:48.000000000 +0100
943 +++ gcc-4.8.3.aros/libcpp/configure 2015-02-26 16:39:08.879698333 +0000
944 @@ -7155,6 +7155,7 @@
945 arm*-*-*eabi* | \
946 arm*-*-rtems* | \
947 arm*-*-symbianelf* | \
948 + arm*-*-aros | \
949 x86_64-*-* | \
950 ia64-*-* | \
951 hppa*64*-*-* | \
952 diff -ruN gcc-4.8.3/libcpp/configure.ac gcc-4.8.3.aros/libcpp/configure.ac
953 --- gcc-4.8.3/libcpp/configure.ac 2013-04-03 16:13:33.000000000 +0100
954 +++ gcc-4.8.3.aros/libcpp/configure.ac 2015-02-26 16:39:08.879698333 +0000
955 @@ -187,6 +187,7 @@
956 arm*-*-*eabi* | \
957 arm*-*-rtems* | \
958 arm*-*-symbianelf* | \
959 + arm*-*-aros | \
960 x86_64-*-* | \
961 ia64-*-* | \
962 hppa*64*-*-* | \
963 diff -ruN gcc-4.8.3/libgcc/config.host gcc-4.8.3.aros/libgcc/config.host
964 --- gcc-4.8.3/libgcc/config.host 2014-03-20 16:12:30.000000000 +0000
965 +++ gcc-4.8.3.aros/libgcc/config.host 2015-02-26 16:39:08.879698333 +0000
966 @@ -681,7 +681,7 @@
967 m32rle-*-linux*)
968 tmake_file="$tmake_file m32r/t-linux t-fdpbit"
970 -m68k-*-elf* | fido-*-elf)
971 +m68k-*-elf* | fido-*-elf | m68k-*-aros*)
972 tmake_file="$tmake_file m68k/t-floatlib"
974 m68k*-*-netbsdelf*)
975 @@ -1117,6 +1117,9 @@
976 tmake_file="mep/t-mep t-fdpbit"
977 extra_parts="crtbegin.o crtend.o"
979 +*-*-aros*)
980 + tmake_file=
981 + ;;
983 echo "*** Configuration ${host} not supported" 1>&2
984 exit 1
985 diff -ruN gcc-4.8.3/libgcc/gthr.h gcc-4.8.3.aros/libgcc/gthr.h
986 --- gcc-4.8.3/libgcc/gthr.h 2013-02-04 19:06:20.000000000 +0000
987 +++ gcc-4.8.3.aros/libgcc/gthr.h 2015-02-26 16:39:08.879698333 +0000
988 @@ -141,6 +141,11 @@
989 #define GTHREAD_USE_WEAK 0
990 #endif
992 +#ifdef __AROS__
993 +#undef GTHREAD_USE_WEAK
994 +#define GTHREAD_USE_WEAK 0
995 +#endif
997 #ifndef GTHREAD_USE_WEAK
998 #define GTHREAD_USE_WEAK 1
999 #endif
1000 diff -ruN gcc-4.8.3/libgcc/unwind-dw2.c gcc-4.8.3.aros/libgcc/unwind-dw2.c
1001 --- gcc-4.8.3/libgcc/unwind-dw2.c 2013-06-01 00:21:46.000000000 +0100
1002 +++ gcc-4.8.3.aros/libgcc/unwind-dw2.c 2015-02-26 18:05:58.367852362 +0000
1003 @@ -1546,7 +1546,9 @@
1004 static inline void
1005 init_dwarf_reg_size_table (void)
1007 +#ifdef MD_FALLBACK_FRAME_STATE_FOR
1008 __builtin_init_dwarf_reg_size_table (dwarf_reg_size_table);
1009 +#endif
1012 static void __attribute__((noinline))
1013 diff -ruN gcc-4.8.3/libgcc/unwind-dw2-fde.c gcc-4.8.3.aros/libgcc/unwind-dw2-fde.c
1014 --- gcc-4.8.3/libgcc/unwind-dw2-fde.c 2013-02-04 19:06:20.000000000 +0000
1015 +++ gcc-4.8.3.aros/libgcc/unwind-dw2-fde.c 2015-02-26 16:39:08.879698333 +0000
1016 @@ -92,12 +92,16 @@
1017 #endif
1019 init_object_mutex_once ();
1020 +#ifndef __AROS__ /* This is called when SysBase is not yet set up */
1021 __gthread_mutex_lock (&object_mutex);
1022 +#endif
1024 ob->next = unseen_objects;
1025 unseen_objects = ob;
1027 +#ifndef __AROS__
1028 __gthread_mutex_unlock (&object_mutex);
1029 +#endif
1032 void
1033 diff -ruN gcc-4.8.3/libiberty/filename_cmp.c gcc-4.8.3.aros/libiberty/filename_cmp.c
1034 --- gcc-4.8.3/libiberty/filename_cmp.c 2012-07-13 23:12:28.000000000 +0100
1035 +++ gcc-4.8.3.aros/libiberty/filename_cmp.c 2015-02-26 16:39:08.879698333 +0000
1036 @@ -50,9 +50,12 @@
1038 filename_cmp (const char *s1, const char *s2)
1040 -#if !defined(HAVE_DOS_BASED_FILE_SYSTEM) \
1041 - && !defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
1042 +#if !defined(HAVE_DOS_BASED_FILE_SYSTEM)
1043 +#if defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
1044 + return strcasecmp(s1, s2);
1045 +#else
1046 return strcmp(s1, s2);
1047 +#endif
1048 #else
1049 for (;;)
1051 diff -ruN gcc-4.8.3/libobjc/configure gcc-4.8.3.aros/libobjc/configure
1052 --- gcc-4.8.3/libobjc/configure 2014-04-04 14:53:39.000000000 +0100
1053 +++ gcc-4.8.3.aros/libobjc/configure 2015-02-26 16:39:08.879698333 +0000
1054 @@ -11256,214 +11256,7 @@
1055 # -----------
1057 # Check if we have thread-local storage
1060 - # Check whether --enable-tls was given.
1061 -if test "${enable_tls+set}" = set; then :
1062 - enableval=$enable_tls;
1063 - case "$enableval" in
1064 - yes|no) ;;
1065 - *) as_fn_error "Argument to enable/disable tls must be yes or no" "$LINENO" 5 ;;
1066 - esac
1068 -else
1069 - enable_tls=yes
1073 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports thread-local storage" >&5
1074 -$as_echo_n "checking whether the target supports thread-local storage... " >&6; }
1075 -if test "${gcc_cv_have_tls+set}" = set; then :
1076 - $as_echo_n "(cached) " >&6
1077 -else
1079 - if test "$cross_compiling" = yes; then :
1080 - if test x$gcc_no_link = xyes; then
1081 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1083 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1084 -/* end confdefs.h. */
1085 -__thread int a; int b; int main() { return a = b; }
1086 -_ACEOF
1087 -if ac_fn_c_try_link "$LINENO"; then :
1088 - chktls_save_LDFLAGS="$LDFLAGS"
1089 - case $host in
1090 - *-*-linux*)
1091 - LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
1092 - ;;
1093 - esac
1094 - chktls_save_CFLAGS="$CFLAGS"
1095 - CFLAGS="-fPIC $CFLAGS"
1096 - if test x$gcc_no_link = xyes; then
1097 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1099 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1100 -/* end confdefs.h. */
1101 -int f() { return 0; }
1102 -_ACEOF
1103 -if ac_fn_c_try_link "$LINENO"; then :
1104 - if test x$gcc_no_link = xyes; then
1105 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1107 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1108 -/* end confdefs.h. */
1109 -__thread int a; int b; int f() { return a = b; }
1110 -_ACEOF
1111 -if ac_fn_c_try_link "$LINENO"; then :
1112 - gcc_cv_have_tls=yes
1113 -else
1114 - gcc_cv_have_tls=no
1116 -rm -f core conftest.err conftest.$ac_objext \
1117 - conftest$ac_exeext conftest.$ac_ext
1118 -else
1119 - gcc_cv_have_tls=yes
1121 -rm -f core conftest.err conftest.$ac_objext \
1122 - conftest$ac_exeext conftest.$ac_ext
1123 - CFLAGS="$chktls_save_CFLAGS"
1124 - LDFLAGS="$chktls_save_LDFLAGS"
1125 -else
1126 - gcc_cv_have_tls=no
1128 -rm -f core conftest.err conftest.$ac_objext \
1129 - conftest$ac_exeext conftest.$ac_ext
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 - chktls_save_LDFLAGS="$LDFLAGS"
1139 - LDFLAGS="-static $LDFLAGS"
1140 - if test x$gcc_no_link = xyes; then
1141 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1143 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1144 -/* end confdefs.h. */
1145 -int main() { return 0; }
1146 -_ACEOF
1147 -if ac_fn_c_try_link "$LINENO"; then :
1148 - if test "$cross_compiling" = yes; then :
1149 - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
1150 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1151 -as_fn_error "cannot run test program while cross compiling
1152 -See \`config.log' for more details." "$LINENO" 5; }
1153 -else
1154 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1155 -/* end confdefs.h. */
1156 -__thread int a; int b; int main() { return a = b; }
1157 -_ACEOF
1158 -if ac_fn_c_try_run "$LINENO"; then :
1159 - gcc_cv_have_tls=yes
1160 -else
1161 - gcc_cv_have_tls=no
1163 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1164 - conftest.$ac_objext conftest.beam conftest.$ac_ext
1167 -else
1168 - gcc_cv_have_tls=yes
1170 -rm -f core conftest.err conftest.$ac_objext \
1171 - conftest$ac_exeext conftest.$ac_ext
1172 - LDFLAGS="$chktls_save_LDFLAGS"
1173 - if test $gcc_cv_have_tls = yes; then
1174 - chktls_save_CFLAGS="$CFLAGS"
1175 - thread_CFLAGS=failed
1176 - for flag in '' '-pthread' '-lpthread'; do
1177 - CFLAGS="$flag $chktls_save_CFLAGS"
1178 - if test x$gcc_no_link = xyes; then
1179 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1181 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1182 -/* end confdefs.h. */
1183 -#include <pthread.h>
1184 - void *g(void *d) { return NULL; }
1185 -int
1186 -main ()
1188 -pthread_t t; pthread_create(&t,NULL,g,NULL);
1190 - return 0;
1192 -_ACEOF
1193 -if ac_fn_c_try_link "$LINENO"; then :
1194 - thread_CFLAGS="$flag"
1196 -rm -f core conftest.err conftest.$ac_objext \
1197 - conftest$ac_exeext conftest.$ac_ext
1198 - if test "X$thread_CFLAGS" != Xfailed; then
1199 - break
1200 - fi
1201 - done
1202 - CFLAGS="$chktls_save_CFLAGS"
1203 - if test "X$thread_CFLAGS" != Xfailed; then
1204 - CFLAGS="$thread_CFLAGS $chktls_save_CFLAGS"
1205 - if test "$cross_compiling" = yes; then :
1206 - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
1207 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1208 -as_fn_error "cannot run test program while cross compiling
1209 -See \`config.log' for more details." "$LINENO" 5; }
1210 -else
1211 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1212 -/* end confdefs.h. */
1213 -#include <pthread.h>
1214 - __thread int a;
1215 - static int *volatile a_in_other_thread;
1216 - static void *
1217 - thread_func (void *arg)
1219 - a_in_other_thread = &a;
1220 - return (void *)0;
1222 -int
1223 -main ()
1225 -pthread_t thread;
1226 - void *thread_retval;
1227 - int *volatile a_in_main_thread;
1228 - a_in_main_thread = &a;
1229 - if (pthread_create (&thread, (pthread_attr_t *)0,
1230 - thread_func, (void *)0))
1231 - return 0;
1232 - if (pthread_join (thread, &thread_retval))
1233 - return 0;
1234 - return (a_in_other_thread == a_in_main_thread);
1236 - return 0;
1238 -_ACEOF
1239 -if ac_fn_c_try_run "$LINENO"; then :
1240 - gcc_cv_have_tls=yes
1241 -else
1242 - gcc_cv_have_tls=no
1244 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1245 - conftest.$ac_objext conftest.beam conftest.$ac_ext
1248 - CFLAGS="$chktls_save_CFLAGS"
1249 - fi
1250 - fi
1251 -else
1252 - gcc_cv_have_tls=no
1254 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1255 - conftest.$ac_objext conftest.beam conftest.$ac_ext
1259 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_have_tls" >&5
1260 -$as_echo "$gcc_cv_have_tls" >&6; }
1261 - if test "$enable_tls $gcc_cv_have_tls" = "yes yes"; then
1263 -$as_echo "#define HAVE_TLS 1" >>confdefs.h
1265 - fi
1266 +#dnl GCC_ENABLE_TLS
1268 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exception model to use" >&5
1269 $as_echo_n "checking for exception model to use... " >&6; }
1270 diff -ruN gcc-4.8.3/libobjc/configure.ac gcc-4.8.3.aros/libobjc/configure.ac
1271 --- gcc-4.8.3/libobjc/configure.ac 2013-02-03 11:16:21.000000000 +0000
1272 +++ gcc-4.8.3.aros/libobjc/configure.ac 2015-02-26 16:39:08.879698333 +0000
1273 @@ -210,7 +210,7 @@
1274 # -----------
1276 # Check if we have thread-local storage
1277 -GCC_CHECK_TLS
1278 +dnl GCC_CHECK_TLS
1280 AC_MSG_CHECKING([for exception model to use])
1281 AC_LANG_PUSH(C)
1282 diff -ruN gcc-4.8.3/libobjc/thr.c gcc-4.8.3.aros/libobjc/thr.c
1283 --- gcc-4.8.3/libobjc/thr.c 2013-02-03 11:16:21.000000000 +0000
1284 +++ gcc-4.8.3.aros/libobjc/thr.c 2015-02-26 16:39:08.879698333 +0000
1285 @@ -39,6 +39,7 @@
1286 #include "objc/runtime.h"
1287 #include "objc-private/module-abi-8.h"
1288 #include "objc-private/runtime.h"
1289 +#define __typedef_BOOL /* Remove definition of BOOL */
1290 #include <gthr.h>
1292 #include <stdlib.h>
1293 diff -ruN gcc-4.8.3/libstdc++-v3/config/os/aros/ctype_base.h gcc-4.8.3.aros/libstdc++-v3/config/os/aros/ctype_base.h
1294 --- gcc-4.8.3/libstdc++-v3/config/os/aros/ctype_base.h 1970-01-01 01:00:00.000000000 +0100
1295 +++ gcc-4.8.3.aros/libstdc++-v3/config/os/aros/ctype_base.h 2015-02-26 16:39:08.879698333 +0000
1296 @@ -0,0 +1,27 @@
1297 +namespace std _GLIBCXX_VISIBILITY(default)
1299 +_GLIBCXX_BEGIN_NAMESPACE_VERSION
1301 +struct ctype_base {
1302 + /* Non-standard typedefs */
1303 + typedef int * __to_type;
1305 + /* NB: Offsets into ctype<char>::_M_table force a particular size
1306 + on the mask type. Because of this, we don't use an enum. */
1307 + typedef unsigned short int mask;
1309 + static const mask upper = _ISupper;
1310 + static const mask lower = _ISlower;
1311 + static const mask alpha = _ISalpha;
1312 + static const mask digit = _ISdigit;
1313 + static const mask xdigit = _ISxdigit;
1314 + static const mask space = _ISspace;
1315 + static const mask print = _ISprint;
1316 + static const mask graph = _ISgraph;
1317 + static const mask cntrl = _IScntrl;
1318 + static const mask punct = _ISpunct;
1319 + static const mask alnum = _ISalnum;
1322 +_GLIBCXX_END_NAMESPACE_VERSION
1323 +} // namespace
1324 diff -ruN gcc-4.8.3/libstdc++-v3/config/os/aros/ctype_configure_char.cc gcc-4.8.3.aros/libstdc++-v3/config/os/aros/ctype_configure_char.cc
1325 --- gcc-4.8.3/libstdc++-v3/config/os/aros/ctype_configure_char.cc 1970-01-01 01:00:00.000000000 +0100
1326 +++ gcc-4.8.3.aros/libstdc++-v3/config/os/aros/ctype_configure_char.cc 2015-02-26 16:39:08.879698333 +0000
1327 @@ -0,0 +1,99 @@
1328 +// Locale support -*- C++ -*-
1330 +// Copyright (C) 2011-2013 Free Software Foundation, Inc.
1332 +// This file is part of the GNU ISO C++ Library. This library is free
1333 +// software; you can redistribute it and/or modify it under the
1334 +// terms of the GNU General Public License as published by the
1335 +// Free Software Foundation; either version 3, or (at your option)
1336 +// any later version.
1338 +// This library is distributed in the hope that it will be useful,
1339 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1340 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1341 +// GNU General Public License for more details.
1343 +// Under Section 7 of GPL version 3, you are granted additional
1344 +// permissions described in the GCC Runtime Library Exception, version
1345 +// 3.1, as published by the Free Software Foundation.
1347 +// You should have received a copy of the GNU General Public License and
1348 +// a copy of the GCC Runtime Library Exception along with this program;
1349 +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
1350 +// <http://www.gnu.org/licenses/>.
1352 +/** @file ctype_configure_char.cc */
1355 +// ISO C++ 14882: 22.1 Locales
1358 +#include <locale>
1359 +#include <cstdlib>
1360 +#include <cstring>
1362 +namespace std _GLIBCXX_VISIBILITY(default)
1364 +_GLIBCXX_BEGIN_NAMESPACE_VERSION
1366 +// Information as gleaned from /usr/include/ctype.h
1368 + const ctype_base::mask*
1369 + ctype<char>::classic_table() throw()
1370 + { return 0; }
1372 + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
1373 + size_t __refs)
1374 + : facet(__refs), _M_del(__table != 0 && __del),
1375 + _M_toupper(NULL), _M_tolower(NULL),
1376 + _M_table(__table ? __table : classic_table())
1377 + {
1378 + memset(_M_widen, 0, sizeof(_M_widen));
1379 + _M_widen_ok = 0;
1380 + memset(_M_narrow, 0, sizeof(_M_narrow));
1381 + _M_narrow_ok = 0;
1384 + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
1385 + : facet(__refs), _M_del(__table != 0 && __del),
1386 + _M_toupper(NULL), _M_tolower(NULL),
1387 + _M_table(__table ? __table : classic_table())
1388 + {
1389 + memset(_M_widen, 0, sizeof(_M_widen));
1390 + _M_widen_ok = 0;
1391 + memset(_M_narrow, 0, sizeof(_M_narrow));
1392 + _M_narrow_ok = 0;
1395 + char
1396 + ctype<char>::do_toupper(char __c) const
1397 + { return ::toupper((int) __c); }
1399 + const char*
1400 + ctype<char>::do_toupper(char* __low, const char* __high) const
1402 + while (__low < __high)
1404 + *__low = ::toupper((int) *__low);
1405 + ++__low;
1407 + return __high;
1410 + char
1411 + ctype<char>::do_tolower(char __c) const
1412 + { return ::tolower((int) __c); }
1414 + const char*
1415 + ctype<char>::do_tolower(char* __low, const char* __high) const
1417 + while (__low < __high)
1419 + *__low = ::tolower((int) *__low);
1420 + ++__low;
1422 + return __high;
1425 +_GLIBCXX_END_NAMESPACE_VERSION
1426 +} // namespace
1427 diff -ruN gcc-4.8.3/libstdc++-v3/config/os/aros/ctype_inline.h gcc-4.8.3.aros/libstdc++-v3/config/os/aros/ctype_inline.h
1428 --- gcc-4.8.3/libstdc++-v3/config/os/aros/ctype_inline.h 1970-01-01 01:00:00.000000000 +0100
1429 +++ gcc-4.8.3.aros/libstdc++-v3/config/os/aros/ctype_inline.h 2015-02-26 16:39:08.879698333 +0000
1430 @@ -0,0 +1,173 @@
1431 +// Locale support -*- C++ -*-
1433 +// Copyright (C) 2000, 2003 Free Software Foundation, Inc.
1435 +// This file is part of the GNU ISO C++ Library. This library is free
1436 +// software; you can redistribute it and/or modify it under the
1437 +// terms of the GNU General Public License as published by the
1438 +// Free Software Foundation; either version 2, or (at your option)
1439 +// any later version.
1441 +// This library is distributed in the hope that it will be useful,
1442 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1443 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1444 +// GNU General Public License for more details.
1446 +// You should have received a copy of the GNU General Public License along
1447 +// with this library; see the file COPYING. If not, write to the Free
1448 +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
1449 +// USA.
1451 +// As a special exception, you may use this file as part of a free software
1452 +// library without restriction. Specifically, if other files instantiate
1453 +// templates or use macros or inline functions from this file, or you compile
1454 +// this file and link it with other files to produce an executable, this
1455 +// file does not by itself cause the resulting executable to be covered by
1456 +// the GNU General Public License. This exception does not however
1457 +// invalidate any other reasons why the executable file might be covered by
1458 +// the GNU General Public License.
1460 +/** @file ctype_inline.h
1461 + * This is an internal header file, included by other library headers.
1462 + * You should not attempt to use it directly.
1463 + */
1466 +// ISO C++ 14882: 22.1 Locales
1469 +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
1470 +// functions go in ctype.cc
1472 +// The following definitions are portable, but insanely slow. If one
1473 +// cares at all about performance, then specialized ctype
1474 +// functionality should be added for the native os in question: see
1475 +// the config/os/bits/ctype_*.h files.
1477 +// Constructing a synthetic "C" table should be seriously considered...
1479 +namespace std _GLIBCXX_VISIBILITY(default)
1481 +_GLIBCXX_BEGIN_NAMESPACE_VERSION
1483 + bool
1484 + ctype<char>::
1485 + is(mask __m, char __c) const
1486 + {
1487 + if (_M_table)
1488 + return _M_table[static_cast<unsigned char>(__c)] & __m;
1489 + else
1491 + bool __ret = false;
1492 + const size_t __bitmasksize = 15;
1493 + size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0
1494 + for (; __bitcur <= __bitmasksize; ++__bitcur)
1496 + const mask __bit = static_cast<mask>(1 << __bitcur);
1497 + if (__m & __bit)
1499 + bool __testis;
1500 + switch (__bit)
1502 + case space:
1503 + __testis = isspace(__c);
1504 + break;
1505 + case print:
1506 + __testis = isprint(__c);
1507 + break;
1508 + case cntrl:
1509 + __testis = iscntrl(__c);
1510 + break;
1511 + case upper:
1512 + __testis = isupper(__c);
1513 + break;
1514 + case lower:
1515 + __testis = islower(__c);
1516 + break;
1517 + case alpha:
1518 + __testis = isalpha(__c);
1519 + break;
1520 + case digit:
1521 + __testis = isdigit(__c);
1522 + break;
1523 + case punct:
1524 + __testis = ispunct(__c);
1525 + break;
1526 + case xdigit:
1527 + __testis = isxdigit(__c);
1528 + break;
1529 + case alnum:
1530 + __testis = isalnum(__c);
1531 + break;
1532 + case graph:
1533 + __testis = isgraph(__c);
1534 + break;
1535 + default:
1536 + __testis = false;
1537 + break;
1539 + __ret |= __testis;
1542 + return __ret;
1546 + const char*
1547 + ctype<char>::
1548 + is(const char* __low, const char* __high, mask* __vec) const
1550 + if (_M_table)
1551 + while (__low < __high)
1552 + *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
1553 + else
1555 + // Highest bitmask in ctype_base == 10.
1556 + const size_t __bitmasksize = 15;
1557 + for (;__low < __high; ++__vec, ++__low)
1559 + mask __m = 0;
1560 + // Lowest bitmask in ctype_base == 0
1561 + size_t __i = 0;
1562 + for (;__i <= __bitmasksize; ++__i)
1564 + const mask __bit = static_cast<mask>(1 << __i);
1565 + if (this->is(__bit, *__low))
1566 + __m |= __bit;
1568 + *__vec = __m;
1571 + return __high;
1574 + const char*
1575 + ctype<char>::
1576 + scan_is(mask __m, const char* __low, const char* __high) const
1578 + if (_M_table)
1579 + while (__low < __high
1580 + && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
1581 + ++__low;
1582 + else
1583 + while (__low < __high && !this->is(__m, *__low))
1584 + ++__low;
1585 + return __low;
1588 + const char*
1589 + ctype<char>::
1590 + scan_not(mask __m, const char* __low, const char* __high) const
1592 + if (_M_table)
1593 + while (__low < __high
1594 + && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
1595 + ++__low;
1596 + else
1597 + while (__low < __high && this->is(__m, *__low) != 0)
1598 + ++__low;
1599 + return __low;
1602 +_GLIBCXX_END_NAMESPACE_VERSION
1603 +} // namespace
1604 diff -ruN gcc-4.8.3/libstdc++-v3/config/os/aros/ctype_noninline.h gcc-4.8.3.aros/libstdc++-v3/config/os/aros/ctype_noninline.h
1605 --- gcc-4.8.3/libstdc++-v3/config/os/aros/ctype_noninline.h 1970-01-01 01:00:00.000000000 +0100
1606 +++ gcc-4.8.3.aros/libstdc++-v3/config/os/aros/ctype_noninline.h 2015-02-26 16:39:08.879698333 +0000
1607 @@ -0,0 +1,56 @@
1608 + const ctype_base::mask*
1609 + ctype<char>::classic_table() throw()
1610 + { return *__ctype_b_ptr; }
1612 + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
1613 + size_t __refs)
1614 + : facet(__refs), _M_del(__table != 0 && __del),
1615 + _M_toupper(NULL), _M_tolower(NULL),
1616 + _M_table(__table ? __table : classic_table())
1617 + {
1618 + memset(_M_widen, 0, sizeof(_M_widen));
1619 + _M_widen_ok = 0;
1620 + memset(_M_narrow, 0, sizeof(_M_narrow));
1621 + _M_narrow_ok = 0;
1624 + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
1625 + : facet(__refs), _M_del(__table != 0 && __del),
1626 + _M_toupper(NULL), _M_tolower(NULL),
1627 + _M_table(__table ? __table : classic_table())
1628 + {
1629 + memset(_M_widen, 0, sizeof(_M_widen));
1630 + _M_widen_ok = 0;
1631 + memset(_M_narrow, 0, sizeof(_M_narrow));
1632 + _M_narrow_ok = 0;
1635 + char
1636 + ctype<char>::do_toupper(char __c) const
1637 + { return ::toupper((int) __c); }
1639 + const char*
1640 + ctype<char>::do_toupper(char* __low, const char* __high) const
1642 + while (__low < __high)
1644 + *__low = ::toupper((int) *__low);
1645 + ++__low;
1647 + return __high;
1650 + char
1651 + ctype<char>::do_tolower(char __c) const
1652 + { return ::tolower((int) __c); }
1654 + const char*
1655 + ctype<char>::do_tolower(char* __low, const char* __high) const
1657 + while (__low < __high)
1659 + *__low = ::tolower((int) *__low);
1660 + ++__low;
1662 + return __high;
1664 diff -ruN gcc-4.8.3/libstdc++-v3/config/os/aros/os_defines.h gcc-4.8.3.aros/libstdc++-v3/config/os/aros/os_defines.h
1665 --- gcc-4.8.3/libstdc++-v3/config/os/aros/os_defines.h 1970-01-01 01:00:00.000000000 +0100
1666 +++ gcc-4.8.3.aros/libstdc++-v3/config/os/aros/os_defines.h 2015-02-26 16:39:08.879698333 +0000
1667 @@ -0,0 +1,6 @@
1668 +#ifndef _GLIBCXX_OS_DEFINES
1669 +#define _GLIBCXX_OS_DEFINES
1671 +#define __off64_t off_t
1673 +#endif
1674 diff -ruN gcc-4.8.3/libstdc++-v3/configure gcc-4.8.3.aros/libstdc++-v3/configure
1675 --- gcc-4.8.3/libstdc++-v3/configure 2014-04-04 14:53:39.000000000 +0100
1676 +++ gcc-4.8.3.aros/libstdc++-v3/configure 2015-02-26 16:39:08.879698333 +0000
1677 @@ -5288,12 +5288,12 @@
1680 # Libtool setup.
1681 -if test "x${with_newlib}" != "xyes"; then
1682 - enable_dlopen=yes
1687 +#if test "x${with_newlib}" != "xyes"; then
1688 +# AC_LIBTOOL_DLOPEN
1692 +#fi
1693 case `pwd` in
1694 *\ * | *\ *)
1695 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
1696 @@ -8024,6 +8024,8 @@
1700 + enable_dlopen=no
1703 enable_win32_dll=no
1705 @@ -18572,6 +18574,7 @@
1707 struct iovec iov[2];
1708 writev(0, iov, 0);
1709 +#error be sure to fail
1711 return 0;
1713 @@ -18594,6 +18597,7 @@
1715 struct iovec iov[2];
1716 writev(0, iov, 0);
1717 +#error be sure to fail
1719 return 0;
1721 @@ -27615,6 +27619,58 @@
1723 # Base decisions on target environment.
1724 case "${host}" in
1725 + *-aros*)
1726 + for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
1727 + machine/param.h sys/machine.h sys/types.h fp.h locale.h float.h inttypes.h
1728 +do :
1729 + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
1730 +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
1731 +eval as_val=\$$as_ac_Header
1732 + if test "x$as_val" = x""yes; then :
1733 + cat >>confdefs.h <<_ACEOF
1734 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
1735 +_ACEOF
1739 +done
1742 + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
1743 + GLIBCXX_CHECK_WCHAR_T_SUPPORT
1745 + $as_echo "#define HAVE_FINITE 1" >>confdefs.h
1747 + $as_echo "#define HAVE_FINITEF 1" >>confdefs.h
1749 + $as_echo "#define HAVE_FREXPF 1" >>confdefs.h
1751 + $as_echo "#define HAVE_HYPOTF 1" >>confdefs.h
1753 + $as_echo "#define HAVE_ISINF 1" >>confdefs.h
1755 + $as_echo "#define HAVE_ISINFF 1" >>confdefs.h
1757 + $as_echo "#define HAVE_ISNAN 1" >>confdefs.h
1759 + $as_echo "#define HAVE_ISNANF 1" >>confdefs.h
1761 + $as_echo "#define HAVE_SINCOS 1" >>confdefs.h
1763 + $as_echo "#define HAVE_SINCOSF 1" >>confdefs.h
1765 + if test x"long_double_math_on_this_cpu" = x"yes"; then
1766 + $as_echo "#define HAVE_FINITEL 1" >>confdefs.h
1768 + $as_echo "#define HAVE_HYPOTL 1" >>confdefs.h
1770 + $as_echo "#define HAVE_ISINFL 1" >>confdefs.h
1772 + $as_echo "#define HAVE_ISNANL 1" >>confdefs.h
1774 + fi
1775 + ;;
1777 arm*-*-symbianelf*)
1778 # This is a freestanding configuration; there is nothing to do here.
1780 diff -ruN gcc-4.8.3/libstdc++-v3/configure.ac gcc-4.8.3.aros/libstdc++-v3/configure.ac
1781 --- gcc-4.8.3/libstdc++-v3/configure.ac 2013-04-09 21:47:55.000000000 +0100
1782 +++ gcc-4.8.3.aros/libstdc++-v3/configure.ac 2015-02-26 16:39:08.879698333 +0000
1783 @@ -89,9 +89,9 @@
1784 GLIBCXX_CONFIGURE
1786 # Libtool setup.
1787 -if test "x${with_newlib}" != "xyes"; then
1788 - AC_LIBTOOL_DLOPEN
1790 +#if test "x${with_newlib}" != "xyes"; then
1791 +# AC_LIBTOOL_DLOPEN
1792 +#fi
1793 AM_PROG_LIBTOOL
1794 ACX_LT_HOST_FLAGS
1795 AC_SUBST(enable_shared)
1796 diff -ruN gcc-4.8.3/libstdc++-v3/configure.host gcc-4.8.3.aros/libstdc++-v3/configure.host
1797 --- gcc-4.8.3/libstdc++-v3/configure.host 2013-06-19 02:18:38.000000000 +0100
1798 +++ gcc-4.8.3.aros/libstdc++-v3/configure.host 2015-02-26 16:39:08.879698333 +0000
1799 @@ -230,6 +230,9 @@
1800 os_include_dir="os/generic"
1801 atomicity_dir="cpu/generic"
1803 + aros*)
1804 + os_include_dir="os/aros"
1805 + ;;
1806 bsd*)
1807 # Plain BSD attempts to share FreeBSD files.
1808 os_include_dir="os/bsd/freebsd"
1809 diff -ruN gcc-4.8.3/libstdc++-v3/crossconfig.m4 gcc-4.8.3.aros/libstdc++-v3/crossconfig.m4
1810 --- gcc-4.8.3/libstdc++-v3/crossconfig.m4 2012-05-02 20:34:31.000000000 +0100
1811 +++ gcc-4.8.3.aros/libstdc++-v3/crossconfig.m4 2015-02-26 16:39:08.879698333 +0000
1812 @@ -5,6 +5,31 @@
1813 AC_DEFUN([GLIBCXX_CROSSCONFIG],[
1814 # Base decisions on target environment.
1815 case "${host}" in
1816 + *-aros*)
1817 + AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
1818 + machine/param.h sys/machine.h sys/types.h fp.h locale.h float.h inttypes.h])
1820 + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
1821 + GLIBCXX_CHECK_WCHAR_T_SUPPORT
1823 + AC_DEFINE(HAVE_FINITE)
1824 + AC_DEFINE(HAVE_FINITEF)
1825 + AC_DEFINE(HAVE_FREXPF)
1826 + AC_DEFINE(HAVE_HYPOTF)
1827 + AC_DEFINE(HAVE_ISINF)
1828 + AC_DEFINE(HAVE_ISINFF)
1829 + AC_DEFINE(HAVE_ISNAN)
1830 + AC_DEFINE(HAVE_ISNANF)
1831 + AC_DEFINE(HAVE_SINCOS)
1832 + AC_DEFINE(HAVE_SINCOSF)
1833 + if test x"long_double_math_on_this_cpu" = x"yes"; then
1834 + AC_DEFINE(HAVE_FINITEL)
1835 + AC_DEFINE(HAVE_HYPOTL)
1836 + AC_DEFINE(HAVE_ISINFL)
1837 + AC_DEFINE(HAVE_ISNANL)
1838 + fi
1839 + ;;
1841 arm*-*-symbianelf*)
1842 # This is a freestanding configuration; there is nothing to do here.
1844 diff -ruN gcc-4.8.3/libstdc++-v3/include/Makefile.in gcc-4.8.3.aros/libstdc++-v3/include/Makefile.in
1845 --- gcc-4.8.3/libstdc++-v3/include/Makefile.in 2013-07-31 20:29:13.000000000 +0100
1846 +++ gcc-4.8.3.aros/libstdc++-v3/include/Makefile.in 2015-02-26 16:39:08.879698333 +0000
1847 @@ -1536,6 +1536,7 @@
1848 -e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
1849 -e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
1850 -e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \
1851 + -e 's/_GLIBCXX___AROS__/__AROS__/g' \
1852 -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
1853 < $< > $@
1855 diff -ruN gcc-4.8.3/libstdc++-v3/include/std/ratio gcc-4.8.3.aros/libstdc++-v3/include/std/ratio
1856 --- gcc-4.8.3/libstdc++-v3/include/std/ratio 2013-02-03 17:54:05.000000000 +0000
1857 +++ gcc-4.8.3.aros/libstdc++-v3/include/std/ratio 2015-02-26 16:39:08.879698333 +0000
1858 @@ -211,10 +211,10 @@
1860 private:
1861 static_assert(__d != 0, "Internal library error");
1862 - static_assert(sizeof (uintmax_t) == sizeof (unsigned long long),
1863 - "This library calls __builtin_clzll on uintmax_t, which "
1864 - "is unsafe on your platform. Please complain to "
1865 - "http://gcc.gnu.org/bugzilla/");
1866 +// static_assert(sizeof (uintmax_t) == sizeof (unsigned long long),
1867 +// "This library calls __builtin_clzll on uintmax_t, which "
1868 +// "is unsafe on your platform. Please complain to "
1869 +// "http://gcc.gnu.org/bugzilla/");
1870 static constexpr int __shift = __builtin_clzll(__d);
1871 static constexpr int __coshift_ = sizeof(uintmax_t) * 8 - __shift;
1872 static constexpr int __coshift = (__shift != 0) ? __coshift_ : 0;