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