config: fix build with external compiler by passing the sysroot where needed
[AROS.git] / tools / crosstools / gcc-6.1.0-aros.diff
blobe144d8ee0fb3d8335912d4514a8bcbc0ed6153b4
1 diff -ruN gcc-6.1.0/boehm-gc/include/gc_amiga_redirects.h gcc-6.1.0.aros/boehm-gc/include/gc_amiga_redirects.h
2 --- gcc-6.1.0/boehm-gc/include/gc_amiga_redirects.h 2001-08-17 19:30:51.000000000 +0100
3 +++ gcc-6.1.0.aros/boehm-gc/include/gc_amiga_redirects.h 2016-04-27 15:13:21.001535038 +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.1.0/boehm-gc/include/gc.h gcc-6.1.0.aros/boehm-gc/include/gc.h
14 --- gcc-6.1.0/boehm-gc/include/gc.h 2014-10-23 09:39:19.000000000 +0100
15 +++ gcc-6.1.0.aros/boehm-gc/include/gc.h 2016-04-27 15:13:21.001535038 +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.1.0/configure gcc-6.1.0.aros/configure
26 --- gcc-6.1.0/configure 2016-03-17 22:54:19.000000000 +0000
27 +++ gcc-6.1.0.aros/configure 2016-04-27 15:13:21.001535038 +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.1.0/configure.ac gcc-6.1.0.aros/configure.ac
48 --- gcc-6.1.0/configure.ac 2016-03-17 22:54:19.000000000 +0000
49 +++ gcc-6.1.0.aros/configure.ac 2016-04-27 15:13:21.001535038 +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.1.0/fixincludes/configure gcc-6.1.0.aros/fixincludes/configure
70 --- gcc-6.1.0/fixincludes/configure 2016-04-27 09:22:11.000000000 +0100
71 +++ gcc-6.1.0.aros/fixincludes/configure 2016-04-27 15:13:21.001535038 +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.1.0/fixincludes/configure.ac gcc-6.1.0.aros/fixincludes/configure.ac
81 --- gcc-6.1.0/fixincludes/configure.ac 2012-05-29 20:28:57.000000000 +0100
82 +++ gcc-6.1.0.aros/fixincludes/configure.ac 2016-04-27 15:13:21.001535038 +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.1.0/gcc/config/aarch64/aros.h gcc-6.1.0.aros/gcc/config/aarch64/aros.h
92 --- gcc-6.1.0/gcc/config/aarch64/aros.h 1970-01-01 01:00:00.000000000 +0100
93 +++ gcc-6.1.0.aros/gcc/config/aarch64/aros.h 2016-04-27 15:13:21.001535038 +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.1.0/gcc/config/aarch64/t-aros gcc-6.1.0.aros/gcc/config/aarch64/t-aros
159 --- gcc-6.1.0/gcc/config/aarch64/t-aros 1970-01-01 01:00:00.000000000 +0100
160 +++ gcc-6.1.0.aros/gcc/config/aarch64/t-aros 2016-04-27 15:13:21.001535038 +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.1.0/gcc/config/arm/aros.h gcc-6.1.0.aros/gcc/config/arm/aros.h
184 --- gcc-6.1.0/gcc/config/arm/aros.h 1970-01-01 01:00:00.000000000 +0100
185 +++ gcc-6.1.0.aros/gcc/config/arm/aros.h 2016-04-27 15:13:21.001535038 +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.1.0/gcc/config/arm/t-aros gcc-6.1.0.aros/gcc/config/arm/t-aros
270 --- gcc-6.1.0/gcc/config/arm/t-aros 1970-01-01 01:00:00.000000000 +0100
271 +++ gcc-6.1.0.aros/gcc/config/arm/t-aros 2016-04-27 15:13:21.001535038 +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.1.0/gcc/config/aros.h gcc-6.1.0.aros/gcc/config/aros.h
296 --- gcc-6.1.0/gcc/config/aros.h 1970-01-01 01:00:00.000000000 +0100
297 +++ gcc-6.1.0.aros/gcc/config/aros.h 2016-04-27 15:13:21.001535038 +0100
298 @@ -0,0 +1,113 @@
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
412 diff -ruN gcc-6.1.0/gcc/config/aros.opt gcc-6.1.0.aros/gcc/config/aros.opt
413 --- gcc-6.1.0/gcc/config/aros.opt 1970-01-01 01:00:00.000000000 +0100
414 +++ gcc-6.1.0.aros/gcc/config/aros.opt 2016-04-27 15:13:21.001535038 +0100
415 @@ -0,0 +1,35 @@
416 +; Processor-independent options for AROS.
418 +; Copyright (C) 2015 Free Software Foundation, Inc.
420 +; This file is part of GCC.
422 +; GCC is free software; you can redistribute it and/or modify it under
423 +; the terms of the GNU General Public License as published by the Free
424 +; Software Foundation; either version 3, or (at your option) any later
425 +; version.
427 +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
428 +; WARRANTY; without even the implied warranty of MERCHANTABILITY or
429 +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
430 +; for more details.
432 +; You should have received a copy of the GNU General Public License
433 +; along with GCC; see the file COPYING3. If not see
434 +; <http://www.gnu.org/licenses/>.
436 +posix
437 +Driver
439 +noposixc
440 +Driver
442 +nostdc
443 +Driver
445 +nosysbase
446 +Driver
448 +nix
449 +Driver
451 diff -ruN gcc-6.1.0/gcc/config/i386/aros64.h gcc-6.1.0.aros/gcc/config/i386/aros64.h
452 --- gcc-6.1.0/gcc/config/i386/aros64.h 1970-01-01 01:00:00.000000000 +0100
453 +++ gcc-6.1.0.aros/gcc/config/i386/aros64.h 2016-04-27 15:13:21.001535038 +0100
454 @@ -0,0 +1,34 @@
455 +/* Definitions for AMD x86_64 running AROS systems with ELF64 format.
456 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002
457 + Free Software Foundation, Inc.
458 + Contributed by Stanislaw Szymczyk <sszymczy@gmail.com>. Based on aros.h.
460 +This file is part of GNU CC.
462 +GNU CC is free software; you can redistribute it and/or modify
463 +it under the terms of the GNU General Public License as published by
464 +the Free Software Foundation; either version 2, or (at your option)
465 +any later version.
467 +GNU CC is distributed in the hope that it will be useful,
468 +but WITHOUT ANY WARRANTY; without even the implied warranty of
469 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
470 +GNU General Public License for more details.
472 +You should have received a copy of the GNU General Public License
473 +along with GNU CC; see the file COPYING. If not, write to
474 +the Free Software Foundation, 59 Temple Place - Suite 330,
475 +Boston, MA 02111-1307, USA. */
477 +/* The svr4 ABI for the i386 says that records and unions are returned
478 + in memory. In the 64bit compilation we will turn this flag off in
479 + override_options, as we never do pcc_struct_return scheme on this target. */
480 +#undef DEFAULT_PCC_STRUCT_RETURN
481 +#define DEFAULT_PCC_STRUCT_RETURN 1
483 +/* Provide a LINK_SPEC appropriate for AROS. */
485 +#undef LINK_SPEC
486 +#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} -L %R/lib"
488 +/* FIXME: AROS doesn't support dw2 unwinding yet. */
489 diff -ruN gcc-6.1.0/gcc/config/i386/aros.h gcc-6.1.0.aros/gcc/config/i386/aros.h
490 --- gcc-6.1.0/gcc/config/i386/aros.h 1970-01-01 01:00:00.000000000 +0100
491 +++ gcc-6.1.0.aros/gcc/config/i386/aros.h 2016-04-27 15:13:21.001535038 +0100
492 @@ -0,0 +1,25 @@
493 +/* Definitions for Intel 386 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 Fabio Alemagna.
497 + Based upon i386/linux.h by Eric Youngdale.
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 +#undef LINK_SPEC
517 +#define LINK_SPEC "-m elf_i386 -L%R/lib"
518 diff -ruN gcc-6.1.0/gcc/config/m68k/m68k.c gcc-6.1.0.aros/gcc/config/m68k/m68k.c
519 --- gcc-6.1.0/gcc/config/m68k/m68k.c 2016-01-04 14:30:50.000000000 +0000
520 +++ gcc-6.1.0.aros/gcc/config/m68k/m68k.c 2016-04-27 15:13:21.001535038 +0100
521 @@ -4452,7 +4452,7 @@
522 else if (letter == '/')
523 asm_fprintf (file, "%R");
524 else if (letter == '?')
525 - asm_fprintf (file, m68k_library_id_string);
526 + asm_fprintf (file, "%s", m68k_library_id_string);
527 else if (letter == 'p')
529 output_addr_const (file, op);
530 diff -ruN gcc-6.1.0/gcc/config/m68k/m68k.h gcc-6.1.0.aros/gcc/config/m68k/m68k.h
531 --- gcc-6.1.0/gcc/config/m68k/m68k.h 2016-01-04 14:30:50.000000000 +0000
532 +++ gcc-6.1.0.aros/gcc/config/m68k/m68k.h 2016-04-27 15:13:21.001535038 +0100
533 @@ -330,7 +330,9 @@
534 register elimination. */
535 #define FIRST_PSEUDO_REGISTER 25
537 -/* All m68k targets (except AmigaOS) use %a5 as the PIC register */
538 +/* All m68k targets (except AmigaOS) use %a5 as the PIC register.
539 + * On AmigaOS, we use %a4
540 + */
541 #define PIC_OFFSET_TABLE_REGNUM \
542 (!flag_pic ? INVALID_REGNUM \
543 : reload_completed ? REGNO (pic_offset_table_rtx) \
544 @@ -420,7 +422,8 @@
545 /* Most m68k targets use %a6 as a frame pointer. The AmigaOS
546 ABI uses %a6 for shared library calls, therefore the frame
547 pointer is shifted to %a5 on this target. */
548 -#define FRAME_POINTER_REGNUM A6_REG
549 +#define FRAME_POINTER_REGNUM A5_REG
550 +#define PIC_REG A4_REG
552 /* Base register for access to arguments of the function.
553 * This isn't a hardware register. It will be eliminated to the
554 diff -ruN gcc-6.1.0/gcc/config/m68k/m68k.md gcc-6.1.0.aros/gcc/config/m68k/m68k.md
555 --- gcc-6.1.0/gcc/config/m68k/m68k.md 2016-02-22 14:22:07.000000000 +0000
556 +++ gcc-6.1.0.aros/gcc/config/m68k/m68k.md 2016-04-27 15:13:21.001535038 +0100
557 @@ -133,7 +133,8 @@
558 [(D0_REG 0)
559 (A0_REG 8)
560 (A1_REG 9)
561 - (PIC_REG 13)
562 + (A4_REG 12)
563 + (A5_REG 13)
564 (A6_REG 14)
565 (SP_REG 15)
566 (FP0_REG 16)
567 @@ -7089,7 +7090,7 @@
569 if (TARGET_ID_SHARED_LIBRARY)
571 - operands[1] = gen_rtx_REG (Pmode, PIC_REG);
572 + operands[1] = gen_rtx_REG (Pmode, A4_REG);
573 return MOTOROLA ? "move.l %?(%1),%0" : "movel %1@(%?), %0";
575 else if (MOTOROLA)
576 diff -ruN gcc-6.1.0/gcc/config/m68k/t-aros gcc-6.1.0.aros/gcc/config/m68k/t-aros
577 --- gcc-6.1.0/gcc/config/m68k/t-aros 1970-01-01 01:00:00.000000000 +0100
578 +++ gcc-6.1.0.aros/gcc/config/m68k/t-aros 2016-04-27 15:13:21.001535038 +0100
579 @@ -0,0 +1,2 @@
580 +# Custom multilibs for AROS
581 +M68K_MLIB_CPU += && match(MLIB, "^68")
582 diff -ruN gcc-6.1.0/gcc/config/rs6000/aros.h gcc-6.1.0.aros/gcc/config/rs6000/aros.h
583 --- gcc-6.1.0/gcc/config/rs6000/aros.h 1970-01-01 01:00:00.000000000 +0100
584 +++ gcc-6.1.0.aros/gcc/config/rs6000/aros.h 2016-04-27 15:13:21.001535038 +0100
585 @@ -0,0 +1,151 @@
586 +/* Definitions for Powerpc running AROS systems with ELF format.
587 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002
588 + Free Software Foundation, Inc.
589 + Contributed by Markus Weiss.
590 + Based upon i386/aros.h by Fabio Alemagna.
592 +This file is part of GNU CC.
594 +GNU CC is free software; you can redistribute it and/or modify
595 +it under the terms of the GNU General Public License as published by
596 +the Free Software Foundation; either version 2, or (at your option)
597 +any later version.
599 +GNU CC is distributed in the hope that it will be useful,
600 +but WITHOUT ANY WARRANTY; without even the implied warranty of
601 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
602 +GNU General Public License for more details.
604 +You should have received a copy of the GNU General Public License
605 +along with GNU CC; see the file COPYING. If not, write to
606 +the Free Software Foundation, 59 Temple Place - Suite 330,
607 +Boston, MA 02111-1307, USA. */
609 +/* Symbols missing in comparison to i386/aros.h are either
610 + defined in elfos.h, rs6000/rs6000.h rs6000/sysv4.h
611 + or not needed for PowerPC.
614 +/* We need to define __powerpc__. */
616 +#undef TARGET_OS_CPP_BUILTINS
617 +#define TARGET_OS_CPP_BUILTINS() \
618 + do \
619 + { \
620 + builtin_define_std ("AROS"); \
621 + builtin_define ("AMIGA"); \
622 + builtin_define ("_AMIGA"); \
623 + builtin_define ("__powerpc__"); \
624 + builtin_define ("__ELF__"); \
625 + builtin_assert ("system=posix"); \
626 + if (flag_pic) \
627 + { \
628 + builtin_define ("__PIC__"); \
629 + builtin_define ("__pic__"); \
630 + } \
631 + } \
632 + while (0)
634 +/* This one taken from linux.h. */
635 +/* We are 32-bit all the time, so optimize a little. */
636 +#undef TARGET_64BIT
637 +#define TARGET_64BIT 0
639 +/* The svr4 ABI for the i386 says that records and unions are returned
640 + in memory. */
641 +/*#undef DEFAULT_PCC_STRUCT_RETURN
642 +#define DEFAULT_PCC_STRUCT_RETURN 1
643 +see rs6000/rs6000.h
647 +#undef ASM_COMMENT_START
648 +#define ASM_COMMENT_START "#"
649 +see rs6000/rs6000.h
653 +#undef DBX_REGISTER_NUMBER
654 +#define DBX_REGISTER_NUMBER(n) \
655 + (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
656 +see rs6000/sysv4.h
659 +/* Output assembler code to FILE to call the profiler.
660 + To the best of my knowledge, no Linux libc has required the label
661 + argument to mcount. */
664 +#define NO_PROFILE_COUNTERS 1
665 +not used by other similar ppc compilers
666 +only in darwin.h rs6000/linux64.h rs6000/rs6000.c
670 +#undef MCOUNT_NAME
671 +#define MCOUNT_NAME "mcount"
672 +see rs6000/sysv4.h RS6000_MCOUNT
675 +/* The GLIBC version of mcount for the x86 assumes that there is a
676 + frame, so we cannot allow profiling without a frame pointer. */
678 +#undef SUBTARGET_FRAME_POINTER_REQUIRED
679 +#define SUBTARGET_FRAME_POINTER_REQUIRED crtl->profile
680 +seems to be handled by rs6000/rs6000.h
683 +#undef CC1_SPEC
684 +#define CC1_SPEC "%(cc1_cpu) %{profile:-p}"
686 +/* Provide a LINK_SPEC appropriate for AROS. */
688 +#undef LINK_SPEC
689 +#define LINK_SPEC "-m elf32ppc -L %R/lib"
691 +/* A C statement (sans semicolon) to output to the stdio stream
692 + FILE the assembler definition of uninitialized global DECL named
693 + NAME whose size is SIZE bytes and alignment is ALIGN bytes.
694 + Try to use asm_output_aligned_bss to implement this macro. */
696 +#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
697 + asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
698 +see rs6000/sysv4.h
701 +/* A C statement to output to the stdio stream FILE an assembler
702 + command to advance the location counter to a multiple of 1<<LOG
703 + bytes if it is within MAX_SKIP bytes.
705 + This is used to align code labels according to Intel recommendations. */
707 +#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
708 +#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
709 + do { \
710 + if ((LOG) != 0) { \
711 + if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
712 + else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
713 + } \
714 + } while (0)
715 +#endif
716 +see rs6000/sysv4.h
719 +/* Handle special EH pointer encodings. Absolute, pc-relative, and
720 + indirect are handled automatically. */
722 +#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
723 + do { \
724 + if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel) \
725 + { \
726 + fputs (ASM_LONG, FILE); \
727 + assemble_name (FILE, XSTR (ADDR, 0)); \
728 + fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
729 + goto DONE; \
730 + } \
731 + } while (0)
732 +not used for PowerPC
735 +/* FIXME: AROS doesn't support dw2 unwinding yet. */
736 +#undef MD_FALLBACK_FRAME_STATE_FOR
737 diff -ruN gcc-6.1.0/gcc/config/rs6000/rs6000.c gcc-6.1.0.aros/gcc/config/rs6000/rs6000.c
738 --- gcc-6.1.0/gcc/config/rs6000/rs6000.c 2016-04-15 00:21:30.000000000 +0100
739 +++ gcc-6.1.0.aros/gcc/config/rs6000/rs6000.c 2016-04-27 15:13:21.001535038 +0100
740 @@ -1429,6 +1429,8 @@
741 false },
742 { "shortcall", 0, 0, false, true, true, rs6000_handle_longcall_attribute,
743 false },
744 + { "stackparm", 0, 0, false, true, true, rs6000_handle_longcall_attribute,
745 + false },
746 { "ms_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute,
747 false },
748 { "gcc_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute,
749 @@ -9934,6 +9936,9 @@
750 && !lookup_attribute ("shortcall", TYPE_ATTRIBUTES (fntype))))
751 cum->call_cookie |= CALL_LONG;
753 + cum->stackparm = fntype && lookup_attribute("stackparm",
754 + TYPE_ATTRIBUTES(fntype));
756 if (TARGET_DEBUG_ARG)
758 fprintf (stderr, "\ninit_cumulative_args:");
759 @@ -11080,6 +11085,9 @@
761 rs6000_discover_homogeneous_aggregate (mode, type, &elt_mode, &n_elts);
763 + if (cum->stackparm)
764 + return NULL_RTX;
766 if (TARGET_MACHO && rs6000_darwin64_struct_check_p (mode, type))
768 rtx rslt = rs6000_darwin64_record_arg (cum, type, named, /*retval= */false);
769 @@ -11688,6 +11696,9 @@
770 int first_reg_offset;
771 alias_set_type set;
773 + if (cum->stackparm)
774 + return;
776 /* Skip the last named argument. */
777 next_cum = *get_cumulative_args (cum);
778 rs6000_function_arg_advance_1 (&next_cum, mode, type, true, 0);
779 diff -ruN gcc-6.1.0/gcc/config/rs6000/rs6000.h gcc-6.1.0.aros/gcc/config/rs6000/rs6000.h
780 --- gcc-6.1.0/gcc/config/rs6000/rs6000.h 2016-01-20 20:30:24.000000000 +0000
781 +++ gcc-6.1.0.aros/gcc/config/rs6000/rs6000.h 2016-04-27 15:13:21.001535038 +0100
782 @@ -1836,6 +1836,7 @@
783 int nargs_prototype; /* # args left in the current prototype */
784 int prototype; /* Whether a prototype was defined */
785 int stdarg; /* Whether function is a stdarg function. */
786 + int stackparm; /* Whether function has all args on the stack */
787 int call_cookie; /* Do special things for this call */
788 int sysv_gregno; /* next available GP register */
789 int intoffset; /* running offset in struct (darwin64) */
790 diff -ruN gcc-6.1.0/gcc/config/t-aros gcc-6.1.0.aros/gcc/config/t-aros
791 --- gcc-6.1.0/gcc/config/t-aros 1970-01-01 01:00:00.000000000 +0100
792 +++ gcc-6.1.0.aros/gcc/config/t-aros 2016-04-27 15:13:21.001535038 +0100
793 @@ -0,0 +1,29 @@
794 +# In AROS, "/usr" is a four-letter word.
795 +# Must match NATIVE_SYSTEM_HEADER_COMPONENT in aros.h !
796 +NATIVE_SYSTEM_HEADER_DIR = /include
798 +# Don't add AROS target include path when compiling host compiler
799 +CPPFLAGS =
801 +# Copy AROS specific include replacement files
802 +LIBGCC_DEPS += stmp-aros-hrds
804 +EXTRA_AROS_HEADERS = aros/types/size_t.h aros/types/ptrdiff_t.h \
805 + aros/types/wchar_t.h aros/types/wint_t.h aros/types/null.h
807 +stmp-int-hdrs : | include/aros/types
809 +include/aros/types : $(addprefix $(srcdir)/ginclude/,$(EXTRA_AROS_HEADERS))
810 + -if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi
811 + -if [ -d include/aros/types ] ; \
812 + then true; \
813 + else \
814 + mkdir include/aros; chmod a+rx include/aros; \
815 + mkdir include/aros/types; chmod a+rx include/aros/types; \
816 + fi
817 + for file in $(EXTRA_AROS_HEADERS); do \
818 + $(STAMP) include/$$file; \
819 + rm -fr include/$$file; \
820 + cp $(srcdir)/ginclude/$$file include/$$file; \
821 + chmod a+r include/$$file; \
822 + done
823 diff -ruN gcc-6.1.0/gcc/config.build gcc-6.1.0.aros/gcc/config.build
824 --- gcc-6.1.0/gcc/config.build 2016-01-04 14:30:50.000000000 +0000
825 +++ gcc-6.1.0.aros/gcc/config.build 2016-04-27 15:13:21.001535038 +0100
826 @@ -73,6 +73,9 @@
827 build_xm_file=i386/xm-djgpp.h
828 build_exeext=.exe
830 + *-*-aros*)
831 + build_xm_file=xm-aros.h
832 + ;;
833 *-*-sysv*)
834 # All other System V variants.
835 build_install_headers_dir=install-headers-cpio
836 diff -ruN gcc-6.1.0/gcc/config.gcc gcc-6.1.0.aros/gcc/config.gcc
837 --- gcc-6.1.0/gcc/config.gcc 2016-04-11 11:14:59.000000000 +0100
838 +++ gcc-6.1.0.aros/gcc/config.gcc 2016-04-27 15:13:21.001535038 +0100
839 @@ -798,6 +798,15 @@
841 esac
843 +*-*-aros*)
844 + gas=yes
845 + gnu_ld=yes
846 + thread_file=posix
847 + use_collect2=no
848 + xm_defines='STDC_HEADERS=1'
849 + extra_options="${extra_options} aros.opt"
850 + ;;
852 *-*-openbsd*)
853 tmake_file="t-openbsd"
854 case ${enable_threads} in
855 @@ -907,6 +916,11 @@
856 esac
858 case ${target} in
859 +aarch64*-*-aros*)
860 + tm_file="${tm_file} dbxelf.h elfos.h aarch64/aarch64-elf.h aros.h aarch64/aros.h"
861 + tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aros t-aros"
862 + xm_file="xm-aros.h"
863 + ;;
864 aarch64*-*-elf | aarch64*-*-rtems*)
865 tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h"
866 tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-elf-raw.h"
867 @@ -993,6 +1007,16 @@
868 tm_file="${tm_file} vms/vms.h alpha/vms.h"
869 tmake_file="${tmake_file} alpha/t-vms"
871 +arm*-*-aros*)
872 + tm_file="dbxelf.h elfos.h arm/elf.h arm/bpabi.h aros.h arm/aros.h arm/aout.h arm/arm.h"
873 + tm_file="$tm_file ../../libgcc/config/arm/bpabi-lib.h"
874 + tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-arm-softfp arm/t-bpabi arm/t-aros t-aros"
875 + xm_file="xm-aros.h"
876 + # The BPABI long long divmod functions return a 128-bit value in
877 + # registers r0-r3. Correctly modeling that requires the use of
878 + # TImode.
879 + need_64bit_hwint=yes
880 + ;;
881 arc*-*-elf*)
882 extra_headers="arc-simd.h"
883 tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
884 @@ -1594,6 +1618,16 @@
885 done
886 TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
888 +i[34567]86-*-aros*)
889 + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h aros.h i386/aros.h"
890 + xm_file=xm-aros.h
891 + tmake_file="${tmake_file} i386/t-i386elf t-aros"
892 + ;;
893 +x86_64-*-aros*)
894 + 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"
895 + tmake_file="${tmake_file} i386/t-i386elf t-aros"
896 + xm_file=xm-aros.h
897 + ;;
898 i[34567]86-pc-msdosdjgpp*)
899 xm_file=i386/xm-djgpp.h
900 tm_file="dbxcoff.h ${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h i386/djgpp-stdint.h"
901 @@ -1891,6 +1925,16 @@
902 thread_file='posix'
905 +m68k-*-aros*)
906 + default_m68k_cpu=68000
907 + default_cf_cpu=5206
908 + 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"
909 + tm_file="${tm_file} aros.h"
910 + tm_defines="${tm_defines} MOTOROLA=1"
911 + tmake_file="m68k/t-floatlib m68k/t-m68kbare m68k/t-m68kelf"
912 + tmake_file="$tmake_file m68k/t-aros m68k/t-mlibs t-aros"
913 + extra_parts="crtbegin.o crtend.o"
914 + ;;
915 m68k-*-elf* | fido-*-elf*)
916 case ${target} in
917 fido-*-elf*)
918 @@ -2391,6 +2435,13 @@
919 extra_options="${extra_options} rs6000/sysv4.opt"
920 tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems rs6000/t-ppccomm"
922 +powerpc-*-aros*)
923 + tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h aros.h"
924 + extra_options="${extra_options} rs6000/sysv4.opt"
925 + tm_file="${tm_file} rs6000/aros.h"
926 + xm_file=xm-aros.h
927 + tmake_file="$tmake_file t-aros"
928 + ;;
929 powerpc*-*-linux*)
930 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h"
931 extra_options="${extra_options} rs6000/sysv4.opt"
932 diff -ruN gcc-6.1.0/gcc/config.host gcc-6.1.0.aros/gcc/config.host
933 --- gcc-6.1.0/gcc/config.host 2016-01-04 14:30:50.000000000 +0000
934 +++ gcc-6.1.0.aros/gcc/config.host 2016-04-27 15:13:21.001535038 +0100
935 @@ -281,6 +281,10 @@
936 out_host_hook_obj=host-hpux.o
937 host_xmake_file="${host_xmake_file} x-hpux"
939 + *-*-aros*)
940 + host_can_use_collect2=no
941 + host_xm_file=xm-aros.h
942 + ;;
943 *-*-*vms*)
944 host_xm_file="vms/xm-vms.h"
945 host_xmake_file=vms/x-vms
946 diff -ruN gcc-6.1.0/gcc/ginclude/aros/types/null.h gcc-6.1.0.aros/gcc/ginclude/aros/types/null.h
947 --- gcc-6.1.0/gcc/ginclude/aros/types/null.h 1970-01-01 01:00:00.000000000 +0100
948 +++ gcc-6.1.0.aros/gcc/ginclude/aros/types/null.h 2016-04-27 15:13:21.001535038 +0100
949 @@ -0,0 +1,3 @@
950 +/* Replace AROS' NULL definition with gcc's one */
951 +#define __need_NULL
952 +#include <stddef.h>
953 diff -ruN gcc-6.1.0/gcc/ginclude/aros/types/ptrdiff_t.h gcc-6.1.0.aros/gcc/ginclude/aros/types/ptrdiff_t.h
954 --- gcc-6.1.0/gcc/ginclude/aros/types/ptrdiff_t.h 1970-01-01 01:00:00.000000000 +0100
955 +++ gcc-6.1.0.aros/gcc/ginclude/aros/types/ptrdiff_t.h 2016-04-27 15:13:21.001535038 +0100
956 @@ -0,0 +1,3 @@
957 +/* Replace AROS' ptrdiff_t definition with gcc's one */
958 +#define __need_ptrdiff_t
959 +#include <stddef.h>
960 diff -ruN gcc-6.1.0/gcc/ginclude/aros/types/size_t.h gcc-6.1.0.aros/gcc/ginclude/aros/types/size_t.h
961 --- gcc-6.1.0/gcc/ginclude/aros/types/size_t.h 1970-01-01 01:00:00.000000000 +0100
962 +++ gcc-6.1.0.aros/gcc/ginclude/aros/types/size_t.h 2016-04-27 15:13:21.001535038 +0100
963 @@ -0,0 +1,3 @@
964 +/* Replace AROS' size_t definition with gcc's one */
965 +#define __need_size_t
966 +#include <stddef.h>
967 diff -ruN gcc-6.1.0/gcc/ginclude/aros/types/wchar_t.h gcc-6.1.0.aros/gcc/ginclude/aros/types/wchar_t.h
968 --- gcc-6.1.0/gcc/ginclude/aros/types/wchar_t.h 1970-01-01 01:00:00.000000000 +0100
969 +++ gcc-6.1.0.aros/gcc/ginclude/aros/types/wchar_t.h 2016-04-27 15:13:21.001535038 +0100
970 @@ -0,0 +1,3 @@
971 +/* Replace AROS' wchar_t definition with gcc's one */
972 +#define __need_wchar_t
973 +#include <stddef.h>
974 diff -ruN gcc-6.1.0/gcc/ginclude/aros/types/wint_t.h gcc-6.1.0.aros/gcc/ginclude/aros/types/wint_t.h
975 --- gcc-6.1.0/gcc/ginclude/aros/types/wint_t.h 1970-01-01 01:00:00.000000000 +0100
976 +++ gcc-6.1.0.aros/gcc/ginclude/aros/types/wint_t.h 2016-04-27 15:13:21.001535038 +0100
977 @@ -0,0 +1,3 @@
978 +/* Replace AROS' wint_t definition with gcc's one */
979 +#define __need_wint_t
980 +#include <stddef.h>
981 diff -ruN gcc-6.1.0/gcc/ginclude/stddef.h gcc-6.1.0.aros/gcc/ginclude/stddef.h
982 --- gcc-6.1.0/gcc/ginclude/stddef.h 2016-01-04 14:30:50.000000000 +0000
983 +++ gcc-6.1.0.aros/gcc/ginclude/stddef.h 2016-04-27 15:13:21.001535038 +0100
984 @@ -131,6 +131,7 @@
985 #ifndef __PTRDIFF_T
986 #ifndef _PTRDIFF_T_
987 #ifndef _BSD_PTRDIFF_T_
988 +#ifndef _AROS_TYPES_PTRDIFF_T_H
989 #ifndef ___int_ptrdiff_t_h
990 #ifndef _GCC_PTRDIFF_T
991 #ifndef _PTRDIFF_T_DECLARED /* DragonFly */
992 @@ -140,6 +141,7 @@
993 #define __PTRDIFF_T
994 #define _PTRDIFF_T_
995 #define _BSD_PTRDIFF_T_
996 +#define _AROS_TYPES_PTRDIFF_T_H
997 #define ___int_ptrdiff_t_h
998 #define _GCC_PTRDIFF_T
999 #define _PTRDIFF_T_DECLARED
1000 @@ -150,6 +152,7 @@
1001 #endif /* _PTRDIFF_T_DECLARED */
1002 #endif /* _GCC_PTRDIFF_T */
1003 #endif /* ___int_ptrdiff_t_h */
1004 +#endif /* _AROS_TYPES_PTRDIFF_T_H */
1005 #endif /* _BSD_PTRDIFF_T_ */
1006 #endif /* _PTRDIFF_T_ */
1007 #endif /* __PTRDIFF_T */
1008 @@ -176,6 +179,7 @@
1009 #ifndef __SIZE_T
1010 #ifndef _SIZE_T_
1011 #ifndef _BSD_SIZE_T_
1012 +#ifndef _AROS_TYPES_SIZE_T_H
1013 #ifndef _SIZE_T_DEFINED_
1014 #ifndef _SIZE_T_DEFINED
1015 #ifndef _BSD_SIZE_T_DEFINED_ /* Darwin */
1016 @@ -193,6 +197,7 @@
1017 #define __SIZE_T
1018 #define _SIZE_T_
1019 #define _BSD_SIZE_T_
1020 +#define _AROS_TYPES_SIZE_T_H
1021 #define _SIZE_T_DEFINED_
1022 #define _SIZE_T_DEFINED
1023 #define _BSD_SIZE_T_DEFINED_ /* Darwin */
1024 @@ -226,6 +231,7 @@
1025 #endif /* _BSD_SIZE_T_DEFINED_ */
1026 #endif /* _SIZE_T_DEFINED */
1027 #endif /* _SIZE_T_DEFINED_ */
1028 +#endif /* _AROS_TYPES_SIZE_T_H */
1029 #endif /* _BSD_SIZE_T_ */
1030 #endif /* _SIZE_T_ */
1031 #endif /* __SIZE_T */
1032 diff -ruN gcc-6.1.0/include/filenames.h gcc-6.1.0.aros/include/filenames.h
1033 --- gcc-6.1.0/include/filenames.h 2015-07-14 17:08:59.000000000 +0100
1034 +++ gcc-6.1.0.aros/include/filenames.h 2016-04-27 15:13:21.001535038 +0100
1035 @@ -42,6 +42,10 @@
1036 # define HAS_DRIVE_SPEC(f) HAS_DOS_DRIVE_SPEC (f)
1037 # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c)
1038 # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f)
1039 +#elif defined __AROS__
1040 +# define IS_DIR_SEPARATOR(c) ((c) == '/' || (c) == ':')
1041 +# define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0]) || (strchr((f), ':')))
1042 +# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM
1043 #else /* not DOSish */
1044 # if defined(__APPLE__)
1045 # ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
1046 diff -ruN gcc-6.1.0/libgcc/config.host gcc-6.1.0.aros/libgcc/config.host
1047 --- gcc-6.1.0/libgcc/config.host 2016-02-26 20:02:28.000000000 +0000
1048 +++ gcc-6.1.0.aros/libgcc/config.host 2016-04-27 15:13:21.001535038 +0100
1049 @@ -804,7 +804,7 @@
1050 m32rle-*-linux*)
1051 tmake_file="$tmake_file m32r/t-linux t-fdpbit"
1053 -m68k-*-elf* | fido-*-elf)
1054 +m68k-*-elf* | fido-*-elf | m68k-*-aros*)
1055 tmake_file="$tmake_file m68k/t-floatlib"
1057 m68k*-*-netbsdelf*)
1058 @@ -1333,6 +1333,9 @@
1059 tmake_file="$tmake_file nvptx/t-nvptx"
1060 extra_parts="crt0.o"
1062 +*-*-aros*)
1063 + tmake_file=
1064 + ;;
1066 echo "*** Configuration ${host} not supported" 1>&2
1067 exit 1
1068 diff -ruN gcc-6.1.0/libgcc/gthr.h gcc-6.1.0.aros/libgcc/gthr.h
1069 --- gcc-6.1.0/libgcc/gthr.h 2016-01-04 14:30:50.000000000 +0000
1070 +++ gcc-6.1.0.aros/libgcc/gthr.h 2016-04-27 15:13:21.001535038 +0100
1071 @@ -141,6 +141,11 @@
1072 #define GTHREAD_USE_WEAK 0
1073 #endif
1075 +#ifdef __AROS__
1076 +#undef GTHREAD_USE_WEAK
1077 +#define GTHREAD_USE_WEAK 0
1078 +#endif
1080 #ifndef GTHREAD_USE_WEAK
1081 #define GTHREAD_USE_WEAK 1
1082 #endif
1083 diff -ruN gcc-6.1.0/libgcc/unwind-dw2.c gcc-6.1.0.aros/libgcc/unwind-dw2.c
1084 --- gcc-6.1.0/libgcc/unwind-dw2.c 2016-01-04 14:30:50.000000000 +0000
1085 +++ gcc-6.1.0.aros/libgcc/unwind-dw2.c 2016-04-27 15:13:21.001535038 +0100
1086 @@ -1542,7 +1542,9 @@
1087 static inline void
1088 init_dwarf_reg_size_table (void)
1090 +#ifdef MD_FALLBACK_FRAME_STATE_FOR
1091 __builtin_init_dwarf_reg_size_table (dwarf_reg_size_table);
1092 +#endif
1095 static void __attribute__((noinline))
1096 diff -ruN gcc-6.1.0/libgcc/unwind-dw2-fde.c gcc-6.1.0.aros/libgcc/unwind-dw2-fde.c
1097 --- gcc-6.1.0/libgcc/unwind-dw2-fde.c 2016-01-04 14:30:50.000000000 +0000
1098 +++ gcc-6.1.0.aros/libgcc/unwind-dw2-fde.c 2016-04-27 15:13:21.001535038 +0100
1099 @@ -92,12 +92,16 @@
1100 #endif
1102 init_object_mutex_once ();
1103 +#ifndef __AROS__ /* This is called when SysBase is not yet set up */
1104 __gthread_mutex_lock (&object_mutex);
1105 +#endif
1107 ob->next = unseen_objects;
1108 unseen_objects = ob;
1110 +#ifndef __AROS__
1111 __gthread_mutex_unlock (&object_mutex);
1112 +#endif
1115 void
1116 diff -ruN gcc-6.1.0/libiberty/filename_cmp.c gcc-6.1.0.aros/libiberty/filename_cmp.c
1117 --- gcc-6.1.0/libiberty/filename_cmp.c 2014-11-11 23:33:25.000000000 +0000
1118 +++ gcc-6.1.0.aros/libiberty/filename_cmp.c 2016-04-27 15:13:21.001535038 +0100
1119 @@ -55,9 +55,12 @@
1121 filename_cmp (const char *s1, const char *s2)
1123 -#if !defined(HAVE_DOS_BASED_FILE_SYSTEM) \
1124 - && !defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
1125 +#if !defined(HAVE_DOS_BASED_FILE_SYSTEM)
1126 +#if defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
1127 + return strcasecmp(s1, s2);
1128 +#else
1129 return strcmp(s1, s2);
1130 +#endif
1131 #else
1132 for (;;)
1134 diff -ruN gcc-6.1.0/libobjc/configure gcc-6.1.0.aros/libobjc/configure
1135 --- gcc-6.1.0/libobjc/configure 2016-04-27 09:22:11.000000000 +0100
1136 +++ gcc-6.1.0.aros/libobjc/configure 2016-04-27 15:13:21.001535038 +0100
1137 @@ -11253,214 +11253,7 @@
1138 # -----------
1140 # Check if we have thread-local storage
1143 - # Check whether --enable-tls was given.
1144 -if test "${enable_tls+set}" = set; then :
1145 - enableval=$enable_tls;
1146 - case "$enableval" in
1147 - yes|no) ;;
1148 - *) as_fn_error "Argument to enable/disable tls must be yes or no" "$LINENO" 5 ;;
1149 - esac
1151 -else
1152 - enable_tls=yes
1156 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports thread-local storage" >&5
1157 -$as_echo_n "checking whether the target supports thread-local storage... " >&6; }
1158 -if test "${gcc_cv_have_tls+set}" = set; then :
1159 - $as_echo_n "(cached) " >&6
1160 -else
1162 - if test "$cross_compiling" = yes; then :
1163 - if test x$gcc_no_link = xyes; then
1164 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1166 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1167 -/* end confdefs.h. */
1168 -__thread int a; int b; int main() { return a = b; }
1169 -_ACEOF
1170 -if ac_fn_c_try_link "$LINENO"; then :
1171 - chktls_save_LDFLAGS="$LDFLAGS"
1172 - case $host in
1173 - *-*-linux*)
1174 - LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
1175 - ;;
1176 - esac
1177 - chktls_save_CFLAGS="$CFLAGS"
1178 - CFLAGS="-fPIC $CFLAGS"
1179 - if test x$gcc_no_link = xyes; then
1180 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1182 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1183 -/* end confdefs.h. */
1184 -int f() { return 0; }
1185 -_ACEOF
1186 -if ac_fn_c_try_link "$LINENO"; then :
1187 - if test x$gcc_no_link = xyes; then
1188 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1190 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1191 -/* end confdefs.h. */
1192 -__thread int a; int b; int f() { return a = b; }
1193 -_ACEOF
1194 -if ac_fn_c_try_link "$LINENO"; then :
1195 - gcc_cv_have_tls=yes
1196 -else
1197 - gcc_cv_have_tls=no
1199 -rm -f core conftest.err conftest.$ac_objext \
1200 - conftest$ac_exeext conftest.$ac_ext
1201 -else
1202 - gcc_cv_have_tls=yes
1204 -rm -f core conftest.err conftest.$ac_objext \
1205 - conftest$ac_exeext conftest.$ac_ext
1206 - CFLAGS="$chktls_save_CFLAGS"
1207 - LDFLAGS="$chktls_save_LDFLAGS"
1208 -else
1209 - gcc_cv_have_tls=no
1211 -rm -f core conftest.err conftest.$ac_objext \
1212 - conftest$ac_exeext conftest.$ac_ext
1215 -else
1216 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1217 -/* end confdefs.h. */
1218 -__thread int a; int b; int main() { return a = b; }
1219 -_ACEOF
1220 -if ac_fn_c_try_run "$LINENO"; then :
1221 - chktls_save_LDFLAGS="$LDFLAGS"
1222 - LDFLAGS="-static $LDFLAGS"
1223 - if test x$gcc_no_link = xyes; then
1224 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1226 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1227 -/* end confdefs.h. */
1228 -int main() { return 0; }
1229 -_ACEOF
1230 -if ac_fn_c_try_link "$LINENO"; then :
1231 - if test "$cross_compiling" = yes; then :
1232 - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
1233 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1234 -as_fn_error "cannot run test program while cross compiling
1235 -See \`config.log' for more details." "$LINENO" 5; }
1236 -else
1237 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1238 -/* end confdefs.h. */
1239 -__thread int a; int b; int main() { return a = b; }
1240 -_ACEOF
1241 -if ac_fn_c_try_run "$LINENO"; then :
1242 - gcc_cv_have_tls=yes
1243 -else
1244 - gcc_cv_have_tls=no
1246 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1247 - conftest.$ac_objext conftest.beam conftest.$ac_ext
1250 -else
1251 - gcc_cv_have_tls=yes
1253 -rm -f core conftest.err conftest.$ac_objext \
1254 - conftest$ac_exeext conftest.$ac_ext
1255 - LDFLAGS="$chktls_save_LDFLAGS"
1256 - if test $gcc_cv_have_tls = yes; then
1257 - chktls_save_CFLAGS="$CFLAGS"
1258 - thread_CFLAGS=failed
1259 - for flag in '' '-pthread' '-lpthread'; do
1260 - CFLAGS="$flag $chktls_save_CFLAGS"
1261 - if test x$gcc_no_link = xyes; then
1262 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1264 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1265 -/* end confdefs.h. */
1266 -#include <pthread.h>
1267 - void *g(void *d) { return NULL; }
1268 -int
1269 -main ()
1271 -pthread_t t; pthread_create(&t,NULL,g,NULL);
1273 - return 0;
1275 -_ACEOF
1276 -if ac_fn_c_try_link "$LINENO"; then :
1277 - thread_CFLAGS="$flag"
1279 -rm -f core conftest.err conftest.$ac_objext \
1280 - conftest$ac_exeext conftest.$ac_ext
1281 - if test "X$thread_CFLAGS" != Xfailed; then
1282 - break
1283 - fi
1284 - done
1285 - CFLAGS="$chktls_save_CFLAGS"
1286 - if test "X$thread_CFLAGS" != Xfailed; then
1287 - CFLAGS="$thread_CFLAGS $chktls_save_CFLAGS"
1288 - if test "$cross_compiling" = yes; then :
1289 - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
1290 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1291 -as_fn_error "cannot run test program while cross compiling
1292 -See \`config.log' for more details." "$LINENO" 5; }
1293 -else
1294 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1295 -/* end confdefs.h. */
1296 -#include <pthread.h>
1297 - __thread int a;
1298 - static int *volatile a_in_other_thread;
1299 - static void *
1300 - thread_func (void *arg)
1302 - a_in_other_thread = &a;
1303 - return (void *)0;
1305 -int
1306 -main ()
1308 -pthread_t thread;
1309 - void *thread_retval;
1310 - int *volatile a_in_main_thread;
1311 - a_in_main_thread = &a;
1312 - if (pthread_create (&thread, (pthread_attr_t *)0,
1313 - thread_func, (void *)0))
1314 - return 0;
1315 - if (pthread_join (thread, &thread_retval))
1316 - return 0;
1317 - return (a_in_other_thread == a_in_main_thread);
1319 - return 0;
1321 -_ACEOF
1322 -if ac_fn_c_try_run "$LINENO"; then :
1323 - gcc_cv_have_tls=yes
1324 -else
1325 - gcc_cv_have_tls=no
1327 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1328 - conftest.$ac_objext conftest.beam conftest.$ac_ext
1331 - CFLAGS="$chktls_save_CFLAGS"
1332 - fi
1333 - fi
1334 -else
1335 - gcc_cv_have_tls=no
1337 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1338 - conftest.$ac_objext conftest.beam conftest.$ac_ext
1342 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_have_tls" >&5
1343 -$as_echo "$gcc_cv_have_tls" >&6; }
1344 - if test "$enable_tls $gcc_cv_have_tls" = "yes yes"; then
1346 -$as_echo "#define HAVE_TLS 1" >>confdefs.h
1348 - fi
1349 +#dnl GCC_ENABLE_TLS
1352 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the type of bitfields matters" >&5
1353 diff -ruN gcc-6.1.0/libobjc/configure.ac gcc-6.1.0.aros/libobjc/configure.ac
1354 --- gcc-6.1.0/libobjc/configure.ac 2016-01-04 14:30:50.000000000 +0000
1355 +++ gcc-6.1.0.aros/libobjc/configure.ac 2016-04-27 15:13:21.001535038 +0100
1356 @@ -210,7 +210,7 @@
1357 # -----------
1359 # Check if we have thread-local storage
1360 -GCC_CHECK_TLS
1361 +dnl GCC_CHECK_TLS
1363 gt_BITFIELD_TYPE_MATTERS
1365 diff -ruN gcc-6.1.0/libobjc/thr.c gcc-6.1.0.aros/libobjc/thr.c
1366 --- gcc-6.1.0/libobjc/thr.c 2016-01-04 14:30:50.000000000 +0000
1367 +++ gcc-6.1.0.aros/libobjc/thr.c 2016-04-27 15:13:21.001535038 +0100
1368 @@ -35,6 +35,7 @@
1369 #include "objc/runtime.h"
1370 #include "objc-private/module-abi-8.h"
1371 #include "objc-private/runtime.h"
1372 +#define __typedef_BOOL /* Remove definition of BOOL */
1373 #include <gthr.h>
1375 #include <stdlib.h>
1376 diff -ruN gcc-6.1.0/libstdc++-v3/config/os/aros/ctype_base.h gcc-6.1.0.aros/libstdc++-v3/config/os/aros/ctype_base.h
1377 --- gcc-6.1.0/libstdc++-v3/config/os/aros/ctype_base.h 1970-01-01 01:00:00.000000000 +0100
1378 +++ gcc-6.1.0.aros/libstdc++-v3/config/os/aros/ctype_base.h 2016-04-27 15:13:21.001535038 +0100
1379 @@ -0,0 +1,30 @@
1380 +namespace std _GLIBCXX_VISIBILITY(default)
1382 +_GLIBCXX_BEGIN_NAMESPACE_VERSION
1384 +struct ctype_base {
1385 + /* Non-standard typedefs */
1386 + typedef int * __to_type;
1388 + /* NB: Offsets into ctype<char>::_M_table force a particular size
1389 + on the mask type. Because of this, we don't use an enum. */
1390 + typedef unsigned short int mask;
1392 + static const mask upper = _ISupper;
1393 + static const mask lower = _ISlower;
1394 + static const mask alpha = _ISalpha;
1395 + static const mask digit = _ISdigit;
1396 + static const mask xdigit = _ISxdigit;
1397 + static const mask space = _ISspace;
1398 + static const mask print = _ISprint;
1399 + static const mask graph = _ISgraph;
1400 + static const mask cntrl = _IScntrl;
1401 + static const mask punct = _ISpunct;
1402 + static const mask alnum = _ISalnum;
1403 +#if __cplusplus >= 201103L
1404 + static const mask blank = _ISblank;
1405 +#endif
1408 +_GLIBCXX_END_NAMESPACE_VERSION
1409 +} // namespace
1410 diff -ruN gcc-6.1.0/libstdc++-v3/config/os/aros/ctype_configure_char.cc gcc-6.1.0.aros/libstdc++-v3/config/os/aros/ctype_configure_char.cc
1411 --- gcc-6.1.0/libstdc++-v3/config/os/aros/ctype_configure_char.cc 1970-01-01 01:00:00.000000000 +0100
1412 +++ gcc-6.1.0.aros/libstdc++-v3/config/os/aros/ctype_configure_char.cc 2016-04-27 15:13:21.001535038 +0100
1413 @@ -0,0 +1,99 @@
1414 +// Locale support -*- C++ -*-
1416 +// Copyright (C) 2011-2013 Free Software Foundation, Inc.
1418 +// This file is part of the GNU ISO C++ Library. This library is free
1419 +// software; you can redistribute it and/or modify it under the
1420 +// terms of the GNU General Public License as published by the
1421 +// Free Software Foundation; either version 3, or (at your option)
1422 +// any later version.
1424 +// This library is distributed in the hope that it will be useful,
1425 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1426 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1427 +// GNU General Public License for more details.
1429 +// Under Section 7 of GPL version 3, you are granted additional
1430 +// permissions described in the GCC Runtime Library Exception, version
1431 +// 3.1, as published by the Free Software Foundation.
1433 +// You should have received a copy of the GNU General Public License and
1434 +// a copy of the GCC Runtime Library Exception along with this program;
1435 +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
1436 +// <http://www.gnu.org/licenses/>.
1438 +/** @file ctype_configure_char.cc */
1441 +// ISO C++ 14882: 22.1 Locales
1444 +#include <locale>
1445 +#include <cstdlib>
1446 +#include <cstring>
1448 +namespace std _GLIBCXX_VISIBILITY(default)
1450 +_GLIBCXX_BEGIN_NAMESPACE_VERSION
1452 +// Information as gleaned from /usr/include/ctype.h
1454 + const ctype_base::mask*
1455 + ctype<char>::classic_table() throw()
1456 + { return 0; }
1458 + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
1459 + size_t __refs)
1460 + : facet(__refs), _M_del(__table != 0 && __del),
1461 + _M_toupper(NULL), _M_tolower(NULL),
1462 + _M_table(__table ? __table : classic_table())
1463 + {
1464 + memset(_M_widen, 0, sizeof(_M_widen));
1465 + _M_widen_ok = 0;
1466 + memset(_M_narrow, 0, sizeof(_M_narrow));
1467 + _M_narrow_ok = 0;
1470 + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
1471 + : facet(__refs), _M_del(__table != 0 && __del),
1472 + _M_toupper(NULL), _M_tolower(NULL),
1473 + _M_table(__table ? __table : classic_table())
1474 + {
1475 + memset(_M_widen, 0, sizeof(_M_widen));
1476 + _M_widen_ok = 0;
1477 + memset(_M_narrow, 0, sizeof(_M_narrow));
1478 + _M_narrow_ok = 0;
1481 + char
1482 + ctype<char>::do_toupper(char __c) const
1483 + { return ::toupper((int) __c); }
1485 + const char*
1486 + ctype<char>::do_toupper(char* __low, const char* __high) const
1488 + while (__low < __high)
1490 + *__low = ::toupper((int) *__low);
1491 + ++__low;
1493 + return __high;
1496 + char
1497 + ctype<char>::do_tolower(char __c) const
1498 + { return ::tolower((int) __c); }
1500 + const char*
1501 + ctype<char>::do_tolower(char* __low, const char* __high) const
1503 + while (__low < __high)
1505 + *__low = ::tolower((int) *__low);
1506 + ++__low;
1508 + return __high;
1511 +_GLIBCXX_END_NAMESPACE_VERSION
1512 +} // namespace
1513 diff -ruN gcc-6.1.0/libstdc++-v3/config/os/aros/ctype_inline.h gcc-6.1.0.aros/libstdc++-v3/config/os/aros/ctype_inline.h
1514 --- gcc-6.1.0/libstdc++-v3/config/os/aros/ctype_inline.h 1970-01-01 01:00:00.000000000 +0100
1515 +++ gcc-6.1.0.aros/libstdc++-v3/config/os/aros/ctype_inline.h 2016-04-27 15:13:21.001535038 +0100
1516 @@ -0,0 +1,173 @@
1517 +// Locale support -*- C++ -*-
1519 +// Copyright (C) 2000, 2003 Free Software Foundation, Inc.
1521 +// This file is part of the GNU ISO C++ Library. This library is free
1522 +// software; you can redistribute it and/or modify it under the
1523 +// terms of the GNU General Public License as published by the
1524 +// Free Software Foundation; either version 2, or (at your option)
1525 +// any later version.
1527 +// This library is distributed in the hope that it will be useful,
1528 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1529 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1530 +// GNU General Public License for more details.
1532 +// You should have received a copy of the GNU General Public License along
1533 +// with this library; see the file COPYING. If not, write to the Free
1534 +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
1535 +// USA.
1537 +// As a special exception, you may use this file as part of a free software
1538 +// library without restriction. Specifically, if other files instantiate
1539 +// templates or use macros or inline functions from this file, or you compile
1540 +// this file and link it with other files to produce an executable, this
1541 +// file does not by itself cause the resulting executable to be covered by
1542 +// the GNU General Public License. This exception does not however
1543 +// invalidate any other reasons why the executable file might be covered by
1544 +// the GNU General Public License.
1546 +/** @file ctype_inline.h
1547 + * This is an internal header file, included by other library headers.
1548 + * You should not attempt to use it directly.
1549 + */
1552 +// ISO C++ 14882: 22.1 Locales
1555 +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
1556 +// functions go in ctype.cc
1558 +// The following definitions are portable, but insanely slow. If one
1559 +// cares at all about performance, then specialized ctype
1560 +// functionality should be added for the native os in question: see
1561 +// the config/os/bits/ctype_*.h files.
1563 +// Constructing a synthetic "C" table should be seriously considered...
1565 +namespace std _GLIBCXX_VISIBILITY(default)
1567 +_GLIBCXX_BEGIN_NAMESPACE_VERSION
1569 + bool
1570 + ctype<char>::
1571 + is(mask __m, char __c) const
1572 + {
1573 + if (_M_table)
1574 + return _M_table[static_cast<unsigned char>(__c)] & __m;
1575 + else
1577 + bool __ret = false;
1578 + const size_t __bitmasksize = 15;
1579 + size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0
1580 + for (; __bitcur <= __bitmasksize; ++__bitcur)
1582 + const mask __bit = static_cast<mask>(1 << __bitcur);
1583 + if (__m & __bit)
1585 + bool __testis;
1586 + switch (__bit)
1588 + case space:
1589 + __testis = isspace(__c);
1590 + break;
1591 + case print:
1592 + __testis = isprint(__c);
1593 + break;
1594 + case cntrl:
1595 + __testis = iscntrl(__c);
1596 + break;
1597 + case upper:
1598 + __testis = isupper(__c);
1599 + break;
1600 + case lower:
1601 + __testis = islower(__c);
1602 + break;
1603 + case alpha:
1604 + __testis = isalpha(__c);
1605 + break;
1606 + case digit:
1607 + __testis = isdigit(__c);
1608 + break;
1609 + case punct:
1610 + __testis = ispunct(__c);
1611 + break;
1612 + case xdigit:
1613 + __testis = isxdigit(__c);
1614 + break;
1615 + case alnum:
1616 + __testis = isalnum(__c);
1617 + break;
1618 + case graph:
1619 + __testis = isgraph(__c);
1620 + break;
1621 + default:
1622 + __testis = false;
1623 + break;
1625 + __ret |= __testis;
1628 + return __ret;
1632 + const char*
1633 + ctype<char>::
1634 + is(const char* __low, const char* __high, mask* __vec) const
1636 + if (_M_table)
1637 + while (__low < __high)
1638 + *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
1639 + else
1641 + // Highest bitmask in ctype_base == 10.
1642 + const size_t __bitmasksize = 15;
1643 + for (;__low < __high; ++__vec, ++__low)
1645 + mask __m = 0;
1646 + // Lowest bitmask in ctype_base == 0
1647 + size_t __i = 0;
1648 + for (;__i <= __bitmasksize; ++__i)
1650 + const mask __bit = static_cast<mask>(1 << __i);
1651 + if (this->is(__bit, *__low))
1652 + __m |= __bit;
1654 + *__vec = __m;
1657 + return __high;
1660 + const char*
1661 + ctype<char>::
1662 + scan_is(mask __m, const char* __low, const char* __high) const
1664 + if (_M_table)
1665 + while (__low < __high
1666 + && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
1667 + ++__low;
1668 + else
1669 + while (__low < __high && !this->is(__m, *__low))
1670 + ++__low;
1671 + return __low;
1674 + const char*
1675 + ctype<char>::
1676 + scan_not(mask __m, const char* __low, const char* __high) const
1678 + if (_M_table)
1679 + while (__low < __high
1680 + && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
1681 + ++__low;
1682 + else
1683 + while (__low < __high && this->is(__m, *__low) != 0)
1684 + ++__low;
1685 + return __low;
1688 +_GLIBCXX_END_NAMESPACE_VERSION
1689 +} // namespace
1690 diff -ruN gcc-6.1.0/libstdc++-v3/config/os/aros/ctype_noninline.h gcc-6.1.0.aros/libstdc++-v3/config/os/aros/ctype_noninline.h
1691 --- gcc-6.1.0/libstdc++-v3/config/os/aros/ctype_noninline.h 1970-01-01 01:00:00.000000000 +0100
1692 +++ gcc-6.1.0.aros/libstdc++-v3/config/os/aros/ctype_noninline.h 2016-04-27 15:13:21.001535038 +0100
1693 @@ -0,0 +1,56 @@
1694 + const ctype_base::mask*
1695 + ctype<char>::classic_table() throw()
1696 + { return *__ctype_b_ptr; }
1698 + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
1699 + size_t __refs)
1700 + : facet(__refs), _M_del(__table != 0 && __del),
1701 + _M_toupper(NULL), _M_tolower(NULL),
1702 + _M_table(__table ? __table : classic_table())
1703 + {
1704 + memset(_M_widen, 0, sizeof(_M_widen));
1705 + _M_widen_ok = 0;
1706 + memset(_M_narrow, 0, sizeof(_M_narrow));
1707 + _M_narrow_ok = 0;
1710 + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
1711 + : facet(__refs), _M_del(__table != 0 && __del),
1712 + _M_toupper(NULL), _M_tolower(NULL),
1713 + _M_table(__table ? __table : classic_table())
1714 + {
1715 + memset(_M_widen, 0, sizeof(_M_widen));
1716 + _M_widen_ok = 0;
1717 + memset(_M_narrow, 0, sizeof(_M_narrow));
1718 + _M_narrow_ok = 0;
1721 + char
1722 + ctype<char>::do_toupper(char __c) const
1723 + { return ::toupper((int) __c); }
1725 + const char*
1726 + ctype<char>::do_toupper(char* __low, const char* __high) const
1728 + while (__low < __high)
1730 + *__low = ::toupper((int) *__low);
1731 + ++__low;
1733 + return __high;
1736 + char
1737 + ctype<char>::do_tolower(char __c) const
1738 + { return ::tolower((int) __c); }
1740 + const char*
1741 + ctype<char>::do_tolower(char* __low, const char* __high) const
1743 + while (__low < __high)
1745 + *__low = ::tolower((int) *__low);
1746 + ++__low;
1748 + return __high;
1750 diff -ruN gcc-6.1.0/libstdc++-v3/config/os/aros/os_defines.h gcc-6.1.0.aros/libstdc++-v3/config/os/aros/os_defines.h
1751 --- gcc-6.1.0/libstdc++-v3/config/os/aros/os_defines.h 1970-01-01 01:00:00.000000000 +0100
1752 +++ gcc-6.1.0.aros/libstdc++-v3/config/os/aros/os_defines.h 2016-04-27 15:13:21.001535038 +0100
1753 @@ -0,0 +1,11 @@
1754 +// Specific definitions for AROS -*- C++ -*-
1756 +#ifndef _GLIBCXX_OS_DEFINES
1757 +#define _GLIBCXX_OS_DEFINES
1759 +#define __off64_t off_t
1761 +// No support for referencing weak symbols without a definition.
1762 +#define _GLIBCXX_USE_WEAK_REF 0
1764 +#endif
1765 diff -ruN gcc-6.1.0/libstdc++-v3/configure gcc-6.1.0.aros/libstdc++-v3/configure
1766 --- gcc-6.1.0/libstdc++-v3/configure 2016-04-05 20:03:46.000000000 +0100
1767 +++ gcc-6.1.0.aros/libstdc++-v3/configure 2016-04-27 15:13:21.001535038 +0100
1768 @@ -5365,12 +5365,12 @@
1771 # Libtool setup.
1772 -if test "x${with_newlib}" != "xyes"; then
1773 - enable_dlopen=yes
1778 +#if test "x${with_newlib}" != "xyes"; then
1779 +# AC_LIBTOOL_DLOPEN
1783 +#fi
1784 case `pwd` in
1785 *\ * | *\ *)
1786 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
1787 @@ -8101,6 +8101,8 @@
1791 + enable_dlopen=no
1794 enable_win32_dll=no
1796 @@ -19571,6 +19573,7 @@
1798 struct iovec iov[2];
1799 writev(0, iov, 0);
1800 +#error be sure to fail
1802 return 0;
1804 @@ -19593,6 +19596,7 @@
1806 struct iovec iov[2];
1807 writev(0, iov, 0);
1808 +#error be sure to fail
1810 return 0;
1812 @@ -28813,6 +28817,58 @@
1814 # Base decisions on target environment.
1815 case "${host}" in
1816 + *-aros*)
1817 + for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
1818 + machine/param.h sys/machine.h sys/types.h fp.h locale.h float.h inttypes.h
1819 +do :
1820 + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
1821 +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
1822 +eval as_val=\$$as_ac_Header
1823 + if test "x$as_val" = x""yes; then :
1824 + cat >>confdefs.h <<_ACEOF
1825 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
1826 +_ACEOF
1830 +done
1833 + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
1834 + GLIBCXX_CHECK_WCHAR_T_SUPPORT
1836 + $as_echo "#define HAVE_FINITE 1" >>confdefs.h
1838 + $as_echo "#define HAVE_FINITEF 1" >>confdefs.h
1840 + $as_echo "#define HAVE_FREXPF 1" >>confdefs.h
1842 + $as_echo "#define HAVE_HYPOTF 1" >>confdefs.h
1844 + $as_echo "#define HAVE_ISINF 1" >>confdefs.h
1846 + $as_echo "#define HAVE_ISINFF 1" >>confdefs.h
1848 + $as_echo "#define HAVE_ISNAN 1" >>confdefs.h
1850 + $as_echo "#define HAVE_ISNANF 1" >>confdefs.h
1852 + $as_echo "#define HAVE_SINCOS 1" >>confdefs.h
1854 + $as_echo "#define HAVE_SINCOSF 1" >>confdefs.h
1856 + if test x"long_double_math_on_this_cpu" = x"yes"; then
1857 + $as_echo "#define HAVE_FINITEL 1" >>confdefs.h
1859 + $as_echo "#define HAVE_HYPOTL 1" >>confdefs.h
1861 + $as_echo "#define HAVE_ISINFL 1" >>confdefs.h
1863 + $as_echo "#define HAVE_ISNANL 1" >>confdefs.h
1865 + fi
1866 + ;;
1868 arm*-*-symbianelf*)
1869 # This is a freestanding configuration; there is nothing to do here.
1871 diff -ruN gcc-6.1.0/libstdc++-v3/configure.ac gcc-6.1.0.aros/libstdc++-v3/configure.ac
1872 --- gcc-6.1.0/libstdc++-v3/configure.ac 2016-01-15 22:42:41.000000000 +0000
1873 +++ gcc-6.1.0.aros/libstdc++-v3/configure.ac 2016-04-27 15:13:21.001535038 +0100
1874 @@ -89,9 +89,9 @@
1875 GLIBCXX_CONFIGURE
1877 # Libtool setup.
1878 -if test "x${with_newlib}" != "xyes"; then
1879 - AC_LIBTOOL_DLOPEN
1881 +#if test "x${with_newlib}" != "xyes"; then
1882 +# AC_LIBTOOL_DLOPEN
1883 +#fi
1884 AM_PROG_LIBTOOL
1885 ACX_LT_HOST_FLAGS
1886 AC_SUBST(enable_shared)
1887 diff -ruN gcc-6.1.0/libstdc++-v3/configure.host gcc-6.1.0.aros/libstdc++-v3/configure.host
1888 --- gcc-6.1.0/libstdc++-v3/configure.host 2016-01-13 09:48:53.000000000 +0000
1889 +++ gcc-6.1.0.aros/libstdc++-v3/configure.host 2016-04-27 15:13:21.001535038 +0100
1890 @@ -226,6 +226,9 @@
1891 os_include_dir="os/generic"
1892 atomicity_dir="cpu/generic"
1894 + aros*)
1895 + os_include_dir="os/aros"
1896 + ;;
1897 bsd*)
1898 # Plain BSD attempts to share FreeBSD files.
1899 os_include_dir="os/bsd/freebsd"
1900 diff -ruN gcc-6.1.0/libstdc++-v3/crossconfig.m4 gcc-6.1.0.aros/libstdc++-v3/crossconfig.m4
1901 --- gcc-6.1.0/libstdc++-v3/crossconfig.m4 2015-10-11 23:34:28.000000000 +0100
1902 +++ gcc-6.1.0.aros/libstdc++-v3/crossconfig.m4 2016-04-27 15:13:21.001535038 +0100
1903 @@ -5,6 +5,31 @@
1904 AC_DEFUN([GLIBCXX_CROSSCONFIG],[
1905 # Base decisions on target environment.
1906 case "${host}" in
1907 + *-aros*)
1908 + AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
1909 + machine/param.h sys/machine.h sys/types.h fp.h locale.h float.h inttypes.h])
1911 + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
1912 + GLIBCXX_CHECK_WCHAR_T_SUPPORT
1914 + AC_DEFINE(HAVE_FINITE)
1915 + AC_DEFINE(HAVE_FINITEF)
1916 + AC_DEFINE(HAVE_FREXPF)
1917 + AC_DEFINE(HAVE_HYPOTF)
1918 + AC_DEFINE(HAVE_ISINF)
1919 + AC_DEFINE(HAVE_ISINFF)
1920 + AC_DEFINE(HAVE_ISNAN)
1921 + AC_DEFINE(HAVE_ISNANF)
1922 + AC_DEFINE(HAVE_SINCOS)
1923 + AC_DEFINE(HAVE_SINCOSF)
1924 + if test x"long_double_math_on_this_cpu" = x"yes"; then
1925 + AC_DEFINE(HAVE_FINITEL)
1926 + AC_DEFINE(HAVE_HYPOTL)
1927 + AC_DEFINE(HAVE_ISINFL)
1928 + AC_DEFINE(HAVE_ISNANL)
1929 + fi
1930 + ;;
1932 arm*-*-symbianelf*)
1933 # This is a freestanding configuration; there is nothing to do here.
1935 diff -ruN gcc-6.1.0/libstdc++-v3/include/Makefile.in gcc-6.1.0.aros/libstdc++-v3/include/Makefile.in
1936 --- gcc-6.1.0/libstdc++-v3/include/Makefile.in 2016-03-23 00:41:52.000000000 +0000
1937 +++ gcc-6.1.0.aros/libstdc++-v3/include/Makefile.in 2016-04-27 15:13:21.001535038 +0100
1938 @@ -1686,6 +1686,7 @@
1939 -e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
1940 -e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
1941 -e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \
1942 + -e 's/_GLIBCXX___AROS__/__AROS__/g' \
1943 -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
1944 < $< > $@
1946 diff -ruN gcc-6.1.0/libstdc++-v3/include/std/ratio gcc-6.1.0.aros/libstdc++-v3/include/std/ratio
1947 --- gcc-6.1.0/libstdc++-v3/include/std/ratio 2016-01-04 14:30:50.000000000 +0000
1948 +++ gcc-6.1.0.aros/libstdc++-v3/include/std/ratio 2016-04-27 15:13:21.001535038 +0100
1949 @@ -211,10 +211,10 @@
1951 private:
1952 static_assert(__d != 0, "Internal library error");
1953 - static_assert(sizeof (uintmax_t) == sizeof (unsigned long long),
1954 - "This library calls __builtin_clzll on uintmax_t, which "
1955 - "is unsafe on your platform. Please complain to "
1956 - "http://gcc.gnu.org/bugzilla/");
1957 +// static_assert(sizeof (uintmax_t) == sizeof (unsigned long long),
1958 +// "This library calls __builtin_clzll on uintmax_t, which "
1959 +// "is unsafe on your platform. Please complain to "
1960 +// "http://gcc.gnu.org/bugzilla/");
1961 static constexpr int __shift = __builtin_clzll(__d);
1962 static constexpr int __coshift_ = sizeof(uintmax_t) * 8 - __shift;
1963 static constexpr int __coshift = (__shift != 0) ? __coshift_ : 0;