m68k isa fixes. (NicJA)
[AROS.git] / tools / crosstools / gcc-6.5.0-aros.diff
blob4d67ed73feccf063c37ae86609eb610f80cfdfa0
1 diff -ruN gcc-6.5.0/boehm-gc/include/gc.h gcc-6.5.0.aros/boehm-gc/include/gc.h
2 --- gcc-6.5.0/boehm-gc/include/gc.h 2014-10-23 09:39:19.000000000 +0100
3 +++ gcc-6.5.0.aros/boehm-gc/include/gc.h 2019-02-13 12:20:35.215061500 +0000
4 @@ -1056,7 +1056,7 @@
5 GC_API void GC_win32_free_heap ();
6 #endif
8 -#if ( defined(_AMIGA) && !defined(GC_AMIGA_MAKINGLIB) )
9 +#if !defined(__AROS__) && ( defined(_AMIGA) && !defined(GC_AMIGA_MAKINGLIB) )
10 /* Allocation really goes through GC_amiga_allocwrapper_do */
11 # include "gc_amiga_redirects.h"
12 #endif
13 diff -ruN gcc-6.5.0/boehm-gc/include/gc_amiga_redirects.h gcc-6.5.0.aros/boehm-gc/include/gc_amiga_redirects.h
14 --- gcc-6.5.0/boehm-gc/include/gc_amiga_redirects.h 2001-08-17 18:30:51.000000000 +0000
15 +++ gcc-6.5.0.aros/boehm-gc/include/gc_amiga_redirects.h 2019-02-13 12:20:35.215061500 +0000
16 @@ -2,7 +2,7 @@
18 # define GC_AMIGA_REDIRECTS_H
20 -# if ( defined(_AMIGA) && !defined(GC_AMIGA_MAKINGLIB) )
21 +# if !defined(__AROS__) && ( defined(_AMIGA) && !defined(GC_AMIGA_MAKINGLIB) )
22 extern void *GC_amiga_realloc(void *old_object,size_t new_size_in_bytes);
23 # define GC_realloc(a,b) GC_amiga_realloc(a,b)
24 extern void GC_amiga_set_toany(void (*func)(void));
25 diff -ruN gcc-6.5.0/configure gcc-6.5.0.aros/configure
26 --- gcc-6.5.0/configure 2017-01-09 21:01:26.000000000 +0000
27 +++ gcc-6.5.0.aros/configure 2019-02-13 12:20:35.215061500 +0000
28 @@ -3899,6 +3899,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 @@ -4037,6 +4040,8 @@
39 rs6000-*-aix*)
40 host_makefile_frag="config/mh-ppc-aix"
42 + *-*-aros*)
43 + ;;
44 esac
47 diff -ruN gcc-6.5.0/configure.ac gcc-6.5.0.aros/configure.ac
48 --- gcc-6.5.0/configure.ac 2017-01-09 21:01:26.000000000 +0000
49 +++ gcc-6.5.0.aros/configure.ac 2019-02-13 12:20:35.215061500 +0000
50 @@ -1235,6 +1235,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 @@ -1354,6 +1357,8 @@
61 rs6000-*-aix*)
62 host_makefile_frag="config/mh-ppc-aix"
64 + *-*-aros*)
65 + ;;
66 esac
69 diff -ruN gcc-6.5.0/fixincludes/configure gcc-6.5.0.aros/fixincludes/configure
70 --- gcc-6.5.0/fixincludes/configure 2018-10-26 10:56:36.000000000 +0100
71 +++ gcc-6.5.0.aros/fixincludes/configure 2019-02-13 12:20:35.215061500 +0000
72 @@ -4712,6 +4712,7 @@
74 else
75 case $host in
76 + *-*-aros* | \
77 i?86-*-msdosdjgpp* | \
78 i?86-*-mingw32* | \
79 x86_64-*-mingw32* | \
80 diff -ruN gcc-6.5.0/fixincludes/configure.ac gcc-6.5.0.aros/fixincludes/configure.ac
81 --- gcc-6.5.0/fixincludes/configure.ac 2012-05-29 20:28:57.000000000 +0100
82 +++ gcc-6.5.0.aros/fixincludes/configure.ac 2019-02-13 12:20:35.215061500 +0000
83 @@ -50,6 +50,7 @@
84 TARGET=oneprocess
85 fi],
86 [case $host in
87 + *-*-aros* | \
88 i?86-*-msdosdjgpp* | \
89 i?86-*-mingw32* | \
90 x86_64-*-mingw32* | \
91 diff -ruN gcc-6.5.0/gcc/config/aarch64/aros.h gcc-6.5.0.aros/gcc/config/aarch64/aros.h
92 --- gcc-6.5.0/gcc/config/aarch64/aros.h 1970-01-01 00:00:00.000000000 +0000
93 +++ gcc-6.5.0.aros/gcc/config/aarch64/aros.h 2019-02-13 12:20:35.215061500 +0000
94 @@ -0,0 +1,67 @@
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 +#if TARGET_BIG_ENDIAN_DEFAULT
153 +#define LINK_SPEC "-m aarch64elfb_aros -L %R/lib"
154 +#else
155 +#define LINK_SPEC "-m aarch64elf_aros -L %R/lib"
156 +#endif
158 +/* Use own supplement to libgcc. */
159 +#undef LIBGCC_SPEC
160 +#define LIBGCC_SPEC "-lgcc"
162 diff -ruN gcc-6.5.0/gcc/config/aarch64/t-aros gcc-6.5.0.aros/gcc/config/aarch64/t-aros
163 --- gcc-6.5.0/gcc/config/aarch64/t-aros 1970-01-01 00:00:00.000000000 +0000
164 +++ gcc-6.5.0.aros/gcc/config/aarch64/t-aros 2019-02-13 12:20:35.215061500 +0000
165 @@ -0,0 +1,21 @@
166 +# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
167 +# 2008, 2010 Free Software Foundation, Inc.
169 +# This file is part of GCC.
171 +# GCC is free software; you can redistribute it and/or modify
172 +# it under the terms of the GNU General Public License as published by
173 +# the Free Software Foundation; either version 3, or (at your option)
174 +# any later version.
176 +# GCC is distributed in the hope that it will be useful,
177 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
178 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
179 +# GNU General Public License for more details.
181 +# You should have received a copy of the GNU General Public License
182 +# along with GCC; see the file COPYING3. If not see
183 +# <http://www.gnu.org/licenses/>.
187 diff -ruN gcc-6.5.0/gcc/config/arm/aros.h gcc-6.5.0.aros/gcc/config/arm/aros.h
188 --- gcc-6.5.0/gcc/config/arm/aros.h 1970-01-01 00:00:00.000000000 +0000
189 +++ gcc-6.5.0.aros/gcc/config/arm/aros.h 2019-02-13 12:20:35.215061500 +0000
190 @@ -0,0 +1,82 @@
191 +/* Configuration file for ARM AROS EABI targets.
192 + Copyright (C) 2004, 2005, 2006, 2007, 2010
193 + Free Software Foundation, Inc.
194 + Contributed by Pavel Fedin
195 + Based on linux-eabi.h and other AROS targets
197 + This file is part of GCC.
199 + GCC is free software; you can redistribute it and/or modify it
200 + under the terms of the GNU General Public License as published
201 + by the Free Software Foundation; either version 3, or (at your
202 + option) any later version.
204 + GCC is distributed in the hope that it will be useful, but WITHOUT
205 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
206 + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
207 + License for more details.
209 + You should have received a copy of the GNU General Public License
210 + along with GCC; see the file COPYING3. If not see
211 + <http://www.gnu.org/licenses/>. */
213 +/* On EABI GNU/Linux, we want both the BPABI builtins and the
214 + GNU/Linux builtins. */
215 +#undef TARGET_OS_CPP_BUILTINS
216 +#define TARGET_OS_CPP_BUILTINS() \
217 + do \
218 + { \
219 + TARGET_BPABI_CPP_BUILTINS(); \
220 + builtin_define_std ("AROS"); \
221 + builtin_define ("AMIGA"); \
222 + builtin_define ("_AMIGA"); \
223 + builtin_assert ("system=posix"); \
224 + if (flag_pic) \
225 + { \
226 + builtin_define ("__PIC__"); \
227 + builtin_define ("__pic__"); \
228 + } \
229 + } \
230 + while (false)
232 +/* We default to a softfp ABI so that we are compatible
233 + with the Linux EABI (as used by the linker). */
234 +#undef TARGET_DEFAULT_FLOAT_ABI
235 +#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFTFP
237 +/* We default to the "aapcs-linux" ABI so that enums are int-sized by
238 + default. */
239 +#undef ARM_DEFAULT_ABI
240 +#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX
242 +/* Default to armv5t so that thumb shared libraries work.
243 + The ARM10TDMI core is the default for armv5t, so set
244 + SUBTARGET_CPU_DEFAULT to achieve this. */
245 +#undef SUBTARGET_CPU_DEFAULT
246 +#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
248 +/* TARGET_BIG_ENDIAN_DEFAULT is set in
249 + config.gcc for big endian configurations. */
250 +#undef TARGET_LINKER_EMULATION
251 +#if TARGET_BIG_ENDIAN_DEFAULT
252 +#define TARGET_LINKER_EMULATION "armelfb_aros"
253 +#else
254 +#define TARGET_LINKER_EMULATION "armelf_aros"
255 +#endif
257 +#undef SUBTARGET_CPP_SPEC
258 +#define SUBTARGET_CPP_SPEC "-D__ELF__ %{!nostdinc:%{!nostdc:%{!noposixc: -idirafter %R/include/aros/posixc} -idirafter %R/include/aros/stdc}}"
260 +#undef SUBTARGET_EXTRA_LINK_SPEC
261 +#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION
263 +/* Provide a LINK_SPEC appropriate for AROS. */
264 +#undef LINK_SPEC
265 +#define LINK_SPEC SUBTARGET_EXTRA_LINK_SPEC " -L %R/lib"
267 +/* Use own supplement to libgcc. */
268 +#undef LIBGCC_SPEC
269 +#define LIBGCC_SPEC "-laeabi -lgcc"
271 +/* FIXME: AROS doesn't support dw2 unwinding yet. */
272 +#undef MD_FALLBACK_FRAME_STATE_FOR
273 diff -ruN gcc-6.5.0/gcc/config/arm/t-aros gcc-6.5.0.aros/gcc/config/arm/t-aros
274 --- gcc-6.5.0/gcc/config/arm/t-aros 1970-01-01 00:00:00.000000000 +0000
275 +++ gcc-6.5.0.aros/gcc/config/arm/t-aros 2019-02-13 12:20:35.215061500 +0000
276 @@ -0,0 +1,26 @@
277 +# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
278 +# 2008, 2010 Free Software Foundation, Inc.
280 +# This file is part of GCC.
282 +# GCC is free software; you can redistribute it and/or modify
283 +# it under the terms of the GNU General Public License as published by
284 +# the Free Software Foundation; either version 3, or (at your option)
285 +# any later version.
287 +# GCC is distributed in the hope that it will be useful,
288 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
289 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
290 +# GNU General Public License for more details.
292 +# You should have received a copy of the GNU General Public License
293 +# along with GCC; see the file COPYING3. If not see
294 +# <http://www.gnu.org/licenses/>.
296 +MULTILIB_OPTIONS = marm mfloat-abi=hard/mfloat-abi=soft march=armv6/march=armv7-a
297 +MULTILIB_DIRNAMES = arm fpu soft armv6 armv7-a
298 +MULTILIB_EXCEPTIONS =
299 +MULTILIB_MATCHES =
300 +MULTILIB_OSDIRNAMES =
301 +MULTILIB_REQUIRED =
303 diff -ruN gcc-6.5.0/gcc/config/aros.h gcc-6.5.0.aros/gcc/config/aros.h
304 --- gcc-6.5.0/gcc/config/aros.h 1970-01-01 00:00:00.000000000 +0000
305 +++ gcc-6.5.0.aros/gcc/config/aros.h 2019-02-13 12:20:35.215061500 +0000
306 @@ -0,0 +1,115 @@
307 +/* Definitions for AROS
308 + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
309 + Contributed by Fabio Alemagna
310 + Based upon linux.h, contributed by Eric Youngdale.
312 +This file is part of GNU CC.
314 +GNU CC is free software; you can redistribute it and/or modify
315 +it under the terms of the GNU General Public License as published by
316 +the Free Software Foundation; either version 2, or (at your option)
317 +any later version.
319 +GNU CC is distributed in the hope that it will be useful,
320 +but WITHOUT ANY WARRANTY; without even the implied warranty of
321 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
322 +GNU General Public License for more details.
324 +You should have received a copy of the GNU General Public License
325 +along with GNU CC; see the file COPYING. If not, write to
326 +the Free Software Foundation, 59 Temple Place - Suite 330,
327 +Boston, MA 02111-1307, USA. */
329 +/* Don't assume anything about the header files. */
330 +#define NO_IMPLICIT_EXTERN_C
332 +#undef SIZE_TYPE
333 +#define SIZE_TYPE "long unsigned int"
335 +#undef WCHAR_TYPE
336 +#define WCHAR_TYPE "char"
338 +#undef WCHAR_TYPE_SIZE
339 +#define WCHAR_TYPE_SIZE 8
341 +#undef PTRDIFF_TYPE
342 +#define PTRDIFF_TYPE "long int"
344 +#undef TARGET_OS_CPP_BUILTINS
345 +#define TARGET_OS_CPP_BUILTINS() \
346 + do \
347 + { \
348 + builtin_define_std ("AROS"); \
349 + builtin_define ("AMIGA"); \
350 + builtin_define ("_AMIGA"); \
351 + builtin_define ("__ELF__"); \
352 + builtin_assert ("system=posix"); \
353 + } \
354 + while (0)
356 +#undef ASM_APP_ON
357 +#define ASM_APP_ON "#APP\n"
359 +#undef ASM_APP_OFF
360 +#define ASM_APP_OFF "#NO_APP\n"
362 +#undef MD_EXEC_PREFIX
363 +#undef MD_STARTFILE_PREFIX
365 +/* Provide a STARTFILE_SPEC appropriate for AROS. AROS has its own
366 + set of startup files which also take care of handling C++
367 + constructors/destructors. */
369 +#undef STARTFILE_SPEC
370 +#define STARTFILE_SPEC \
371 + "startup%O%s %{detach:detach%O%s} %{nix:nixmain%O%s}"
373 +/* Provide a ENDFILE_SPEC appropriate for AROS. */
375 +#undef ENDFILE_SPEC
376 +#define ENDFILE_SPEC \
377 + "-lautoinit"
379 +/* The compiler is configured with ONLY the gcc/g++ standard headers.
380 + N.B-: NATIVE_SYSTEM_HEADER_DIR must come after GCC_INCLUDE_DIR with gcc6!! */
381 +#undef INCLUDE_DEFAULTS
382 +#define INCLUDE_DEFAULTS \
383 +{ \
384 + { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
385 + { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
386 + { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
387 + { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \
388 + { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 }, \
389 + { 0, 0, 0, 0, 0, 0 } \
392 +#undef CPP_SPEC
393 +#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}}"
395 +/* This is for -profile to use -lc_p instead of -lc. */
396 +#ifndef CC1_SPEC
397 +#define CC1_SPEC "%{profile:-p}"
398 +#endif
400 +/* The GNU C++ standard library requires that these macros be defined. */
401 +#undef CPLUSPLUS_CPP_SPEC
402 +#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
404 +#undef LIB_SPEC
405 +#define LIB_SPEC \
406 + "--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"
408 +#undef LIBSTDCXX_STATIC
409 +#define LIBSTDCXX_STATIC "pthread"
411 +#if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR)
412 +#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
413 +#endif
415 +/* AROS uses its own collect-like program for the moment. */
416 +#undef LINKER_NAME
417 +#define LINKER_NAME "collect-aros"
419 +#define TARGET_HAS_F_SETLKW
421 +#define TARGET_POSIX_IO
422 diff -ruN gcc-6.5.0/gcc/config/aros.opt gcc-6.5.0.aros/gcc/config/aros.opt
423 --- gcc-6.5.0/gcc/config/aros.opt 1970-01-01 00:00:00.000000000 +0000
424 +++ gcc-6.5.0.aros/gcc/config/aros.opt 2019-02-13 12:20:35.215061500 +0000
425 @@ -0,0 +1,35 @@
426 +; Processor-independent options for AROS.
428 +; Copyright (C) 2015 Free Software Foundation, Inc.
430 +; This file is part of GCC.
432 +; GCC is free software; you can redistribute it and/or modify it under
433 +; the terms of the GNU General Public License as published by the Free
434 +; Software Foundation; either version 3, or (at your option) any later
435 +; version.
437 +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
438 +; WARRANTY; without even the implied warranty of MERCHANTABILITY or
439 +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
440 +; for more details.
442 +; You should have received a copy of the GNU General Public License
443 +; along with GCC; see the file COPYING3. If not see
444 +; <http://www.gnu.org/licenses/>.
446 +posix
447 +Driver
449 +noposixc
450 +Driver
452 +nostdc
453 +Driver
455 +nosysbase
456 +Driver
458 +nix
459 +Driver
461 diff -ruN gcc-6.5.0/gcc/config/i386/aros.h gcc-6.5.0.aros/gcc/config/i386/aros.h
462 --- gcc-6.5.0/gcc/config/i386/aros.h 1970-01-01 00:00:00.000000000 +0000
463 +++ gcc-6.5.0.aros/gcc/config/i386/aros.h 2019-02-13 12:20:35.215061500 +0000
464 @@ -0,0 +1,25 @@
465 +/* Definitions for Intel 386 running AROS systems with ELF format.
466 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002
467 + Free Software Foundation, Inc.
468 + Contributed by Fabio Alemagna.
469 + Based upon i386/linux.h by Eric Youngdale.
471 +This file is part of GNU CC.
473 +GNU CC is free software; you can redistribute it and/or modify
474 +it under the terms of the GNU General Public License as published by
475 +the Free Software Foundation; either version 2, or (at your option)
476 +any later version.
478 +GNU CC is distributed in the hope that it will be useful,
479 +but WITHOUT ANY WARRANTY; without even the implied warranty of
480 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
481 +GNU General Public License for more details.
483 +You should have received a copy of the GNU General Public License
484 +along with GNU CC; see the file COPYING. If not, write to
485 +the Free Software Foundation, 59 Temple Place - Suite 330,
486 +Boston, MA 02111-1307, USA. */
488 +#undef LINK_SPEC
489 +#define LINK_SPEC "-m elf_i386 -L%R/lib"
490 diff -ruN gcc-6.5.0/gcc/config/i386/aros64.h gcc-6.5.0.aros/gcc/config/i386/aros64.h
491 --- gcc-6.5.0/gcc/config/i386/aros64.h 1970-01-01 00:00:00.000000000 +0000
492 +++ gcc-6.5.0.aros/gcc/config/i386/aros64.h 2019-02-13 12:20:35.215061500 +0000
493 @@ -0,0 +1,34 @@
494 +/* Definitions for AMD x86_64 running AROS systems with ELF64 format.
495 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002
496 + Free Software Foundation, Inc.
497 + Contributed by Stanislaw Szymczyk <sszymczy@gmail.com>. Based on aros.h.
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 +/* The svr4 ABI for the i386 says that records and unions are returned
517 + in memory. In the 64bit compilation we will turn this flag off in
518 + override_options, as we never do pcc_struct_return scheme on this target. */
519 +#undef DEFAULT_PCC_STRUCT_RETURN
520 +#define DEFAULT_PCC_STRUCT_RETURN 1
522 +/* Provide a LINK_SPEC appropriate for AROS. */
524 +#undef LINK_SPEC
525 +#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} -L %R/lib"
527 +/* FIXME: AROS doesn't support dw2 unwinding yet. */
528 diff -ruN gcc-6.5.0/gcc/config/m68k/m68k.c gcc-6.5.0.aros/gcc/config/m68k/m68k.c
529 --- gcc-6.5.0/gcc/config/m68k/m68k.c 2016-01-04 14:30:50.000000000 +0000
530 +++ gcc-6.5.0.aros/gcc/config/m68k/m68k.c 2019-02-13 12:20:35.215061500 +0000
531 @@ -4452,7 +4452,7 @@
532 else if (letter == '/')
533 asm_fprintf (file, "%R");
534 else if (letter == '?')
535 - asm_fprintf (file, m68k_library_id_string);
536 + asm_fprintf (file, "%s", m68k_library_id_string);
537 else if (letter == 'p')
539 output_addr_const (file, op);
540 diff -ruN gcc-6.5.0/gcc/config/m68k/m68k.h gcc-6.5.0.aros/gcc/config/m68k/m68k.h
541 --- gcc-6.5.0/gcc/config/m68k/m68k.h 2016-01-04 14:30:50.000000000 +0000
542 +++ gcc-6.5.0.aros/gcc/config/m68k/m68k.h 2019-02-13 12:20:35.215061500 +0000
543 @@ -330,7 +330,9 @@
544 register elimination. */
545 #define FIRST_PSEUDO_REGISTER 25
547 -/* All m68k targets (except AmigaOS) use %a5 as the PIC register */
548 +/* All m68k targets (except AmigaOS) use %a5 as the PIC register.
549 + * On AmigaOS, we use %a4
550 + */
551 #define PIC_OFFSET_TABLE_REGNUM \
552 (!flag_pic ? INVALID_REGNUM \
553 : reload_completed ? REGNO (pic_offset_table_rtx) \
554 @@ -420,7 +422,8 @@
555 /* Most m68k targets use %a6 as a frame pointer. The AmigaOS
556 ABI uses %a6 for shared library calls, therefore the frame
557 pointer is shifted to %a5 on this target. */
558 -#define FRAME_POINTER_REGNUM A6_REG
559 +#define FRAME_POINTER_REGNUM A5_REG
560 +#define PIC_REG A4_REG
562 /* Base register for access to arguments of the function.
563 * This isn't a hardware register. It will be eliminated to the
564 diff -ruN gcc-6.5.0/gcc/config/m68k/m68k.md gcc-6.5.0.aros/gcc/config/m68k/m68k.md
565 --- gcc-6.5.0/gcc/config/m68k/m68k.md 2016-02-22 14:22:07.000000000 +0000
566 +++ gcc-6.5.0.aros/gcc/config/m68k/m68k.md 2019-02-13 12:20:35.215061500 +0000
567 @@ -133,7 +133,8 @@
568 [(D0_REG 0)
569 (A0_REG 8)
570 (A1_REG 9)
571 - (PIC_REG 13)
572 + (A4_REG 12)
573 + (A5_REG 13)
574 (A6_REG 14)
575 (SP_REG 15)
576 (FP0_REG 16)
577 @@ -7089,7 +7090,7 @@
579 if (TARGET_ID_SHARED_LIBRARY)
581 - operands[1] = gen_rtx_REG (Pmode, PIC_REG);
582 + operands[1] = gen_rtx_REG (Pmode, A4_REG);
583 return MOTOROLA ? "move.l %?(%1),%0" : "movel %1@(%?), %0";
585 else if (MOTOROLA)
586 diff -ruN gcc-6.5.0/gcc/config/m68k/t-aros gcc-6.5.0.aros/gcc/config/m68k/t-aros
587 --- gcc-6.5.0/gcc/config/m68k/t-aros 1970-01-01 00:00:00.000000000 +0000
588 +++ gcc-6.5.0.aros/gcc/config/m68k/t-aros 2019-02-13 12:20:35.215061500 +0000
589 @@ -0,0 +1,2 @@
590 +# Custom multilibs for AROS
591 +M68K_MLIB_CPU += && match(MLIB, "^68")
592 diff -ruN gcc-6.5.0/gcc/config/rs6000/aros.h gcc-6.5.0.aros/gcc/config/rs6000/aros.h
593 --- gcc-6.5.0/gcc/config/rs6000/aros.h 1970-01-01 00:00:00.000000000 +0000
594 +++ gcc-6.5.0.aros/gcc/config/rs6000/aros.h 2019-02-13 12:20:35.215061500 +0000
595 @@ -0,0 +1,151 @@
596 +/* Definitions for Powerpc running AROS systems with ELF format.
597 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002
598 + Free Software Foundation, Inc.
599 + Contributed by Markus Weiss.
600 + Based upon i386/aros.h by Fabio Alemagna.
602 +This file is part of GNU CC.
604 +GNU CC is free software; you can redistribute it and/or modify
605 +it under the terms of the GNU General Public License as published by
606 +the Free Software Foundation; either version 2, or (at your option)
607 +any later version.
609 +GNU CC is distributed in the hope that it will be useful,
610 +but WITHOUT ANY WARRANTY; without even the implied warranty of
611 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
612 +GNU General Public License for more details.
614 +You should have received a copy of the GNU General Public License
615 +along with GNU CC; see the file COPYING. If not, write to
616 +the Free Software Foundation, 59 Temple Place - Suite 330,
617 +Boston, MA 02111-1307, USA. */
619 +/* Symbols missing in comparison to i386/aros.h are either
620 + defined in elfos.h, rs6000/rs6000.h rs6000/sysv4.h
621 + or not needed for PowerPC.
624 +/* We need to define __powerpc__. */
626 +#undef TARGET_OS_CPP_BUILTINS
627 +#define TARGET_OS_CPP_BUILTINS() \
628 + do \
629 + { \
630 + builtin_define_std ("AROS"); \
631 + builtin_define ("AMIGA"); \
632 + builtin_define ("_AMIGA"); \
633 + builtin_define ("__powerpc__"); \
634 + builtin_define ("__ELF__"); \
635 + builtin_assert ("system=posix"); \
636 + if (flag_pic) \
637 + { \
638 + builtin_define ("__PIC__"); \
639 + builtin_define ("__pic__"); \
640 + } \
641 + } \
642 + while (0)
644 +/* This one taken from linux.h. */
645 +/* We are 32-bit all the time, so optimize a little. */
646 +#undef TARGET_64BIT
647 +#define TARGET_64BIT 0
649 +/* The svr4 ABI for the i386 says that records and unions are returned
650 + in memory. */
651 +/*#undef DEFAULT_PCC_STRUCT_RETURN
652 +#define DEFAULT_PCC_STRUCT_RETURN 1
653 +see rs6000/rs6000.h
657 +#undef ASM_COMMENT_START
658 +#define ASM_COMMENT_START "#"
659 +see rs6000/rs6000.h
663 +#undef DBX_REGISTER_NUMBER
664 +#define DBX_REGISTER_NUMBER(n) \
665 + (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
666 +see rs6000/sysv4.h
669 +/* Output assembler code to FILE to call the profiler.
670 + To the best of my knowledge, no Linux libc has required the label
671 + argument to mcount. */
674 +#define NO_PROFILE_COUNTERS 1
675 +not used by other similar ppc compilers
676 +only in darwin.h rs6000/linux64.h rs6000/rs6000.c
680 +#undef MCOUNT_NAME
681 +#define MCOUNT_NAME "mcount"
682 +see rs6000/sysv4.h RS6000_MCOUNT
685 +/* The GLIBC version of mcount for the x86 assumes that there is a
686 + frame, so we cannot allow profiling without a frame pointer. */
688 +#undef SUBTARGET_FRAME_POINTER_REQUIRED
689 +#define SUBTARGET_FRAME_POINTER_REQUIRED crtl->profile
690 +seems to be handled by rs6000/rs6000.h
693 +#undef CC1_SPEC
694 +#define CC1_SPEC "%(cc1_cpu) %{profile:-p}"
696 +/* Provide a LINK_SPEC appropriate for AROS. */
698 +#undef LINK_SPEC
699 +#define LINK_SPEC "-m elf32ppc -L %R/lib"
701 +/* A C statement (sans semicolon) to output to the stdio stream
702 + FILE the assembler definition of uninitialized global DECL named
703 + NAME whose size is SIZE bytes and alignment is ALIGN bytes.
704 + Try to use asm_output_aligned_bss to implement this macro. */
706 +#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
707 + asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
708 +see rs6000/sysv4.h
711 +/* A C statement to output to the stdio stream FILE an assembler
712 + command to advance the location counter to a multiple of 1<<LOG
713 + bytes if it is within MAX_SKIP bytes.
715 + This is used to align code labels according to Intel recommendations. */
717 +#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
718 +#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
719 + do { \
720 + if ((LOG) != 0) { \
721 + if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
722 + else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
723 + } \
724 + } while (0)
725 +#endif
726 +see rs6000/sysv4.h
729 +/* Handle special EH pointer encodings. Absolute, pc-relative, and
730 + indirect are handled automatically. */
732 +#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
733 + do { \
734 + if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel) \
735 + { \
736 + fputs (ASM_LONG, FILE); \
737 + assemble_name (FILE, XSTR (ADDR, 0)); \
738 + fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
739 + goto DONE; \
740 + } \
741 + } while (0)
742 +not used for PowerPC
745 +/* FIXME: AROS doesn't support dw2 unwinding yet. */
746 +#undef MD_FALLBACK_FRAME_STATE_FOR
747 diff -ruN gcc-6.5.0/gcc/config/rs6000/rs6000.c gcc-6.5.0.aros/gcc/config/rs6000/rs6000.c
748 --- gcc-6.5.0/gcc/config/rs6000/rs6000.c 2018-08-10 21:46:04.000000000 +0100
749 +++ gcc-6.5.0.aros/gcc/config/rs6000/rs6000.c 2019-02-13 12:20:35.215061500 +0000
750 @@ -1535,6 +1535,8 @@
751 false },
752 { "shortcall", 0, 0, false, true, true, rs6000_handle_longcall_attribute,
753 false },
754 + { "stackparm", 0, 0, false, true, true, rs6000_handle_longcall_attribute,
755 + false },
756 { "ms_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute,
757 false },
758 { "gcc_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute,
759 @@ -10577,6 +10579,9 @@
760 && !lookup_attribute ("shortcall", TYPE_ATTRIBUTES (fntype))))
761 cum->call_cookie |= CALL_LONG;
763 + cum->stackparm = fntype && lookup_attribute("stackparm",
764 + TYPE_ATTRIBUTES(fntype));
766 if (TARGET_DEBUG_ARG)
768 fprintf (stderr, "\ninit_cumulative_args:");
769 @@ -11749,6 +11754,9 @@
771 rs6000_discover_homogeneous_aggregate (mode, type, &elt_mode, &n_elts);
773 + if (cum->stackparm)
774 + return NULL_RTX;
776 if (TARGET_MACHO && rs6000_darwin64_struct_check_p (mode, type))
778 rtx rslt = rs6000_darwin64_record_arg (cum, type, named, /*retval= */false);
779 @@ -12355,6 +12363,8 @@
781 /* Skip the last named argument. */
782 next_cum = *get_cumulative_args (cum);
783 + if (next_cum.stackparm)
784 + return;
785 rs6000_function_arg_advance_1 (&next_cum, mode, type, true, 0);
787 if (DEFAULT_ABI == ABI_V4)
788 diff -ruN gcc-6.5.0/gcc/config/rs6000/rs6000.h gcc-6.5.0.aros/gcc/config/rs6000/rs6000.h
789 --- gcc-6.5.0/gcc/config/rs6000/rs6000.h 2018-06-07 15:03:35.000000000 +0100
790 +++ gcc-6.5.0.aros/gcc/config/rs6000/rs6000.h 2019-02-13 12:20:35.215061500 +0000
791 @@ -1881,6 +1881,7 @@
792 int nargs_prototype; /* # args left in the current prototype */
793 int prototype; /* Whether a prototype was defined */
794 int stdarg; /* Whether function is a stdarg function. */
795 + int stackparm; /* Whether function has all args on the stack */
796 int call_cookie; /* Do special things for this call */
797 int sysv_gregno; /* next available GP register */
798 int intoffset; /* running offset in struct (darwin64) */
799 diff -ruN gcc-6.5.0/gcc/config/t-aros gcc-6.5.0.aros/gcc/config/t-aros
800 --- gcc-6.5.0/gcc/config/t-aros 1970-01-01 00:00:00.000000000 +0000
801 +++ gcc-6.5.0.aros/gcc/config/t-aros 2019-02-13 12:20:35.215061500 +0000
802 @@ -0,0 +1,29 @@
803 +# In AROS, "/usr" is a four-letter word.
804 +# Must match NATIVE_SYSTEM_HEADER_COMPONENT in aros.h !
805 +NATIVE_SYSTEM_HEADER_DIR = /include
807 +# Don't add AROS target include path when compiling host compiler
808 +CPPFLAGS =
810 +# Copy AROS specific include replacement files
811 +LIBGCC_DEPS += stmp-aros-hrds
813 +EXTRA_AROS_HEADERS = aros/types/size_t.h aros/types/ptrdiff_t.h \
814 + aros/types/wchar_t.h aros/types/wint_t.h aros/types/null.h
816 +stmp-int-hdrs : | include/aros/types
818 +include/aros/types : $(addprefix $(srcdir)/ginclude/,$(EXTRA_AROS_HEADERS))
819 + -if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi
820 + -if [ -d include/aros/types ] ; \
821 + then true; \
822 + else \
823 + mkdir include/aros; chmod a+rx include/aros; \
824 + mkdir include/aros/types; chmod a+rx include/aros/types; \
825 + fi
826 + for file in $(EXTRA_AROS_HEADERS); do \
827 + $(STAMP) include/$$file; \
828 + rm -fr include/$$file; \
829 + cp $(srcdir)/ginclude/$$file include/$$file; \
830 + chmod a+r include/$$file; \
831 + done
832 diff -ruN gcc-6.5.0/gcc/config.build gcc-6.5.0.aros/gcc/config.build
833 --- gcc-6.5.0/gcc/config.build 2016-01-04 14:30:50.000000000 +0000
834 +++ gcc-6.5.0.aros/gcc/config.build 2019-02-13 12:20:35.215061500 +0000
835 @@ -73,6 +73,9 @@
836 build_xm_file=i386/xm-djgpp.h
837 build_exeext=.exe
839 + *-*-aros*)
840 + build_xm_file=xm-aros.h
841 + ;;
842 *-*-sysv*)
843 # All other System V variants.
844 build_install_headers_dir=install-headers-cpio
845 diff -ruN gcc-6.5.0/gcc/config.gcc gcc-6.5.0.aros/gcc/config.gcc
846 --- gcc-6.5.0/gcc/config.gcc 2017-11-21 09:41:34.000000000 +0000
847 +++ gcc-6.5.0.aros/gcc/config.gcc 2019-02-13 12:20:35.215061500 +0000
848 @@ -798,6 +798,15 @@
850 esac
852 +*-*-aros*)
853 + gas=yes
854 + gnu_ld=yes
855 + thread_file=posix
856 + use_collect2=no
857 + xm_defines='STDC_HEADERS=1'
858 + extra_options="${extra_options} aros.opt"
859 + ;;
861 *-*-openbsd*)
862 tmake_file="t-openbsd"
863 case ${enable_threads} in
864 @@ -912,6 +921,16 @@
865 esac
867 case ${target} in
868 +aarch64*-*-aros*)
869 + tm_file="${tm_file} dbxelf.h elfos.h aarch64/aarch64-elf.h aros.h aarch64/aros.h"
870 + tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aros t-aros"
871 + xm_file="xm-aros.h"
872 + case $target in
873 + aarch64_be-*)
874 + tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
875 + ;;
876 + esac
877 + ;;
878 aarch64*-*-elf | aarch64*-*-rtems*)
879 tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h"
880 tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-elf-raw.h"
881 @@ -1003,6 +1022,21 @@
882 tm_file="${tm_file} vms/vms.h alpha/vms.h"
883 tmake_file="${tmake_file} alpha/t-vms"
885 +arm*-*-aros*)
886 + tm_file="dbxelf.h elfos.h arm/elf.h arm/bpabi.h aros.h arm/aros.h arm/aout.h arm/arm.h"
887 + tm_file="$tm_file ../../libgcc/config/arm/bpabi-lib.h"
888 + tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-arm-softfp arm/t-bpabi arm/t-aros t-aros"
889 + xm_file="xm-aros.h"
890 + # The BPABI long long divmod functions return a 128-bit value in
891 + # registers r0-r3. Correctly modeling that requires the use of
892 + # TImode.
893 + case $target in
894 + arm*b-*-aros*)
895 + tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
896 + ;;
897 + esac
898 + need_64bit_hwint=yes
899 + ;;
900 arc*-*-elf*)
901 extra_headers="arc-simd.h"
902 tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
903 @@ -1612,6 +1646,16 @@
904 done
905 TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
907 +i[34567]86-*-aros*)
908 + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h aros.h i386/aros.h"
909 + xm_file=xm-aros.h
910 + tmake_file="${tmake_file} i386/t-i386elf t-aros"
911 + ;;
912 +x86_64-*-aros*)
913 + 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"
914 + tmake_file="${tmake_file} i386/t-i386elf t-aros"
915 + xm_file=xm-aros.h
916 + ;;
917 i[34567]86-pc-msdosdjgpp*)
918 xm_file=i386/xm-djgpp.h
919 tm_file="dbxcoff.h ${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h i386/djgpp-stdint.h"
920 @@ -1909,6 +1953,16 @@
921 thread_file='posix'
924 +m68k-*-aros*)
925 + default_m68k_cpu=68000
926 + default_cf_cpu=5206
927 + 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"
928 + tm_file="${tm_file} aros.h"
929 + tm_defines="${tm_defines} MOTOROLA=1"
930 + tmake_file="m68k/t-floatlib m68k/t-m68kbare m68k/t-m68kelf"
931 + tmake_file="$tmake_file m68k/t-aros m68k/t-mlibs t-aros"
932 + extra_parts="crtbegin.o crtend.o"
933 + ;;
934 m68k-*-elf* | fido-*-elf*)
935 case ${target} in
936 fido-*-elf*)
937 @@ -2409,6 +2463,13 @@
938 extra_options="${extra_options} rs6000/sysv4.opt"
939 tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems rs6000/t-ppccomm"
941 +powerpc-*-aros*)
942 + tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h aros.h"
943 + extra_options="${extra_options} rs6000/sysv4.opt"
944 + tm_file="${tm_file} rs6000/aros.h"
945 + xm_file=xm-aros.h
946 + tmake_file="$tmake_file t-aros"
947 + ;;
948 powerpc*-*-linux*)
949 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h"
950 extra_options="${extra_options} rs6000/sysv4.opt"
951 diff -ruN gcc-6.5.0/gcc/config.host gcc-6.5.0.aros/gcc/config.host
952 --- gcc-6.5.0/gcc/config.host 2017-01-09 21:01:26.000000000 +0000
953 +++ gcc-6.5.0.aros/gcc/config.host 2019-02-13 12:20:35.215061500 +0000
954 @@ -281,6 +281,10 @@
955 out_host_hook_obj=host-hpux.o
956 host_xmake_file="${host_xmake_file} x-hpux"
958 + *-*-aros*)
959 + host_can_use_collect2=no
960 + host_xm_file=xm-aros.h
961 + ;;
962 *-*-*vms*)
963 host_xm_file="vms/xm-vms.h"
964 host_xmake_file=vms/x-vms
965 diff -ruN gcc-6.5.0/gcc/ginclude/aros/types/null.h gcc-6.5.0.aros/gcc/ginclude/aros/types/null.h
966 --- gcc-6.5.0/gcc/ginclude/aros/types/null.h 1970-01-01 00:00:00.000000000 +0000
967 +++ gcc-6.5.0.aros/gcc/ginclude/aros/types/null.h 2019-02-13 12:20:35.215061500 +0000
968 @@ -0,0 +1,3 @@
969 +/* Replace AROS' NULL definition with gcc's one */
970 +#define __need_NULL
971 +#include <stddef.h>
972 diff -ruN gcc-6.5.0/gcc/ginclude/aros/types/ptrdiff_t.h gcc-6.5.0.aros/gcc/ginclude/aros/types/ptrdiff_t.h
973 --- gcc-6.5.0/gcc/ginclude/aros/types/ptrdiff_t.h 1970-01-01 00:00:00.000000000 +0000
974 +++ gcc-6.5.0.aros/gcc/ginclude/aros/types/ptrdiff_t.h 2019-02-13 12:20:35.215061500 +0000
975 @@ -0,0 +1,3 @@
976 +/* Replace AROS' ptrdiff_t definition with gcc's one */
977 +#define __need_ptrdiff_t
978 +#include <stddef.h>
979 diff -ruN gcc-6.5.0/gcc/ginclude/aros/types/size_t.h gcc-6.5.0.aros/gcc/ginclude/aros/types/size_t.h
980 --- gcc-6.5.0/gcc/ginclude/aros/types/size_t.h 1970-01-01 00:00:00.000000000 +0000
981 +++ gcc-6.5.0.aros/gcc/ginclude/aros/types/size_t.h 2019-02-13 12:20:35.215061500 +0000
982 @@ -0,0 +1,3 @@
983 +/* Replace AROS' size_t definition with gcc's one */
984 +#define __need_size_t
985 +#include <stddef.h>
986 diff -ruN gcc-6.5.0/gcc/ginclude/aros/types/wchar_t.h gcc-6.5.0.aros/gcc/ginclude/aros/types/wchar_t.h
987 --- gcc-6.5.0/gcc/ginclude/aros/types/wchar_t.h 1970-01-01 00:00:00.000000000 +0000
988 +++ gcc-6.5.0.aros/gcc/ginclude/aros/types/wchar_t.h 2019-02-13 12:20:35.215061500 +0000
989 @@ -0,0 +1,3 @@
990 +/* Replace AROS' wchar_t definition with gcc's one */
991 +#define __need_wchar_t
992 +#include <stddef.h>
993 diff -ruN gcc-6.5.0/gcc/ginclude/aros/types/wint_t.h gcc-6.5.0.aros/gcc/ginclude/aros/types/wint_t.h
994 --- gcc-6.5.0/gcc/ginclude/aros/types/wint_t.h 1970-01-01 00:00:00.000000000 +0000
995 +++ gcc-6.5.0.aros/gcc/ginclude/aros/types/wint_t.h 2019-02-13 12:20:35.215061500 +0000
996 @@ -0,0 +1,3 @@
997 +/* Replace AROS' wint_t definition with gcc's one */
998 +#define __need_wint_t
999 +#include <stddef.h>
1000 diff -ruN gcc-6.5.0/gcc/ginclude/stddef.h gcc-6.5.0.aros/gcc/ginclude/stddef.h
1001 --- gcc-6.5.0/gcc/ginclude/stddef.h 2016-01-04 14:30:50.000000000 +0000
1002 +++ gcc-6.5.0.aros/gcc/ginclude/stddef.h 2019-02-13 12:20:35.215061500 +0000
1003 @@ -131,6 +131,7 @@
1004 #ifndef __PTRDIFF_T
1005 #ifndef _PTRDIFF_T_
1006 #ifndef _BSD_PTRDIFF_T_
1007 +#ifndef _AROS_TYPES_PTRDIFF_T_H
1008 #ifndef ___int_ptrdiff_t_h
1009 #ifndef _GCC_PTRDIFF_T
1010 #ifndef _PTRDIFF_T_DECLARED /* DragonFly */
1011 @@ -140,6 +141,7 @@
1012 #define __PTRDIFF_T
1013 #define _PTRDIFF_T_
1014 #define _BSD_PTRDIFF_T_
1015 +#define _AROS_TYPES_PTRDIFF_T_H
1016 #define ___int_ptrdiff_t_h
1017 #define _GCC_PTRDIFF_T
1018 #define _PTRDIFF_T_DECLARED
1019 @@ -150,6 +152,7 @@
1020 #endif /* _PTRDIFF_T_DECLARED */
1021 #endif /* _GCC_PTRDIFF_T */
1022 #endif /* ___int_ptrdiff_t_h */
1023 +#endif /* _AROS_TYPES_PTRDIFF_T_H */
1024 #endif /* _BSD_PTRDIFF_T_ */
1025 #endif /* _PTRDIFF_T_ */
1026 #endif /* __PTRDIFF_T */
1027 @@ -176,6 +179,7 @@
1028 #ifndef __SIZE_T
1029 #ifndef _SIZE_T_
1030 #ifndef _BSD_SIZE_T_
1031 +#ifndef _AROS_TYPES_SIZE_T_H
1032 #ifndef _SIZE_T_DEFINED_
1033 #ifndef _SIZE_T_DEFINED
1034 #ifndef _BSD_SIZE_T_DEFINED_ /* Darwin */
1035 @@ -193,6 +197,7 @@
1036 #define __SIZE_T
1037 #define _SIZE_T_
1038 #define _BSD_SIZE_T_
1039 +#define _AROS_TYPES_SIZE_T_H
1040 #define _SIZE_T_DEFINED_
1041 #define _SIZE_T_DEFINED
1042 #define _BSD_SIZE_T_DEFINED_ /* Darwin */
1043 @@ -226,6 +231,7 @@
1044 #endif /* _BSD_SIZE_T_DEFINED_ */
1045 #endif /* _SIZE_T_DEFINED */
1046 #endif /* _SIZE_T_DEFINED_ */
1047 +#endif /* _AROS_TYPES_SIZE_T_H */
1048 #endif /* _BSD_SIZE_T_ */
1049 #endif /* _SIZE_T_ */
1050 #endif /* __SIZE_T */
1051 diff -ruN gcc-6.5.0/include/filenames.h gcc-6.5.0.aros/include/filenames.h
1052 --- gcc-6.5.0/include/filenames.h 2015-07-14 17:08:59.000000000 +0100
1053 +++ gcc-6.5.0.aros/include/filenames.h 2019-02-13 12:20:35.215061500 +0000
1054 @@ -42,6 +42,13 @@
1055 # define HAS_DRIVE_SPEC(f) HAS_DOS_DRIVE_SPEC (f)
1056 # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c)
1057 # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f)
1058 +#elif defined(__AROS__)
1059 +# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
1060 +# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1
1061 +# endif
1062 +# define HAS_DRIVE_SPEC(f) (0)
1063 +# define IS_DIR_SEPARATOR(c) ((c) == '/' || (c) == ':')
1064 +# define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0]) || (strchr((f), ':')))
1065 #else /* not DOSish */
1066 # if defined(__APPLE__)
1067 # ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
1068 diff -ruN gcc-6.5.0/libatomic/configure.tgt gcc-6.5.0.aros/libatomic/configure.tgt
1069 --- gcc-6.5.0/libatomic/configure.tgt 2016-05-10 08:03:07.000000000 +0100
1070 +++ gcc-6.5.0.aros/libatomic/configure.tgt 2019-02-14 11:26:21.174780700 +0000
1071 @@ -108,6 +108,10 @@
1073 # Other system configury
1074 case "${target}" in
1075 + *-*-aros*)
1076 + config_path="${config_path} posix"
1077 + ;;
1079 arm*-*-linux*)
1080 # OS support for atomic primitives.
1081 config_path="${config_path} linux/arm posix"
1082 diff -ruN gcc-6.5.0/libatomic/libatomic_i.h gcc-6.5.0.aros/libatomic/libatomic_i.h
1083 --- gcc-6.5.0/libatomic/libatomic_i.h 2016-01-04 14:30:50.000000000 +0000
1084 +++ gcc-6.5.0.aros/libatomic/libatomic_i.h 2019-02-13 12:20:35.215061500 +0000
1085 @@ -35,6 +35,9 @@
1086 #include <limits.h>
1087 #include <string.h>
1089 +#if defined(__AROS__)
1090 +#include <exec/types.h>
1091 +#endif
1093 /* Symbol concatenation macros. */
1094 #define C2_(X,Y) X ## Y
1095 @@ -103,7 +106,9 @@
1098 /* The "word" size of the machine. */
1099 +#if !defined(__AROS__) || !defined(__typedef_WORD)
1100 typedef unsigned UWORD __attribute__((mode(word)));
1101 +#endif
1103 /* Macros for handing sub-word sized quantities. */
1104 #define MASK_1 ((UWORD)0xff)
1105 diff -ruN gcc-6.5.0/libgcc/config/arm/t-aros gcc-6.5.0.aros/libgcc/config/arm/t-aros
1106 --- gcc-6.5.0/libgcc/config/arm/t-aros 1970-01-01 00:00:00.000000000 +0000
1107 +++ gcc-6.5.0.aros/libgcc/config/arm/t-aros 2019-02-13 12:20:35.215061500 +0000
1108 @@ -0,0 +1,2 @@
1109 +LIB1ASMFUNCS += _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls
1111 diff -ruN gcc-6.5.0/libgcc/config/m68k/aros-atomic.c gcc-6.5.0.aros/libgcc/config/m68k/aros-atomic.c
1112 --- gcc-6.5.0/libgcc/config/m68k/aros-atomic.c 1970-01-01 00:00:00.000000000 +0000
1113 +++ gcc-6.5.0.aros/libgcc/config/m68k/aros-atomic.c 2019-02-13 12:20:35.215061500 +0000
1114 @@ -0,0 +1,204 @@
1115 +/* AROS-specific atomic operations for m68k AROS.
1116 + Copyright (C) 2019 Free Software Foundation, Inc.
1117 + Based on code contributed by CodeSourcery for ARM EABI Linux.
1119 +This file is part of GCC.
1121 +GCC is free software; you can redistribute it and/or modify it under
1122 +the terms of the GNU General Public License as published by the Free
1123 +Software Foundation; either version 3, or (at your option) any later
1124 +version.
1126 +GCC is distributed in the hope that it will be useful, but WITHOUT ANY
1127 +WARRANTY; without even the implied warranty of MERCHANTABILITY or
1128 +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1129 +for more details.
1131 +Under Section 7 of GPL version 3, you are granted additional
1132 +permissions described in the GCC Runtime Library Exception, version
1133 +3.1, as published by the Free Software Foundation.
1135 +You should have received a copy of the GNU General Public License and
1136 +a copy of the GCC Runtime Library Exception along with this program;
1137 +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
1138 +<http://www.gnu.org/licenses/>. */
1140 +/*We implement byte, short and int versions of each atomic operation
1141 + using the helper defined below. There is no support for
1142 + 64-bit operations yet. */
1144 +#include <stdbool.h>
1146 +/* Helper to compare-and-exchange a 32-bit value. */
1147 +#define __aros_atomic_m68k_cmpxchg(mem, oldval, newval, result) \
1148 + __asm__ __volatile__("casl %0,%2,%1" \
1149 + : "=d" (result), "=m" (*mem) \
1150 + : "d" (newval), "0" (oldval), "m" (*mem))
1152 +static inline unsigned
1153 +__aros_atomic_cmpxchg (unsigned *mem, unsigned oldval, unsigned newval)
1155 + unsigned curval, result;
1157 + for (;;) {
1158 + curval = *mem;
1159 + if (curval != oldval)
1160 + return curval;
1161 + __aros_atomic_m68k_cmpxchg(mem, curval, newval, result);
1162 + if (result == newval)
1163 + return curval;
1167 +#define HIDDEN __attribute__ ((visibility ("hidden")))
1169 +/* Big endian masks */
1170 +#define INVERT_MASK_1 24
1171 +#define INVERT_MASK_2 16
1173 +#define MASK_1 0xffu
1174 +#define MASK_2 0xffffu
1176 +#define NAME_oldval(OP, WIDTH) __sync_fetch_and_##OP##_##WIDTH
1177 +#define NAME_newval(OP, WIDTH) __sync_##OP##_and_fetch_##WIDTH
1179 +#define WORD_SYNC_OP(OP, PFX_OP, INF_OP, RETURN) \
1180 + unsigned HIDDEN \
1181 + NAME##_##RETURN (OP, 4) (unsigned *ptr, unsigned val) \
1182 + { \
1183 + unsigned oldval, newval, cmpval = *ptr; \
1185 + do { \
1186 + oldval = cmpval; \
1187 + newval = PFX_OP (oldval INF_OP val); \
1188 + cmpval = __aros_atomic_cmpxchg (ptr, oldval, newval); \
1189 + } while (__builtin_expect (oldval != cmpval, 0)); \
1191 + return RETURN; \
1194 +#define SUBWORD_SYNC_OP(OP, PFX_OP, INF_OP, TYPE, WIDTH, RETURN) \
1195 + TYPE HIDDEN \
1196 + NAME##_##RETURN (OP, WIDTH) (TYPE *ptr, TYPE sval) \
1197 + { \
1198 + unsigned *wordptr = (unsigned *) ((unsigned long) ptr & ~3); \
1199 + unsigned int mask, shift, oldval, newval, cmpval, wval; \
1201 + shift = (((unsigned long) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH; \
1202 + mask = MASK_##WIDTH << shift; \
1203 + wval = (sval & MASK_##WIDTH) << shift; \
1205 + cmpval = *wordptr; \
1206 + do { \
1207 + oldval = cmpval; \
1208 + newval = PFX_OP (oldval INF_OP wval); \
1209 + newval = (newval & mask) | (oldval & ~mask); \
1210 + cmpval = __aros_atomic_cmpxchg (wordptr, oldval, newval); \
1211 + } while (__builtin_expect (oldval != cmpval, 0)); \
1213 + return (RETURN >> shift) & MASK_##WIDTH; \
1216 +WORD_SYNC_OP (add, , +, oldval)
1217 +WORD_SYNC_OP (sub, , -, oldval)
1218 +WORD_SYNC_OP (or, , |, oldval)
1219 +WORD_SYNC_OP (and, , &, oldval)
1220 +WORD_SYNC_OP (xor, , ^, oldval)
1221 +WORD_SYNC_OP (nand, ~, &, oldval)
1223 +SUBWORD_SYNC_OP (add, , +, unsigned short, 2, oldval)
1224 +SUBWORD_SYNC_OP (sub, , -, unsigned short, 2, oldval)
1225 +SUBWORD_SYNC_OP (or, , |, unsigned short, 2, oldval)
1226 +SUBWORD_SYNC_OP (and, , &, unsigned short, 2, oldval)
1227 +SUBWORD_SYNC_OP (xor, , ^, unsigned short, 2, oldval)
1228 +SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, oldval)
1230 +SUBWORD_SYNC_OP (add, , +, unsigned char, 1, oldval)
1231 +SUBWORD_SYNC_OP (sub, , -, unsigned char, 1, oldval)
1232 +SUBWORD_SYNC_OP (or, , |, unsigned char, 1, oldval)
1233 +SUBWORD_SYNC_OP (and, , &, unsigned char, 1, oldval)
1234 +SUBWORD_SYNC_OP (xor, , ^, unsigned char, 1, oldval)
1235 +SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, oldval)
1237 +WORD_SYNC_OP (add, , +, newval)
1238 +WORD_SYNC_OP (sub, , -, newval)
1239 +WORD_SYNC_OP (or, , |, newval)
1240 +WORD_SYNC_OP (and, , &, newval)
1241 +WORD_SYNC_OP (xor, , ^, newval)
1242 +WORD_SYNC_OP (nand, ~, &, newval)
1244 +SUBWORD_SYNC_OP (add, , +, unsigned short, 2, newval)
1245 +SUBWORD_SYNC_OP (sub, , -, unsigned short, 2, newval)
1246 +SUBWORD_SYNC_OP (or, , |, unsigned short, 2, newval)
1247 +SUBWORD_SYNC_OP (and, , &, unsigned short, 2, newval)
1248 +SUBWORD_SYNC_OP (xor, , ^, unsigned short, 2, newval)
1249 +SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, newval)
1251 +SUBWORD_SYNC_OP (add, , +, unsigned char, 1, newval)
1252 +SUBWORD_SYNC_OP (sub, , -, unsigned char, 1, newval)
1253 +SUBWORD_SYNC_OP (or, , |, unsigned char, 1, newval)
1254 +SUBWORD_SYNC_OP (and, , &, unsigned char, 1, newval)
1255 +SUBWORD_SYNC_OP (xor, , ^, unsigned char, 1, newval)
1256 +SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, newval)
1258 +unsigned HIDDEN
1259 +__sync_val_compare_and_swap_4 (unsigned *ptr, unsigned oldval, unsigned newval)
1261 + return __aros_atomic_cmpxchg (ptr, oldval, newval);
1264 +bool HIDDEN
1265 +__sync_bool_compare_and_swap_4 (unsigned *ptr, unsigned oldval,
1266 + unsigned newval)
1268 + return __aros_atomic_cmpxchg (ptr, oldval, newval) == oldval;
1271 +#define SUBWORD_VAL_CAS(TYPE, WIDTH) \
1272 + TYPE HIDDEN \
1273 + __sync_val_compare_and_swap_##WIDTH (TYPE *ptr, TYPE soldval, \
1274 + TYPE snewval) \
1275 + { \
1276 + unsigned *wordptr = (unsigned *)((unsigned long) ptr & ~3); \
1277 + unsigned int mask, shift, woldval, wnewval; \
1278 + unsigned oldval, newval, cmpval; \
1280 + shift = (((unsigned long) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH; \
1281 + mask = MASK_##WIDTH << shift; \
1282 + woldval = (soldval & MASK_##WIDTH) << shift; \
1283 + wnewval = (snewval & MASK_##WIDTH) << shift; \
1284 + cmpval = *wordptr; \
1286 + do { \
1287 + oldval = cmpval; \
1288 + if ((oldval & mask) != woldval) \
1289 + break; \
1290 + newval = (oldval & ~mask) | wnewval; \
1291 + cmpval = __aros_atomic_cmpxchg (wordptr, oldval, newval); \
1292 + } while (__builtin_expect (oldval != cmpval, 0)); \
1294 + return (oldval >> shift) & MASK_##WIDTH; \
1297 +SUBWORD_VAL_CAS (unsigned short, 2)
1298 +SUBWORD_VAL_CAS (unsigned char, 1)
1300 +#define SUBWORD_BOOL_CAS(TYPE, WIDTH) \
1301 + bool HIDDEN \
1302 + __sync_bool_compare_and_swap_##WIDTH (TYPE *ptr, TYPE oldval, \
1303 + TYPE newval) \
1304 + { \
1305 + return (__sync_val_compare_and_swap_##WIDTH (ptr, oldval, newval) \
1306 + == oldval); \
1309 +SUBWORD_BOOL_CAS (unsigned short, 2)
1310 +SUBWORD_BOOL_CAS (unsigned char, 1)
1312 +#undef NAME_oldval
1313 +#define NAME_oldval(OP, WIDTH) __sync_lock_##OP##_##WIDTH
1314 +#define COMMA ,
1316 +WORD_SYNC_OP (test_and_set, , COMMA, oldval)
1317 +SUBWORD_SYNC_OP (test_and_set, , COMMA, unsigned char, 1, oldval)
1318 +SUBWORD_SYNC_OP (test_and_set, , COMMA, unsigned short, 2, oldval)
1319 diff -ruN gcc-6.5.0/libgcc/config/m68k/lb1sf68.S gcc-6.5.0.aros/libgcc/config/m68k/lb1sf68.S
1320 --- gcc-6.5.0/libgcc/config/m68k/lb1sf68.S 2016-01-04 14:30:50.000000000 +0000
1321 +++ gcc-6.5.0.aros/libgcc/config/m68k/lb1sf68.S 2019-02-13 12:20:35.215061500 +0000
1322 @@ -3123,9 +3123,9 @@
1323 | Now comes the check for +/-INFINITY. We know that both are (maybe not
1324 | finite) numbers, but we have to check if both are infinite whether we
1325 | are adding or subtracting them.
1326 - eorl d3,d2 | to check sign bits
1327 + movel d2,d7 | save sign bit
1328 + eorl d3,d2 | check sign bits
1329 bmi 1f
1330 - movel d0,d7
1331 andl IMM (0x80000000),d7 | get (common) sign bit
1332 bra Lf$infty
1334 @@ -3135,7 +3135,6 @@
1335 cmpl d1,d0 | are both infinite?
1336 beq Lf$inop | if so return NaN
1338 - movel d0,d7
1339 andl IMM (0x80000000),d7 | get a's sign bit '
1340 cmpl d4,d0 | test now for infinity
1341 beq Lf$infty | if a is INFINITY return with this sign
1342 diff -ruN gcc-6.5.0/libgcc/config/m68k/t-aros gcc-6.5.0.aros/libgcc/config/m68k/t-aros
1343 --- gcc-6.5.0/libgcc/config/m68k/t-aros 1970-01-01 00:00:00.000000000 +0000
1344 +++ gcc-6.5.0.aros/libgcc/config/m68k/t-aros 2019-02-13 12:20:35.215061500 +0000
1345 @@ -0,0 +1,4 @@
1347 +aros-atomic.o: $(srcdir)/config/m68k/aros-atomic.c
1348 + $(gcc_compile) -mcpu=68020 -c $<
1349 +libgcc-objects += aros-atomic.o
1350 diff -ruN gcc-6.5.0/libgcc/config.host gcc-6.5.0.aros/libgcc/config.host
1351 --- gcc-6.5.0/libgcc/config.host 2017-11-21 09:41:34.000000000 +0000
1352 +++ gcc-6.5.0.aros/libgcc/config.host 2019-02-13 12:20:35.215061500 +0000
1353 @@ -201,6 +201,9 @@
1355 # Common parts for widely ported systems.
1356 case ${host} in
1357 +*-*-aros*)
1358 + tmake_file="$tmake_file"
1359 + ;;
1360 *-*-darwin*)
1361 asm_hidden_op=.private_extern
1362 tmake_file="$tmake_file t-darwin ${cpu_type}/t-darwin t-libgcc-pic t-slibgcc-darwin"
1363 @@ -381,6 +384,12 @@
1364 tmake_file="$tmake_file arm/t-arm arm/t-elf t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
1365 extra_parts="$extra_parts crti.o crtn.o"
1367 +arm*-*-aros*) # ARM AROS
1368 + tmake_file="${tmake_file} arm/t-arm arm/t-aros t-fixedpoint-gnu-prefix arm/t-bpabi t-crtfm"
1369 + tmake_file="${tmake_file} arm/t-softfp t-softfp"
1370 + tm_file="${tm_file} arm/bpabi-lib.h"
1371 + unwind_header=config/arm/unwind-arm.h
1372 + ;;
1373 arm*-*-freebsd*) # ARM FreeBSD EABI
1374 tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix arm/t-elf"
1375 tmake_file="${tmake_file} arm/t-bpabi arm/t-freebsd"
1376 @@ -816,6 +825,9 @@
1377 m32rle-*-linux*)
1378 tmake_file="$tmake_file m32r/t-linux t-fdpbit"
1380 +m68k-*-aros*)
1381 + tmake_file="$tmake_file m68k/t-floatlib m68k/t-aros"
1382 + ;;
1383 m68k-*-elf* | fido-*-elf)
1384 tmake_file="$tmake_file m68k/t-floatlib"
1386 @@ -1340,6 +1352,9 @@
1387 tmake_file="$tmake_file nvptx/t-nvptx"
1388 extra_parts="crt0.o"
1390 +*-*-aros*)
1391 + tmake_file="$tmake_file"
1392 + ;;
1394 echo "*** Configuration ${host} not supported" 1>&2
1395 exit 1
1396 diff -ruN gcc-6.5.0/libgcc/gthr.h gcc-6.5.0.aros/libgcc/gthr.h
1397 --- gcc-6.5.0/libgcc/gthr.h 2016-01-04 14:30:50.000000000 +0000
1398 +++ gcc-6.5.0.aros/libgcc/gthr.h 2019-02-13 12:20:35.215061500 +0000
1399 @@ -141,6 +141,11 @@
1400 #define GTHREAD_USE_WEAK 0
1401 #endif
1403 +#ifdef __AROS__
1404 +#undef GTHREAD_USE_WEAK
1405 +#define GTHREAD_USE_WEAK 0
1406 +#endif
1408 #ifndef GTHREAD_USE_WEAK
1409 #define GTHREAD_USE_WEAK 1
1410 #endif
1411 diff -ruN gcc-6.5.0/libgcc/unwind-dw2-fde.c gcc-6.5.0.aros/libgcc/unwind-dw2-fde.c
1412 --- gcc-6.5.0/libgcc/unwind-dw2-fde.c 2016-01-04 14:30:50.000000000 +0000
1413 +++ gcc-6.5.0.aros/libgcc/unwind-dw2-fde.c 2019-02-13 12:20:35.215061500 +0000
1414 @@ -92,12 +92,16 @@
1415 #endif
1417 init_object_mutex_once ();
1418 +#ifndef __AROS__ /* This is called when SysBase is not yet set up */
1419 __gthread_mutex_lock (&object_mutex);
1420 +#endif
1422 ob->next = unseen_objects;
1423 unseen_objects = ob;
1425 +#ifndef __AROS__
1426 __gthread_mutex_unlock (&object_mutex);
1427 +#endif
1430 void
1431 diff -ruN gcc-6.5.0/libgcc/unwind-dw2.c gcc-6.5.0.aros/libgcc/unwind-dw2.c
1432 --- gcc-6.5.0/libgcc/unwind-dw2.c 2016-01-04 14:30:50.000000000 +0000
1433 +++ gcc-6.5.0.aros/libgcc/unwind-dw2.c 2019-02-13 12:20:35.215061500 +0000
1434 @@ -1542,7 +1542,9 @@
1435 static inline void
1436 init_dwarf_reg_size_table (void)
1438 +#ifdef MD_FALLBACK_FRAME_STATE_FOR
1439 __builtin_init_dwarf_reg_size_table (dwarf_reg_size_table);
1440 +#endif
1443 static void __attribute__((noinline))
1444 diff -ruN gcc-6.5.0/libiberty/filename_cmp.c gcc-6.5.0.aros/libiberty/filename_cmp.c
1445 --- gcc-6.5.0/libiberty/filename_cmp.c 2014-11-11 23:33:25.000000000 +0000
1446 +++ gcc-6.5.0.aros/libiberty/filename_cmp.c 2019-02-13 12:20:35.215061500 +0000
1447 @@ -55,9 +55,12 @@
1449 filename_cmp (const char *s1, const char *s2)
1451 -#if !defined(HAVE_DOS_BASED_FILE_SYSTEM) \
1452 - && !defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
1453 +#if !defined(HAVE_DOS_BASED_FILE_SYSTEM)
1454 +#if defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
1455 + return strcasecmp(s1, s2);
1456 +#else
1457 return strcmp(s1, s2);
1458 +#endif
1459 #else
1460 for (;;)
1462 diff -ruN gcc-6.5.0/libobjc/configure gcc-6.5.0.aros/libobjc/configure
1463 --- gcc-6.5.0/libobjc/configure 2018-10-26 10:56:36.000000000 +0100
1464 +++ gcc-6.5.0.aros/libobjc/configure 2019-02-13 12:20:35.215061500 +0000
1465 @@ -11253,214 +11253,7 @@
1466 # -----------
1468 # Check if we have thread-local storage
1471 - # Check whether --enable-tls was given.
1472 -if test "${enable_tls+set}" = set; then :
1473 - enableval=$enable_tls;
1474 - case "$enableval" in
1475 - yes|no) ;;
1476 - *) as_fn_error "Argument to enable/disable tls must be yes or no" "$LINENO" 5 ;;
1477 - esac
1479 -else
1480 - enable_tls=yes
1484 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports thread-local storage" >&5
1485 -$as_echo_n "checking whether the target supports thread-local storage... " >&6; }
1486 -if test "${gcc_cv_have_tls+set}" = set; then :
1487 - $as_echo_n "(cached) " >&6
1488 -else
1490 - if test "$cross_compiling" = yes; then :
1491 - if test x$gcc_no_link = xyes; then
1492 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1494 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1495 -/* end confdefs.h. */
1496 -__thread int a; int b; int main() { return a = b; }
1497 -_ACEOF
1498 -if ac_fn_c_try_link "$LINENO"; then :
1499 - chktls_save_LDFLAGS="$LDFLAGS"
1500 - case $host in
1501 - *-*-linux*)
1502 - LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
1503 - ;;
1504 - esac
1505 - chktls_save_CFLAGS="$CFLAGS"
1506 - CFLAGS="-fPIC $CFLAGS"
1507 - if test x$gcc_no_link = xyes; then
1508 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1510 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1511 -/* end confdefs.h. */
1512 -int f() { return 0; }
1513 -_ACEOF
1514 -if ac_fn_c_try_link "$LINENO"; then :
1515 - if test x$gcc_no_link = xyes; then
1516 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1518 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1519 -/* end confdefs.h. */
1520 -__thread int a; int b; int f() { return a = b; }
1521 -_ACEOF
1522 -if ac_fn_c_try_link "$LINENO"; then :
1523 - gcc_cv_have_tls=yes
1524 -else
1525 - gcc_cv_have_tls=no
1527 -rm -f core conftest.err conftest.$ac_objext \
1528 - conftest$ac_exeext conftest.$ac_ext
1529 -else
1530 - gcc_cv_have_tls=yes
1532 -rm -f core conftest.err conftest.$ac_objext \
1533 - conftest$ac_exeext conftest.$ac_ext
1534 - CFLAGS="$chktls_save_CFLAGS"
1535 - LDFLAGS="$chktls_save_LDFLAGS"
1536 -else
1537 - gcc_cv_have_tls=no
1539 -rm -f core conftest.err conftest.$ac_objext \
1540 - conftest$ac_exeext conftest.$ac_ext
1543 -else
1544 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1545 -/* end confdefs.h. */
1546 -__thread int a; int b; int main() { return a = b; }
1547 -_ACEOF
1548 -if ac_fn_c_try_run "$LINENO"; then :
1549 - chktls_save_LDFLAGS="$LDFLAGS"
1550 - LDFLAGS="-static $LDFLAGS"
1551 - if test x$gcc_no_link = xyes; then
1552 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1554 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1555 -/* end confdefs.h. */
1556 -int main() { return 0; }
1557 -_ACEOF
1558 -if ac_fn_c_try_link "$LINENO"; then :
1559 - if test "$cross_compiling" = yes; then :
1560 - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
1561 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1562 -as_fn_error "cannot run test program while cross compiling
1563 -See \`config.log' for more details." "$LINENO" 5; }
1564 -else
1565 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1566 -/* end confdefs.h. */
1567 -__thread int a; int b; int main() { return a = b; }
1568 -_ACEOF
1569 -if ac_fn_c_try_run "$LINENO"; then :
1570 - gcc_cv_have_tls=yes
1571 -else
1572 - gcc_cv_have_tls=no
1574 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1575 - conftest.$ac_objext conftest.beam conftest.$ac_ext
1578 -else
1579 - gcc_cv_have_tls=yes
1581 -rm -f core conftest.err conftest.$ac_objext \
1582 - conftest$ac_exeext conftest.$ac_ext
1583 - LDFLAGS="$chktls_save_LDFLAGS"
1584 - if test $gcc_cv_have_tls = yes; then
1585 - chktls_save_CFLAGS="$CFLAGS"
1586 - thread_CFLAGS=failed
1587 - for flag in '' '-pthread' '-lpthread'; do
1588 - CFLAGS="$flag $chktls_save_CFLAGS"
1589 - if test x$gcc_no_link = xyes; then
1590 - as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
1592 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1593 -/* end confdefs.h. */
1594 -#include <pthread.h>
1595 - void *g(void *d) { return NULL; }
1596 -int
1597 -main ()
1599 -pthread_t t; pthread_create(&t,NULL,g,NULL);
1601 - return 0;
1603 -_ACEOF
1604 -if ac_fn_c_try_link "$LINENO"; then :
1605 - thread_CFLAGS="$flag"
1607 -rm -f core conftest.err conftest.$ac_objext \
1608 - conftest$ac_exeext conftest.$ac_ext
1609 - if test "X$thread_CFLAGS" != Xfailed; then
1610 - break
1611 - fi
1612 - done
1613 - CFLAGS="$chktls_save_CFLAGS"
1614 - if test "X$thread_CFLAGS" != Xfailed; then
1615 - CFLAGS="$thread_CFLAGS $chktls_save_CFLAGS"
1616 - if test "$cross_compiling" = yes; then :
1617 - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
1618 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1619 -as_fn_error "cannot run test program while cross compiling
1620 -See \`config.log' for more details." "$LINENO" 5; }
1621 -else
1622 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1623 -/* end confdefs.h. */
1624 -#include <pthread.h>
1625 - __thread int a;
1626 - static int *volatile a_in_other_thread;
1627 - static void *
1628 - thread_func (void *arg)
1630 - a_in_other_thread = &a;
1631 - return (void *)0;
1633 -int
1634 -main ()
1636 -pthread_t thread;
1637 - void *thread_retval;
1638 - int *volatile a_in_main_thread;
1639 - a_in_main_thread = &a;
1640 - if (pthread_create (&thread, (pthread_attr_t *)0,
1641 - thread_func, (void *)0))
1642 - return 0;
1643 - if (pthread_join (thread, &thread_retval))
1644 - return 0;
1645 - return (a_in_other_thread == a_in_main_thread);
1647 - return 0;
1649 -_ACEOF
1650 -if ac_fn_c_try_run "$LINENO"; then :
1651 - gcc_cv_have_tls=yes
1652 -else
1653 - gcc_cv_have_tls=no
1655 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1656 - conftest.$ac_objext conftest.beam conftest.$ac_ext
1659 - CFLAGS="$chktls_save_CFLAGS"
1660 - fi
1661 - fi
1662 -else
1663 - gcc_cv_have_tls=no
1665 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1666 - conftest.$ac_objext conftest.beam conftest.$ac_ext
1670 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_have_tls" >&5
1671 -$as_echo "$gcc_cv_have_tls" >&6; }
1672 - if test "$enable_tls $gcc_cv_have_tls" = "yes yes"; then
1674 -$as_echo "#define HAVE_TLS 1" >>confdefs.h
1676 - fi
1677 +#dnl GCC_ENABLE_TLS
1680 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the type of bitfields matters" >&5
1681 diff -ruN gcc-6.5.0/libobjc/configure.ac gcc-6.5.0.aros/libobjc/configure.ac
1682 --- gcc-6.5.0/libobjc/configure.ac 2016-01-04 14:30:50.000000000 +0000
1683 +++ gcc-6.5.0.aros/libobjc/configure.ac 2019-02-13 12:20:35.215061500 +0000
1684 @@ -210,7 +210,7 @@
1685 # -----------
1687 # Check if we have thread-local storage
1688 -GCC_CHECK_TLS
1689 +dnl GCC_CHECK_TLS
1691 gt_BITFIELD_TYPE_MATTERS
1693 diff -ruN gcc-6.5.0/libobjc/thr.c gcc-6.5.0.aros/libobjc/thr.c
1694 --- gcc-6.5.0/libobjc/thr.c 2016-01-04 14:30:50.000000000 +0000
1695 +++ gcc-6.5.0.aros/libobjc/thr.c 2019-02-13 12:20:35.215061500 +0000
1696 @@ -35,6 +35,7 @@
1697 #include "objc/runtime.h"
1698 #include "objc-private/module-abi-8.h"
1699 #include "objc-private/runtime.h"
1700 +#define __typedef_BOOL /* Remove definition of BOOL */
1701 #include <gthr.h>
1703 #include <stdlib.h>
1704 diff -ruN gcc-6.5.0/libstdc++-v3/config/os/aros/ctype_base.h gcc-6.5.0.aros/libstdc++-v3/config/os/aros/ctype_base.h
1705 --- gcc-6.5.0/libstdc++-v3/config/os/aros/ctype_base.h 1970-01-01 00:00:00.000000000 +0000
1706 +++ gcc-6.5.0.aros/libstdc++-v3/config/os/aros/ctype_base.h 2019-02-13 12:20:35.215061500 +0000
1707 @@ -0,0 +1,30 @@
1708 +namespace std _GLIBCXX_VISIBILITY(default)
1710 +_GLIBCXX_BEGIN_NAMESPACE_VERSION
1712 +struct ctype_base {
1713 + /* Non-standard typedefs */
1714 + typedef int * __to_type;
1716 + /* NB: Offsets into ctype<char>::_M_table force a particular size
1717 + on the mask type. Because of this, we don't use an enum. */
1718 + typedef unsigned short int mask;
1720 + static const mask upper = _ISupper;
1721 + static const mask lower = _ISlower;
1722 + static const mask alpha = _ISalpha;
1723 + static const mask digit = _ISdigit;
1724 + static const mask xdigit = _ISxdigit;
1725 + static const mask space = _ISspace;
1726 + static const mask print = _ISprint;
1727 + static const mask graph = _ISgraph;
1728 + static const mask cntrl = _IScntrl;
1729 + static const mask punct = _ISpunct;
1730 + static const mask alnum = _ISalnum;
1731 +#if __cplusplus >= 201103L
1732 + static const mask blank = _ISblank;
1733 +#endif
1736 +_GLIBCXX_END_NAMESPACE_VERSION
1737 +} // namespace
1738 diff -ruN gcc-6.5.0/libstdc++-v3/config/os/aros/ctype_configure_char.cc gcc-6.5.0.aros/libstdc++-v3/config/os/aros/ctype_configure_char.cc
1739 --- gcc-6.5.0/libstdc++-v3/config/os/aros/ctype_configure_char.cc 1970-01-01 00:00:00.000000000 +0000
1740 +++ gcc-6.5.0.aros/libstdc++-v3/config/os/aros/ctype_configure_char.cc 2019-02-13 12:20:35.215061500 +0000
1741 @@ -0,0 +1,99 @@
1742 +// Locale support -*- C++ -*-
1744 +// Copyright (C) 2011-2013 Free Software Foundation, Inc.
1746 +// This file is part of the GNU ISO C++ Library. This library is free
1747 +// software; you can redistribute it and/or modify it under the
1748 +// terms of the GNU General Public License as published by the
1749 +// Free Software Foundation; either version 3, or (at your option)
1750 +// any later version.
1752 +// This library is distributed in the hope that it will be useful,
1753 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1754 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1755 +// GNU General Public License for more details.
1757 +// Under Section 7 of GPL version 3, you are granted additional
1758 +// permissions described in the GCC Runtime Library Exception, version
1759 +// 3.1, as published by the Free Software Foundation.
1761 +// You should have received a copy of the GNU General Public License and
1762 +// a copy of the GCC Runtime Library Exception along with this program;
1763 +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
1764 +// <http://www.gnu.org/licenses/>.
1766 +/** @file ctype_configure_char.cc */
1769 +// ISO C++ 14882: 22.1 Locales
1772 +#include <locale>
1773 +#include <cstdlib>
1774 +#include <cstring>
1776 +namespace std _GLIBCXX_VISIBILITY(default)
1778 +_GLIBCXX_BEGIN_NAMESPACE_VERSION
1780 +// Information as gleaned from /usr/include/ctype.h
1782 + const ctype_base::mask*
1783 + ctype<char>::classic_table() throw()
1784 + { return 0; }
1786 + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
1787 + size_t __refs)
1788 + : facet(__refs), _M_del(__table != 0 && __del),
1789 + _M_toupper(NULL), _M_tolower(NULL),
1790 + _M_table(__table ? __table : classic_table())
1791 + {
1792 + memset(_M_widen, 0, sizeof(_M_widen));
1793 + _M_widen_ok = 0;
1794 + memset(_M_narrow, 0, sizeof(_M_narrow));
1795 + _M_narrow_ok = 0;
1798 + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
1799 + : facet(__refs), _M_del(__table != 0 && __del),
1800 + _M_toupper(NULL), _M_tolower(NULL),
1801 + _M_table(__table ? __table : classic_table())
1802 + {
1803 + memset(_M_widen, 0, sizeof(_M_widen));
1804 + _M_widen_ok = 0;
1805 + memset(_M_narrow, 0, sizeof(_M_narrow));
1806 + _M_narrow_ok = 0;
1809 + char
1810 + ctype<char>::do_toupper(char __c) const
1811 + { return ::toupper((int) __c); }
1813 + const char*
1814 + ctype<char>::do_toupper(char* __low, const char* __high) const
1816 + while (__low < __high)
1818 + *__low = ::toupper((int) *__low);
1819 + ++__low;
1821 + return __high;
1824 + char
1825 + ctype<char>::do_tolower(char __c) const
1826 + { return ::tolower((int) __c); }
1828 + const char*
1829 + ctype<char>::do_tolower(char* __low, const char* __high) const
1831 + while (__low < __high)
1833 + *__low = ::tolower((int) *__low);
1834 + ++__low;
1836 + return __high;
1839 +_GLIBCXX_END_NAMESPACE_VERSION
1840 +} // namespace
1841 diff -ruN gcc-6.5.0/libstdc++-v3/config/os/aros/ctype_inline.h gcc-6.5.0.aros/libstdc++-v3/config/os/aros/ctype_inline.h
1842 --- gcc-6.5.0/libstdc++-v3/config/os/aros/ctype_inline.h 1970-01-01 00:00:00.000000000 +0000
1843 +++ gcc-6.5.0.aros/libstdc++-v3/config/os/aros/ctype_inline.h 2019-02-13 12:20:35.215061500 +0000
1844 @@ -0,0 +1,173 @@
1845 +// Locale support -*- C++ -*-
1847 +// Copyright (C) 2000, 2003 Free Software Foundation, Inc.
1849 +// This file is part of the GNU ISO C++ Library. This library is free
1850 +// software; you can redistribute it and/or modify it under the
1851 +// terms of the GNU General Public License as published by the
1852 +// Free Software Foundation; either version 2, or (at your option)
1853 +// any later version.
1855 +// This library is distributed in the hope that it will be useful,
1856 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1857 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1858 +// GNU General Public License for more details.
1860 +// You should have received a copy of the GNU General Public License along
1861 +// with this library; see the file COPYING. If not, write to the Free
1862 +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
1863 +// USA.
1865 +// As a special exception, you may use this file as part of a free software
1866 +// library without restriction. Specifically, if other files instantiate
1867 +// templates or use macros or inline functions from this file, or you compile
1868 +// this file and link it with other files to produce an executable, this
1869 +// file does not by itself cause the resulting executable to be covered by
1870 +// the GNU General Public License. This exception does not however
1871 +// invalidate any other reasons why the executable file might be covered by
1872 +// the GNU General Public License.
1874 +/** @file ctype_inline.h
1875 + * This is an internal header file, included by other library headers.
1876 + * You should not attempt to use it directly.
1877 + */
1880 +// ISO C++ 14882: 22.1 Locales
1883 +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
1884 +// functions go in ctype.cc
1886 +// The following definitions are portable, but insanely slow. If one
1887 +// cares at all about performance, then specialized ctype
1888 +// functionality should be added for the native os in question: see
1889 +// the config/os/bits/ctype_*.h files.
1891 +// Constructing a synthetic "C" table should be seriously considered...
1893 +namespace std _GLIBCXX_VISIBILITY(default)
1895 +_GLIBCXX_BEGIN_NAMESPACE_VERSION
1897 + bool
1898 + ctype<char>::
1899 + is(mask __m, char __c) const
1900 + {
1901 + if (_M_table)
1902 + return _M_table[static_cast<unsigned char>(__c)] & __m;
1903 + else
1905 + bool __ret = false;
1906 + const size_t __bitmasksize = 15;
1907 + size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0
1908 + for (; __bitcur <= __bitmasksize; ++__bitcur)
1910 + const mask __bit = static_cast<mask>(1 << __bitcur);
1911 + if (__m & __bit)
1913 + bool __testis;
1914 + switch (__bit)
1916 + case space:
1917 + __testis = isspace(__c);
1918 + break;
1919 + case print:
1920 + __testis = isprint(__c);
1921 + break;
1922 + case cntrl:
1923 + __testis = iscntrl(__c);
1924 + break;
1925 + case upper:
1926 + __testis = isupper(__c);
1927 + break;
1928 + case lower:
1929 + __testis = islower(__c);
1930 + break;
1931 + case alpha:
1932 + __testis = isalpha(__c);
1933 + break;
1934 + case digit:
1935 + __testis = isdigit(__c);
1936 + break;
1937 + case punct:
1938 + __testis = ispunct(__c);
1939 + break;
1940 + case xdigit:
1941 + __testis = isxdigit(__c);
1942 + break;
1943 + case alnum:
1944 + __testis = isalnum(__c);
1945 + break;
1946 + case graph:
1947 + __testis = isgraph(__c);
1948 + break;
1949 + default:
1950 + __testis = false;
1951 + break;
1953 + __ret |= __testis;
1956 + return __ret;
1960 + const char*
1961 + ctype<char>::
1962 + is(const char* __low, const char* __high, mask* __vec) const
1964 + if (_M_table)
1965 + while (__low < __high)
1966 + *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
1967 + else
1969 + // Highest bitmask in ctype_base == 10.
1970 + const size_t __bitmasksize = 15;
1971 + for (;__low < __high; ++__vec, ++__low)
1973 + mask __m = 0;
1974 + // Lowest bitmask in ctype_base == 0
1975 + size_t __i = 0;
1976 + for (;__i <= __bitmasksize; ++__i)
1978 + const mask __bit = static_cast<mask>(1 << __i);
1979 + if (this->is(__bit, *__low))
1980 + __m |= __bit;
1982 + *__vec = __m;
1985 + return __high;
1988 + const char*
1989 + ctype<char>::
1990 + scan_is(mask __m, const char* __low, const char* __high) const
1992 + if (_M_table)
1993 + while (__low < __high
1994 + && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
1995 + ++__low;
1996 + else
1997 + while (__low < __high && !this->is(__m, *__low))
1998 + ++__low;
1999 + return __low;
2002 + const char*
2003 + ctype<char>::
2004 + scan_not(mask __m, const char* __low, const char* __high) const
2006 + if (_M_table)
2007 + while (__low < __high
2008 + && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
2009 + ++__low;
2010 + else
2011 + while (__low < __high && this->is(__m, *__low) != 0)
2012 + ++__low;
2013 + return __low;
2016 +_GLIBCXX_END_NAMESPACE_VERSION
2017 +} // namespace
2018 diff -ruN gcc-6.5.0/libstdc++-v3/config/os/aros/ctype_noninline.h gcc-6.5.0.aros/libstdc++-v3/config/os/aros/ctype_noninline.h
2019 --- gcc-6.5.0/libstdc++-v3/config/os/aros/ctype_noninline.h 1970-01-01 00:00:00.000000000 +0000
2020 +++ gcc-6.5.0.aros/libstdc++-v3/config/os/aros/ctype_noninline.h 2019-02-13 12:20:35.215061500 +0000
2021 @@ -0,0 +1,56 @@
2022 + const ctype_base::mask*
2023 + ctype<char>::classic_table() throw()
2024 + { return *__ctype_b_ptr; }
2026 + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
2027 + size_t __refs)
2028 + : facet(__refs), _M_del(__table != 0 && __del),
2029 + _M_toupper(NULL), _M_tolower(NULL),
2030 + _M_table(__table ? __table : classic_table())
2031 + {
2032 + memset(_M_widen, 0, sizeof(_M_widen));
2033 + _M_widen_ok = 0;
2034 + memset(_M_narrow, 0, sizeof(_M_narrow));
2035 + _M_narrow_ok = 0;
2038 + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
2039 + : facet(__refs), _M_del(__table != 0 && __del),
2040 + _M_toupper(NULL), _M_tolower(NULL),
2041 + _M_table(__table ? __table : classic_table())
2042 + {
2043 + memset(_M_widen, 0, sizeof(_M_widen));
2044 + _M_widen_ok = 0;
2045 + memset(_M_narrow, 0, sizeof(_M_narrow));
2046 + _M_narrow_ok = 0;
2049 + char
2050 + ctype<char>::do_toupper(char __c) const
2051 + { return ::toupper((int) __c); }
2053 + const char*
2054 + ctype<char>::do_toupper(char* __low, const char* __high) const
2056 + while (__low < __high)
2058 + *__low = ::toupper((int) *__low);
2059 + ++__low;
2061 + return __high;
2064 + char
2065 + ctype<char>::do_tolower(char __c) const
2066 + { return ::tolower((int) __c); }
2068 + const char*
2069 + ctype<char>::do_tolower(char* __low, const char* __high) const
2071 + while (__low < __high)
2073 + *__low = ::tolower((int) *__low);
2074 + ++__low;
2076 + return __high;
2078 diff -ruN gcc-6.5.0/libstdc++-v3/config/os/aros/os_defines.h gcc-6.5.0.aros/libstdc++-v3/config/os/aros/os_defines.h
2079 --- gcc-6.5.0/libstdc++-v3/config/os/aros/os_defines.h 1970-01-01 00:00:00.000000000 +0000
2080 +++ gcc-6.5.0.aros/libstdc++-v3/config/os/aros/os_defines.h 2019-02-13 12:20:35.215061500 +0000
2081 @@ -0,0 +1,11 @@
2082 +// Specific definitions for AROS -*- C++ -*-
2084 +#ifndef _GLIBCXX_OS_DEFINES
2085 +#define _GLIBCXX_OS_DEFINES
2087 +#define __off64_t off_t
2089 +// No support for referencing weak symbols without a definition.
2090 +#define _GLIBCXX_USE_WEAK_REF 0
2092 +#endif
2093 diff -ruN gcc-6.5.0/libstdc++-v3/configure gcc-6.5.0.aros/libstdc++-v3/configure
2094 --- gcc-6.5.0/libstdc++-v3/configure 2018-02-19 17:02:38.000000000 +0000
2095 +++ gcc-6.5.0.aros/libstdc++-v3/configure 2019-02-13 12:20:35.215061500 +0000
2096 @@ -5367,12 +5367,12 @@
2099 # Libtool setup.
2100 -if test "x${with_newlib}" != "xyes"; then
2101 - enable_dlopen=yes
2106 +#if test "x${with_newlib}" != "xyes"; then
2107 +# AC_LIBTOOL_DLOPEN
2111 +#fi
2112 case `pwd` in
2113 *\ * | *\ *)
2114 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
2115 @@ -8103,6 +8103,8 @@
2119 + enable_dlopen=no
2122 enable_win32_dll=no
2124 @@ -19643,6 +19645,7 @@
2126 struct iovec iov[2];
2127 writev(0, iov, 0);
2128 +#error be sure to fail
2130 return 0;
2132 @@ -19665,6 +19668,7 @@
2134 struct iovec iov[2];
2135 writev(0, iov, 0);
2136 +#error be sure to fail
2138 return 0;
2140 @@ -28885,6 +28889,58 @@
2142 # Base decisions on target environment.
2143 case "${host}" in
2144 + *-aros*)
2145 + for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
2146 + machine/param.h sys/machine.h sys/types.h fp.h locale.h float.h inttypes.h
2147 +do :
2148 + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
2149 +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
2150 +eval as_val=\$$as_ac_Header
2151 + if test "x$as_val" = x""yes; then :
2152 + cat >>confdefs.h <<_ACEOF
2153 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
2154 +_ACEOF
2158 +done
2161 + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
2162 + GLIBCXX_CHECK_WCHAR_T_SUPPORT
2164 + $as_echo "#define HAVE_FINITE 1" >>confdefs.h
2166 + $as_echo "#define HAVE_FINITEF 1" >>confdefs.h
2168 + $as_echo "#define HAVE_FREXPF 1" >>confdefs.h
2170 + $as_echo "#define HAVE_HYPOTF 1" >>confdefs.h
2172 + $as_echo "#define HAVE_ISINF 1" >>confdefs.h
2174 + $as_echo "#define HAVE_ISINFF 1" >>confdefs.h
2176 + $as_echo "#define HAVE_ISNAN 1" >>confdefs.h
2178 + $as_echo "#define HAVE_ISNANF 1" >>confdefs.h
2180 + $as_echo "#define HAVE_SINCOS 1" >>confdefs.h
2182 + $as_echo "#define HAVE_SINCOSF 1" >>confdefs.h
2184 + if test x"long_double_math_on_this_cpu" = x"yes"; then
2185 + $as_echo "#define HAVE_FINITEL 1" >>confdefs.h
2187 + $as_echo "#define HAVE_HYPOTL 1" >>confdefs.h
2189 + $as_echo "#define HAVE_ISINFL 1" >>confdefs.h
2191 + $as_echo "#define HAVE_ISNANL 1" >>confdefs.h
2193 + fi
2194 + ;;
2196 arm*-*-symbianelf*)
2197 # This is a freestanding configuration; there is nothing to do here.
2199 diff -ruN gcc-6.5.0/libstdc++-v3/configure.ac gcc-6.5.0.aros/libstdc++-v3/configure.ac
2200 --- gcc-6.5.0/libstdc++-v3/configure.ac 2018-02-19 17:02:38.000000000 +0000
2201 +++ gcc-6.5.0.aros/libstdc++-v3/configure.ac 2019-02-13 12:20:35.215061500 +0000
2202 @@ -89,9 +89,9 @@
2203 GLIBCXX_CONFIGURE
2205 # Libtool setup.
2206 -if test "x${with_newlib}" != "xyes"; then
2207 - AC_LIBTOOL_DLOPEN
2209 +#if test "x${with_newlib}" != "xyes"; then
2210 +# AC_LIBTOOL_DLOPEN
2211 +#fi
2212 AM_PROG_LIBTOOL
2213 ACX_LT_HOST_FLAGS
2214 AC_SUBST(enable_shared)
2215 diff -ruN gcc-6.5.0/libstdc++-v3/configure.host gcc-6.5.0.aros/libstdc++-v3/configure.host
2216 --- gcc-6.5.0/libstdc++-v3/configure.host 2016-09-27 07:11:15.000000000 +0100
2217 +++ gcc-6.5.0.aros/libstdc++-v3/configure.host 2019-02-13 12:20:35.215061500 +0000
2218 @@ -226,6 +226,9 @@
2219 os_include_dir="os/generic"
2220 atomicity_dir="cpu/generic"
2222 + aros*)
2223 + os_include_dir="os/aros"
2224 + ;;
2225 bsd*)
2226 # Plain BSD attempts to share FreeBSD files.
2227 os_include_dir="os/bsd/freebsd"
2228 diff -ruN gcc-6.5.0/libstdc++-v3/crossconfig.m4 gcc-6.5.0.aros/libstdc++-v3/crossconfig.m4
2229 --- gcc-6.5.0/libstdc++-v3/crossconfig.m4 2015-10-11 23:34:28.000000000 +0100
2230 +++ gcc-6.5.0.aros/libstdc++-v3/crossconfig.m4 2019-02-13 12:20:35.215061500 +0000
2231 @@ -5,6 +5,31 @@
2232 AC_DEFUN([GLIBCXX_CROSSCONFIG],[
2233 # Base decisions on target environment.
2234 case "${host}" in
2235 + *-aros*)
2236 + AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
2237 + machine/param.h sys/machine.h sys/types.h fp.h locale.h float.h inttypes.h])
2239 + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
2240 + GLIBCXX_CHECK_WCHAR_T_SUPPORT
2242 + AC_DEFINE(HAVE_FINITE)
2243 + AC_DEFINE(HAVE_FINITEF)
2244 + AC_DEFINE(HAVE_FREXPF)
2245 + AC_DEFINE(HAVE_HYPOTF)
2246 + AC_DEFINE(HAVE_ISINF)
2247 + AC_DEFINE(HAVE_ISINFF)
2248 + AC_DEFINE(HAVE_ISNAN)
2249 + AC_DEFINE(HAVE_ISNANF)
2250 + AC_DEFINE(HAVE_SINCOS)
2251 + AC_DEFINE(HAVE_SINCOSF)
2252 + if test x"long_double_math_on_this_cpu" = x"yes"; then
2253 + AC_DEFINE(HAVE_FINITEL)
2254 + AC_DEFINE(HAVE_HYPOTL)
2255 + AC_DEFINE(HAVE_ISINFL)
2256 + AC_DEFINE(HAVE_ISNANL)
2257 + fi
2258 + ;;
2260 arm*-*-symbianelf*)
2261 # This is a freestanding configuration; there is nothing to do here.
2263 diff -ruN gcc-6.5.0/libstdc++-v3/include/Makefile.in gcc-6.5.0.aros/libstdc++-v3/include/Makefile.in
2264 --- gcc-6.5.0/libstdc++-v3/include/Makefile.in 2018-02-19 17:02:38.000000000 +0000
2265 +++ gcc-6.5.0.aros/libstdc++-v3/include/Makefile.in 2019-02-13 12:20:35.215061500 +0000
2266 @@ -1687,6 +1687,7 @@
2267 -e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
2268 -e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
2269 -e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \
2270 + -e 's/_GLIBCXX___AROS__/__AROS__/g' \
2271 -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
2272 < $< > $@
2274 diff -ruN gcc-6.5.0/libstdc++-v3/include/c_global/cstdint gcc-6.5.0.aros/libstdc++-v3/include/c_global/cstdint
2275 --- gcc-6.5.0/libstdc++-v3/include/c_global/cstdint 2016-01-04 14:30:50.000000000 +0000
2276 +++ gcc-6.5.0.aros/libstdc++-v3/include/c_global/cstdint 2019-02-13 12:20:35.215061500 +0000
2277 @@ -41,7 +41,7 @@
2278 # include <stdint.h>
2279 #endif
2281 -#ifdef _GLIBCXX_USE_C99_STDINT_TR1
2282 +#if defined(_GLIBCXX_USE_C99_STDINT_TR1)
2284 namespace std
2286 @@ -74,8 +74,10 @@
2287 using ::uint_fast64_t;
2289 using ::uint_least8_t;
2290 +#if !defined (__UINT_LEAST16_TYPE__) || !defined(__UINT_LEAST32_TYPE__)
2291 using ::uint_least16_t;
2292 using ::uint_least32_t;
2293 +#endif
2294 using ::uint_least64_t;
2296 using ::uintmax_t;
2297 diff -ruN gcc-6.5.0/libstdc++-v3/include/std/ratio gcc-6.5.0.aros/libstdc++-v3/include/std/ratio
2298 --- gcc-6.5.0/libstdc++-v3/include/std/ratio 2016-01-04 14:30:50.000000000 +0000
2299 +++ gcc-6.5.0.aros/libstdc++-v3/include/std/ratio 2019-02-13 12:20:35.215061500 +0000
2300 @@ -211,10 +211,10 @@
2302 private:
2303 static_assert(__d != 0, "Internal library error");
2304 - static_assert(sizeof (uintmax_t) == sizeof (unsigned long long),
2305 - "This library calls __builtin_clzll on uintmax_t, which "
2306 - "is unsafe on your platform. Please complain to "
2307 - "http://gcc.gnu.org/bugzilla/");
2308 +// static_assert(sizeof (uintmax_t) == sizeof (unsigned long long),
2309 +// "This library calls __builtin_clzll on uintmax_t, which "
2310 +// "is unsafe on your platform. Please complain to "
2311 +// "http://gcc.gnu.org/bugzilla/");
2312 static constexpr int __shift = __builtin_clzll(__d);
2313 static constexpr int __coshift_ = sizeof(uintmax_t) * 8 - __shift;
2314 static constexpr int __coshift = (__shift != 0) ? __coshift_ : 0;