summaryrefslogtreecommitdiff
path: root/external/gpl3/gcc/patches/0001-minix.patch
blob: e38c56807c60c7ad5c4fc1db25487aa7aa351a81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
diff -rNU3 dist.nbsd/gcc/config.gcc dist/gcc/config.gcc
--- dist.nbsd/gcc/config.gcc	2015-10-16 12:40:18.000000000 +0200
+++ dist/gcc/config.gcc	2015-10-16 13:35:51.000000000 +0200
@@ -704,6 +704,12 @@
   tmake_file="${tmake_file} t-glibc"
   target_has_targetcm=yes
   ;;
+*-*-minix*)
+  tmake_file="t-slibgcc"
+  gas=yes
+  gnu_ld=yes
+  default_use_cxa_atexit=yes
+  ;;
 *-*-netbsd*)
   tmake_file="t-slibgcc"
   gas=yes
@@ -887,6 +893,34 @@
 	extra_options="${extra_options} arm/vxworks.opt"
 	tmake_file="${tmake_file} arm/t-arm arm/t-vxworks"
 	;;
+arm*-*-minix*)
+	tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf"
+	tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h"
+	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+
+	    tm_file="$tm_file arm/bpabi.h"
+	    tmake_file="$tmake_file arm/t-bpabi t-minix"
+
+	    # The BPABI long long divmod functions return a 128-bit value in
+	    # registers r0-r3.  Correctly modeling that requires the use of
+	    # TImode.
+	    need_64bit_hwint=yes
+	    # The EABI requires the use of __cxa_atexit.
+	    default_use_cxa_atexit=yes
+	
+	case ${target} in
+	arm*-*-minix-*hf*)
+	    tm_defines="${tm_defines} TARGET_DEFAULT_FLOAT_ABI=ARM_FLOAT_ABI_HARD"
+	    ;;
+	esac
+	case ${target} in
+	armv4*) with_cpu=${with_cpu:-strongarm};;
+	armv6*) with_cpu=${with_cpu:-arm1176jzf-s};;
+	armv7*) with_cpu=${with_cpu:-cortex-a8};;
+	esac
+	tm_file="$tm_file arm/eabi.h newlib-stdint.h minix-spec.h arm/minix.h minix.h"
+	tmake_file="$tmake_file arm/t-arm-softfp soft-fp/t-softfp"
+	;;
 arm*-*-netbsdelf*)
 	tmake_file="${tmake_file} arm/t-arm"
 	tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h arm/aout.h arm/arm.h"
@@ -1287,6 +1321,11 @@
 x86_64-*-freebsd*)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
 	;;
+i[34567]86-*-minix)
+	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h minix-spec.h i386/minix.h minix.h"
+	tmake_file="${tmake_file} i386/t-crtstuff"
+	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+	;;
 i[34567]86-*-netbsdelf*)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${nbsd_tm_file} i386/netbsd-elf.h"
 	tmake_file="${tmake_file} i386/t-crtstuff"
diff -rNU3 dist.nbsd/gcc/gcov.c dist/gcc/gcov.c
--- dist.nbsd/gcc/gcov.c	2015-10-16 12:40:18.000000000 +0200
+++ dist/gcc/gcov.c	2015-10-16 13:36:18.000000000 +0200
@@ -62,6 +62,10 @@
 
 /* This is the size of the buffer used to read in source file lines.  */
 
+#if defined(__minix)
+#define block_t gcc_block_t
+#endif
+
 struct function_info;
 struct block_info;
 struct source_info;
diff -rNU3 dist.nbsd/gcc/ginclude/stddef.h dist/gcc/ginclude/stddef.h
--- dist.nbsd/gcc/ginclude/stddef.h	2015-10-16 12:40:18.000000000 +0200
+++ dist/gcc/ginclude/stddef.h	2015-10-16 13:35:25.000000000 +0200
@@ -48,7 +48,7 @@
 
 /* On 4.3bsd-net2, make sure ansi.h is included, so we have
    one less case to deal with in the following.  */
-#if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__)
+#if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__) || defined(__minix)
 #ifndef inhibit_libc
 #include <machine/ansi.h>
 #endif
diff -rNU3 dist.nbsd/libgcc/config.host dist/libgcc/config.host
--- dist.nbsd/libgcc/config.host	2015-10-16 12:40:19.000000000 +0200
+++ dist/libgcc/config.host	2015-10-16 13:36:44.000000000 +0200
@@ -325,6 +325,10 @@
 	tmake_file="$tmake_file arm/t-arm arm/t-vxworks t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
 	extra_parts="$extra_parts crti.o crtn.o"
 	;;
+arm*-*-minix*)
+	tmake_file="$tmake_file arm/t-arm"
+	unwind_header=config/arm/unwind-arm.h
+	;;
 arm*-*-netbsdelf*)
 	tmake_file="$tmake_file arm/t-arm"
 	case ${host} in
@@ -525,6 +529,8 @@
 x86_64-*-freebsd*)
 	tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff"
 	;;
+i[34567]86-*-minix*)
+	;;
 i[34567]86-*-netbsdelf*)
 	;;
 x86_64-*-netbsd*)