cannelloni: needs dynamic library
[buildroot-gz.git] / package / gcc / 4.8.5 / 874-xtensa-add-uclinux-support.patch
blob23db3d863c77297b4aace83e5746d8d9b976ee80
1 From 70c2cb98fb129b4766b5da0f945dc41fd568c77a Mon Sep 17 00:00:00 2001
2 From: Max Filippov <jcmvbkbc@gmail.com>
3 Date: Sat, 22 Aug 2015 08:44:26 +0300
4 Subject: [PATCH] xtensa: add uclinux support
6 2015-10-03 Max Filippov <jcmvbkbc@gmail.com>
7 gcc/
8 * config.gcc (xtensa*-*-uclinux*): New configuration.
9 * config/xtensa/uclinux.h: New file.
10 * config/xtensa/uclinux.opt: New file.
12 libgcc/
13 * config.host (xtensa*-*-uclinux*): New configuration.
15 Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
16 ---
17 Backported from: r228450
19 gcc/config.gcc | 5 ++++
20 gcc/config/xtensa/uclinux.h | 69 +++++++++++++++++++++++++++++++++++++++++++
21 gcc/config/xtensa/uclinux.opt | 32 ++++++++++++++++++++
22 libgcc/config.host | 5 ++++
23 4 files changed, 111 insertions(+)
24 create mode 100644 gcc/config/xtensa/uclinux.h
25 create mode 100644 gcc/config/xtensa/uclinux.opt
27 diff --git a/gcc/config.gcc b/gcc/config.gcc
28 index c52f5a8..56797bd 100644
29 --- a/gcc/config.gcc
30 +++ b/gcc/config.gcc
31 @@ -2995,6 +2995,11 @@ xtensa*-*-linux*)
32 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/linux.h"
33 tmake_file="${tmake_file} xtensa/t-xtensa"
35 +xtensa*-*-uclinux*)
36 + tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/uclinux.h"
37 + tmake_file="${tmake_file} xtensa/t-xtensa"
38 + extra_options="${extra_options} xtensa/uclinux.opt"
39 + ;;
40 am33_2.0-*-linux*)
41 tm_file="mn10300/mn10300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h"
42 gas=yes gnu_ld=yes
43 diff --git a/gcc/config/xtensa/uclinux.h b/gcc/config/xtensa/uclinux.h
44 new file mode 100644
45 index 0000000..4606020
46 --- /dev/null
47 +++ b/gcc/config/xtensa/uclinux.h
48 @@ -0,0 +1,69 @@
49 +/* Xtensa uClinux configuration.
50 + Derived from the configuration for GCC for Intel i386 running Linux.
51 + Copyright (C) 2001-2015 Free Software Foundation, Inc.
53 +This file is part of GCC.
55 +GCC is free software; you can redistribute it and/or modify it under
56 +the terms of the GNU General Public License as published by the Free
57 +Software Foundation; either version 3, or (at your option) any later
58 +version.
60 +GCC is distributed in the hope that it will be useful, but WITHOUT ANY
61 +WARRANTY; without even the implied warranty of MERCHANTABILITY or
62 +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
63 +for more details.
65 +You should have received a copy of the GNU General Public License
66 +along with GCC; see the file COPYING3. If not see
67 +<http://www.gnu.org/licenses/>. */
69 +#undef TARGET_OS_CPP_BUILTINS
70 +#define TARGET_OS_CPP_BUILTINS() \
71 + do \
72 + { \
73 + GNU_USER_TARGET_OS_CPP_BUILTINS (); \
74 + builtin_define ("__uClinux__"); \
75 + } \
76 + while (0)
78 +#undef SUBTARGET_CPP_SPEC
79 +#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
81 +#undef SIZE_TYPE
82 +#define SIZE_TYPE "unsigned int"
84 +#undef PTRDIFF_TYPE
85 +#define PTRDIFF_TYPE "int"
87 +#undef WCHAR_TYPE
88 +#define WCHAR_TYPE "long int"
90 +#undef WCHAR_TYPE_SIZE
91 +#define WCHAR_TYPE_SIZE 32
93 +#undef ASM_SPEC
94 +#define ASM_SPEC \
95 + "%{mtext-section-literals:--text-section-literals} \
96 + %{mno-text-section-literals:--no-text-section-literals} \
97 + %{mtarget-align:--target-align} \
98 + %{mno-target-align:--no-target-align} \
99 + %{mlongcalls:--longcalls} \
100 + %{mno-longcalls:--no-longcalls} \
101 + %{mauto-litpools:--auto-litpools} \
102 + %{mno-auto-litpools:--no-auto-litpools}"
104 +#undef LINK_SPEC
105 +#define LINK_SPEC "%{!no-elf2flt:%{!elf2flt*:-elf2flt}}"
107 +#undef LOCAL_LABEL_PREFIX
108 +#define LOCAL_LABEL_PREFIX "."
110 +/* Always enable "-fpic" for Xtensa Linux. */
111 +#define XTENSA_ALWAYS_PIC 1
113 +#undef TARGET_LIBC_HAS_FUNCTION
114 +#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
116 +#undef DBX_REGISTER_NUMBER
118 diff --git a/gcc/config/xtensa/uclinux.opt b/gcc/config/xtensa/uclinux.opt
119 new file mode 100644
120 index 0000000..95ef777
121 --- /dev/null
122 +++ b/gcc/config/xtensa/uclinux.opt
123 @@ -0,0 +1,32 @@
124 +; Xtensa uClinux options.
126 +; Copyright (C) 2015 Free Software Foundation, Inc.
128 +; This file is part of GCC.
130 +; GCC is free software; you can redistribute it and/or modify it under
131 +; the terms of the GNU General Public License as published by the Free
132 +; Software Foundation; either version 3, or (at your option) any later
133 +; version.
135 +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
136 +; WARRANTY; without even the implied warranty of MERCHANTABILITY or
137 +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
138 +; for more details.
140 +; You should have received a copy of the GNU General Public License
141 +; along with GCC; see the file COPYING3. If not see
142 +; <http://www.gnu.org/licenses/>.
144 +; See the GCC internals manual (options.texi) for a description of
145 +; this file's format.
147 +; Please try to keep this file in ASCII collating order.
149 +elf2flt
150 +Driver
152 +elf2flt=
153 +Driver JoinedOrMissing
155 +; This comment is to ensure we retain the blank line above.
156 diff --git a/libgcc/config.host b/libgcc/config.host
157 index 2c64756..2ee92c1 100644
158 --- a/libgcc/config.host
159 +++ b/libgcc/config.host
160 @@ -1295,6 +1295,11 @@ xtensa*-*-linux*)
161 tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux t-slibgcc-libgcc"
162 md_unwind_header=xtensa/linux-unwind.h
164 +xtensa*-*-uclinux*)
165 + tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux t-slibgcc-libgcc"
166 + md_unwind_header=xtensa/linux-unwind.h
167 + extra_parts="$extra_parts crtbeginS.o crtbeginT.o crtendS.o"
168 + ;;
169 am33_2.0-*-linux*)
170 # Don't need crtbeginT.o from *-*-linux* default.
171 extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
173 1.8.1.4