try to make sure compiler/include/mmakefile is always refreshed correctly.
[AROS.git] / tools / crosstools / gcc-6.3.0-aros.diff
blob84bd50744bd95e828371538984a80436a9751d52
1 diff -ruN gcc-6.3.0/boehm-gc/include/gc_amiga_redirects.h gcc-6.3.0.aros/boehm-gc/include/gc_amiga_redirects.h
2 --- gcc-6.3.0/boehm-gc/include/gc_amiga_redirects.h 2001-08-17 19:30:51.000000000 +0100
3 +++ gcc-6.3.0.aros/boehm-gc/include/gc_amiga_redirects.h 2017-03-31 05:50:59.846860603 +0100
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-6.3.0/boehm-gc/include/gc.h gcc-6.3.0.aros/boehm-gc/include/gc.h
14 --- gcc-6.3.0/boehm-gc/include/gc.h 2014-10-23 09:39:19.000000000 +0100
15 +++ gcc-6.3.0.aros/boehm-gc/include/gc.h 2017-03-31 05:50:59.846860603 +0100
16 @@ -1056,7 +1056,7 @@
17 GC_API void GC_win32_free_heap ();
18 #endif
20 -#if ( defined(_AMIGA) && !defined(GC_AMIGA_MAKINGLIB) )
21 +#if !defined(__AROS__) && ( defined(_AMIGA) && !defined(GC_AMIGA_MAKINGLIB) )
22 /* Allocation really goes through GC_amiga_allocwrapper_do */
23 # include "gc_amiga_redirects.h"
24 #endif
25 diff -ruN gcc-6.3.0/configure gcc-6.3.0.aros/configure
26 --- gcc-6.3.0/configure 2016-03-17 22:54:19.000000000 +0000
27 +++ gcc-6.3.0.aros/configure 2017-03-31 05:50:59.846860603 +0100
28 @@ -3896,6 +3896,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 @@ -4034,6 +4037,8 @@
39 rs6000-*-aix*)
40 host_makefile_frag="config/mh-ppc-aix"
42 + *-*-aros*)
43 + ;;
44 esac
47 diff -ruN gcc-6.3.0/configure.ac gcc-6.3.0.aros/configure.ac
48 --- gcc-6.3.0/configure.ac 2016-03-17 22:54:19.000000000 +0000
49 +++ gcc-6.3.0.aros/configure.ac 2017-03-31 05:50:59.846860603 +0100
50 @@ -1232,6 +1232,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 @@ -1351,6 +1354,8 @@
61 rs6000-*-aix*)
62 host_makefile_frag="config/mh-ppc-aix"
64 + *-*-aros*)
65 + ;;
66 esac
69 diff -ruN gcc-6.3.0/fixincludes/configure gcc-6.3.0.aros/fixincludes/configure
70 --- gcc-6.3.0/fixincludes/configure 2016-12-21 07:53:16.000000000 +0000
71 +++ gcc-6.3.0.aros/fixincludes/configure 2017-03-31 05:50:59.846860603 +0100
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-6.3.0/fixincludes/configure.ac gcc-6.3.0.aros/fixincludes/configure.ac
81 --- gcc-6.3.0/fixincludes/configure.ac 2012-05-29 20:28:57.000000000 +0100
82 +++ gcc-6.3.0.aros/fixincludes/configure.ac 2017-03-31 05:50:59.846860603 +0100
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-6.3.0/gcc/config/aarch64/aros.h gcc-6.3.0.aros/gcc/config/aarch64/aros.h
92 --- gcc-6.3.0/gcc/config/aarch64/aros.h 1970-01-01 01:00:00.000000000 +0100
93 +++ gcc-6.3.0.aros/gcc/config/aarch64/aros.h 2017-03-31 05:50:59.846860603 +0100
94 @@ -0,0 +1,63 @@
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 + builtin_define_std ("AROS"); \
124 + builtin_define ("AMIGA"); \
125 + builtin_define ("_AMIGA"); \
126 + builtin_assert ("system=posix"); \
127 + if (flag_pic) \
128 + { \
129 + builtin_define ("__PIC__"); \
130 + builtin_define ("__pic__"); \
131 + } \
132 + } \
133 + while (false)
135 +/* TARGET_BIG_ENDIAN_DEFAULT is set in
136 + config.gcc for big endian configurations. */
137 +#undef TARGET_LINKER_EMULATION
138 +#if TARGET_BIG_ENDIAN_DEFAULT
139 +#define TARGET_LINKER_EMULATION "aarch64elfb_aros"
140 +#else
141 +#define TARGET_LINKER_EMULATION "aarch64elf_aros"
142 +#endif
144 +#undef SUBTARGET_CPP_SPEC
145 +#define SUBTARGET_CPP_SPEC "-D__ELF__ %{!nostdinc:%{!nostdc:%{!noposixc: -idirafter %R/include/aros/posixc} -idirafter %R/include/aros/stdc}}"
147 +#undef SUBTARGET_EXTRA_LINK_SPEC
148 +#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION
150 +/* Provide a LINK_SPEC appropriate for AROS. */
151 +#undef LINK_SPEC
152 +#define LINK_SPEC "-m aarch64elf_aros -L %R/lib"
154 +/* Use own supplement to libgcc. */
155 +#undef LIBGCC_SPEC
156 +#define LIBGCC_SPEC "-lgcc"
158 diff -ruN gcc-6.3.0/gcc/config/aarch64/t-aros gcc-6.3.0.aros/gcc/config/aarch64/t-aros
159 --- gcc-6.3.0/gcc/config/aarch64/t-aros 1970-01-01 01:00:00.000000000 +0100
160 +++ gcc-6.3.0.aros/gcc/config/aarch64/t-aros 2017-03-31 05:50:59.846860603 +0100
161 @@ -0,0 +1,21 @@
162 +# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
163 +# 2008, 2010 Free Software Foundation, Inc.
165 +# This file is part of GCC.
167 +# GCC is free software; you can redistribute it and/or modify
168 +# it under the terms of the GNU General Public License as published by
169 +# the Free Software Foundation; either version 3, or (at your option)
170 +# any later version.
172 +# GCC is distributed in the hope that it will be useful,
173 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
174 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
175 +# GNU General Public License for more details.
177 +# You should have received a copy of the GNU General Public License
178 +# along with GCC; see the file COPYING3. If not see
179 +# <http://www.gnu.org/licenses/>.
183 diff -ruN gcc-6.3.0/gcc/config/arm/aros.h gcc-6.3.0.aros/gcc/config/arm/aros.h
184 --- gcc-6.3.0/gcc/config/arm/aros.h 1970-01-01 01:00:00.000000000 +0100
185 +++ gcc-6.3.0.aros/gcc/config/arm/aros.h 2017-03-31 05:50:59.846860603 +0100
186 @@ -0,0 +1,82 @@
187 +/* Configuration file for ARM AROS EABI targets.
188 + Copyright (C) 2004, 2005, 2006, 2007, 2010
189 + Free Software Foundation, Inc.
190 + Contributed by Pavel Fedin
191 + Based on linux-eabi.h and other AROS targets
193 + This file is part of GCC.
195 + GCC is free software; you can redistribute it and/or modify it
196 + under the terms of the GNU General Public License as published
197 + by the Free Software Foundation; either version 3, or (at your
198 + option) any later version.
200 + GCC is distributed in the hope that it will be useful, but WITHOUT
201 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
202 + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
203 + License for more details.
205 + You should have received a copy of the GNU General Public License
206 + along with GCC; see the file COPYING3. If not see
207 + <http://www.gnu.org/licenses/>. */
209 +/* On EABI GNU/Linux, we want both the BPABI builtins and the
210 + GNU/Linux builtins. */
211 +#undef TARGET_OS_CPP_BUILTINS
212 +#define TARGET_OS_CPP_BUILTINS() \
213 + do \
214 + { \
215 + TARGET_BPABI_CPP_BUILTINS(); \
216 + builtin_define_std ("AROS"); \
217 + builtin_define ("AMIGA"); \
218 + builtin_define ("_AMIGA"); \
219 + builtin_assert ("system=posix"); \
220 + if (flag_pic) \
221 + { \
222 + builtin_define ("__PIC__"); \
223 + builtin_define ("__pic__"); \
224 + } \
225 + } \
226 + while (false)
228 +/* We default to a softfp ABI so that we are compatible
229 + with the Linux EABI (as used by the linker). */
230 +#undef TARGET_DEFAULT_FLOAT_ABI
231 +#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFTFP
233 +/* We default to the "aapcs-linux" ABI so that enums are int-sized by
234 + default. */
235 +#undef ARM_DEFAULT_ABI
236 +#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX
238 +/* Default to armv5t so that thumb shared libraries work.
239 + The ARM10TDMI core is the default for armv5t, so set
240 + SUBTARGET_CPU_DEFAULT to achieve this. */
241 +#undef SUBTARGET_CPU_DEFAULT
242 +#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
244 +/* TARGET_BIG_ENDIAN_DEFAULT is set in
245 + config.gcc for big endian configurations. */
246 +#undef TARGET_LINKER_EMULATION
247 +#if TARGET_BIG_ENDIAN_DEFAULT
248 +#define TARGET_LINKER_EMULATION "armelfb_aros"
249 +#else
250 +#define TARGET_LINKER_EMULATION "armelf_aros"
251 +#endif
253 +#undef SUBTARGET_CPP_SPEC
254 +#define SUBTARGET_CPP_SPEC "-D__ELF__ %{!nostdinc:%{!nostdc:%{!noposixc: -idirafter %R/include/aros/posixc} -idirafter %R/include/aros/stdc}}"
256 +#undef SUBTARGET_EXTRA_LINK_SPEC
257 +#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION
259 +/* Provide a LINK_SPEC appropriate for AROS. */
260 +#undef LINK_SPEC
261 +#define LINK_SPEC "-m armelf_aros -L %R/lib"
263 +/* Use own supplement to libgcc. */
264 +#undef LIBGCC_SPEC
265 +#define LIBGCC_SPEC "-laeabi -lgcc"
267 +/* FIXME: AROS doesn't support dw2 unwinding yet. */
268 +#undef MD_FALLBACK_FRAME_STATE_FOR
269 diff -ruN gcc-6.3.0/gcc/config/arm/t-aros gcc-6.3.0.aros/gcc/config/arm/t-aros
270 --- gcc-6.3.0/gcc/config/arm/t-aros 1970-01-01 01:00:00.000000000 +0100
271 +++ gcc-6.3.0.aros/gcc/config/arm/t-aros 2017-03-31 05:50:59.846860603 +0100
272 @@ -0,0 +1,22 @@
273 +# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
274 +# 2008, 2010 Free Software Foundation, Inc.
276 +# This file is part of GCC.
278 +# GCC is free software; you can redistribute it and/or modify
279 +# it under the terms of the GNU General Public License as published by
280 +# the Free Software Foundation; either version 3, or (at your option)
281 +# any later version.
283 +# GCC is distributed in the hope that it will be useful,
284 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
285 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
286 +# GNU General Public License for more details.
288 +# You should have received a copy of the GNU General Public License
289 +# along with GCC; see the file COPYING3. If not see
290 +# <http://www.gnu.org/licenses/>.
292 +MULTILIB_OPTIONS = marm mfloat-abi=hard/mfloat-abi=soft march=armv6/march=armv7-a
293 +MULTILIB_DIRNAMES = arm fpu soft armv6 armv7-a
295 diff -ruN gcc-6.3.0/gcc/config/aros.h gcc-6.3.0.aros/gcc/config/aros.h
296 --- gcc-6.3.0/gcc/config/aros.h 1970-01-01 01:00:00.000000000 +0100
297 +++ gcc-6.3.0.aros/gcc/config/aros.h 2017-03-31 15:07:05.144741206 +0100
298 @@ -0,0 +1,115 @@
299 +/* Definitions for AROS
300 + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
301 + Contributed by Fabio Alemagna
302 + Based upon linux.h, contributed by Eric Youngdale.
304 +This file is part of GNU CC.
306 +GNU CC is free software; you can redistribute it and/or modify
307 +it under the terms of the GNU General Public License as published by
308 +the Free Software Foundation; either version 2, or (at your option)
309 +any later version.
311 +GNU CC is distributed in the hope that it will be useful,
312 +but WITHOUT ANY WARRANTY; without even the implied warranty of
313 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
314 +GNU General Public License for more details.
316 +You should have received a copy of the GNU General Public License
317 +along with GNU CC; see the file COPYING. If not, write to
318 +the Free Software Foundation, 59 Temple Place - Suite 330,
319 +Boston, MA 02111-1307, USA. */
321 +/* Don't assume anything about the header files. */
322 +#define NO_IMPLICIT_EXTERN_C
324 +#undef SIZE_TYPE
325 +#define SIZE_TYPE "long unsigned int"
327 +#undef WCHAR_TYPE
328 +#define WCHAR_TYPE "char"
330 +#undef WCHAR_TYPE_SIZE
331 +#define WCHAR_TYPE_SIZE 8
333 +#undef PTRDIFF_TYPE
334 +#define PTRDIFF_TYPE "long int"
336 +#undef TARGET_OS_CPP_BUILTINS
337 +#define TARGET_OS_CPP_BUILTINS() \
338 + do \
339 + { \
340 + builtin_define_std ("AROS"); \
341 + builtin_define ("AMIGA"); \
342 + builtin_define ("_AMIGA"); \
343 + builtin_define ("__ELF__"); \
344 + builtin_assert ("system=posix"); \
345 + } \
346 + while (0)
348 +#undef ASM_APP_ON
349 +#define ASM_APP_ON "#APP\n"
351 +#undef ASM_APP_OFF
352 +#define ASM_APP_OFF "#NO_APP\n"
354 +#undef MD_EXEC_PREFIX
355 +#undef MD_STARTFILE_PREFIX
357 +/* Provide a STARTFILE_SPEC appropriate for AROS. AROS has its own
358 + set of startup files which also take care of handling C++
359 + constructors/destructors. */
361 +#undef STARTFILE_SPEC
362 +#define STARTFILE_SPEC \
363 + "startup.o%s %{detach:detach.o%s} %{nix:nixmain.o%s}"
365 +/* Provide a ENDFILE_SPEC appropriate for AROS. */
367 +#undef ENDFILE_SPEC
368 +#define ENDFILE_SPEC \
369 + "-lautoinit"
371 +/* The compiler is configured with ONLY the gcc/g++ standard headers.
372 + N.B-: NATIVE_SYSTEM_HEADER_DIR must come after GCC_INCLUDE_DIR with gcc6!! */
373 +#undef INCLUDE_DEFAULTS
374 +#define INCLUDE_DEFAULTS \
375 +{ \
376 + { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
377 + { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
378 + { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
379 + { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \
380 + { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 }, \
381 + { 0, 0, 0, 0, 0, 0 } \
384 +#undef CPP_SPEC
385 +#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT} %{nix:-D__NIX__} %{!nostdinc:%{!nostdc:%{!noposixc:-idirafter %R/include/aros/posixc} -idirafter %R/include/aros/stdc}}"
387 +/* This is for -profile to use -lc_p instead of -lc. */
388 +#ifndef CC1_SPEC
389 +#define CC1_SPEC "%{profile:-p}"
390 +#endif
392 +/* The GNU C++ standard library requires that these macros be defined. */
393 +#undef CPLUSPLUS_CPP_SPEC
394 +#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
396 +#undef LIB_SPEC
397 +#define LIB_SPEC \
398 + "--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"
400 +#undef LIBSTDCXX_STATIC
401 +#define LIBSTDCXX_STATIC "pthread"
403 +#if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR)
404 +#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
405 +#endif
407 +/* AROS uses its own collect-like program for the moment. */
408 +#undef LINKER_NAME
409 +#define LINKER_NAME "collect-aros"
411 +#define TARGET_HAS_F_SETLKW
413 +#define TARGET_POSIX_IO
414 diff -ruN gcc-6.3.0/gcc/config/aros.opt gcc-6.3.0.aros/gcc/config/aros.opt
415 --- gcc-6.3.0/gcc/config/aros.opt 1970-01-01 01:00:00.000000000 +0100
416 +++ gcc-6.3.0.aros/gcc/config/aros.opt 2017-03-31 05:50:59.846860603 +0100
417 @@ -0,0 +1,35 @@
418 +; Processor-independent options for AROS.
420 +; Copyright (C) 2015 Free Software Foundation, Inc.
422 +; This file is part of GCC.
424 +; GCC is free software; you can redistribute it and/or modify it under
425 +; the terms of the GNU General Public License as published by the Free
426 +; Software Foundation; either version 3, or (at your option) any later
427 +; version.
429 +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
430 +; WARRANTY; without even the implied warranty of MERCHANTABILITY or
431 +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
432 +; for more details.
434 +; You should have received a copy of the GNU General Public License
435 +; along with GCC; see the file COPYING3. If not see
436 +; <http://www.gnu.org/licenses/>.
438 +posix
439 +Driver
441 +noposixc
442 +Driver
444 +nostdc
445 +Driver
447 +nosysbase
448 +Driver
450 +nix
451 +Driver
453 diff -ruN gcc-6.3.0/gcc/config/i386/aros64.h gcc-6.3.0.aros/gcc/config/i386/aros64.h
454 --- gcc-6.3.0/gcc/config/i386/aros64.h 1970-01-01 01:00:00.000000000 +0100
455 +++ gcc-6.3.0.aros/gcc/config/i386/aros64.h 2017-03-31 05:50:59.846860603 +0100
456 @@ -0,0 +1,34 @@
457 +/* Definitions for AMD x86_64 running AROS systems with ELF64 format.
458 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002
459 + Free Software Foundation, Inc.
460 + Contributed by Stanislaw Szymczyk <sszymczy@gmail.com>. Based on aros.h.
462 +This file is part of GNU CC.
464 +GNU CC is free software; you can redistribute it and/or modify
465 +it under the terms of the GNU General Public License as published by
466 +the Free Software Foundation; either version 2, or (at your option)
467 +any later version.
469 +GNU CC is distributed in the hope that it will be useful,
470 +but WITHOUT ANY WARRANTY; without even the implied warranty of
471 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
472 +GNU General Public License for more details.
474 +You should have received a copy of the GNU General Public License
475 +along with GNU CC; see the file COPYING. If not, write to
476 +the Free Software Foundation, 59 Temple Place - Suite 330,
477 +Boston, MA 02111-1307, USA. */
479 +/* The svr4 ABI for the i386 says that records and unions are returned
480 + in memory. In the 64bit compilation we will turn this flag off in
481 + override_options, as we never do pcc_struct_return scheme on this target. */
482 +#undef DEFAULT_PCC_STRUCT_RETURN
483 +#define DEFAULT_PCC_STRUCT_RETURN 1
485 +/* Provide a LINK_SPEC appropriate for AROS. */
487 +#undef LINK_SPEC
488 +#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} -L %R/lib"
490 +/* FIXME: AROS doesn't support dw2 unwinding yet. */
491 diff -ruN gcc-6.3.0/gcc/config/i386/aros.h gcc-6.3.0.aros/gcc/config/i386/aros.h
492 --- gcc-6.3.0/gcc/config/i386/aros.h 1970-01-01 01:00:00.000000000 +0100
493 +++ gcc-6.3.0.aros/gcc/config/i386/aros.h 2017-03-31 05:50:59.846860603 +0100
494 @@ -0,0 +1,25 @@
495 +/* Definitions for Intel 386 running AROS systems with ELF format.
496 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002
497 + Free Software Foundation, Inc.
498 + Contributed by Fabio Alemagna.
499 + Based upon i386/linux.h by Eric Youngdale.
501 +This file is part of GNU CC.
503 +GNU CC is free software; you can redistribute it and/or modify
504 +it under the terms of the GNU General Public License as published by
505 +the Free Software Foundation; either version 2, or (at your option)
506 +any later version.
508 +GNU CC is distributed in the hope that it will be useful,
509 +but WITHOUT ANY WARRANTY; without even the implied warranty of
510 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
511 +GNU General Public License for more details.
513 +You should have received a copy of the GNU General Public License
514 +along with GNU CC; see the file COPYING. If not, write to
515 +the Free Software Foundation, 59 Temple Place - Suite 330,
516 +Boston, MA 02111-1307, USA. */
518 +#undef LINK_SPEC
519 +#define LINK_SPEC "-m elf_i386 -L%R/lib"
520 diff -ruN gcc-6.3.0/gcc/config/m68k/m68k.c gcc-6.3.0.aros/gcc/config/m68k/m68k.c
521 --- gcc-6.3.0/gcc/config/m68k/m68k.c 2016-01-04 14:30:50.000000000 +0000
522 +++ gcc-6.3.0.aros/gcc/config/m68k/m68k.c 2017-03-31 05:50:59.846860603 +0100
523 @@ -4452,7 +4452,7 @@
524 else if (letter == '/')
525 asm_fprintf (file, "%R");
526 else if (letter == '?')
527 - asm_fprintf (file, m68k_library_id_string);
528 + asm_fprintf (file, "%s", m68k_library_id_string);
529 else if (letter == 'p')
531 output_addr_const (file, op);
532 diff -ruN gcc-6.3.0/gcc/config/m68k/m68k.h gcc-6.3.0.aros/gcc/config/m68k/m68k.h
533 --- gcc-6.3.0/gcc/config/m68k/m68k.h 2016-01-04 14:30:50.000000000 +0000
534 +++ gcc-6.3.0.aros/gcc/config/m68k/m68k.h 2017-03-31 05:50:59.846860603 +0100
535 @@ -330,7 +330,9 @@
536 register elimination. */
537 #define FIRST_PSEUDO_REGISTER 25
539 -/* All m68k targets (except AmigaOS) use %a5 as the PIC register */
540 +/* All m68k targets (except AmigaOS) use %a5 as the PIC register.
541 + * On AmigaOS, we use %a4
542 + */
543 #define PIC_OFFSET_TABLE_REGNUM \
544 (!flag_pic ? INVALID_REGNUM \
545 : reload_completed ? REGNO (pic_offset_table_rtx) \
546 @@ -420,7 +422,8 @@
547 /* Most m68k targets use %a6 as a frame pointer. The AmigaOS
548 ABI uses %a6 for shared library calls, therefore the frame
549 pointer is shifted to %a5 on this target. */
550 -#define FRAME_POINTER_REGNUM A6_REG
551 +#define FRAME_POINTER_REGNUM A5_REG
552 +#define PIC_REG A4_REG
554 /* Base register for access to arguments of the function.
555 * This isn't a hardware register. It will be eliminated to the
556 diff -ruN gcc-6.3.0/gcc/config/m68k/m68k.md gcc-6.3.0.aros/gcc/config/m68k/m68k.md
557 --- gcc-6.3.0/gcc/config/m68k/m68k.md 2016-02-22 14:22:07.000000000 +0000
558 +++ gcc-6.3.0.aros/gcc/config/m68k/m68k.md 2017-03-31 05:50:59.846860603 +0100
559 @@ -133,7 +133,8 @@
560 [(D0_REG 0)
561 (A0_REG 8)
562 (A1_REG 9)
563 - (PIC_REG 13)
564 + (A4_REG 12)
565 + (A5_REG 13)
566 (A6_REG 14)
567 (SP_REG 15)
568 (FP0_REG 16)
569 @@ -7089,7 +7090,7 @@
571 if (TARGET_ID_SHARED_LIBRARY)
573 - operands[1] = gen_rtx_REG (Pmode, PIC_REG);
574 + operands[1] = gen_rtx_REG (Pmode, A4_REG);
575 return MOTOROLA ? "move.l %?(%1),%0" : "movel %1@(%?), %0";
577 else if (MOTOROLA)
578 diff -ruN gcc-6.3.0/gcc/config/m68k/t-aros gcc-6.3.0.aros/gcc/config/m68k/t-aros
579 --- gcc-6.3.0/gcc/config/m68k/t-aros 1970-01-01 01:00:00.000000000 +0100
580 +++ gcc-6.3.0.aros/gcc/config/m68k/t-aros 2017-03-31 05:50:59.846860603 +0100
581 @@ -0,0 +1,2 @@
582 +# Custom multilibs for AROS
583 +M68K_MLIB_CPU += && match(MLIB, "^68")
584 diff -ruN gcc-6.3.0/gcc/config/rs6000/aros.h gcc-6.3.0.aros/gcc/config/rs6000/aros.h
585 --- gcc-6.3.0/gcc/config/rs6000/aros.h 1970-01-01 01:00:00.000000000 +0100
586 +++ gcc-6.3.0.aros/gcc/config/rs6000/aros.h 2017-03-31 05:50:59.846860603 +0100
587 @@ -0,0 +1,151 @@
588 +/* Definitions for Powerpc running AROS systems with ELF format.
589 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002
590 + Free Software Foundation, Inc.
591 + Contributed by Markus Weiss.
592 + Based upon i386/aros.h by Fabio Alemagna.
594 +This file is part of GNU CC.
596 +GNU CC is free software; you can redistribute it and/or modify
597 +it under the terms of the GNU General Public License as published by
598 +the Free Software Foundation; either version 2, or (at your option)
599 +any later version.
601 +GNU CC is distributed in the hope that it will be useful,
602 +but WITHOUT ANY WARRANTY; without even the implied warranty of
603 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
604 +GNU General Public License for more details.
606 +You should have received a copy of the GNU General Public License
607 +along with GNU CC; see the file COPYING. If not, write to
608 +the Free Software Foundation, 59 Temple Place - Suite 330,
609 +Boston, MA 02111-1307, USA. */
611 +/* Symbols missing in comparison to i386/aros.h are either
612 + defined in elfos.h, rs6000/rs6000.h rs6000/sysv4.h
613 + or not needed for PowerPC.
616 +/* We need to define __powerpc__. */
618 +#undef TARGET_OS_CPP_BUILTINS
619 +#define TARGET_OS_CPP_BUILTINS() \
620 + do \
621 + { \
622 + builtin_define_std ("AROS"); \
623 + builtin_define ("AMIGA"); \
624 + builtin_define ("_AMIGA"); \
625 + builtin_define ("__powerpc__"); \
626 + builtin_define ("__ELF__"); \
627 + builtin_assert ("system=posix"); \
628 + if (flag_pic) \
629 + { \
630 + builtin_define ("__PIC__"); \
631 + builtin_define ("__pic__"); \
632 + } \
633 + } \
634 + while (0)
636 +/* This one taken from linux.h. */
637 +/* We are 32-bit all the time, so optimize a little. */
638 +#undef TARGET_64BIT
639 +#define TARGET_64BIT 0
641 +/* The svr4 ABI for the i386 says that records and unions are returned
642 + in memory. */
643 +/*#undef DEFAULT_PCC_STRUCT_RETURN
644 +#define DEFAULT_PCC_STRUCT_RETURN 1
645 +see rs6000/rs6000.h
649 +#undef ASM_COMMENT_START
650 +#define ASM_COMMENT_START "#"
651 +see rs6000/rs6000.h
655 +#undef DBX_REGISTER_NUMBER
656 +#define DBX_REGISTER_NUMBER(n) \
657 + (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
658 +see rs6000/sysv4.h
661 +/* Output assembler code to FILE to call the profiler.
662 + To the best of my knowledge, no Linux libc has required the label
663 + argument to mcount. */
666 +#define NO_PROFILE_COUNTERS 1
667 +not used by other similar ppc compilers
668 +only in darwin.h rs6000/linux64.h rs6000/rs6000.c
672 +#undef MCOUNT_NAME
673 +#define MCOUNT_NAME "mcount"
674 +see rs6000/sysv4.h RS6000_MCOUNT
677 +/* The GLIBC version of mcount for the x86 assumes that there is a
678 + frame, so we cannot allow profiling without a frame pointer. */
680 +#undef SUBTARGET_FRAME_POINTER_REQUIRED
681 +#define SUBTARGET_FRAME_POINTER_REQUIRED crtl->profile
682 +seems to be handled by rs6000/rs6000.h
685 +#undef CC1_SPEC
686 +#define CC1_SPEC "%(cc1_cpu) %{profile:-p}"
688 +/* Provide a LINK_SPEC appropriate for AROS. */
690 +#undef LINK_SPEC
691 +#define LINK_SPEC "-m elf32ppc -L %R/lib"
693 +/* A C statement (sans semicolon) to output to the stdio stream
694 + FILE the assembler definition of uninitialized global DECL named
695 + NAME whose size is SIZE bytes and alignment is ALIGN bytes.
696 + Try to use asm_output_aligned_bss to implement this macro. */
698 +#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
699 + asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
700 +see rs6000/sysv4.h
703 +/* A C statement to output to the stdio stream FILE an assembler
704 + command to advance the location counter to a multiple of 1<<LOG
705 + bytes if it is within MAX_SKIP bytes.
707 + This is used to align code labels according to Intel recommendations. */
709 +#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
710 +#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
711 + do { \
712 + if ((LOG) != 0) { \
713 + if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
714 + else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
715 + } \
716 + } while (0)
717 +#endif
718 +see rs6000/sysv4.h
721 +/* Handle special EH pointer encodings. Absolute, pc-relative, and
722 + indirect are handled automatically. */
724 +#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
725 + do { \
726 + if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel) \
727 + { \
728 + fputs (ASM_LONG, FILE); \
729 + assemble_name (FILE, XSTR (ADDR, 0)); \
730 + fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
731 + goto DONE; \
732 + } \
733 + } while (0)
734 +not used for PowerPC
737 +/* FIXME: AROS doesn't support dw2 unwinding yet. */
738 +#undef MD_FALLBACK_FRAME_STATE_FOR
739 diff -ruN gcc-6.3.0/gcc/config/rs6000/rs6000.c gcc-6.3.0.aros/gcc/config/rs6000/rs6000.c
740 --- gcc-6.3.0/gcc/config/rs6000/rs6000.c 2016-12-13 23:56:17.000000000 +0000
741 +++ gcc-6.3.0.aros/gcc/config/rs6000/rs6000.c 2017-03-31 05:50:59.846860603 +0100
742 @@ -1446,6 +1446,8 @@
743 false },
744 { "shortcall", 0, 0, false, true, true, rs6000_handle_longcall_attribute,
745 false },
746 + { "stackparm", 0, 0, false, true, true, rs6000_handle_longcall_attribute,
747 + false },
748 { "ms_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute,
749 false },
750 { "gcc_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute,
751 @@ -10378,6 +10380,9 @@
752 && !lookup_attribute ("shortcall", TYPE_ATTRIBUTES (fntype))))
753 cum->call_cookie |= CALL_LONG;
755 + cum->stackparm = fntype && lookup_attribute("stackparm",
756 + TYPE_ATTRIBUTES(fntype));
758 if (TARGET_DEBUG_ARG)
760 fprintf (stderr, "\ninit_cumulative_args:");
761 @@ -11550,6 +11555,9 @@
763 rs6000_discover_homogeneous_aggregate (mode, type, &elt_mode, &n_elts);
765 + if (cum->stackparm)
766 + return NULL_RTX;
768 if (TARGET_MACHO && rs6000_darwin64_struct_check_p (mode, type))
770 rtx rslt = rs6000_darwin64_record_arg (cum, type, named, /*retval= */false);
771 @@ -12154,6 +12162,9 @@
772 int first_reg_offset;
773 alias_set_type set;
775 + if (cum->stackparm)
776 + return;
778 /* Skip the last named argument. */
779 next_cum = *get_cumulative_args (cum);
780 rs6000_function_arg_advance_1 (&next_cum, mode, type, true, 0);
781 diff -ruN gcc-6.3.0/gcc/config/rs6000/rs6000.h gcc-6.3.0.aros/gcc/config/rs6000/rs6000.h
782 --- gcc-6.3.0/gcc/config/rs6000/rs6000.h 2016-07-07 20:42:07.000000000 +0100
783 +++ gcc-6.3.0.aros/gcc/config/rs6000/rs6000.h 2017-03-31 05:50:59.846860603 +0100
784 @@ -1876,6 +1876,7 @@
785 int nargs_prototype; /* # args left in the current prototype */
786 int prototype; /* Whether a prototype was defined */
787 int stdarg; /* Whether function is a stdarg function. */
788 + int stackparm; /* Whether function has all args on the stack */
789 int call_cookie; /* Do special things for this call */
790 int sysv_gregno; /* next available GP register */
791 int intoffset; /* running offset in struct (darwin64) */
792 diff -ruN gcc-6.3.0/gcc/config/t-aros gcc-6.3.0.aros/gcc/config/t-aros
793 --- gcc-6.3.0/gcc/config/t-aros 1970-01-01 01:00:00.000000000 +0100
794 +++ gcc-6.3.0.aros/gcc/config/t-aros 2017-03-31 05:50:59.846860603 +0100
795 @@ -0,0 +1,29 @@
796 +# In AROS, "/usr" is a four-letter word.
797 +# Must match NATIVE_SYSTEM_HEADER_COMPONENT in aros.h !
798 +NATIVE_SYSTEM_HEADER_DIR = /include
800 +# Don't add AROS target include path when compiling host compiler
801 +CPPFLAGS =
803 +# Copy AROS specific include replacement files
804 +LIBGCC_DEPS += stmp-aros-hrds
806 +EXTRA_AROS_HEADERS = aros/types/size_t.h aros/types/ptrdiff_t.h \
807 + aros/types/wchar_t.h aros/types/wint_t.h aros/types/null.h
809 +stmp-int-hdrs : | include/aros/types
811 +include/aros/types : $(addprefix $(srcdir)/ginclude/,$(EXTRA_AROS_HEADERS))
812 + -if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi
813 + -if [ -d include/aros/types ] ; \
814 + then true; \
815 + else \
816 + mkdir include/aros; chmod a+rx include/aros; \
817 + mkdir include/aros/types; chmod a+rx include/aros/types; \
818 + fi
819 + for file in $(EXTRA_AROS_HEADERS); do \
820 + $(STAMP) include/$$file; \
821 + rm -fr include/$$file; \
822 + cp $(srcdir)/ginclude/$$file include/$$file; \
823 + chmod a+r include/$$file; \
824 + done
825 diff -ruN gcc-6.3.0/gcc/config.build gcc-6.3.0.aros/gcc/config.build
826 --- gcc-6.3.0/gcc/config.build 2016-01-04 14:30:50.000000000 +0000
827 +++ gcc-6.3.0.aros/gcc/config.build 2017-03-31 05:50:59.846860603 +0100
828 @@ -73,6 +73,9 @@
829 build_xm_file=i386/xm-djgpp.h
830 build_exeext=.exe
832 + *-*-aros*)
833 + build_xm_file=xm-aros.h
834 + ;;
835 *-*-sysv*)
836 # All other System V variants.
837 build_install_headers_dir=install-headers-cpio
838 diff -ruN gcc-6.3.0/gcc/config.gcc gcc-6.3.0.aros/gcc/config.gcc
839 --- gcc-6.3.0/gcc/config.gcc 2016-11-07 21:38:43.000000000 +0000
840 +++ gcc-6.3.0.aros/gcc/config.gcc 2017-03-31 05:50:59.846860603 +0100
841 @@ -798,6 +798,15 @@
843 esac
845 +*-*-aros*)
846 + gas=yes
847 + gnu_ld=yes
848 + thread_file=posix
849 + use_collect2=no
850 + xm_defines='STDC_HEADERS=1'
851 + extra_options="${extra_options} aros.opt"
852 + ;;
854 *-*-openbsd*)
855 tmake_file="t-openbsd"
856 case ${enable_threads} in
857 @@ -912,6 +921,11 @@
858 esac
860 case ${target} in
861 +aarch64*-*-aros*)
862 + tm_file="${tm_file} dbxelf.h elfos.h aarch64/aarch64-elf.h aros.h aarch64/aros.h"
863 + tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aros t-aros"
864 + xm_file="xm-aros.h"
865 + ;;
866 aarch64*-*-elf | aarch64*-*-rtems*)
867 tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h"
868 tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-elf-raw.h"
869 @@ -998,6 +1012,16 @@
870 tm_file="${tm_file} vms/vms.h alpha/vms.h"
871 tmake_file="${tmake_file} alpha/t-vms"
873 +arm*-*-aros*)
874 + tm_file="dbxelf.h elfos.h arm/elf.h arm/bpabi.h aros.h arm/aros.h arm/aout.h arm/arm.h"
875 + tm_file="$tm_file ../../libgcc/config/arm/bpabi-lib.h"
876 + tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-arm-softfp arm/t-bpabi arm/t-aros t-aros"
877 + xm_file="xm-aros.h"
878 + # The BPABI long long divmod functions return a 128-bit value in
879 + # registers r0-r3. Correctly modeling that requires the use of
880 + # TImode.
881 + need_64bit_hwint=yes
882 + ;;
883 arc*-*-elf*)
884 extra_headers="arc-simd.h"
885 tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
886 @@ -1603,6 +1627,16 @@
887 done
888 TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
890 +i[34567]86-*-aros*)
891 + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h aros.h i386/aros.h"
892 + xm_file=xm-aros.h
893 + tmake_file="${tmake_file} i386/t-i386elf t-aros"
894 + ;;
895 +x86_64-*-aros*)
896 + 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"
897 + tmake_file="${tmake_file} i386/t-i386elf t-aros"
898 + xm_file=xm-aros.h
899 + ;;
900 i[34567]86-pc-msdosdjgpp*)
901 xm_file=i386/xm-djgpp.h
902 tm_file="dbxcoff.h ${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h i386/djgpp-stdint.h"
903 @@ -1900,6 +1934,16 @@
904 thread_file='posix'
907 +m68k-*-aros*)
908 + default_m68k_cpu=68000
909 + default_cf_cpu=5206
910 + 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"
911 + tm_file="${tm_file} aros.h"
912 + tm_defines="${tm_defines} MOTOROLA=1"
913 + tmake_file="m68k/t-floatlib m68k/t-m68kbare m68k/t-m68kelf"
914 + tmake_file="$tmake_file m68k/t-aros m68k/t-mlibs t-aros"
915 + extra_parts="crtbegin.o crtend.o"
916 + ;;
917 m68k-*-elf* | fido-*-elf*)
918 case ${target} in
919 fido-*-elf*)
920 @@ -2400,6 +2444,13 @@
921 extra_options="${extra_options} rs6000/sysv4.opt"
922 tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems rs6000/t-ppccomm"
924 +powerpc-*-aros*)
925 + tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h aros.h"
926 + extra_options="${extra_options} rs6000/sysv4.opt"
927 + tm_file="${tm_file} rs6000/aros.h"
928 + xm_file=xm-aros.h
929 + tmake_file="$tmake_file t-aros"
930 + ;;
931 powerpc*-*-linux*)
932 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h"
933 extra_options="${extra_options} rs6000/sysv4.opt"
934 diff -ruN gcc-6.3.0/gcc/config.host gcc-6.3.0.aros/gcc/config.host
935 --- gcc-6.3.0/gcc/config.host 2016-01-04 14:30:50.000000000 +0000
936 +++ gcc-6.3.0.aros/gcc/config.host 2017-03-31 05:50:59.846860603 +0100
937 @@ -281,6 +281,10 @@
938 out_host_hook_obj=host-hpux.o
939 host_xmake_file="${host_xmake_file} x-hpux"
941 + *-*-aros*)
942 + host_can_use_collect2=no
943 + host_xm_file=xm-aros.h
944 + ;;
945 *-*-*vms*)
946 host_xm_file="vms/xm-vms.h"
947 host_xmake_file=vms/x-vms
948 diff -ruN gcc-6.3.0/gcc/ginclude/aros/types/null.h gcc-6.3.0.aros/gcc/ginclude/aros/types/null.h
949 --- gcc-6.3.0/gcc/ginclude/aros/types/null.h 1970-01-01 01:00:00.000000000 +0100
950 +++ gcc-6.3.0.aros/gcc/ginclude/aros/types/null.h 2017-03-31 05:50:59.846860603 +0100
951 @@ -0,0 +1,3 @@
952 +/* Replace AROS' NULL definition with gcc's one */
953 +#define __need_NULL
954 +#include <stddef.h>
955 diff -ruN gcc-6.3.0/gcc/ginclude/aros/types/ptrdiff_t.h gcc-6.3.0.aros/gcc/ginclude/aros/types/ptrdiff_t.h
956 --- gcc-6.3.0/gcc/ginclude/aros/types/ptrdiff_t.h 1970-01-01 01:00:00.000000000 +0100
957 +++ gcc-6.3.0.aros/gcc/ginclude/aros/types/ptrdiff_t.h 2017-03-31 05:50:59.846860603 +0100
958 @@ -0,0 +1,3 @@
959 +/* Replace AROS' ptrdiff_t definition with gcc's one */
960 +#define __need_ptrdiff_t
961 +#include <stddef.h>
962 diff -ruN gcc-6.3.0/gcc/ginclude/aros/types/size_t.h gcc-6.3.0.aros/gcc/ginclude/aros/types/size_t.h
963 --- gcc-6.3.0/gcc/ginclude/aros/types/size_t.h 1970-01-01 01:00:00.000000000 +0100
964 +++ gcc-6.3.0.aros/gcc/ginclude/aros/types/size_t.h 2017-03-31 05:50:59.846860603 +0100
965 @@ -0,0 +1,3 @@
966 +/* Replace AROS' size_t definition with gcc's one */
967 +#define __need_size_t
968 +#include <stddef.h>
969 diff -ruN gcc-6.3.0/gcc/ginclude/aros/types/wchar_t.h gcc-6.3.0.aros/gcc/ginclude/aros/types/wchar_t.h
970 --- gcc-6.3.0/gcc/ginclude/aros/types/wchar_t.h 1970-01-01 01:00:00.000000000 +0100
971 +++ gcc-6.3.0.aros/gcc/ginclude/aros/types/wchar_t.h 2017-03-31 05:50:59.846860603 +0100
972 @@ -0,0 +1,3 @@
973 +/* Replace AROS' wchar_t definition with gcc's one */
974 +#define __need_wchar_t
975 +#include <stddef.h>
976 diff -ruN gcc-6.3.0/gcc/ginclude/aros/types/wint_t.h gcc-6.3.0.aros/gcc/ginclude/aros/types/wint_t.h
977 --- gcc-6.3.0/gcc/ginclude/aros/types/wint_t.h 1970-01-01 01:00:00.000000000 +0100
978 +++ gcc-6.3.0.aros/gcc/ginclude/aros/types/wint_t.h 2017-03-31 05:50:59.846860603 +0100
979 @@ -0,0 +1,3 @@
980 +/* Replace AROS' wint_t definition with gcc's one */
981 +#define __need_wint_t
982 +#include <stddef.h>
983 diff -ruN gcc-6.3.0/gcc/ginclude/stddef.h gcc-6.3.0.aros/gcc/ginclude/stddef.h
984 --- gcc-6.3.0/gcc/ginclude/stddef.h 2016-01-04 14:30:50.000000000 +0000
985 +++ gcc-6.3.0.aros/gcc/ginclude/stddef.h 2017-03-31 05:50:59.846860603 +0100
986 @@ -131,6 +131,7 @@
987 #ifndef __PTRDIFF_T
988 #ifndef _PTRDIFF_T_
989 #ifndef _BSD_PTRDIFF_T_
990 +#ifndef _AROS_TYPES_PTRDIFF_T_H
991 #ifndef ___int_ptrdiff_t_h
992 #ifndef _GCC_PTRDIFF_T
993 #ifndef _PTRDIFF_T_DECLARED /* DragonFly */
994 @@ -140,6 +141,7 @@
995 #define __PTRDIFF_T
996 #define _PTRDIFF_T_
997 #define _BSD_PTRDIFF_T_
998 +#define _AROS_TYPES_PTRDIFF_T_H
999 #define ___int_ptrdiff_t_h
1000 #define _GCC_PTRDIFF_T
1001 #define _PTRDIFF_T_DECLARED
1002 @@ -150,6 +152,7 @@
1003 #endif /* _PTRDIFF_T_DECLARED */
1004 #endif /* _GCC_PTRDIFF_T */
1005 #endif /* ___int_ptrdiff_t_h */
1006 +#endif /* _AROS_TYPES_PTRDIFF_T_H */
1007 #endif /* _BSD_PTRDIFF_T_ */
1008 #endif /* _PTRDIFF_T_ */
1009 #endif /* __PTRDIFF_T */
1010 @@ -176,6 +179,7 @@
1011 #ifndef __SIZE_T
1012 #ifndef _SIZE_T_
1013 #ifndef _BSD_SIZE_T_
1014 +#ifndef _AROS_TYPES_SIZE_T_H
1015 #ifndef _SIZE_T_DEFINED_
1016 #ifndef _SIZE_T_DEFINED
1017 #ifndef _BSD_SIZE_T_DEFINED_ /* Darwin */
1018 @@ -193,6 +197,7 @@
1019 #define __SIZE_T
1020 #define _SIZE_T_
1021 #define _BSD_SIZE_T_
1022 +#define _AROS_TYPES_SIZE_T_H
1023 #define _SIZE_T_DEFINED_
1024 #define _SIZE_T_DEFINED
1025 #define _BSD_SIZE_T_DEFINED_ /* Darwin */
1026 @@ -226,6 +231,7 @@
1027 #endif /* _BSD_SIZE_T_DEFINED_ */
1028 #endif /* _SIZE_T_DEFINED */
1029 #endif /* _SIZE_T_DEFINED_ */
1030 +#endif /* _AROS_TYPES_SIZE_T_H */
1031 #endif /* _BSD_SIZE_T_ */
1032 #endif /* _SIZE_T_ */
1033 #endif /* __SIZE_T */
1034 diff -ruN gcc-6.3.0/include/filenames.h gcc-6.3.0.aros/include/filenames.h
1035 --- gcc-6.3.0/include/filenames.h 2015-07-14 17:08:59.000000000 +0100
1036 +++ gcc-6.3.0.aros/include/filenames.h 2017-03-31 15:45:18.412174344 +0100
1037 @@ -42,6 +42,13 @@
1038 # define HAS_DRIVE_SPEC(f) HAS_DOS_DRIVE_SPEC (f)
1039 # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c)
1040 # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f)
1041 +#elif defined(__AROS__)
1042 +# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
1043 +# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1
1044 +# endif
1045 +# define HAS_DRIVE_SPEC(f) (0)
1046 +# define IS_DIR_SEPARATOR(c) ((c) == '/' || (c) == ':')
1047 +# define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0]) || (strchr((f), ':')))
1048 #else /* not DOSish */
1049 # if defined(__APPLE__)
1050 # ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
1051 diff -ruN gcc-6.3.0/libgcc/config.host gcc-6.3.0.aros/libgcc/config.host
1052 --- gcc-6.3.0/libgcc/config.host 2016-11-19 03:03:55.000000000 +0000
1053 +++ gcc-6.3.0.aros/libgcc/config.host 2017-03-31 05:50:59.846860603 +0100
1054 @@ -811,7 +811,7 @@
1055 m32rle-*-linux*)
1056 tmake_file="$tmake_file m32r/t-linux t-fdpbit"
1058 -m68k-*-elf* | fido-*-elf)
1059 +m68k-*-elf* | fido-*-elf | m68k-*-aros*)
1060 tmake_file="$tmake_file m68k/t-floatlib"
1062 m68k*-*-netbsdelf*)
1063 @@ -1335,6 +1335,9 @@
1064 tmake_file="$tmake_file nvptx/t-nvptx"
1065 extra_parts="crt0.o"
1067 +*-*-aros*)
1068 + tmake_file=
1069 + ;;
1071 echo "*** Configuration ${host} not supported" 1>&2
1072 exit 1
1073 diff -ruN gcc-6.3.0/libgcc/gthr.h gcc-6.3.0.aros/libgcc/gthr.h
1074 --- gcc-6.3.0/libgcc/gthr.h 2016-01-04 14:30:50.000000000 +0000
1075 +++ gcc-6.3.0.aros/libgcc/gthr.h 2017-03-31 05:50:59.846860603 +0100
1076 @@ -141,6 +141,11 @@
1077 #define GTHREAD_USE_WEAK 0
1078 #endif
1080 +#ifdef __AROS__
1081 +#undef GTHREAD_USE_WEAK
1082 +#define GTHREAD_USE_WEAK 0
1083 +#endif
1085 #ifndef GTHREAD_USE_WEAK
1086 #define GTHREAD_USE_WEAK 1
1087 #endif
1088 diff -ruN gcc-6.3.0/libgcc/unwind-dw2.c gcc-6.3.0.aros/libgcc/unwind-dw2.c
1089 --- gcc-6.3.0/libgcc/unwind-dw2.c 2016-01-04 14:30:50.000000000 +0000
1090 +++ gcc-6.3.0.aros/libgcc/unwind-dw2.c 2017-03-31 05:50:59.846860603 +0100
1091 @@ -1542,7 +1542,9 @@
1092 static inline void
1093 init_dwarf_reg_size_table (void)
1095 +#ifdef MD_FALLBACK_FRAME_STATE_FOR
1096 __builtin_init_dwarf_reg_size_table (dwarf_reg_size_table);
1097 +#endif
1100 static void __attribute__((noinline))
1101 diff -ruN gcc-6.3.0/libgcc/unwind-dw2-fde.c gcc-6.3.0.aros/libgcc/unwind-dw2-fde.c
1102 --- gcc-6.3.0/libgcc/unwind-dw2-fde.c 2016-01-04 14:30:50.000000000 +0000
1103 +++ gcc-6.3.0.aros/libgcc/unwind-dw2-fde.c 2017-03-31 05:50:59.846860603 +0100
1104 @@ -92,12 +92,16 @@
1105 #endif
1107 init_object_mutex_once ();
1108 +#ifndef __AROS__ /* This is called when SysBase is not yet set up */
1109 __gthread_mutex_lock (&object_mutex);
1110 +#endif
1112 ob->next = unseen_objects;
1113 unseen_objects = ob;
1115 +#ifndef __AROS__
1116 __gthread_mutex_unlock (&object_mutex);
1117 +#endif
1120 void
1121 diff -ruN gcc-6.3.0/libiberty/filename_cmp.c gcc-6.3.0.aros/libiberty/filename_cmp.c
1122 --- gcc-6.3.0/libiberty/filename_cmp.c 2014-11-11 23:33:25.000000000 +0000
1123 +++ gcc-6.3.0.aros/libiberty/filename_cmp.c 2017-03-31 05:50:59.846860603 +0100
1124 @@ -55,9 +55,12 @@
1126 filename_cmp (const char *s1, const char *s2)
1128 -#if !defined(HAVE_DOS_BASED_FILE_SYSTEM) \
1129 - && !defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
1130 +#if !defined(HAVE_DOS_BASED_FILE_SYSTEM)
1131 +#if defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
1132 + return strcasecmp(s1, s2);
1133 +#else
1134 return strcmp(s1, s2);
1135 +#endif
1136 #else
1137 for (;;)
1139 diff -ruN gcc-6.3.0/libobjc/configure gcc-6.3.0.aros/libobjc/configure
1140 --- gcc-6.3.0/libobjc/configure 2016-12-21 07:53:23.000000000 +0000
1141 +++ gcc-6.3.0.aros/libobjc/configure 2017-03-31 05:50:59.846860603 +0100
1142 @@ -11253,214 +11253,7 @@
1143 # -----------
1145 # Check if we have thread-local storage
1148 - # Check whether --enable-tls was given.
1149 -if test "${enable_tls+set}" = set; then :
1150 - enableval=$enable_tls;
1151 - case "$enableval" in
1152 - yes|no) ;;
1153 - *) as_fn_error "Argument to enable/disable tls must be yes or no" "$LINENO" 5 ;;
1154 - esac
1156 -else
1157 - enable_tls=yes
1161 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports thread-local storage" >&5
1162 -$as_echo_n "checking whether the target supports thread-local storage... " >&6; }
1163 -if test "${gcc_cv_have_tls+set}" = set; then :
1164 - $as_echo_n "(cached) " >&6
1165 -else
1167 - if test "$cross_compiling" = yes; then :
1168 - if test x$gcc_no_link = xyes; then
1169 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1171 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1172 -/* end confdefs.h. */
1173 -__thread int a; int b; int main() { return a = b; }
1174 -_ACEOF
1175 -if ac_fn_c_try_link "$LINENO"; then :
1176 - chktls_save_LDFLAGS="$LDFLAGS"
1177 - case $host in
1178 - *-*-linux*)
1179 - LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
1180 - ;;
1181 - esac
1182 - chktls_save_CFLAGS="$CFLAGS"
1183 - CFLAGS="-fPIC $CFLAGS"
1184 - if test x$gcc_no_link = xyes; then
1185 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1187 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1188 -/* end confdefs.h. */
1189 -int f() { return 0; }
1190 -_ACEOF
1191 -if ac_fn_c_try_link "$LINENO"; then :
1192 - if test x$gcc_no_link = xyes; then
1193 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1195 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1196 -/* end confdefs.h. */
1197 -__thread int a; int b; int f() { return a = b; }
1198 -_ACEOF
1199 -if ac_fn_c_try_link "$LINENO"; then :
1200 - gcc_cv_have_tls=yes
1201 -else
1202 - gcc_cv_have_tls=no
1204 -rm -f core conftest.err conftest.$ac_objext \
1205 - conftest$ac_exeext conftest.$ac_ext
1206 -else
1207 - gcc_cv_have_tls=yes
1209 -rm -f core conftest.err conftest.$ac_objext \
1210 - conftest$ac_exeext conftest.$ac_ext
1211 - CFLAGS="$chktls_save_CFLAGS"
1212 - LDFLAGS="$chktls_save_LDFLAGS"
1213 -else
1214 - gcc_cv_have_tls=no
1216 -rm -f core conftest.err conftest.$ac_objext \
1217 - conftest$ac_exeext conftest.$ac_ext
1220 -else
1221 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1222 -/* end confdefs.h. */
1223 -__thread int a; int b; int main() { return a = b; }
1224 -_ACEOF
1225 -if ac_fn_c_try_run "$LINENO"; then :
1226 - chktls_save_LDFLAGS="$LDFLAGS"
1227 - LDFLAGS="-static $LDFLAGS"
1228 - if test x$gcc_no_link = xyes; then
1229 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1231 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1232 -/* end confdefs.h. */
1233 -int main() { return 0; }
1234 -_ACEOF
1235 -if ac_fn_c_try_link "$LINENO"; then :
1236 - if test "$cross_compiling" = yes; then :
1237 - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
1238 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1239 -as_fn_error "cannot run test program while cross compiling
1240 -See \`config.log' for more details." "$LINENO" 5; }
1241 -else
1242 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1243 -/* end confdefs.h. */
1244 -__thread int a; int b; int main() { return a = b; }
1245 -_ACEOF
1246 -if ac_fn_c_try_run "$LINENO"; then :
1247 - gcc_cv_have_tls=yes
1248 -else
1249 - gcc_cv_have_tls=no
1251 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1252 - conftest.$ac_objext conftest.beam conftest.$ac_ext
1255 -else
1256 - gcc_cv_have_tls=yes
1258 -rm -f core conftest.err conftest.$ac_objext \
1259 - conftest$ac_exeext conftest.$ac_ext
1260 - LDFLAGS="$chktls_save_LDFLAGS"
1261 - if test $gcc_cv_have_tls = yes; then
1262 - chktls_save_CFLAGS="$CFLAGS"
1263 - thread_CFLAGS=failed
1264 - for flag in '' '-pthread' '-lpthread'; do
1265 - CFLAGS="$flag $chktls_save_CFLAGS"
1266 - if test x$gcc_no_link = xyes; then
1267 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1269 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1270 -/* end confdefs.h. */
1271 -#include <pthread.h>
1272 - void *g(void *d) { return NULL; }
1273 -int
1274 -main ()
1276 -pthread_t t; pthread_create(&t,NULL,g,NULL);
1278 - return 0;
1280 -_ACEOF
1281 -if ac_fn_c_try_link "$LINENO"; then :
1282 - thread_CFLAGS="$flag"
1284 -rm -f core conftest.err conftest.$ac_objext \
1285 - conftest$ac_exeext conftest.$ac_ext
1286 - if test "X$thread_CFLAGS" != Xfailed; then
1287 - break
1288 - fi
1289 - done
1290 - CFLAGS="$chktls_save_CFLAGS"
1291 - if test "X$thread_CFLAGS" != Xfailed; then
1292 - CFLAGS="$thread_CFLAGS $chktls_save_CFLAGS"
1293 - if test "$cross_compiling" = yes; then :
1294 - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
1295 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1296 -as_fn_error "cannot run test program while cross compiling
1297 -See \`config.log' for more details." "$LINENO" 5; }
1298 -else
1299 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1300 -/* end confdefs.h. */
1301 -#include <pthread.h>
1302 - __thread int a;
1303 - static int *volatile a_in_other_thread;
1304 - static void *
1305 - thread_func (void *arg)
1307 - a_in_other_thread = &a;
1308 - return (void *)0;
1310 -int
1311 -main ()
1313 -pthread_t thread;
1314 - void *thread_retval;
1315 - int *volatile a_in_main_thread;
1316 - a_in_main_thread = &a;
1317 - if (pthread_create (&thread, (pthread_attr_t *)0,
1318 - thread_func, (void *)0))
1319 - return 0;
1320 - if (pthread_join (thread, &thread_retval))
1321 - return 0;
1322 - return (a_in_other_thread == a_in_main_thread);
1324 - return 0;
1326 -_ACEOF
1327 -if ac_fn_c_try_run "$LINENO"; then :
1328 - gcc_cv_have_tls=yes
1329 -else
1330 - gcc_cv_have_tls=no
1332 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1333 - conftest.$ac_objext conftest.beam conftest.$ac_ext
1336 - CFLAGS="$chktls_save_CFLAGS"
1337 - fi
1338 - fi
1339 -else
1340 - gcc_cv_have_tls=no
1342 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1343 - conftest.$ac_objext conftest.beam conftest.$ac_ext
1347 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_have_tls" >&5
1348 -$as_echo "$gcc_cv_have_tls" >&6; }
1349 - if test "$enable_tls $gcc_cv_have_tls" = "yes yes"; then
1351 -$as_echo "#define HAVE_TLS 1" >>confdefs.h
1353 - fi
1354 +#dnl GCC_ENABLE_TLS
1357 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the type of bitfields matters" >&5
1358 diff -ruN gcc-6.3.0/libobjc/configure.ac gcc-6.3.0.aros/libobjc/configure.ac
1359 --- gcc-6.3.0/libobjc/configure.ac 2016-01-04 14:30:50.000000000 +0000
1360 +++ gcc-6.3.0.aros/libobjc/configure.ac 2017-03-31 05:50:59.846860603 +0100
1361 @@ -210,7 +210,7 @@
1362 # -----------
1364 # Check if we have thread-local storage
1365 -GCC_CHECK_TLS
1366 +dnl GCC_CHECK_TLS
1368 gt_BITFIELD_TYPE_MATTERS
1370 diff -ruN gcc-6.3.0/libobjc/thr.c gcc-6.3.0.aros/libobjc/thr.c
1371 --- gcc-6.3.0/libobjc/thr.c 2016-01-04 14:30:50.000000000 +0000
1372 +++ gcc-6.3.0.aros/libobjc/thr.c 2017-03-31 05:50:59.846860603 +0100
1373 @@ -35,6 +35,7 @@
1374 #include "objc/runtime.h"
1375 #include "objc-private/module-abi-8.h"
1376 #include "objc-private/runtime.h"
1377 +#define __typedef_BOOL /* Remove definition of BOOL */
1378 #include <gthr.h>
1380 #include <stdlib.h>
1381 diff -ruN gcc-6.3.0/libstdc++-v3/config/os/aros/ctype_base.h gcc-6.3.0.aros/libstdc++-v3/config/os/aros/ctype_base.h
1382 --- gcc-6.3.0/libstdc++-v3/config/os/aros/ctype_base.h 1970-01-01 01:00:00.000000000 +0100
1383 +++ gcc-6.3.0.aros/libstdc++-v3/config/os/aros/ctype_base.h 2017-03-31 05:50:59.846860603 +0100
1384 @@ -0,0 +1,30 @@
1385 +namespace std _GLIBCXX_VISIBILITY(default)
1387 +_GLIBCXX_BEGIN_NAMESPACE_VERSION
1389 +struct ctype_base {
1390 + /* Non-standard typedefs */
1391 + typedef int * __to_type;
1393 + /* NB: Offsets into ctype<char>::_M_table force a particular size
1394 + on the mask type. Because of this, we don't use an enum. */
1395 + typedef unsigned short int mask;
1397 + static const mask upper = _ISupper;
1398 + static const mask lower = _ISlower;
1399 + static const mask alpha = _ISalpha;
1400 + static const mask digit = _ISdigit;
1401 + static const mask xdigit = _ISxdigit;
1402 + static const mask space = _ISspace;
1403 + static const mask print = _ISprint;
1404 + static const mask graph = _ISgraph;
1405 + static const mask cntrl = _IScntrl;
1406 + static const mask punct = _ISpunct;
1407 + static const mask alnum = _ISalnum;
1408 +#if __cplusplus >= 201103L
1409 + static const mask blank = _ISblank;
1410 +#endif
1413 +_GLIBCXX_END_NAMESPACE_VERSION
1414 +} // namespace
1415 diff -ruN gcc-6.3.0/libstdc++-v3/config/os/aros/ctype_configure_char.cc gcc-6.3.0.aros/libstdc++-v3/config/os/aros/ctype_configure_char.cc
1416 --- gcc-6.3.0/libstdc++-v3/config/os/aros/ctype_configure_char.cc 1970-01-01 01:00:00.000000000 +0100
1417 +++ gcc-6.3.0.aros/libstdc++-v3/config/os/aros/ctype_configure_char.cc 2017-03-31 05:50:59.846860603 +0100
1418 @@ -0,0 +1,99 @@
1419 +// Locale support -*- C++ -*-
1421 +// Copyright (C) 2011-2013 Free Software Foundation, Inc.
1423 +// This file is part of the GNU ISO C++ Library. This library is free
1424 +// software; you can redistribute it and/or modify it under the
1425 +// terms of the GNU General Public License as published by the
1426 +// Free Software Foundation; either version 3, or (at your option)
1427 +// any later version.
1429 +// This library is distributed in the hope that it will be useful,
1430 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1431 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1432 +// GNU General Public License for more details.
1434 +// Under Section 7 of GPL version 3, you are granted additional
1435 +// permissions described in the GCC Runtime Library Exception, version
1436 +// 3.1, as published by the Free Software Foundation.
1438 +// You should have received a copy of the GNU General Public License and
1439 +// a copy of the GCC Runtime Library Exception along with this program;
1440 +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
1441 +// <http://www.gnu.org/licenses/>.
1443 +/** @file ctype_configure_char.cc */
1446 +// ISO C++ 14882: 22.1 Locales
1449 +#include <locale>
1450 +#include <cstdlib>
1451 +#include <cstring>
1453 +namespace std _GLIBCXX_VISIBILITY(default)
1455 +_GLIBCXX_BEGIN_NAMESPACE_VERSION
1457 +// Information as gleaned from /usr/include/ctype.h
1459 + const ctype_base::mask*
1460 + ctype<char>::classic_table() throw()
1461 + { return 0; }
1463 + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
1464 + size_t __refs)
1465 + : facet(__refs), _M_del(__table != 0 && __del),
1466 + _M_toupper(NULL), _M_tolower(NULL),
1467 + _M_table(__table ? __table : classic_table())
1468 + {
1469 + memset(_M_widen, 0, sizeof(_M_widen));
1470 + _M_widen_ok = 0;
1471 + memset(_M_narrow, 0, sizeof(_M_narrow));
1472 + _M_narrow_ok = 0;
1475 + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
1476 + : facet(__refs), _M_del(__table != 0 && __del),
1477 + _M_toupper(NULL), _M_tolower(NULL),
1478 + _M_table(__table ? __table : classic_table())
1479 + {
1480 + memset(_M_widen, 0, sizeof(_M_widen));
1481 + _M_widen_ok = 0;
1482 + memset(_M_narrow, 0, sizeof(_M_narrow));
1483 + _M_narrow_ok = 0;
1486 + char
1487 + ctype<char>::do_toupper(char __c) const
1488 + { return ::toupper((int) __c); }
1490 + const char*
1491 + ctype<char>::do_toupper(char* __low, const char* __high) const
1493 + while (__low < __high)
1495 + *__low = ::toupper((int) *__low);
1496 + ++__low;
1498 + return __high;
1501 + char
1502 + ctype<char>::do_tolower(char __c) const
1503 + { return ::tolower((int) __c); }
1505 + const char*
1506 + ctype<char>::do_tolower(char* __low, const char* __high) const
1508 + while (__low < __high)
1510 + *__low = ::tolower((int) *__low);
1511 + ++__low;
1513 + return __high;
1516 +_GLIBCXX_END_NAMESPACE_VERSION
1517 +} // namespace
1518 diff -ruN gcc-6.3.0/libstdc++-v3/config/os/aros/ctype_inline.h gcc-6.3.0.aros/libstdc++-v3/config/os/aros/ctype_inline.h
1519 --- gcc-6.3.0/libstdc++-v3/config/os/aros/ctype_inline.h 1970-01-01 01:00:00.000000000 +0100
1520 +++ gcc-6.3.0.aros/libstdc++-v3/config/os/aros/ctype_inline.h 2017-03-31 05:50:59.846860603 +0100
1521 @@ -0,0 +1,173 @@
1522 +// Locale support -*- C++ -*-
1524 +// Copyright (C) 2000, 2003 Free Software Foundation, Inc.
1526 +// This file is part of the GNU ISO C++ Library. This library is free
1527 +// software; you can redistribute it and/or modify it under the
1528 +// terms of the GNU General Public License as published by the
1529 +// Free Software Foundation; either version 2, or (at your option)
1530 +// any later version.
1532 +// This library is distributed in the hope that it will be useful,
1533 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1534 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1535 +// GNU General Public License for more details.
1537 +// You should have received a copy of the GNU General Public License along
1538 +// with this library; see the file COPYING. If not, write to the Free
1539 +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
1540 +// USA.
1542 +// As a special exception, you may use this file as part of a free software
1543 +// library without restriction. Specifically, if other files instantiate
1544 +// templates or use macros or inline functions from this file, or you compile
1545 +// this file and link it with other files to produce an executable, this
1546 +// file does not by itself cause the resulting executable to be covered by
1547 +// the GNU General Public License. This exception does not however
1548 +// invalidate any other reasons why the executable file might be covered by
1549 +// the GNU General Public License.
1551 +/** @file ctype_inline.h
1552 + * This is an internal header file, included by other library headers.
1553 + * You should not attempt to use it directly.
1554 + */
1557 +// ISO C++ 14882: 22.1 Locales
1560 +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
1561 +// functions go in ctype.cc
1563 +// The following definitions are portable, but insanely slow. If one
1564 +// cares at all about performance, then specialized ctype
1565 +// functionality should be added for the native os in question: see
1566 +// the config/os/bits/ctype_*.h files.
1568 +// Constructing a synthetic "C" table should be seriously considered...
1570 +namespace std _GLIBCXX_VISIBILITY(default)
1572 +_GLIBCXX_BEGIN_NAMESPACE_VERSION
1574 + bool
1575 + ctype<char>::
1576 + is(mask __m, char __c) const
1577 + {
1578 + if (_M_table)
1579 + return _M_table[static_cast<unsigned char>(__c)] & __m;
1580 + else
1582 + bool __ret = false;
1583 + const size_t __bitmasksize = 15;
1584 + size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0
1585 + for (; __bitcur <= __bitmasksize; ++__bitcur)
1587 + const mask __bit = static_cast<mask>(1 << __bitcur);
1588 + if (__m & __bit)
1590 + bool __testis;
1591 + switch (__bit)
1593 + case space:
1594 + __testis = isspace(__c);
1595 + break;
1596 + case print:
1597 + __testis = isprint(__c);
1598 + break;
1599 + case cntrl:
1600 + __testis = iscntrl(__c);
1601 + break;
1602 + case upper:
1603 + __testis = isupper(__c);
1604 + break;
1605 + case lower:
1606 + __testis = islower(__c);
1607 + break;
1608 + case alpha:
1609 + __testis = isalpha(__c);
1610 + break;
1611 + case digit:
1612 + __testis = isdigit(__c);
1613 + break;
1614 + case punct:
1615 + __testis = ispunct(__c);
1616 + break;
1617 + case xdigit:
1618 + __testis = isxdigit(__c);
1619 + break;
1620 + case alnum:
1621 + __testis = isalnum(__c);
1622 + break;
1623 + case graph:
1624 + __testis = isgraph(__c);
1625 + break;
1626 + default:
1627 + __testis = false;
1628 + break;
1630 + __ret |= __testis;
1633 + return __ret;
1637 + const char*
1638 + ctype<char>::
1639 + is(const char* __low, const char* __high, mask* __vec) const
1641 + if (_M_table)
1642 + while (__low < __high)
1643 + *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
1644 + else
1646 + // Highest bitmask in ctype_base == 10.
1647 + const size_t __bitmasksize = 15;
1648 + for (;__low < __high; ++__vec, ++__low)
1650 + mask __m = 0;
1651 + // Lowest bitmask in ctype_base == 0
1652 + size_t __i = 0;
1653 + for (;__i <= __bitmasksize; ++__i)
1655 + const mask __bit = static_cast<mask>(1 << __i);
1656 + if (this->is(__bit, *__low))
1657 + __m |= __bit;
1659 + *__vec = __m;
1662 + return __high;
1665 + const char*
1666 + ctype<char>::
1667 + scan_is(mask __m, const char* __low, const char* __high) const
1669 + if (_M_table)
1670 + while (__low < __high
1671 + && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
1672 + ++__low;
1673 + else
1674 + while (__low < __high && !this->is(__m, *__low))
1675 + ++__low;
1676 + return __low;
1679 + const char*
1680 + ctype<char>::
1681 + scan_not(mask __m, const char* __low, const char* __high) const
1683 + if (_M_table)
1684 + while (__low < __high
1685 + && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
1686 + ++__low;
1687 + else
1688 + while (__low < __high && this->is(__m, *__low) != 0)
1689 + ++__low;
1690 + return __low;
1693 +_GLIBCXX_END_NAMESPACE_VERSION
1694 +} // namespace
1695 diff -ruN gcc-6.3.0/libstdc++-v3/config/os/aros/ctype_noninline.h gcc-6.3.0.aros/libstdc++-v3/config/os/aros/ctype_noninline.h
1696 --- gcc-6.3.0/libstdc++-v3/config/os/aros/ctype_noninline.h 1970-01-01 01:00:00.000000000 +0100
1697 +++ gcc-6.3.0.aros/libstdc++-v3/config/os/aros/ctype_noninline.h 2017-03-31 05:50:59.846860603 +0100
1698 @@ -0,0 +1,56 @@
1699 + const ctype_base::mask*
1700 + ctype<char>::classic_table() throw()
1701 + { return *__ctype_b_ptr; }
1703 + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
1704 + size_t __refs)
1705 + : facet(__refs), _M_del(__table != 0 && __del),
1706 + _M_toupper(NULL), _M_tolower(NULL),
1707 + _M_table(__table ? __table : classic_table())
1708 + {
1709 + memset(_M_widen, 0, sizeof(_M_widen));
1710 + _M_widen_ok = 0;
1711 + memset(_M_narrow, 0, sizeof(_M_narrow));
1712 + _M_narrow_ok = 0;
1715 + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
1716 + : facet(__refs), _M_del(__table != 0 && __del),
1717 + _M_toupper(NULL), _M_tolower(NULL),
1718 + _M_table(__table ? __table : classic_table())
1719 + {
1720 + memset(_M_widen, 0, sizeof(_M_widen));
1721 + _M_widen_ok = 0;
1722 + memset(_M_narrow, 0, sizeof(_M_narrow));
1723 + _M_narrow_ok = 0;
1726 + char
1727 + ctype<char>::do_toupper(char __c) const
1728 + { return ::toupper((int) __c); }
1730 + const char*
1731 + ctype<char>::do_toupper(char* __low, const char* __high) const
1733 + while (__low < __high)
1735 + *__low = ::toupper((int) *__low);
1736 + ++__low;
1738 + return __high;
1741 + char
1742 + ctype<char>::do_tolower(char __c) const
1743 + { return ::tolower((int) __c); }
1745 + const char*
1746 + ctype<char>::do_tolower(char* __low, const char* __high) const
1748 + while (__low < __high)
1750 + *__low = ::tolower((int) *__low);
1751 + ++__low;
1753 + return __high;
1755 diff -ruN gcc-6.3.0/libstdc++-v3/config/os/aros/os_defines.h gcc-6.3.0.aros/libstdc++-v3/config/os/aros/os_defines.h
1756 --- gcc-6.3.0/libstdc++-v3/config/os/aros/os_defines.h 1970-01-01 01:00:00.000000000 +0100
1757 +++ gcc-6.3.0.aros/libstdc++-v3/config/os/aros/os_defines.h 2017-03-31 05:50:59.846860603 +0100
1758 @@ -0,0 +1,11 @@
1759 +// Specific definitions for AROS -*- C++ -*-
1761 +#ifndef _GLIBCXX_OS_DEFINES
1762 +#define _GLIBCXX_OS_DEFINES
1764 +#define __off64_t off_t
1766 +// No support for referencing weak symbols without a definition.
1767 +#define _GLIBCXX_USE_WEAK_REF 0
1769 +#endif
1770 diff -ruN gcc-6.3.0/libstdc++-v3/configure gcc-6.3.0.aros/libstdc++-v3/configure
1771 --- gcc-6.3.0/libstdc++-v3/configure 2016-12-12 18:03:30.000000000 +0000
1772 +++ gcc-6.3.0.aros/libstdc++-v3/configure 2017-03-31 05:50:59.846860603 +0100
1773 @@ -5365,12 +5365,12 @@
1776 # Libtool setup.
1777 -if test "x${with_newlib}" != "xyes"; then
1778 - enable_dlopen=yes
1783 +#if test "x${with_newlib}" != "xyes"; then
1784 +# AC_LIBTOOL_DLOPEN
1788 +#fi
1789 case `pwd` in
1790 *\ * | *\ *)
1791 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
1792 @@ -8101,6 +8101,8 @@
1796 + enable_dlopen=no
1799 enable_win32_dll=no
1801 @@ -19640,6 +19642,7 @@
1803 struct iovec iov[2];
1804 writev(0, iov, 0);
1805 +#error be sure to fail
1807 return 0;
1809 @@ -19662,6 +19665,7 @@
1811 struct iovec iov[2];
1812 writev(0, iov, 0);
1813 +#error be sure to fail
1815 return 0;
1817 @@ -28882,6 +28886,58 @@
1819 # Base decisions on target environment.
1820 case "${host}" in
1821 + *-aros*)
1822 + for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
1823 + machine/param.h sys/machine.h sys/types.h fp.h locale.h float.h inttypes.h
1824 +do :
1825 + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
1826 +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
1827 +eval as_val=\$$as_ac_Header
1828 + if test "x$as_val" = x""yes; then :
1829 + cat >>confdefs.h <<_ACEOF
1830 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
1831 +_ACEOF
1835 +done
1838 + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
1839 + GLIBCXX_CHECK_WCHAR_T_SUPPORT
1841 + $as_echo "#define HAVE_FINITE 1" >>confdefs.h
1843 + $as_echo "#define HAVE_FINITEF 1" >>confdefs.h
1845 + $as_echo "#define HAVE_FREXPF 1" >>confdefs.h
1847 + $as_echo "#define HAVE_HYPOTF 1" >>confdefs.h
1849 + $as_echo "#define HAVE_ISINF 1" >>confdefs.h
1851 + $as_echo "#define HAVE_ISINFF 1" >>confdefs.h
1853 + $as_echo "#define HAVE_ISNAN 1" >>confdefs.h
1855 + $as_echo "#define HAVE_ISNANF 1" >>confdefs.h
1857 + $as_echo "#define HAVE_SINCOS 1" >>confdefs.h
1859 + $as_echo "#define HAVE_SINCOSF 1" >>confdefs.h
1861 + if test x"long_double_math_on_this_cpu" = x"yes"; then
1862 + $as_echo "#define HAVE_FINITEL 1" >>confdefs.h
1864 + $as_echo "#define HAVE_HYPOTL 1" >>confdefs.h
1866 + $as_echo "#define HAVE_ISINFL 1" >>confdefs.h
1868 + $as_echo "#define HAVE_ISNANL 1" >>confdefs.h
1870 + fi
1871 + ;;
1873 arm*-*-symbianelf*)
1874 # This is a freestanding configuration; there is nothing to do here.
1876 diff -ruN gcc-6.3.0/libstdc++-v3/configure.ac gcc-6.3.0.aros/libstdc++-v3/configure.ac
1877 --- gcc-6.3.0/libstdc++-v3/configure.ac 2016-01-15 22:42:41.000000000 +0000
1878 +++ gcc-6.3.0.aros/libstdc++-v3/configure.ac 2017-03-31 05:50:59.846860603 +0100
1879 @@ -89,9 +89,9 @@
1880 GLIBCXX_CONFIGURE
1882 # Libtool setup.
1883 -if test "x${with_newlib}" != "xyes"; then
1884 - AC_LIBTOOL_DLOPEN
1886 +#if test "x${with_newlib}" != "xyes"; then
1887 +# AC_LIBTOOL_DLOPEN
1888 +#fi
1889 AM_PROG_LIBTOOL
1890 ACX_LT_HOST_FLAGS
1891 AC_SUBST(enable_shared)
1892 diff -ruN gcc-6.3.0/libstdc++-v3/configure.host gcc-6.3.0.aros/libstdc++-v3/configure.host
1893 --- gcc-6.3.0/libstdc++-v3/configure.host 2016-09-27 07:11:15.000000000 +0100
1894 +++ gcc-6.3.0.aros/libstdc++-v3/configure.host 2017-03-31 05:50:59.846860603 +0100
1895 @@ -226,6 +226,9 @@
1896 os_include_dir="os/generic"
1897 atomicity_dir="cpu/generic"
1899 + aros*)
1900 + os_include_dir="os/aros"
1901 + ;;
1902 bsd*)
1903 # Plain BSD attempts to share FreeBSD files.
1904 os_include_dir="os/bsd/freebsd"
1905 diff -ruN gcc-6.3.0/libstdc++-v3/crossconfig.m4 gcc-6.3.0.aros/libstdc++-v3/crossconfig.m4
1906 --- gcc-6.3.0/libstdc++-v3/crossconfig.m4 2015-10-11 23:34:28.000000000 +0100
1907 +++ gcc-6.3.0.aros/libstdc++-v3/crossconfig.m4 2017-03-31 05:50:59.846860603 +0100
1908 @@ -5,6 +5,31 @@
1909 AC_DEFUN([GLIBCXX_CROSSCONFIG],[
1910 # Base decisions on target environment.
1911 case "${host}" in
1912 + *-aros*)
1913 + AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
1914 + machine/param.h sys/machine.h sys/types.h fp.h locale.h float.h inttypes.h])
1916 + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
1917 + GLIBCXX_CHECK_WCHAR_T_SUPPORT
1919 + AC_DEFINE(HAVE_FINITE)
1920 + AC_DEFINE(HAVE_FINITEF)
1921 + AC_DEFINE(HAVE_FREXPF)
1922 + AC_DEFINE(HAVE_HYPOTF)
1923 + AC_DEFINE(HAVE_ISINF)
1924 + AC_DEFINE(HAVE_ISINFF)
1925 + AC_DEFINE(HAVE_ISNAN)
1926 + AC_DEFINE(HAVE_ISNANF)
1927 + AC_DEFINE(HAVE_SINCOS)
1928 + AC_DEFINE(HAVE_SINCOSF)
1929 + if test x"long_double_math_on_this_cpu" = x"yes"; then
1930 + AC_DEFINE(HAVE_FINITEL)
1931 + AC_DEFINE(HAVE_HYPOTL)
1932 + AC_DEFINE(HAVE_ISINFL)
1933 + AC_DEFINE(HAVE_ISNANL)
1934 + fi
1935 + ;;
1937 arm*-*-symbianelf*)
1938 # This is a freestanding configuration; there is nothing to do here.
1940 diff -ruN gcc-6.3.0/libstdc++-v3/include/Makefile.in gcc-6.3.0.aros/libstdc++-v3/include/Makefile.in
1941 --- gcc-6.3.0/libstdc++-v3/include/Makefile.in 2016-10-03 15:36:13.000000000 +0100
1942 +++ gcc-6.3.0.aros/libstdc++-v3/include/Makefile.in 2017-03-31 05:50:59.846860603 +0100
1943 @@ -1687,6 +1687,7 @@
1944 -e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
1945 -e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
1946 -e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \
1947 + -e 's/_GLIBCXX___AROS__/__AROS__/g' \
1948 -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
1949 < $< > $@
1951 diff -ruN gcc-6.3.0/libstdc++-v3/include/std/ratio gcc-6.3.0.aros/libstdc++-v3/include/std/ratio
1952 --- gcc-6.3.0/libstdc++-v3/include/std/ratio 2016-01-04 14:30:50.000000000 +0000
1953 +++ gcc-6.3.0.aros/libstdc++-v3/include/std/ratio 2017-03-31 05:50:59.846860603 +0100
1954 @@ -211,10 +211,10 @@
1956 private:
1957 static_assert(__d != 0, "Internal library error");
1958 - static_assert(sizeof (uintmax_t) == sizeof (unsigned long long),
1959 - "This library calls __builtin_clzll on uintmax_t, which "
1960 - "is unsafe on your platform. Please complain to "
1961 - "http://gcc.gnu.org/bugzilla/");
1962 +// static_assert(sizeof (uintmax_t) == sizeof (unsigned long long),
1963 +// "This library calls __builtin_clzll on uintmax_t, which "
1964 +// "is unsafe on your platform. Please complain to "
1965 +// "http://gcc.gnu.org/bugzilla/");
1966 static constexpr int __shift = __builtin_clzll(__d);
1967 static constexpr int __coshift_ = sizeof(uintmax_t) * 8 - __shift;
1968 static constexpr int __coshift = (__shift != 0) ? __coshift_ : 0;