cleanup gcc include dirs
[AROS.git] / tools / crosstools / gcc-4.8.3-aros.diff
blob89f0c274f7211791fab2beeba530a5b46d157303
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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-: STANDARD_INCLUDE_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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-11 13:33:07.466394838 +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-fde.c gcc-4.8.3.aros/libgcc/unwind-dw2-fde.c
1001 --- gcc-4.8.3/libgcc/unwind-dw2-fde.c 2013-02-04 19:06:20.000000000 +0000
1002 +++ gcc-4.8.3.aros/libgcc/unwind-dw2-fde.c 2015-02-11 13:33:07.466394838 +0000
1003 @@ -92,12 +92,16 @@
1004 #endif
1006 init_object_mutex_once ();
1007 +#ifndef __AROS__ /* This is called when SysBase is not yet set up */
1008 __gthread_mutex_lock (&object_mutex);
1009 +#endif
1011 ob->next = unseen_objects;
1012 unseen_objects = ob;
1014 +#ifndef __AROS__
1015 __gthread_mutex_unlock (&object_mutex);
1016 +#endif
1019 void
1020 diff -ruN gcc-4.8.3/libiberty/filename_cmp.c gcc-4.8.3.aros/libiberty/filename_cmp.c
1021 --- gcc-4.8.3/libiberty/filename_cmp.c 2012-07-13 23:12:28.000000000 +0100
1022 +++ gcc-4.8.3.aros/libiberty/filename_cmp.c 2015-02-11 13:33:07.466394838 +0000
1023 @@ -50,9 +50,12 @@
1025 filename_cmp (const char *s1, const char *s2)
1027 -#if !defined(HAVE_DOS_BASED_FILE_SYSTEM) \
1028 - && !defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
1029 +#if !defined(HAVE_DOS_BASED_FILE_SYSTEM)
1030 +#if defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
1031 + return strcasecmp(s1, s2);
1032 +#else
1033 return strcmp(s1, s2);
1034 +#endif
1035 #else
1036 for (;;)
1038 diff -ruN gcc-4.8.3/libobjc/configure gcc-4.8.3.aros/libobjc/configure
1039 --- gcc-4.8.3/libobjc/configure 2014-04-04 14:53:39.000000000 +0100
1040 +++ gcc-4.8.3.aros/libobjc/configure 2015-02-11 13:33:07.466394838 +0000
1041 @@ -11256,214 +11256,7 @@
1042 # -----------
1044 # Check if we have thread-local storage
1047 - # Check whether --enable-tls was given.
1048 -if test "${enable_tls+set}" = set; then :
1049 - enableval=$enable_tls;
1050 - case "$enableval" in
1051 - yes|no) ;;
1052 - *) as_fn_error "Argument to enable/disable tls must be yes or no" "$LINENO" 5 ;;
1053 - esac
1055 -else
1056 - enable_tls=yes
1060 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports thread-local storage" >&5
1061 -$as_echo_n "checking whether the target supports thread-local storage... " >&6; }
1062 -if test "${gcc_cv_have_tls+set}" = set; then :
1063 - $as_echo_n "(cached) " >&6
1064 -else
1066 - if test "$cross_compiling" = yes; then :
1067 - if test x$gcc_no_link = xyes; then
1068 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1070 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1071 -/* end confdefs.h. */
1072 -__thread int a; int b; int main() { return a = b; }
1073 -_ACEOF
1074 -if ac_fn_c_try_link "$LINENO"; then :
1075 - chktls_save_LDFLAGS="$LDFLAGS"
1076 - case $host in
1077 - *-*-linux*)
1078 - LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
1079 - ;;
1080 - esac
1081 - chktls_save_CFLAGS="$CFLAGS"
1082 - CFLAGS="-fPIC $CFLAGS"
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 -int f() { return 0; }
1089 -_ACEOF
1090 -if ac_fn_c_try_link "$LINENO"; then :
1091 - if test x$gcc_no_link = xyes; then
1092 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1094 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1095 -/* end confdefs.h. */
1096 -__thread int a; int b; int f() { return a = b; }
1097 -_ACEOF
1098 -if ac_fn_c_try_link "$LINENO"; then :
1099 - gcc_cv_have_tls=yes
1100 -else
1101 - gcc_cv_have_tls=no
1103 -rm -f core conftest.err conftest.$ac_objext \
1104 - conftest$ac_exeext conftest.$ac_ext
1105 -else
1106 - gcc_cv_have_tls=yes
1108 -rm -f core conftest.err conftest.$ac_objext \
1109 - conftest$ac_exeext conftest.$ac_ext
1110 - CFLAGS="$chktls_save_CFLAGS"
1111 - LDFLAGS="$chktls_save_LDFLAGS"
1112 -else
1113 - gcc_cv_have_tls=no
1115 -rm -f core conftest.err conftest.$ac_objext \
1116 - conftest$ac_exeext conftest.$ac_ext
1119 -else
1120 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1121 -/* end confdefs.h. */
1122 -__thread int a; int b; int main() { return a = b; }
1123 -_ACEOF
1124 -if ac_fn_c_try_run "$LINENO"; then :
1125 - chktls_save_LDFLAGS="$LDFLAGS"
1126 - LDFLAGS="-static $LDFLAGS"
1127 - if test x$gcc_no_link = xyes; then
1128 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1130 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1131 -/* end confdefs.h. */
1132 -int main() { return 0; }
1133 -_ACEOF
1134 -if ac_fn_c_try_link "$LINENO"; then :
1135 - if test "$cross_compiling" = yes; then :
1136 - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
1137 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1138 -as_fn_error "cannot run test program while cross compiling
1139 -See \`config.log' for more details." "$LINENO" 5; }
1140 -else
1141 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1142 -/* end confdefs.h. */
1143 -__thread int a; int b; int main() { return a = b; }
1144 -_ACEOF
1145 -if ac_fn_c_try_run "$LINENO"; then :
1146 - gcc_cv_have_tls=yes
1147 -else
1148 - gcc_cv_have_tls=no
1150 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1151 - conftest.$ac_objext conftest.beam conftest.$ac_ext
1154 -else
1155 - gcc_cv_have_tls=yes
1157 -rm -f core conftest.err conftest.$ac_objext \
1158 - conftest$ac_exeext conftest.$ac_ext
1159 - LDFLAGS="$chktls_save_LDFLAGS"
1160 - if test $gcc_cv_have_tls = yes; then
1161 - chktls_save_CFLAGS="$CFLAGS"
1162 - thread_CFLAGS=failed
1163 - for flag in '' '-pthread' '-lpthread'; do
1164 - CFLAGS="$flag $chktls_save_CFLAGS"
1165 - if test x$gcc_no_link = xyes; then
1166 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1168 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1169 -/* end confdefs.h. */
1170 -#include <pthread.h>
1171 - void *g(void *d) { return NULL; }
1172 -int
1173 -main ()
1175 -pthread_t t; pthread_create(&t,NULL,g,NULL);
1177 - return 0;
1179 -_ACEOF
1180 -if ac_fn_c_try_link "$LINENO"; then :
1181 - thread_CFLAGS="$flag"
1183 -rm -f core conftest.err conftest.$ac_objext \
1184 - conftest$ac_exeext conftest.$ac_ext
1185 - if test "X$thread_CFLAGS" != Xfailed; then
1186 - break
1187 - fi
1188 - done
1189 - CFLAGS="$chktls_save_CFLAGS"
1190 - if test "X$thread_CFLAGS" != Xfailed; then
1191 - CFLAGS="$thread_CFLAGS $chktls_save_CFLAGS"
1192 - if test "$cross_compiling" = yes; then :
1193 - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
1194 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1195 -as_fn_error "cannot run test program while cross compiling
1196 -See \`config.log' for more details." "$LINENO" 5; }
1197 -else
1198 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1199 -/* end confdefs.h. */
1200 -#include <pthread.h>
1201 - __thread int a;
1202 - static int *volatile a_in_other_thread;
1203 - static void *
1204 - thread_func (void *arg)
1206 - a_in_other_thread = &a;
1207 - return (void *)0;
1209 -int
1210 -main ()
1212 -pthread_t thread;
1213 - void *thread_retval;
1214 - int *volatile a_in_main_thread;
1215 - a_in_main_thread = &a;
1216 - if (pthread_create (&thread, (pthread_attr_t *)0,
1217 - thread_func, (void *)0))
1218 - return 0;
1219 - if (pthread_join (thread, &thread_retval))
1220 - return 0;
1221 - return (a_in_other_thread == a_in_main_thread);
1223 - return 0;
1225 -_ACEOF
1226 -if ac_fn_c_try_run "$LINENO"; then :
1227 - gcc_cv_have_tls=yes
1228 -else
1229 - gcc_cv_have_tls=no
1231 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1232 - conftest.$ac_objext conftest.beam conftest.$ac_ext
1235 - CFLAGS="$chktls_save_CFLAGS"
1236 - fi
1237 - fi
1238 -else
1239 - gcc_cv_have_tls=no
1241 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1242 - conftest.$ac_objext conftest.beam conftest.$ac_ext
1246 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_have_tls" >&5
1247 -$as_echo "$gcc_cv_have_tls" >&6; }
1248 - if test "$enable_tls $gcc_cv_have_tls" = "yes yes"; then
1250 -$as_echo "#define HAVE_TLS 1" >>confdefs.h
1252 - fi
1253 +#dnl GCC_ENABLE_TLS
1255 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exception model to use" >&5
1256 $as_echo_n "checking for exception model to use... " >&6; }
1257 diff -ruN gcc-4.8.3/libobjc/configure.ac gcc-4.8.3.aros/libobjc/configure.ac
1258 --- gcc-4.8.3/libobjc/configure.ac 2013-02-03 11:16:21.000000000 +0000
1259 +++ gcc-4.8.3.aros/libobjc/configure.ac 2015-02-11 13:33:07.466394838 +0000
1260 @@ -210,7 +210,7 @@
1261 # -----------
1263 # Check if we have thread-local storage
1264 -GCC_CHECK_TLS
1265 +dnl GCC_CHECK_TLS
1267 AC_MSG_CHECKING([for exception model to use])
1268 AC_LANG_PUSH(C)
1269 diff -ruN gcc-4.8.3/libobjc/thr.c gcc-4.8.3.aros/libobjc/thr.c
1270 --- gcc-4.8.3/libobjc/thr.c 2013-02-03 11:16:21.000000000 +0000
1271 +++ gcc-4.8.3.aros/libobjc/thr.c 2015-02-11 13:33:07.466394838 +0000
1272 @@ -39,6 +39,7 @@
1273 #include "objc/runtime.h"
1274 #include "objc-private/module-abi-8.h"
1275 #include "objc-private/runtime.h"
1276 +#define __typedef_BOOL /* Remove definition of BOOL */
1277 #include <gthr.h>
1279 #include <stdlib.h>
1280 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
1281 --- gcc-4.8.3/libstdc++-v3/config/os/aros/ctype_base.h 1970-01-01 01:00:00.000000000 +0100
1282 +++ gcc-4.8.3.aros/libstdc++-v3/config/os/aros/ctype_base.h 2015-02-11 13:33:07.466394838 +0000
1283 @@ -0,0 +1,27 @@
1284 +namespace std _GLIBCXX_VISIBILITY(default)
1286 +_GLIBCXX_BEGIN_NAMESPACE_VERSION
1288 +struct ctype_base {
1289 + /* Non-standard typedefs */
1290 + typedef int * __to_type;
1292 + /* NB: Offsets into ctype<char>::_M_table force a particular size
1293 + on the mask type. Because of this, we don't use an enum. */
1294 + typedef unsigned short int mask;
1296 + static const mask upper = _ISupper;
1297 + static const mask lower = _ISlower;
1298 + static const mask alpha = _ISalpha;
1299 + static const mask digit = _ISdigit;
1300 + static const mask xdigit = _ISxdigit;
1301 + static const mask space = _ISspace;
1302 + static const mask print = _ISprint;
1303 + static const mask graph = _ISgraph;
1304 + static const mask cntrl = _IScntrl;
1305 + static const mask punct = _ISpunct;
1306 + static const mask alnum = _ISalnum;
1309 +_GLIBCXX_END_NAMESPACE_VERSION
1310 +} // namespace
1311 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
1312 --- gcc-4.8.3/libstdc++-v3/config/os/aros/ctype_configure_char.cc 1970-01-01 01:00:00.000000000 +0100
1313 +++ gcc-4.8.3.aros/libstdc++-v3/config/os/aros/ctype_configure_char.cc 2015-02-11 13:33:07.466394838 +0000
1314 @@ -0,0 +1,99 @@
1315 +// Locale support -*- C++ -*-
1317 +// Copyright (C) 2011-2013 Free Software Foundation, Inc.
1319 +// This file is part of the GNU ISO C++ Library. This library is free
1320 +// software; you can redistribute it and/or modify it under the
1321 +// terms of the GNU General Public License as published by the
1322 +// Free Software Foundation; either version 3, or (at your option)
1323 +// any later version.
1325 +// This library is distributed in the hope that it will be useful,
1326 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1327 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1328 +// GNU General Public License for more details.
1330 +// Under Section 7 of GPL version 3, you are granted additional
1331 +// permissions described in the GCC Runtime Library Exception, version
1332 +// 3.1, as published by the Free Software Foundation.
1334 +// You should have received a copy of the GNU General Public License and
1335 +// a copy of the GCC Runtime Library Exception along with this program;
1336 +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
1337 +// <http://www.gnu.org/licenses/>.
1339 +/** @file ctype_configure_char.cc */
1342 +// ISO C++ 14882: 22.1 Locales
1345 +#include <locale>
1346 +#include <cstdlib>
1347 +#include <cstring>
1349 +namespace std _GLIBCXX_VISIBILITY(default)
1351 +_GLIBCXX_BEGIN_NAMESPACE_VERSION
1353 +// Information as gleaned from /usr/include/ctype.h
1355 + const ctype_base::mask*
1356 + ctype<char>::classic_table() throw()
1357 + { return 0; }
1359 + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
1360 + size_t __refs)
1361 + : facet(__refs), _M_del(__table != 0 && __del),
1362 + _M_toupper(NULL), _M_tolower(NULL),
1363 + _M_table(__table ? __table : classic_table())
1364 + {
1365 + memset(_M_widen, 0, sizeof(_M_widen));
1366 + _M_widen_ok = 0;
1367 + memset(_M_narrow, 0, sizeof(_M_narrow));
1368 + _M_narrow_ok = 0;
1371 + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
1372 + : facet(__refs), _M_del(__table != 0 && __del),
1373 + _M_toupper(NULL), _M_tolower(NULL),
1374 + _M_table(__table ? __table : classic_table())
1375 + {
1376 + memset(_M_widen, 0, sizeof(_M_widen));
1377 + _M_widen_ok = 0;
1378 + memset(_M_narrow, 0, sizeof(_M_narrow));
1379 + _M_narrow_ok = 0;
1382 + char
1383 + ctype<char>::do_toupper(char __c) const
1384 + { return ::toupper((int) __c); }
1386 + const char*
1387 + ctype<char>::do_toupper(char* __low, const char* __high) const
1389 + while (__low < __high)
1391 + *__low = ::toupper((int) *__low);
1392 + ++__low;
1394 + return __high;
1397 + char
1398 + ctype<char>::do_tolower(char __c) const
1399 + { return ::tolower((int) __c); }
1401 + const char*
1402 + ctype<char>::do_tolower(char* __low, const char* __high) const
1404 + while (__low < __high)
1406 + *__low = ::tolower((int) *__low);
1407 + ++__low;
1409 + return __high;
1412 +_GLIBCXX_END_NAMESPACE_VERSION
1413 +} // namespace
1414 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
1415 --- gcc-4.8.3/libstdc++-v3/config/os/aros/ctype_inline.h 1970-01-01 01:00:00.000000000 +0100
1416 +++ gcc-4.8.3.aros/libstdc++-v3/config/os/aros/ctype_inline.h 2015-02-11 13:33:07.466394838 +0000
1417 @@ -0,0 +1,173 @@
1418 +// Locale support -*- C++ -*-
1420 +// Copyright (C) 2000, 2003 Free Software Foundation, Inc.
1422 +// This file is part of the GNU ISO C++ Library. This library is free
1423 +// software; you can redistribute it and/or modify it under the
1424 +// terms of the GNU General Public License as published by the
1425 +// Free Software Foundation; either version 2, or (at your option)
1426 +// any later version.
1428 +// This library is distributed in the hope that it will be useful,
1429 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1430 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1431 +// GNU General Public License for more details.
1433 +// You should have received a copy of the GNU General Public License along
1434 +// with this library; see the file COPYING. If not, write to the Free
1435 +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
1436 +// USA.
1438 +// As a special exception, you may use this file as part of a free software
1439 +// library without restriction. Specifically, if other files instantiate
1440 +// templates or use macros or inline functions from this file, or you compile
1441 +// this file and link it with other files to produce an executable, this
1442 +// file does not by itself cause the resulting executable to be covered by
1443 +// the GNU General Public License. This exception does not however
1444 +// invalidate any other reasons why the executable file might be covered by
1445 +// the GNU General Public License.
1447 +/** @file ctype_inline.h
1448 + * This is an internal header file, included by other library headers.
1449 + * You should not attempt to use it directly.
1450 + */
1453 +// ISO C++ 14882: 22.1 Locales
1456 +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
1457 +// functions go in ctype.cc
1459 +// The following definitions are portable, but insanely slow. If one
1460 +// cares at all about performance, then specialized ctype
1461 +// functionality should be added for the native os in question: see
1462 +// the config/os/bits/ctype_*.h files.
1464 +// Constructing a synthetic "C" table should be seriously considered...
1466 +namespace std _GLIBCXX_VISIBILITY(default)
1468 +_GLIBCXX_BEGIN_NAMESPACE_VERSION
1470 + bool
1471 + ctype<char>::
1472 + is(mask __m, char __c) const
1473 + {
1474 + if (_M_table)
1475 + return _M_table[static_cast<unsigned char>(__c)] & __m;
1476 + else
1478 + bool __ret = false;
1479 + const size_t __bitmasksize = 15;
1480 + size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0
1481 + for (; __bitcur <= __bitmasksize; ++__bitcur)
1483 + const mask __bit = static_cast<mask>(1 << __bitcur);
1484 + if (__m & __bit)
1486 + bool __testis;
1487 + switch (__bit)
1489 + case space:
1490 + __testis = isspace(__c);
1491 + break;
1492 + case print:
1493 + __testis = isprint(__c);
1494 + break;
1495 + case cntrl:
1496 + __testis = iscntrl(__c);
1497 + break;
1498 + case upper:
1499 + __testis = isupper(__c);
1500 + break;
1501 + case lower:
1502 + __testis = islower(__c);
1503 + break;
1504 + case alpha:
1505 + __testis = isalpha(__c);
1506 + break;
1507 + case digit:
1508 + __testis = isdigit(__c);
1509 + break;
1510 + case punct:
1511 + __testis = ispunct(__c);
1512 + break;
1513 + case xdigit:
1514 + __testis = isxdigit(__c);
1515 + break;
1516 + case alnum:
1517 + __testis = isalnum(__c);
1518 + break;
1519 + case graph:
1520 + __testis = isgraph(__c);
1521 + break;
1522 + default:
1523 + __testis = false;
1524 + break;
1526 + __ret |= __testis;
1529 + return __ret;
1533 + const char*
1534 + ctype<char>::
1535 + is(const char* __low, const char* __high, mask* __vec) const
1537 + if (_M_table)
1538 + while (__low < __high)
1539 + *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
1540 + else
1542 + // Highest bitmask in ctype_base == 10.
1543 + const size_t __bitmasksize = 15;
1544 + for (;__low < __high; ++__vec, ++__low)
1546 + mask __m = 0;
1547 + // Lowest bitmask in ctype_base == 0
1548 + size_t __i = 0;
1549 + for (;__i <= __bitmasksize; ++__i)
1551 + const mask __bit = static_cast<mask>(1 << __i);
1552 + if (this->is(__bit, *__low))
1553 + __m |= __bit;
1555 + *__vec = __m;
1558 + return __high;
1561 + const char*
1562 + ctype<char>::
1563 + scan_is(mask __m, const char* __low, const char* __high) const
1565 + if (_M_table)
1566 + while (__low < __high
1567 + && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
1568 + ++__low;
1569 + else
1570 + while (__low < __high && !this->is(__m, *__low))
1571 + ++__low;
1572 + return __low;
1575 + const char*
1576 + ctype<char>::
1577 + scan_not(mask __m, const char* __low, const char* __high) const
1579 + if (_M_table)
1580 + while (__low < __high
1581 + && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
1582 + ++__low;
1583 + else
1584 + while (__low < __high && this->is(__m, *__low) != 0)
1585 + ++__low;
1586 + return __low;
1589 +_GLIBCXX_END_NAMESPACE_VERSION
1590 +} // namespace
1591 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
1592 --- gcc-4.8.3/libstdc++-v3/config/os/aros/ctype_noninline.h 1970-01-01 01:00:00.000000000 +0100
1593 +++ gcc-4.8.3.aros/libstdc++-v3/config/os/aros/ctype_noninline.h 2015-02-11 13:33:07.466394838 +0000
1594 @@ -0,0 +1,56 @@
1595 + const ctype_base::mask*
1596 + ctype<char>::classic_table() throw()
1597 + { return *__ctype_b_ptr; }
1599 + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
1600 + size_t __refs)
1601 + : facet(__refs), _M_del(__table != 0 && __del),
1602 + _M_toupper(NULL), _M_tolower(NULL),
1603 + _M_table(__table ? __table : classic_table())
1604 + {
1605 + memset(_M_widen, 0, sizeof(_M_widen));
1606 + _M_widen_ok = 0;
1607 + memset(_M_narrow, 0, sizeof(_M_narrow));
1608 + _M_narrow_ok = 0;
1611 + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
1612 + : facet(__refs), _M_del(__table != 0 && __del),
1613 + _M_toupper(NULL), _M_tolower(NULL),
1614 + _M_table(__table ? __table : classic_table())
1615 + {
1616 + memset(_M_widen, 0, sizeof(_M_widen));
1617 + _M_widen_ok = 0;
1618 + memset(_M_narrow, 0, sizeof(_M_narrow));
1619 + _M_narrow_ok = 0;
1622 + char
1623 + ctype<char>::do_toupper(char __c) const
1624 + { return ::toupper((int) __c); }
1626 + const char*
1627 + ctype<char>::do_toupper(char* __low, const char* __high) const
1629 + while (__low < __high)
1631 + *__low = ::toupper((int) *__low);
1632 + ++__low;
1634 + return __high;
1637 + char
1638 + ctype<char>::do_tolower(char __c) const
1639 + { return ::tolower((int) __c); }
1641 + const char*
1642 + ctype<char>::do_tolower(char* __low, const char* __high) const
1644 + while (__low < __high)
1646 + *__low = ::tolower((int) *__low);
1647 + ++__low;
1649 + return __high;
1651 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
1652 --- gcc-4.8.3/libstdc++-v3/config/os/aros/os_defines.h 1970-01-01 01:00:00.000000000 +0100
1653 +++ gcc-4.8.3.aros/libstdc++-v3/config/os/aros/os_defines.h 2015-02-11 13:33:07.466394838 +0000
1654 @@ -0,0 +1,6 @@
1655 +#ifndef _GLIBCXX_OS_DEFINES
1656 +#define _GLIBCXX_OS_DEFINES
1658 +#define __off64_t off_t
1660 +#endif
1661 diff -ruN gcc-4.8.3/libstdc++-v3/configure gcc-4.8.3.aros/libstdc++-v3/configure
1662 --- gcc-4.8.3/libstdc++-v3/configure 2014-04-04 14:53:39.000000000 +0100
1663 +++ gcc-4.8.3.aros/libstdc++-v3/configure 2015-02-11 13:33:07.466394838 +0000
1664 @@ -5288,12 +5288,12 @@
1667 # Libtool setup.
1668 -if test "x${with_newlib}" != "xyes"; then
1669 - enable_dlopen=yes
1674 +#if test "x${with_newlib}" != "xyes"; then
1675 +# AC_LIBTOOL_DLOPEN
1679 +#fi
1680 case `pwd` in
1681 *\ * | *\ *)
1682 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
1683 @@ -8024,6 +8024,8 @@
1687 + enable_dlopen=no
1690 enable_win32_dll=no
1692 @@ -18572,6 +18574,7 @@
1694 struct iovec iov[2];
1695 writev(0, iov, 0);
1696 +#error be sure to fail
1698 return 0;
1700 @@ -18594,6 +18597,7 @@
1702 struct iovec iov[2];
1703 writev(0, iov, 0);
1704 +#error be sure to fail
1706 return 0;
1708 @@ -27615,6 +27619,58 @@
1710 # Base decisions on target environment.
1711 case "${host}" in
1712 + *-aros*)
1713 + for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
1714 + machine/param.h sys/machine.h sys/types.h fp.h locale.h float.h inttypes.h
1715 +do :
1716 + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
1717 +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
1718 +eval as_val=\$$as_ac_Header
1719 + if test "x$as_val" = x""yes; then :
1720 + cat >>confdefs.h <<_ACEOF
1721 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
1722 +_ACEOF
1726 +done
1729 + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
1730 + GLIBCXX_CHECK_WCHAR_T_SUPPORT
1732 + $as_echo "#define HAVE_FINITE 1" >>confdefs.h
1734 + $as_echo "#define HAVE_FINITEF 1" >>confdefs.h
1736 + $as_echo "#define HAVE_FREXPF 1" >>confdefs.h
1738 + $as_echo "#define HAVE_HYPOTF 1" >>confdefs.h
1740 + $as_echo "#define HAVE_ISINF 1" >>confdefs.h
1742 + $as_echo "#define HAVE_ISINFF 1" >>confdefs.h
1744 + $as_echo "#define HAVE_ISNAN 1" >>confdefs.h
1746 + $as_echo "#define HAVE_ISNANF 1" >>confdefs.h
1748 + $as_echo "#define HAVE_SINCOS 1" >>confdefs.h
1750 + $as_echo "#define HAVE_SINCOSF 1" >>confdefs.h
1752 + if test x"long_double_math_on_this_cpu" = x"yes"; then
1753 + $as_echo "#define HAVE_FINITEL 1" >>confdefs.h
1755 + $as_echo "#define HAVE_HYPOTL 1" >>confdefs.h
1757 + $as_echo "#define HAVE_ISINFL 1" >>confdefs.h
1759 + $as_echo "#define HAVE_ISNANL 1" >>confdefs.h
1761 + fi
1762 + ;;
1764 arm*-*-symbianelf*)
1765 # This is a freestanding configuration; there is nothing to do here.
1767 diff -ruN gcc-4.8.3/libstdc++-v3/configure.ac gcc-4.8.3.aros/libstdc++-v3/configure.ac
1768 --- gcc-4.8.3/libstdc++-v3/configure.ac 2013-04-09 21:47:55.000000000 +0100
1769 +++ gcc-4.8.3.aros/libstdc++-v3/configure.ac 2015-02-11 13:33:07.466394838 +0000
1770 @@ -89,9 +89,9 @@
1771 GLIBCXX_CONFIGURE
1773 # Libtool setup.
1774 -if test "x${with_newlib}" != "xyes"; then
1775 - AC_LIBTOOL_DLOPEN
1777 +#if test "x${with_newlib}" != "xyes"; then
1778 +# AC_LIBTOOL_DLOPEN
1779 +#fi
1780 AM_PROG_LIBTOOL
1781 ACX_LT_HOST_FLAGS
1782 AC_SUBST(enable_shared)
1783 diff -ruN gcc-4.8.3/libstdc++-v3/configure.host gcc-4.8.3.aros/libstdc++-v3/configure.host
1784 --- gcc-4.8.3/libstdc++-v3/configure.host 2013-06-19 02:18:38.000000000 +0100
1785 +++ gcc-4.8.3.aros/libstdc++-v3/configure.host 2015-02-11 13:33:07.466394838 +0000
1786 @@ -230,6 +230,9 @@
1787 os_include_dir="os/generic"
1788 atomicity_dir="cpu/generic"
1790 + aros*)
1791 + os_include_dir="os/aros"
1792 + ;;
1793 bsd*)
1794 # Plain BSD attempts to share FreeBSD files.
1795 os_include_dir="os/bsd/freebsd"
1796 diff -ruN gcc-4.8.3/libstdc++-v3/crossconfig.m4 gcc-4.8.3.aros/libstdc++-v3/crossconfig.m4
1797 --- gcc-4.8.3/libstdc++-v3/crossconfig.m4 2012-05-02 20:34:31.000000000 +0100
1798 +++ gcc-4.8.3.aros/libstdc++-v3/crossconfig.m4 2015-02-11 13:33:07.466394838 +0000
1799 @@ -5,6 +5,31 @@
1800 AC_DEFUN([GLIBCXX_CROSSCONFIG],[
1801 # Base decisions on target environment.
1802 case "${host}" in
1803 + *-aros*)
1804 + AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
1805 + machine/param.h sys/machine.h sys/types.h fp.h locale.h float.h inttypes.h])
1807 + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
1808 + GLIBCXX_CHECK_WCHAR_T_SUPPORT
1810 + AC_DEFINE(HAVE_FINITE)
1811 + AC_DEFINE(HAVE_FINITEF)
1812 + AC_DEFINE(HAVE_FREXPF)
1813 + AC_DEFINE(HAVE_HYPOTF)
1814 + AC_DEFINE(HAVE_ISINF)
1815 + AC_DEFINE(HAVE_ISINFF)
1816 + AC_DEFINE(HAVE_ISNAN)
1817 + AC_DEFINE(HAVE_ISNANF)
1818 + AC_DEFINE(HAVE_SINCOS)
1819 + AC_DEFINE(HAVE_SINCOSF)
1820 + if test x"long_double_math_on_this_cpu" = x"yes"; then
1821 + AC_DEFINE(HAVE_FINITEL)
1822 + AC_DEFINE(HAVE_HYPOTL)
1823 + AC_DEFINE(HAVE_ISINFL)
1824 + AC_DEFINE(HAVE_ISNANL)
1825 + fi
1826 + ;;
1828 arm*-*-symbianelf*)
1829 # This is a freestanding configuration; there is nothing to do here.
1831 diff -ruN gcc-4.8.3/libstdc++-v3/include/Makefile.in gcc-4.8.3.aros/libstdc++-v3/include/Makefile.in
1832 --- gcc-4.8.3/libstdc++-v3/include/Makefile.in 2013-07-31 20:29:13.000000000 +0100
1833 +++ gcc-4.8.3.aros/libstdc++-v3/include/Makefile.in 2015-02-11 13:33:07.466394838 +0000
1834 @@ -1536,6 +1536,7 @@
1835 -e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
1836 -e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
1837 -e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \
1838 + -e 's/_GLIBCXX___AROS__/__AROS__/g' \
1839 -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
1840 < $< > $@
1842 diff -ruN gcc-4.8.3/libstdc++-v3/include/std/ratio gcc-4.8.3.aros/libstdc++-v3/include/std/ratio
1843 --- gcc-4.8.3/libstdc++-v3/include/std/ratio 2013-02-03 17:54:05.000000000 +0000
1844 +++ gcc-4.8.3.aros/libstdc++-v3/include/std/ratio 2015-02-11 13:33:07.466394838 +0000
1845 @@ -211,10 +211,10 @@
1847 private:
1848 static_assert(__d != 0, "Internal library error");
1849 - static_assert(sizeof (uintmax_t) == sizeof (unsigned long long),
1850 - "This library calls __builtin_clzll on uintmax_t, which "
1851 - "is unsafe on your platform. Please complain to "
1852 - "http://gcc.gnu.org/bugzilla/");
1853 +// static_assert(sizeof (uintmax_t) == sizeof (unsigned long long),
1854 +// "This library calls __builtin_clzll on uintmax_t, which "
1855 +// "is unsafe on your platform. Please complain to "
1856 +// "http://gcc.gnu.org/bugzilla/");
1857 static constexpr int __shift = __builtin_clzll(__d);
1858 static constexpr int __coshift_ = sizeof(uintmax_t) * 8 - __shift;
1859 static constexpr int __coshift = (__shift != 0) ? __coshift_ : 0;