1 diff -ruB --unidirectional-new-file ../gcc-4.9.2/config/gthr.m4 ../gcc-4.9.2-akaros/config/gthr.m4
2 --- gcc-4.9.2/config/gthr.m4 2012-10-15 09:10:30.000000000 -0400
3 +++ gcc-4.9.2-akaros/config/gthr.m4 2017-03-03 10:23:03.195008678 -0500
5 AC_DEFUN([GCC_AC_THREAD_HEADER],
8 + akaros) thread_header=config/gthr-akaros.h ;;
9 aix) thread_header=config/rs6000/gthr-aix.h ;;
10 dce) thread_header=config/pa/gthr-dce.h ;;
11 lynx) thread_header=config/gthr-lynx.h ;;
12 diff -ruB --unidirectional-new-file ../gcc-4.9.2/config.sub ../gcc-4.9.2-akaros/config.sub
13 --- gcc-4.9.2/config.sub 2013-10-01 12:50:56.000000000 -0400
14 +++ gcc-4.9.2-akaros/config.sub 2015-12-17 14:58:45.053386336 -0500
16 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
17 | -sym* | -kopensolaris* | -plan9* \
18 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
20 + | -aos* | -aros* | -akaros* \
21 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
22 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
23 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
24 diff -ruB --unidirectional-new-file ../gcc-4.9.2/gcc/config.gcc ../gcc-4.9.2-akaros/gcc/config.gcc
25 --- gcc-4.9.2/gcc/config.gcc 2014-09-17 10:16:02.000000000 -0400
26 +++ gcc-4.9.2-akaros/gcc/config.gcc 2016-08-29 14:36:33.860402669 -0400
28 default_use_cxa_atexit=yes
32 + # brho 2016-05-26 needed for various command line options like -rdynamic
33 + extra_options="$extra_options gnu-user.opt"
35 + # We need this for the shared libgcc_s.so
36 + tmake_file="t-slibgcc"
37 + # Linux has these options (among others that I removed). I think it's saying
38 + # to use the glibc targetcm, which needs glibc-c.o to be built, which needs
39 + # the t-glibc makefrag
40 + c_target_objs="${c_target_objs} glibc-c.o"
41 + cxx_target_objs="${cxx_target_objs} glibc-c.o"
42 + tmake_file="${tmake_file} t-glibc"
43 + target_has_targetcm=yes
44 + # We've had these options for a while, linux also has them (and tgmath=no)
45 + default_use_cxa_atexit=yes
53 @@ -1357,6 +1376,27 @@
54 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h i386/rdos.h i386/rdos64.h"
55 tmake_file="i386/t-i386elf t-svr4"
57 +# hasn't been compiled in a long time (2015-04-17)
58 +i[34567]86-*-akaros*)
59 + # i386 linux, plus akaros/h i386/akaros.h
60 + # consider adding i386/gnu-user-common.h i386/gnu-user.h etc
61 + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h glibc-stdint.h gnu-user.h akaros.h i386/akaros.h"
62 + # linux doesn't use the tmake_file here, but a subset of these is still
63 + # needed (probably the FP stuff)
64 + tmake_file="${tmake_file} t-slibgcc-elf-ver t-linux i386/t-fprules-softfp soft-fp/t-softfp i386/t-linux"
67 + # similar to linux, but minus some gnu bits. gnu-user64 wants an x32 ld
68 + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h i386/x86-64.h akaros.h i386/akaros64.h"
69 + tmake_file="${tmake_file} i386/t-linux64"
70 + # linux does not need these tmake files, but we need at least some of them.
71 + # without these, compilation failed.
72 + tmake_file="${tmake_file} i386/t-fprules-softfp soft-fp/t-softfp i386/t-linux"
75 + tm_file="dbxelf.h elfos.h gnu-user.h akaros.h ${tm_file} riscv/akaros.h riscv/akaros64.h glibc-stdint.h"
76 + tmake_file="${tmake_file} t-slibgcc-elf-ver t-linux"
78 i[34567]86-*-freebsd*)
79 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h"
81 diff -ruB --unidirectional-new-file ../gcc-4.9.2/gcc/configure ../gcc-4.9.2-akaros/gcc/configure
82 --- gcc-4.9.2/gcc/configure 2014-10-10 08:51:28.000000000 -0400
83 +++ gcc-4.9.2-akaros/gcc/configure 2017-03-03 09:52:31.094928720 -0500
84 @@ -11204,7 +11204,7 @@
86 target_thread_file='single'
88 - aix | dce | lynx | mipssde | posix | rtems | \
89 + akaros | aix | dce | lynx | mipssde | posix | rtems | \
90 single | tpf | vxworks | win32)
91 target_thread_file=${enable_threads}
93 diff -ruB --unidirectional-new-file ../gcc-4.9.2/libgcc/config.host ../gcc-4.9.2-akaros/libgcc/config.host
94 --- gcc-4.9.2/libgcc/config.host 2014-03-27 11:40:31.000000000 -0400
95 +++ gcc-4.9.2-akaros/libgcc/config.host 2015-12-17 14:58:45.053386336 -0500
100 -*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
101 +*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-akaros*)
102 tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux"
103 extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
104 if test x$enable_vtable_verify = xyes; then
105 @@ -562,12 +562,14 @@
112 extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
113 tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
114 md_unwind_header=i386/linux-unwind.h
116 -i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)
117 +i[34567]86-*-akaros* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)
118 extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
119 tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
122 tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
123 md_unwind_header=i386/linux-unwind.h
125 -x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
126 +x86_64-*-akaros* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
127 extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
128 tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
130 @@ -1259,6 +1261,7 @@
131 i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu | \
132 i[34567]86-*-linux* | x86_64-*-linux* | \
133 i[34567]86-*-gnu* | \
134 + i[34567]86-*-akaros* | x86_64-*-akaros* | \
135 i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]* | \
136 i[34567]86-*-cygwin* | x86_64-*-cygwin* | \
137 i[34567]86-*-mingw* | x86_64-*-mingw* | \
138 diff -ruB --unidirectional-new-file ../gcc-4.9.2/libgcc/configure ../gcc-4.9.2-akaros/libgcc/configure
139 --- gcc-4.9.2/libgcc/configure 2014-02-07 02:46:34.000000000 -0500
140 +++ gcc-4.9.2-akaros/libgcc/configure 2017-03-03 10:24:15.231328458 -0500
141 @@ -4561,6 +4561,7 @@
142 # Map from thread model to thread header.
144 case $target_thread_file in
145 + akaros) thread_header=config/gthr-akaros.h ;;
146 aix) thread_header=config/rs6000/gthr-aix.h ;;
147 dce) thread_header=config/pa/gthr-dce.h ;;
148 lynx) thread_header=config/gthr-lynx.h ;;
149 diff -ruB --unidirectional-new-file ../gcc-4.9.2/libgcc/crtstuff.c ../gcc-4.9.2-akaros/libgcc/crtstuff.c
150 --- gcc-4.9.2/libgcc/crtstuff.c 2014-03-10 14:31:20.000000000 -0400
151 +++ gcc-4.9.2-akaros/libgcc/crtstuff.c 2016-10-05 17:05:34.811880982 -0400
154 This file must be compiled with gcc. */
156 +/* AKAROS: changed so we set # define USE_PT_GNU_EH_FRAME */
158 /* Target machine header files require this define. */
161 @@ -112,12 +114,14 @@
165 +/* AKAROS: added __gnu_akaros__ */
166 #if defined(OBJECT_FORMAT_ELF) \
167 && !defined(OBJECT_FORMAT_FLAT) \
168 && defined(HAVE_LD_EH_FRAME_HDR) \
169 && !defined(CRTSTUFFT_O) \
170 && defined(inhibit_libc) \
171 - && (defined(__GLIBC__) || defined(__gnu_linux__) || defined(__GNU__))
172 + && (defined(__GLIBC__) || defined(__gnu_linux__) || \
173 + defined(__gnu_akaros__) || defined(__GNU__))
174 /* On systems using glibc, an inhibit_libc build of libgcc is only
175 part of a bootstrap process. Build the same crt*.o as would be
176 built with headers present, so that it is not necessary to build
177 diff -ruB --unidirectional-new-file ../gcc-4.9.2/libgomp/configure.tgt ../gcc-4.9.2-akaros/libgomp/configure.tgt
178 --- gcc-4.9.2/libgomp/configure.tgt 2013-06-06 06:04:49.000000000 -0400
179 +++ gcc-4.9.2-akaros/libgomp/configure.tgt 2015-12-17 14:58:45.053386336 -0500
185 + config_path="akaros posix"
189 config_path="mingw32 posix"
191 diff -ruB --unidirectional-new-file ../gcc-4.9.2/libstdc++-v3/configure ../gcc-4.9.2-akaros/libstdc++-v3/configure
192 --- gcc-4.9.2/libstdc++-v3/configure 2014-03-20 14:57:07.000000000 -0400
193 +++ gcc-4.9.2-akaros/libstdc++-v3/configure 2017-03-03 10:25:14.351591016 -0500
194 @@ -6332,7 +6332,7 @@
197 # This must be Linux ELF.
198 -linux* | k*bsd*-gnu | kopensolaris*-gnu)
199 +linux* | k*bsd*-gnu | kopensolaris*-gnu | akaros*)
200 lt_cv_deplibs_check_method=pass_all
203 @@ -7118,7 +7118,7 @@
207 -x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
208 +x86_64-*akaros*|x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
209 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
210 # Find out which ABI we are using.
211 echo 'int i;' > conftest.$ac_ext
212 @@ -7133,7 +7133,7 @@
213 x86_64-*kfreebsd*-gnu)
214 LD="${LD-ld} -m elf_i386_fbsd"
217 + x86_64-*linux*|x86_64-*akaros*)
218 case `/usr/bin/file conftest.o` in
220 LD="${LD-ld} -m elf32_x86_64"
221 @@ -7162,7 +7162,7 @@
222 x86_64-*kfreebsd*-gnu)
223 LD="${LD-ld} -m elf_x86_64_fbsd"
226 + x86_64-*linux*|x86_64-*akaros*)
227 LD="${LD-ld} -m elf_x86_64"
230 @@ -8684,7 +8684,7 @@
231 lt_prog_compiler_static='-non_shared'
234 - linux* | k*bsd*-gnu | kopensolaris*-gnu)
235 + linux* | k*bsd*-gnu | kopensolaris*-gnu | akaros*)
237 # old Intel for x86_64 which still supported -KPIC.
239 @@ -9279,7 +9279,7 @@
240 archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
243 - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
244 + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | akaros*)
246 if test "$host_os" = linux-dietlibc; then
248 @@ -10819,7 +10819,7 @@
251 # This must be Linux ELF.
252 -linux* | k*bsd*-gnu | kopensolaris*-gnu)
253 +linux* | k*bsd*-gnu | kopensolaris*-gnu | akaros*)
257 @@ -12744,7 +12744,7 @@
258 inherit_rpath_CXX=yes
261 - linux* | k*bsd*-gnu | kopensolaris*-gnu)
262 + linux* | k*bsd*-gnu | kopensolaris*-gnu | akaros*)
265 # Kuck and Associates, Inc. (KAI) C++ Compiler
266 @@ -13331,7 +13331,7 @@
272 case `$CC -V 2>&1 | sed 5q` in
275 @@ -13582,7 +13582,7 @@
279 - linux* | k*bsd*-gnu | kopensolaris*-gnu)
280 + linux* | k*bsd*-gnu | kopensolaris*-gnu | akaros*)
284 @@ -14503,7 +14503,7 @@
287 # This must be Linux ELF.
288 -linux* | k*bsd*-gnu | kopensolaris*-gnu)
289 +linux* | k*bsd*-gnu | kopensolaris*-gnu | akaros*)
293 @@ -15183,6 +15183,7 @@
294 $as_echo "$target_thread_file" >&6; }
296 case $target_thread_file in
297 + akaros) thread_header=config/gthr-akaros.h ;;
298 aix) thread_header=config/rs6000/gthr-aix.h ;;
299 dce) thread_header=config/pa/gthr-dce.h ;;
300 lynx) thread_header=config/gthr-lynx.h ;;
301 @@ -15214,7 +15215,7 @@
302 if test x$gcc_no_link != xyes; then
303 # Can do link tests. Limit to some tested platforms
305 - *-*-linux* | *-*-uclinux* | *-*-kfreebsd*-gnu | *-*-gnu*)
306 + *-*-linux* | *-*-uclinux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-akaros*)
307 atomic_builtins_link_tests=yes
310 @@ -15843,7 +15844,7 @@
311 # Default to "generic".
312 if test $enable_clocale_flag = auto; then
314 - linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
315 + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | akaros*)
316 enable_clocale_flag=gnu
319 @@ -16239,7 +16240,7 @@
321 if test $enable_libstdcxx_allocator_flag = auto; then
323 - linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
324 + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | akaros*)
325 enable_libstdcxx_allocator_flag=new
328 @@ -19461,7 +19462,7 @@
330 ac_has_sched_yield=yes
332 - gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
333 + gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | akaros*)
334 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for at least GNU libc 2.17" >&5
335 $as_echo_n "checking for at least GNU libc 2.17... " >&6; }
336 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
337 @@ -19961,7 +19962,7 @@
339 if test x"$ac_has_clock_monotonic" != x"yes"; then
343 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime syscall" >&5
344 $as_echo_n "checking for clock_gettime syscall... " >&6; }
345 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
346 @@ -26836,7 +26837,7 @@
347 if ac_fn_c_try_link "$LINENO"; then :
348 chktls_save_LDFLAGS="$LDFLAGS"
351 + *-*-linux* | *-*-akaros*)
352 LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
355 @@ -27399,7 +27400,7 @@
356 if test "X$additional_includedir" = "X/usr/local/include"; then
357 if test -n "$GCC"; then
359 - linux*) haveit=yes;;
360 + linux* | akaros*) haveit=yes;;
364 @@ -27443,7 +27444,7 @@
365 if test "X$additional_libdir" = "X/usr/local/lib"; then
366 if test -n "$GCC"; then
368 - linux*) haveit=yes;;
369 + linux* | akaros*) haveit=yes;;
373 @@ -52273,7 +52274,7 @@
374 if ac_fn_c_try_link "$LINENO"; then :
375 chktls_save_LDFLAGS="$LDFLAGS"
378 + *-*-linux* | *-*-akaros*)
379 LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
382 @@ -52464,7 +52465,7 @@
386 - *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu | *-cygwin*)
387 + *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu | *-cygwin* | *-akaros*)
389 # All these tests are for C++; save the language and the compiler flags.
390 # The CXXFLAGS thing is suspicious, but based on similar bits previously
391 @@ -58474,7 +58475,7 @@
392 if ac_fn_c_try_link "$LINENO"; then :
393 chktls_save_LDFLAGS="$LDFLAGS"
396 + *-*-linux* | *-*-akaros*)
397 LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
400 @@ -77175,7 +77176,7 @@
405 + *-linux* | *-akaros*)
406 case "$enable_linux_futex" in
408 # If headers don't have gettid/futex syscalls definition, then
409 diff -ruB --unidirectional-new-file ../gcc-4.9.2/libstdc++-v3/configure.host ../gcc-4.9.2-akaros/libstdc++-v3/configure.host
410 --- gcc-4.9.2/libstdc++-v3/configure.host 2013-07-04 17:07:44.000000000 -0400
411 +++ gcc-4.9.2-akaros/libstdc++-v3/configure.host 2015-12-17 14:58:45.061386380 -0500
413 os_include_dir="os/qnx/qnx6.1"
417 + os_include_dir="os/akaros"
420 # This too-vague configuration does not provide enough information
421 # to select a ctype include, and thus os_include_dir is a crap shoot.
422 diff -ruB --unidirectional-new-file ../gcc-4.9.2/libstdc++-v3/crossconfig.m4 ../gcc-4.9.2-akaros/libstdc++-v3/crossconfig.m4
423 --- gcc-4.9.2/libstdc++-v3/crossconfig.m4 2014-03-20 14:57:07.000000000 -0400
424 +++ gcc-4.9.2-akaros/libstdc++-v3/crossconfig.m4 2015-12-17 14:58:45.061386380 -0500
426 AC_DEFINE(HAVE_SINHF)
427 AC_DEFINE(HAVE_SINHL)
430 + GLIBCXX_CHECK_MATH_SUPPORT
431 + GLIBCXX_CHECK_STDLIB_SUPPORT
434 GLIBCXX_CHECK_COMPILER_FEATURES
435 GLIBCXX_CHECK_LINKER_FEATURES