Merge lp:~michaelh1/crosstool-ng/aarch64-linaro-tip into lp:~linaro-toolchain-dev/crosstool-ng/linaro

Proposed by Michael Hope
Status: Merged
Merged at revision: 2505
Proposed branch: lp:~michaelh1/crosstool-ng/aarch64-linaro-tip
Merge into: lp:~linaro-toolchain-dev/crosstool-ng/linaro
Diff against target: 1311 lines (+1139/-13)
13 files modified
config/binutils/binutils.in (+2/-2)
config/cc/gcc.in (+8/-0)
contrib/linaro/patches/gcc/linaro-4.7+bzr115029/gcc-multiarch-doc.patch (+66/-0)
contrib/linaro/patches/gcc/linaro-4.7+bzr115029/gcc-multiarch.patch (+663/-0)
contrib/linaro/patches/gcc/linaro-4.7+bzr115029/gcc-nls.patch (+75/-0)
contrib/linaro/patches/gcc/linaro-4.7+bzr115029/link-with-cxx.patch (+15/-0)
contrib/linaro/patches/gcc/linaro-4.7+bzr115029/multilib-defaults.patch (+12/-0)
contrib/linaro/patches/gcc/linaro-4.7+bzr115029/multilib.patch (+46/-0)
contrib/linaro/patches/gcc/linaro-4.7+bzr115029/multilibwithmultiarch.patch (+133/-0)
contrib/linaro/patches/gcc/linaro-4.7+bzr115029/triplet.patch (+91/-0)
contrib/linaro/update-aarch64.sh (+18/-3)
samples/linaro-aarch64-linux-gnu/crosstool.config (+5/-4)
samples/linaro-aarch64-none-elf/crosstool.config (+5/-4)
To merge this branch: bzr merge lp:~michaelh1/crosstool-ng/aarch64-linaro-tip
Reviewer Review Type Date Requested Status
Linaro Toolchain Builder Pending
Review via email: mp+130284@code.launchpad.net

This proposal supersedes a proposal from 2012-10-18.

Description of the change

config/gcc: add a Linaro GCC tip option for aarch64.

To post a comment you must log in.
Revision history for this message
Michael Hope (michaelh1) wrote : Posted in a previous version of this proposal

cbuild has taken a snapshot of this branch at r2505 and queued it for build.

The diff against the ancestor r2504 is available at:
 http://builds.linaro.org/toolchain/snapshots/crosstool-ng-linaro-1.13.1+bzr2505~michaelh1~aarch64-linaro-tip.diff

and will be built on the following builders:
 i686-lucid

You can track the build queue at:
 http://ex.seabright.co.nz/helpers/scheduler

cbuild-snapshot: crosstool-ng-linaro-1.13.1+bzr2505~michaelh1~aarch64-linaro-tip
cbuild-ancestor: lp:~linaro-toolchain-dev/crosstool-ng/linaro+bzr2504
cbuild-state: check

Revision history for this message
Michael Hope (michaelh1) wrote : Posted in a previous version of this proposal

cbuild has taken a snapshot of this branch at r2506 and queued it for build.

The diff against the ancestor r2504 is available at:
 http://builds.linaro.org/toolchain/snapshots/crosstool-ng-linaro-1.13.1+bzr2506~michaelh1~aarch64-linaro-tip.diff

and will be built on the following builders:
 i686-lucid

You can track the build queue at:
 http://ex.seabright.co.nz/helpers/scheduler

cbuild-snapshot: crosstool-ng-linaro-1.13.1+bzr2506~michaelh1~aarch64-linaro-tip
cbuild-ancestor: lp:~linaro-toolchain-dev/crosstool-ng/linaro+bzr2504
cbuild-state: check

Revision history for this message
Michael Hope (michaelh1) wrote :

cbuild has taken a snapshot of this branch at r2507 and queued it for build.

The diff against the ancestor r2504 is available at:
 http://builds.linaro.org/toolchain/snapshots/crosstool-ng-linaro-1.13.1+bzr2507~michaelh1~aarch64-linaro-tip.diff

and will be built on the following builders:
 i686-lucid

You can track the build queue at:
 http://ex.seabright.co.nz/helpers/scheduler

cbuild-snapshot: crosstool-ng-linaro-1.13.1+bzr2507~michaelh1~aarch64-linaro-tip
cbuild-ancestor: lp:~linaro-toolchain-dev/crosstool-ng/linaro+bzr2504
cbuild-state: check

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'config/binutils/binutils.in'
--- config/binutils/binutils.in 2012-10-03 21:28:32 +0000
+++ config/binutils/binutils.in 2012-10-18 05:18:20 +0000
@@ -10,7 +10,7 @@
1010
11config BINUTILS_V_2_24_PRE11config BINUTILS_V_2_24_PRE
12 bool12 bool
13 prompt "2.24~20120920+gitb05c76f (EXPERIMENTAL)"13 prompt "2.24~20121016+git142208f (EXPERIMENTAL)"
14 depends on EXPERIMENTAL && ARCH_aarch6414 depends on EXPERIMENTAL && ARCH_aarch64
15 select BINUTILS_2_22_or_later15 select BINUTILS_2_22_or_later
1616
@@ -62,7 +62,7 @@
62 string62 string
63# Don't remove next line63# Don't remove next line
64# CT_INSERT_VERSION_STRING_BELOW64# CT_INSERT_VERSION_STRING_BELOW
65 default "2.24~20120920+gitb05c76f" if BINUTILS_V_2_24_PRE65 default "2.24~20121016+git142208f" if BINUTILS_V_2_24_PRE
66 default "2.22" if BINUTILS_V_2_2266 default "2.22" if BINUTILS_V_2_22
67 default "2.21.53" if BINUTILS_V_2_21_5367 default "2.21.53" if BINUTILS_V_2_21_53
68 default "2.21.1a" if BINUTILS_V_2_21_1a68 default "2.21.1a" if BINUTILS_V_2_21_1a
6969
=== modified file 'config/cc/gcc.in'
--- config/cc/gcc.in 2012-10-12 01:58:28 +0000
+++ config/cc/gcc.in 2012-10-18 05:18:20 +0000
@@ -42,6 +42,13 @@
42 depends on CC_GCC_SHOW_LINARO42 depends on CC_GCC_SHOW_LINARO
43 select CC_GCC_4_743 select CC_GCC_4_7
4444
45config CC_V_linaro_4_7_TIP
46 bool
47 prompt "linaro-4.7+bzr115029 (EXPERIMENTAL)"
48 depends on EXPERIMENTAL && ARCH_aarch64
49 depends on CC_GCC_SHOW_LINARO
50 select CC_GCC_4_7
51
45config CC_V_arm_aarch64_4_7_PRE52config CC_V_arm_aarch64_4_7_PRE
46 bool53 bool
47 prompt "arm-aarch64-4.7+svn191987 (EXPERIMENTAL)"54 prompt "arm-aarch64-4.7+svn191987 (EXPERIMENTAL)"
@@ -353,6 +360,7 @@
353# CT_INSERT_VERSION_STRING_BELOW360# CT_INSERT_VERSION_STRING_BELOW
354 default "arm-aarch64-4.7+svn191987" if CC_V_arm_aarch64_4_7_PRE361 default "arm-aarch64-4.7+svn191987" if CC_V_arm_aarch64_4_7_PRE
355 default "linaro-4.7-2012.10" if CC_V_linaro_4_7_2012_10362 default "linaro-4.7-2012.10" if CC_V_linaro_4_7_2012_10
363 default "linaro-4.7+bzr115029" if CC_V_linaro_4_7_TIP
356 default "4.7.0" if CC_V_4_7_0364 default "4.7.0" if CC_V_4_7_0
357 default "4.6.2" if CC_V_4_6_2365 default "4.6.2" if CC_V_4_6_2
358 default "4.6.1" if CC_V_4_6_1366 default "4.6.1" if CC_V_4_6_1
359367
=== added directory 'contrib/linaro/patches/gcc/linaro-4.7+bzr115029'
=== added file 'contrib/linaro/patches/gcc/linaro-4.7+bzr115029/gcc-multiarch-doc.patch'
--- contrib/linaro/patches/gcc/linaro-4.7+bzr115029/gcc-multiarch-doc.patch 1970-01-01 00:00:00 +0000
+++ contrib/linaro/patches/gcc/linaro-4.7+bzr115029/gcc-multiarch-doc.patch 2012-10-18 05:18:20 +0000
@@ -0,0 +1,66 @@
1# DP: Document -print-multiarch option
2
3--- a/gcc/doc/fragments.texi
4+++ b/gcc/doc/fragments.texi
5@@ -129,6 +129,33 @@
6 of options to be used for all builds. If you set this, you should
7 probably set @code{CRTSTUFF_T_CFLAGS} to a dash followed by it.
8
9+@findex MULTILIB_OSDIRNAMES
10+@item MULTILIB_OSDIRNAMES
11+If @code{MULTILIB_OPTIONS} is used, this variable specifies the list
12+of OS subdirectory names. The format is either the same as of
13+@code{MULTILIB_DIRNAMES}, or a set of mappings. When it is the same
14+as @code{MULTILIB_DIRNAMES}, it describes the multilib directories
15+using OS conventions, rather than GCC conventions. When it is a set
16+of mappings of the form @var{gccdir}=@var{osdir}, the left side gives
17+the GCC convention and the right gives the equivalent OS defined
18+location. If the @var{osdir} part begins with a @samp{!}, the os
19+directory names are used exclusively. Use the mapping when there is
20+no one-to-one equivalence between GCC levels and the OS.
21+
22+For multilib enabled configurations (see @code{MULTIARCH_DIRNAME})
23+below), the multilib name is appended to each directory name, separated
24+by a colon (e.g. @samp{../lib:x86_64-linux-gnu}).
25+
26+@findex MULTIARCH_DIRNAME
27+@item MULTIARCH_DIRNAME
28+If @code{MULTIARCH_DIRNAME} is used, this variable specifies the
29+multiarch name for this configuration. For multiarch enabled
30+configurations it is used to search libraries and crt files in
31+@file{/lib/@var{multiarch}} and @file{/usr/lib/@var{multiarch}}, and
32+system header files in @file{/usr/include/@var{multiarch}}.
33+@code{MULTIARCH_DIRNAME} is not used for multilib enabled
34+configurations, but encoded in @code{MULTILIB_OSDIRNAMES} instead.
35+
36 @findex SPECS
37 @item SPECS
38 Unfortunately, setting @code{MULTILIB_EXTRA_OPTS} is not enough, since
39--- a/gcc/doc/invoke.texi
40+++ b/gcc/doc/invoke.texi
41@@ -6011,6 +6011,11 @@
42 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
43 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
44
45+@item -print-multiarch
46+@opindex print-multiarch
47+Print the path to OS libraries for the selected multiarch,
48+relative to some @file{lib} subdirectory.
49+
50 @item -print-prog-name=@var{program}
51 @opindex print-prog-name
52 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
53--- a/gcc/doc/install.texi
54+++ b/gcc/doc/install.texi
55@@ -1036,6 +1036,11 @@
56 conventions, etc.@: should not be built. The default is to build a
57 predefined set of them.
58
59+@item --enable-multiarch
60+Specify wether to enable or disable multiarch support. The default is
61+to detect for glibc start files in a multiarch location, and enable it
62+if the files are found.
63+
64 Some targets provide finer-grained control over which multilibs are built
65 (e.g., @option{--disable-softfloat}):
66 @table @code
067
=== added file 'contrib/linaro/patches/gcc/linaro-4.7+bzr115029/gcc-multiarch.patch'
--- contrib/linaro/patches/gcc/linaro-4.7+bzr115029/gcc-multiarch.patch 1970-01-01 00:00:00 +0000
+++ contrib/linaro/patches/gcc/linaro-4.7+bzr115029/gcc-multiarch.patch 2012-10-18 05:18:20 +0000
@@ -0,0 +1,663 @@
1# DP: Add multiarch support to GCC.
2# DP:
3# DP: Convert the multilib option to a target triplet,
4# DP: add multiarch include directories and libraries path:
5# DP: /usr/local/include/<arch>-linux-gnu
6# DP: /usr/include/<arch>-linux-gnu
7# DP: /usr/lib/<arch>-linux-gnu
8# DP: to the system paths.
9
102011-08-18 Matthias Klose <doko@ubuntu.com>
11
12 * doc/invoke.texi: Document -print-multiarch.
13 * Makefile.in (s-mlib): Pass MULTIARCH_DIRNAME to genmultilib.
14 * genmultilib: Add new option for the multiarch name.
15 * gcc.c (multiarch_dir): Define.
16 (for_each_path): Search for multiarch suffixes.
17 (driver_handle_option): Handle multiarch option.
18 (do_spec_1): Pass -imultiarch if defined.
19 (main): Print multiarch.
20 (set_multilib_dir): Separate multilib and multiarch names
21 from multilib_select.
22 (print_multilib_info): Ignore multiarch names in multilib_select.
23 * incpath.c (add_standard_paths): Search the multiarch include dirs.
24 * cppdeault.h (default_include): Document multiarch in multilib
25 member.
26 * cppdefault.c: [LOCAL_INCLUDE_DIR, STANDARD_INCLUDE_DIR] Add an
27 include directory for multiarch directories.
28 * common.opt: New options --print-multiarch and -imultilib.
29 * config/s390/t-linux64: Add multiarch names in MULTILIB_OSDIRNAMES.
30 * config/sparc/t-linux64: Likewise.
31 * config/powerpc/t-linux64: Likewise.
32 * config/i386/t-linux64: Likewise.
33 * config/mips/t-linux64: Likewise.
34 * config/alpha/t-linux: Define MULTIARCH_DIRNAME.
35 * config/arm/t-linux: Likewise.
36 * config/i386/t-linux: Likewise.
37 * config/pa/t-linux: Likewise.
38 * config/sparc/t-linux: Likewise.
39 * config/ia64/t-glibc: Define MULTIARCH_DIRNAME for linux target.
40
41
42--- a/gcc/incpath.c (revision 182390)
43+++ b/gcc/incpath.c (working copy)
44@@ -150,8 +150,14 @@
45 if (!filename_ncmp (p->fname, cpp_GCC_INCLUDE_DIR, len))
46 {
47 char *str = concat (iprefix, p->fname + len, NULL);
48- if (p->multilib && imultilib)
49+ if (p->multilib == 1 && imultilib)
50 str = concat (str, dir_separator_str, imultilib, NULL);
51+ else if (p->multilib == 2)
52+ {
53+ if (!imultiarch)
54+ continue;
55+ str = concat (str, dir_separator_str, imultiarch, NULL);
56+ }
57 add_path (str, SYSTEM, p->cxx_aware, false);
58 }
59 }
60@@ -195,8 +201,14 @@
61 else
62 str = update_path (p->fname, p->component);
63
64- if (p->multilib && imultilib)
65+ if (p->multilib == 1 && imultilib)
66 str = concat (str, dir_separator_str, imultilib, NULL);
67+ else if (p->multilib == 2)
68+ {
69+ if (!imultiarch)
70+ continue;
71+ str = concat (str, dir_separator_str, imultiarch, NULL);
72+ }
73
74 add_path (str, SYSTEM, p->cxx_aware, false);
75 }
76--- a/gcc/gcc.c (revision 182390)
77+++ b/gcc/gcc.c (working copy)
78@@ -1147,6 +1147,11 @@
79 set_multilib_dir based on the compilation options. */
80
81 static const char *multilib_os_dir;
82+
83+/* Subdirectory to use for locating libraries in multiarch conventions. Set by
84+ set_multilib_dir based on the compilation options. */
85+
86+static const char *multiarch_dir;
87
088
89 /* Structure to keep track of the specs that have been defined so far.
90 These are accessed using %(specname) in a compiler or link
91@@ -2072,6 +2077,7 @@
92 struct prefix_list *pl;
93 const char *multi_dir = NULL;
94 const char *multi_os_dir = NULL;
95+ const char *multiarch_suffix = NULL;
96 const char *multi_suffix;
97 const char *just_multi_suffix;
98 char *path = NULL;
99@@ -2089,11 +2095,14 @@
100 }
101 if (do_multi && multilib_os_dir && strcmp (multilib_os_dir, ".") != 0)
102 multi_os_dir = concat (multilib_os_dir, dir_separator_str, NULL);
103+ if (multiarch_dir)
104+ multiarch_suffix = concat (multiarch_dir, dir_separator_str, NULL);
105
106 while (1)
107 {
108 size_t multi_dir_len = 0;
109 size_t multi_os_dir_len = 0;
110+ size_t multiarch_len = 0;
111 size_t suffix_len;
112 size_t just_suffix_len;
113 size_t len;
114@@ -2102,16 +2111,15 @@
115 multi_dir_len = strlen (multi_dir);
116 if (multi_os_dir)
117 multi_os_dir_len = strlen (multi_os_dir);
118+ if (multiarch_suffix)
119+ multiarch_len = strlen (multiarch_suffix);
120 suffix_len = strlen (multi_suffix);
121 just_suffix_len = strlen (just_multi_suffix);
122
123 if (path == NULL)
124 {
125 len = paths->max_len + extra_space + 1;
126- if (suffix_len > multi_os_dir_len)
127- len += suffix_len;
128- else
129- len += multi_os_dir_len;
130+ len += MAX (MAX (suffix_len, multi_os_dir_len), multiarch_len);
131 path = XNEWVEC (char, len);
132 }
133
134@@ -2140,6 +2148,16 @@
135 break;
136 }
137
138+ /* Now try the multiarch path. */
139+ if (!skip_multi_dir
140+ && !pl->require_machine_suffix && multiarch_dir)
141+ {
142+ memcpy (path + len, multiarch_suffix, multiarch_len + 1);
143+ ret = callback (path, callback_info);
144+ if (ret)
145+ break;
146+ }
147+
148 /* Now try the base path. */
149 if (!pl->require_machine_suffix
150 && !(pl->os_multilib ? skip_multi_os_dir : skip_multi_dir))
151@@ -2970,6 +2970,9 @@
152 fputs (_(" -print-libgcc-file-name Display the name of the compiler's companion library\n"), stdout);
153 fputs (_(" -print-file-name=<lib> Display the full path to library <lib>\n"), stdout);
154 fputs (_(" -print-prog-name=<prog> Display the full path to compiler component <prog>\n"), stdout);
155+ fputs (_("\
156+ -print-multiarch Display the target's normalized GNU triplet, used as\n\
157+ a component in the library path\n"), stdout);
158 fputs (_(" -print-multi-directory Display the root directory for versions of libgcc\n"), stdout);
159 fputs (_("\
160 -print-multi-lib Display the mapping between command line options and\n\
161@@ -3228,6 +3246,7 @@
162 case OPT_print_multi_directory:
163 case OPT_print_sysroot:
164 case OPT_print_multi_os_directory:
165+ case OPT_print_multiarch:
166 case OPT_print_sysroot_headers_suffix:
167 case OPT_time:
168 case OPT_wrapper:
169@@ -4880,6 +4899,15 @@
170 do_spec_1 (" ", 0, NULL);
171 }
172
173+ if (multiarch_dir)
174+ {
175+ do_spec_1 ("-imultiarch", 1, NULL);
176+ /* Make this a separate argument. */
177+ do_spec_1 (" ", 0, NULL);
178+ do_spec_1 (multiarch_dir, 1, NULL);
179+ do_spec_1 (" ", 0, NULL);
180+ }
181+
182 if (gcc_exec_prefix)
183 {
184 do_spec_1 ("-iprefix", 1, NULL);
185@@ -6497,6 +6525,15 @@
186 return (0);
187 }
188
189+ if (print_multiarch)
190+ {
191+ if (multiarch_dir == NULL)
192+ printf ("\n");
193+ else
194+ printf ("%s\n", multiarch_dir);
195+ return (0);
196+ }
197+
198 if (print_sysroot)
199 {
200 if (target_system_root)
201@@ -7472,10 +7509,26 @@
202 q++;
203 if (q < end)
204 {
205- char *new_multilib_os_dir = XNEWVEC (char, end - q);
206+ const char *q2 = q + 1;
207+ char *new_multilib_os_dir;
208+
209+ while (q2 < end && *q2 != ':')
210+ q2++;
211+ if (*q2 == ':')
212+ end = q2;
213+ new_multilib_os_dir = XNEWVEC (char, end - q);
214 memcpy (new_multilib_os_dir, q + 1, end - q - 1);
215 new_multilib_os_dir[end - q - 1] = '\0';
216- multilib_os_dir = new_multilib_os_dir;
217+ multilib_os_dir = *new_multilib_os_dir ? new_multilib_os_dir : ".";
218+
219+ end = this_path + this_path_len;
220+ if (q2 < end && *q2 == ':')
221+ {
222+ char *new_multiarch_dir = XNEWVEC (char, end - q2);
223+ memcpy (new_multiarch_dir, q2 + 1, end - q2 - 1);
224+ new_multiarch_dir[end - q2 - 1] = '\0';
225+ multiarch_dir = new_multiarch_dir;
226+ }
227 break;
228 }
229 }
230@@ -7537,7 +7590,7 @@
231 /* When --disable-multilib was used but target defines
232 MULTILIB_OSDIRNAMES, entries starting with .: are there just
233 to find multilib_os_dir, so skip them from output. */
234- if (this_path[0] == '.' && this_path[1] == ':')
235+ if (this_path[0] == '.' && this_path[1] == ':' && this_path[2] != ':')
236 skip = 1;
237
238 /* Check for matches with the multilib_exclusions. We don't bother
239--- a/gcc/genmultilib (revision 182390)
240+++ b/gcc/genmultilib (working copy)
241@@ -84,6 +84,8 @@
242 # This argument can be used together with MULTILIB_EXCEPTIONS and will take
243 # effect after the MULTILIB_EXCEPTIONS.
244
245+# The optional nine argument is the multiarch name.
246+
247 # The last option should be "yes" if multilibs are enabled. If it is not
248 # "yes", all GCC multilib dir names will be ".".
249
250@@ -133,7 +135,8 @@
251 exclusions=$6
252 osdirnames=$7
253 multilib_required=$8
254-enable_multilib=$9
255+multiarch=$9
256+enable_multilib=${10}
257
258 echo "static const char *const multilib_raw[] = {"
259
260@@ -261,6 +264,9 @@
261 # names.
262 toosdirnames=
263 defaultosdirname=
264+if [ -n "${multiarch}" ]; then
265+ defaultosdirname=::${multiarch}
266+fi
267 if [ -n "${osdirnames}" ]; then
268 set x ${osdirnames}
269 shift
270@@ -268,6 +274,9 @@
271 case "$1" in
272 .=*)
273 defaultosdirname=`echo $1 | sed 's|^.=|:|'`
274+ if [ -n "${multiarch}" ]; then
275+ defaultosdirname=${defaultosdirname}:${multiarch}
276+ fi
277 shift
278 ;;
279 *=*)
280@@ -353,13 +362,13 @@
281 dirout=`echo ${combo} | sed -e 's/=/-/g'`
282 fi
283 # Remove the leading and trailing slashes.
284- dirout=`echo ${dirout} | sed -e 's|^/||' -e 's|/$||g'`
285+ dirout=`echo ${dirout} | sed -e 's|^/||' -e 's|/*:/*|:|' -e 's|/$||g'`
286
287 # Use the OS directory names rather than the option names.
288 if [ -n "${toosdirnames}" ]; then
289 osdirout=`echo ${combo} | sed ${toosdirnames}`
290 # Remove the leading and trailing slashes.
291- osdirout=`echo ${osdirout} | sed -e 's|^/||' -e 's|/$||g'`
292+ osdirout=`echo ${osdirout} | sed -e 's|^/||' -e 's|/*:/*|:|' -e 's|/$||g'`
293 if [ "x${enable_multilib}" != xyes ]; then
294 dirout=".:${osdirout}"
295 disable_multilib=yes
296--- a/gcc/configure.ac (revision 182390)
297+++ b/gcc/configure.ac (working copy)
298@@ -620,6 +620,21 @@
299 [], [enable_multilib=yes])
300 AC_SUBST(enable_multilib)
301
302+# Determine whether or not multiarch is enabled.
303+AC_ARG_ENABLE(multiarch,
304+[AS_HELP_STRING([--enable-multiarch],
305+ [enable support for multiarch paths])],
306+[case "${withval}" in
307+yes|no|auto-detect) enable_multiarch=$withval;;
308+*) AC_MSG_ERROR(bad value ${withval} given for --enable-multiarch option) ;;
309+esac], [enable_multiarch=auto-detect])
310+AC_MSG_CHECKING(for multiarch configuration)
311+AC_SUBST(enable_multiarch)
312+AC_MSG_RESULT($enable_multiarch)
313+
314+# needed for setting the multiarch name on ARM
315+AC_SUBST(with_float)
316+
317 # Enable __cxa_atexit for C++.
318 AC_ARG_ENABLE(__cxa_atexit,
319 [AS_HELP_STRING([--enable-__cxa_atexit], [enable __cxa_atexit for C++])],
320--- a/gcc/cppdefault.c (revision 182390)
321+++ b/gcc/cppdefault.c (working copy)
322@@ -60,6 +60,7 @@
323 #endif
324 #ifdef LOCAL_INCLUDE_DIR
325 /* /usr/local/include comes before the fixincluded header files. */
326+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
327 { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
328 #endif
329 #ifdef PREFIX_INCLUDE_DIR
330@@ -87,6 +88,7 @@
331 #endif
332 #ifdef NATIVE_SYSTEM_HEADER_DIR
333 /* /usr/include comes dead last. */
334+ { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 },
335 { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 },
336 #endif
337 { 0, 0, 0, 0, 0, 0 }
338--- a/gcc/cppdefault.h (revision 182390)
339+++ b/gcc/cppdefault.h (working copy)
340@@ -43,9 +43,11 @@
341 C++. */
342 const char add_sysroot; /* FNAME should be prefixed by
343 cpp_SYSROOT. */
344- const char multilib; /* FNAME should have the multilib path
345- specified with -imultilib
346- appended. */
347+ const char multilib; /* FNAME should have appended
348+ - the multilib path specified with -imultilib
349+ when 1 is passed,
350+ - the multiarch path specified with
351+ -imultiarch, when 2 is passed. */
352 };
353
354 extern const struct default_include cpp_include_defaults[];
355--- a/gcc/common.opt (revision 182390)
356+++ b/gcc/common.opt (working copy)
357@@ -345,6 +345,9 @@
358 -print-multi-os-directory
359 Driver Alias(print-multi-os-directory)
360
361+-print-multiarch
362+Driver Alias(print-multiarch)
363+
364 -print-prog-name
365 Driver Separate Alias(print-prog-name=)
366
367@@ -2268,6 +2271,10 @@
368 Common Joined Var(plugindir_string) Init(0)
369 -iplugindir=<dir> Set <dir> to be the default plugin directory
370
371+imultiarch
372+Common Joined Separate RejectDriver Var(imultiarch) Init(0)
373+-imultiarch <dir> Set <dir> to be the multiarch include subdirectory
374+
375 l
376 Driver Joined Separate
377
378@@ -2325,6 +2332,9 @@
379
380 print-multi-os-directory
381 Driver Var(print_multi_os_directory)
382+
383+print-multiarch
384+Driver Var(print_multiarch)
385
386 print-prog-name=
387 Driver JoinedOrMissing Var(print_prog_name)
388--- a/gcc/config.gcc (revision 182390)
389+++ b/gcc/config.gcc (working copy)
390@@ -1508,7 +1508,7 @@
391 ;;
392 ia64*-*-linux*)
393 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ia64/sysv4.h ia64/linux.h"
394- tmake_file="${tmake_file} ia64/t-ia64 t-libunwind"
395+ tmake_file="${tmake_file} ia64/t-ia64 ia64/t-glibc t-libunwind"
396 target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
397 ;;
398 ia64*-*-hpux*)
399@@ -2012,6 +2012,7 @@
400 ;;
401 *)
402 tm_file="${tm_file} rs6000/linux.h glibc-stdint.h"
403+ tmake_file="$tmake_file rs6000/t-linux"
404 ;;
405 esac
406 case ${target} in
407@@ -3467,10 +3468,14 @@
408
409 i[34567]86-*-darwin* | x86_64-*-darwin*)
410 ;;
411- i[34567]86-*-linux* | x86_64-*-linux* | \
412- i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu | \
413- i[34567]86-*-gnu*)
414+ i[34567]86-*-linux* | x86_64-*-linux*)
415 ;;
416+ i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu)
417+ tmake_file="${tmake_file} i386/t-linux i386/t-kfreebsd"
418+ ;;
419+ i[34567]86-*-gnu*)
420+ tmake_file="${tmake_file} i386/t-linux i386/t-gnu"
421+ ;;
422 i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
423 ;;
424 i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw*)
425--- a/gcc/Makefile.in (revision 182390)
426+++ b/gcc/Makefile.in (working copy)
427@@ -352,6 +352,17 @@
428
429 enable_plugin = @enable_plugin@
430
431+# Multiarch support
432+enable_multiarch = @enable_multiarch@
433+with_float = @with_float@
434+ifeq ($(enable_multiarch),yes)
435+ if_multiarch = $(1)
436+else ifeq ($(enable_multiarch),auto-detect)
437+ if_multiarch = $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o),$(1))
438+else
439+ if_multiarch =
440+endif
441+
442 CPPLIB = ../libcpp/libcpp.a
443 CPPINC = -I$(srcdir)/../libcpp/include
444
445@@ -1845,10 +1845,11 @@
446 "$(MULTILIB_EXCLUSIONS)" \
447 "$(MULTILIB_OSDIRNAMES)" \
448 "$(MULTILIB_REQUIRED)" \
449+ "$(MULTIARCH_DIRNAME)" \
450 "@enable_multilib@" \
451 > tmp-mlib.h; \
452 else \
453- $(SHELL) $(srcdir)/genmultilib '' '' '' '' '' '' '' '' no\
454+ $(SHELL) $(srcdir)/genmultilib '' '' '' '' '' '' '' '' "$(MULTIARCH_DIRNAME)" no\
455 > tmp-mlib.h; \
456 fi
457 $(SHELL) $(srcdir)/../move-if-change tmp-mlib.h multilib.h
458--- a/gcc/config/alpha/t-linux (revision 0)
459+++ b/gcc/config/alpha/t-linux (revision 0)
460@@ -0,0 +1 @@
461+MULTIARCH_DIRNAME = $(call if_multiarch,alpha-linux-gnu)
462--- a/gcc/config/s390/t-linux64 (revision 182390)
463+++ b/gcc/config/s390/t-linux64 (working copy)
464@@ -7,4 +7,5 @@
465
466 MULTILIB_OPTIONS = m64/m31
467 MULTILIB_DIRNAMES = 64 32
468-MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
469+MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:s390x-linux-gnu)
470+MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu)
471--- a/gcc/config/sparc/t-linux64 (revision 182390)
472+++ b/gcc/config/sparc/t-linux64 (working copy)
473@@ -26,4 +26,5 @@
474
475 MULTILIB_OPTIONS = m64/m32
476 MULTILIB_DIRNAMES = 64 32
477-MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
478+MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:sparc64-linux-gnu)
479+MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:sparc-linux-gnu)
480--- a/gcc/config/sparc/t-linux (revision 0)
481+++ b/gcc/config/sparc/t-linux (revision 0)
482@@ -0,0 +1 @@
483+MULTIARCH_DIRNAME = $(call if_multiarch,sparc-linux-gnu)
484--- a/gcc/config/i386/t-kfreebsd (revision 0)
485+++ b/gcc/config/i386/t-kfreebsd (revision 0)
486@@ -0,0 +1,5 @@
487+MULTIARCH_DIRNAME = $(call if_multiarch,i386-kfreebsd-gnu)
488+
489+# MULTILIB_OSDIRNAMES are set in t-linux64.
490+KFREEBSD_OS = $(filter kfreebsd%, $(word 3, $(subst -, ,$(target))))
491+MULTILIB_OSDIRNAMES := $(subst linux,$(KFREEBSD_OS),$(MULTILIB_OSDIRNAMES))
492--- a/gcc/config/i386/t-gnu (revision 0)
493+++ b/gcc/config/i386/t-gnu (revision 0)
494@@ -0,0 +1 @@
495+MULTIARCH_DIRNAME = $(call if_multiarch,i386-gnu)
496--- a/gcc/config/i386/t-linux (revision 0)
497+++ b/gcc/config/i386/t-linux (revision 0)
498@@ -0,0 +1 @@
499+MULTIARCH_DIRNAME = $(call if_multiarch,i386-linux-gnu)
500--- a/gcc/config/i386/t-linux64 (revision 182390)
501+++ b/gcc/config/i386/t-linux64 (working copy)
502@@ -34,6 +34,6 @@
503 comma=,
504 MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
505 MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
506-MULTILIB_OSDIRNAMES = m64=../lib64
507-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
508+MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
509+MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
510 MULTILIB_OSDIRNAMES+= mx32=../libx32
511--- a/gcc/config/ia64/t-glibc (revision 0)
512+++ b/gcc/config/ia64/t-glibc (revision 0)
513@@ -0,0 +1,3 @@
514+ifneq (,$(findstring linux, $(target)))
515+MULTIARCH_DIRNAME = $(call if_multiarch,ia64-linux-gnu)
516+endif
517--- a/gcc/config/m68k/t-linux (revision 182390)
518+++ b/gcc/config/m68k/t-linux (working copy)
519@@ -19,6 +19,8 @@
520 # Only include multilibs for 680x0 and ColdFire CPUs with an MMU.
521 M68K_MLIB_CPU += && ((CPU ~ "^m680") || (CPU ~ "^mcf")) && (FLAGS ~ "FL_MMU")
522
523+MULTIARCH_DIRNAME = $(call if_multiarch,m68k-linux-gnu)
524+
525 # This rule uses MULTILIB_MATCHES to generate a definition of
526 # SYSROOT_SUFFIX_SPEC.
527 sysroot-suffix.h: $(srcdir)/config/m68k/print-sysroot-suffix.sh
528--- a/gcc/config/rs6000/t-spe (revision 182390)
529+++ b/gcc/config/rs6000/t-spe (working copy)
530@@ -71,3 +71,6 @@
531 mabi=altivec/mlittle \
532 maltivec/mlittle \
533 maltivec/mabi=altivec/mlittle
534+
535+MULTIARCH_DIRNAME = powerpc-linux-gnuspe$(if $(findstring rs6000/e500-double.h, $(tm_file)),,v1)
536+
537--- a/gcc/config/rs6000/t-linux64 (revision 182390)
538+++ b/gcc/config/rs6000/t-linux64 (working copy)
539@@ -31,5 +31,7 @@
540 MULTILIB_EXTRA_OPTS = fPIC mstrict-align
541 MULTILIB_EXCEPTIONS = m64/msoft-float
542 MULTILIB_EXCLUSIONS = m64/!m32/msoft-float
543-MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) nof
544+MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:powerpc64-linux-gnu)
545+MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
546+MULTILIB_OSDIRNAMES += nof
547 MULTILIB_MATCHES = $(MULTILIB_MATCHES_FLOAT)
548--- a/gcc/config/rs6000/t-linux (revision 0)
549+++ b/gcc/config/rs6000/t-linux (revision 0)
550@@ -0,0 +1 @@
551+MULTIARCH_DIRNAME = powerpc-linux-gnu
552--- a/gcc/config/arm/t-linux-eabi (revision 182390)
553+++ b/gcc/config/arm/t-linux-eabi (working copy)
554@@ -24,3 +24,6 @@
555 #MULTILIB_OPTIONS += mcpu=fa606te/mcpu=fa626te/mcpu=fmp626/mcpu=fa726te
556 #MULTILIB_DIRNAMES += fa606te fa626te fmp626 fa726te
557 #MULTILIB_EXCEPTIONS += *mthumb/*mcpu=fa606te *mthumb/*mcpu=fa626te *mthumb/*mcpu=fmp626 *mthumb/*mcpu=fa726te*
558+
559+ARM_EB = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),eb)
560+MULTIARCH_DIRNAME = $(call if_multiarch,arm$(ARM_EB)-linux-gnueabi$(if $(filter hard,$(with_float)),hf))
561--- a/gcc/config/pa/t-linux (revision 0)
562+++ b/gcc/config/pa/t-linux (revision 0)
563@@ -0,0 +1 @@
564+MULTIARCH_DIRNAME = $(call if_multiarch,hppa-linux-gnu)
565--- a/gcc/config/mips/t-linux64 (revision 182390)
566+++ b/gcc/config/mips/t-linux64 (working copy)
567@@ -18,4 +18,9 @@
568
569 MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
570 MULTILIB_DIRNAMES = n32 32 64
571-MULTILIB_OSDIRNAMES = ../lib32 ../lib ../lib64
572+MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
573+MIPS_SOFT = $(if $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)),soft)
574+MULTILIB_OSDIRNAMES = \
575+ ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
576+ ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
577+ ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
578--- a/libstdc++-v3/python/hook.in
579+++ b/libstdc++-v3/python/hook.in
580@@ -47,7 +47,10 @@
581 libdir = libdir[len (prefix):]
582
583 # Compute the ".."s needed to get from libdir to the prefix.
584- dotdots = ('..' + os.sep) * len (libdir.split (os.sep))
585+ backdirs = len (libdir.split (os.sep))
586+ if not os.path.basename(os.path.dirname(__file__)).startswith('lib'):
587+ backdirs += 1 # multiarch subdir
588+ dotdots = ('..' + os.sep) * backdirs
589
590 objfile = gdb.current_objfile ().filename
591 dir_ = os.path.join (os.path.dirname (objfile), dotdots, pythondir)
592--- a/gcc/configure 2012-04-10 09:54:30 +0000
593+++ b/gcc/configure 2012-04-12 02:39:34 +0000
594@@ -764,6 +764,8 @@
595 enable_shared
596 enable_fixed_point
597 enable_decimal_float
598+with_float
599+enable_multiarch
600 enable_multilib
601 ENABLE_BUILD_WITH_CXX
602 coverage_flags
603@@ -875,6 +877,7 @@
604 enable_build_with_cxx
605 with_stabs
606 enable_multilib
607+enable_multiarch
608 enable___cxa_atexit
609 enable_decimal_float
610 enable_fixed_point
611@@ -1576,6 +1579,7 @@
612 enable detailed memory allocation stats gathering
613 --enable-build-with-cxx build with C++ compiler instead of C compiler
614 --enable-multilib enable library support for multiple ABIs
615+ --enable-multiarch enable support for multiarch paths
616 --enable-__cxa_atexit enable __cxa_atexit for C++
617 --enable-decimal-float={no,yes,bid,dpd}
618 enable decimal float extension to C. Selecting 'bid'
619@@ -7045,6 +7049,26 @@
620
621
622
623+# Determine whether or not multiarch is enabled.
624+# Check whether --enable-multiarch was given.
625+if test "${enable_multiarch+set}" = set; then :
626+ enableval=$enable_multiarch; case "${withval}" in
627+yes|no|auto-detect) enable_multiarch=$withval;;
628+*) as_fn_error "bad value ${withval} given for --enable-multiarch option" "$LINENO" 5 ;;
629+esac
630+else
631+ enable_multiarch=auto-detect
632+fi
633+
634+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for multiarch configuration" >&5
635+$as_echo_n "checking for multiarch configuration... " >&6; }
636+
637+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_multiarch" >&5
638+$as_echo "$enable_multiarch" >&6; }
639+
640+# needed for setting the multiarch name on ARM
641+
642+
643 # Enable __cxa_atexit for C++.
644 # Check whether --enable-__cxa_atexit was given.
645 if test "${enable___cxa_atexit+set}" = set; then :
646@@ -17971,7 +17995,7 @@
647 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
648 lt_status=$lt_dlunknown
649 cat > conftest.$ac_ext <<_LT_EOF
650-#line 17974 "configure"
651+#line 17998 "configure"
652 #include "confdefs.h"
653
654 #if HAVE_DLFCN_H
655@@ -18077,7 +18101,7 @@
656 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
657 lt_status=$lt_dlunknown
658 cat > conftest.$ac_ext <<_LT_EOF
659-#line 18080 "configure"
660+#line 18104 "configure"
661 #include "confdefs.h"
662
663 #if HAVE_DLFCN_H
664
1665
=== added file 'contrib/linaro/patches/gcc/linaro-4.7+bzr115029/gcc-nls.patch'
--- contrib/linaro/patches/gcc/linaro-4.7+bzr115029/gcc-nls.patch 1970-01-01 00:00:00 +0000
+++ contrib/linaro/patches/gcc/linaro-4.7+bzr115029/gcc-nls.patch 2012-10-18 05:18:20 +0000
@@ -0,0 +1,75 @@
1diff -Naru gcc-linaro-4.7-2012.04/gcc/gcc.c gcc-linaro-4.7-2012.04-updated/gcc/gcc.c
2--- gcc-linaro-4.7-2012.04/gcc/gcc.c 2012-04-10 17:54:47.000000000 +0800
3+++ gcc-linaro-4.7-2012.04-updated/gcc/gcc.c 2012-04-17 10:09:17.261047794 +0800
4@@ -6154,7 +6154,7 @@
5 /* Unlock the stdio streams. */
6 unlock_std_streams ();
7
8- gcc_init_libintl ();
9+ gcc_init_libintl_program (argv[0]);
10
11 diagnostic_initialize (global_dc, 0);
12 if (atexit (delete_temp_files) != 0)
13diff -Naru gcc-linaro-4.7-2012.04/gcc/intl.c gcc-linaro-4.7-2012.04-updated/gcc/intl.c
14--- gcc-linaro-4.7-2012.04/gcc/intl.c 2012-04-10 17:54:47.000000000 +0800
15+++ gcc-linaro-4.7-2012.04-updated/gcc/intl.c 2012-04-17 10:41:40.129785979 +0800
16@@ -49,6 +49,14 @@
17 void
18 gcc_init_libintl (void)
19 {
20+ gcc_init_libintl_program("gcc");
21+}
22+
23+#define LIBINTL_RELATIVE_DIR "../share/locale"
24+
25+void
26+gcc_init_libintl_program (const char * program_name)
27+{
28 #ifdef HAVE_LC_MESSAGES
29 setlocale (LC_CTYPE, "");
30 setlocale (LC_MESSAGES, "");
31@@ -56,7 +64,32 @@
32 setlocale (LC_ALL, "");
33 #endif
34
35- (void) bindtextdomain ("gcc", LOCALEDIR);
36+ if (!access (LOCALEDIR, X_OK))
37+ {
38+ /* If LOCALEDIR exists, use LOCALEDIR. */
39+ (void) bindtextdomain ("gcc", LOCALEDIR);
40+ }
41+ else
42+ {
43+ /* Try relative dir, i.e. .../bin/../share/locale. */
44+ int len1, len2;
45+ char *prefix_dir, *locale_dir;
46+ prefix_dir = make_relative_prefix(program_name,".",".");
47+ len1 = strlen (prefix_dir);
48+ len2 = strlen (LIBINTL_RELATIVE_DIR);
49+ locale_dir = xmalloc (len1 + len2 + 1);
50+ if (locale_dir != NULL)
51+ {
52+ strcpy (locale_dir, prefix_dir);
53+ strcpy (locale_dir + len1, LIBINTL_RELATIVE_DIR);
54+ (void) bindtextdomain ("gcc", locale_dir);
55+ }
56+ else
57+ (void) bindtextdomain ("gcc", LOCALEDIR);
58+
59+ free (prefix_dir);
60+ }
61+
62 (void) textdomain ("gcc");
63
64 /* Opening quotation mark. */
65diff -Naru gcc-linaro-4.7-2012.04/gcc/intl.h gcc-linaro-4.7-2012.04-updated/gcc/intl.h
66--- gcc-linaro-4.7-2012.04/gcc/intl.h 2012-04-10 17:54:47.000000000 +0800
67+++ gcc-linaro-4.7-2012.04-updated/gcc/intl.h 2012-04-17 10:09:17.261047794 +0800
68@@ -30,6 +30,7 @@
69 #ifdef ENABLE_NLS
70 #include <libintl.h>
71 extern void gcc_init_libintl (void);
72+extern void gcc_init_libintl_program (const char *);
73 extern size_t gcc_gettext_width (const char *);
74 #else
75 /* Stubs. */
076
=== added file 'contrib/linaro/patches/gcc/linaro-4.7+bzr115029/link-with-cxx.patch'
--- contrib/linaro/patches/gcc/linaro-4.7+bzr115029/link-with-cxx.patch 1970-01-01 00:00:00 +0000
+++ contrib/linaro/patches/gcc/linaro-4.7+bzr115029/link-with-cxx.patch 2012-10-18 05:18:20 +0000
@@ -0,0 +1,15 @@
1=== modified file 'gcc/Makefile.in'
2--- a/gcc/Makefile.in 2012-04-02 13:36:04 +0000
3+++ b/gcc/Makefile.in 2012-04-13 04:12:57 +0000
4@@ -229,8 +229,8 @@
5 ifneq ($(ENABLE_BUILD_WITH_CXX),yes)
6 COMPILER = $(CC)
7 COMPILER_FLAGS = $(CFLAGS)
8-LINKER = $(CC)
9-LINKER_FLAGS = $(CFLAGS)
10+LINKER = $(CXX)
11+LINKER_FLAGS = $(CXXFLAGS)
12 else
13 COMPILER = $(CXX)
14 COMPILER_FLAGS = $(CXXFLAGS)
15
016
=== added file 'contrib/linaro/patches/gcc/linaro-4.7+bzr115029/multilib-defaults.patch'
--- contrib/linaro/patches/gcc/linaro-4.7+bzr115029/multilib-defaults.patch 1970-01-01 00:00:00 +0000
+++ contrib/linaro/patches/gcc/linaro-4.7+bzr115029/multilib-defaults.patch 2012-10-18 05:18:20 +0000
@@ -0,0 +1,12 @@
1diff -Naru a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
2--- a/gcc/config/arm/linux-elf.h 2012-05-10 09:35:16.834673203 +0800
3+++ b/gcc/config/arm/linux-elf.h 2012-05-11 16:48:48.243398951 +0800
4@@ -48,7 +48,7 @@
5
6 #undef MULTILIB_DEFAULTS
7 #define MULTILIB_DEFAULTS \
8- { "marm", "mlittle-endian", "mfloat-abi=hard", "mno-thumb-interwork" }
9+ { "mthumb", "mlittle-endian", "mfloat-abi=hard", "mno-thumb-interwork" }
10
11 /* Now we define the strings used to build the spec file. */
12 #undef LIB_SPEC
013
=== added file 'contrib/linaro/patches/gcc/linaro-4.7+bzr115029/multilib.patch'
--- contrib/linaro/patches/gcc/linaro-4.7+bzr115029/multilib.patch 1970-01-01 00:00:00 +0000
+++ contrib/linaro/patches/gcc/linaro-4.7+bzr115029/multilib.patch 2012-10-18 05:18:20 +0000
@@ -0,0 +1,46 @@
1diff -Naru a/gcc/config/arm/t-mlibs b/gcc/config/arm/t-mlibs
2--- a/gcc/config/arm/t-mlibs 1970-01-01 08:00:00.000000000 +0800
3+++ b/gcc/config/arm/t-mlibs 2012-05-10 13:45:23.642306042 +0800
4@@ -0,0 +1,21 @@
5+# A set of predefined MULTILIB for different ARM targets.
6+# Through the configure option --with-multilib-list, user can customize the
7+# final MULTILIB implementation.
8+
9+comma := ,
10+space :=
11+space +=
12+
13+MULTILIB_OPTIONS = marm
14+MULTILIB_DIRNAMES = arm
15+MULTILIB_OPTIONS += march=armv4t
16+MULTILIB_DIRNAMES += armv4t
17+MULTILIB_OPTIONS += mfloat-abi=soft
18+MULTILIB_DIRNAMES += soft
19+
20+MULTILIB_EXCEPTIONS =
21+
22+MULTILIB_REQUIRED = marm/march=armv4t/mfloat-abi=soft
23+
24+MULTILIB_OSDIRNAMES = marm/march.armv4t/mfloat-abi.soft=!arm-linux-gnueabi
25+
26diff -Naru a/gcc/config.gcc b/gcc/config.gcc
27--- a/gcc/config.gcc 2012-05-10 09:34:54.444323884 +0800
28+++ b/gcc/config.gcc 2012-05-10 09:38:46.234101983 +0800
29@@ -844,7 +844,7 @@
30 case ${target} in
31 arm*-*-linux-*eabi)
32 tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
33- tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
34+ tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi arm/t-mlibs"
35 # Define multilib configuration for arm-linux-androideabi.
36 case ${target} in
37 *-androideabi)
38@@ -901,7 +901,7 @@
39 case ${target} in
40 arm*-*-eabi*)
41 tm_file="$tm_file newlib-stdint.h"
42- tmake_file="${tmake_file} arm/t-bpabi"
43+ tmake_file="${tmake_file} arm/t-bpabi arm/t-mlibs"
44 use_gcc_stdint=wrap
45 ;;
46 arm*-*-rtemseabi*)
047
=== added file 'contrib/linaro/patches/gcc/linaro-4.7+bzr115029/multilibwithmultiarch.patch'
--- contrib/linaro/patches/gcc/linaro-4.7+bzr115029/multilibwithmultiarch.patch 1970-01-01 00:00:00 +0000
+++ contrib/linaro/patches/gcc/linaro-4.7+bzr115029/multilibwithmultiarch.patch 2012-10-18 05:18:20 +0000
@@ -0,0 +1,133 @@
1diff -Naru a/gcc/gcc.c b/gcc/gcc.c
2--- a/gcc/gcc.c 2012-05-10 09:36:27.244857999 +0800
3+++ b/gcc/gcc.c 2012-05-11 10:45:59.293400990 +0800
4@@ -2154,16 +2154,6 @@
5 break;
6 }
7
8- /* Now try the multiarch path. */
9- if (!skip_multi_dir
10- && !pl->require_machine_suffix && multiarch_dir)
11- {
12- memcpy (path + len, multiarch_suffix, multiarch_len + 1);
13- ret = callback (path, callback_info);
14- if (ret)
15- break;
16- }
17-
18 /* Now try the base path. */
19 if (!pl->require_machine_suffix
20 && !(pl->os_multilib ? skip_multi_os_dir : skip_multi_dir))
21@@ -2191,6 +2181,16 @@
22 if (ret)
23 break;
24 }
25+
26+ /* Now try the multiarch path. */
27+ if (!skip_multi_dir
28+ && !pl->require_machine_suffix && multiarch_dir)
29+ {
30+ memcpy (path + len, multiarch_suffix, multiarch_len + 1);
31+ ret = callback (path, callback_info);
32+ if (ret)
33+ break;
34+ }
35 }
36 if (pl)
37 break;
38@@ -7528,6 +7528,20 @@
39 ++p;
40 }
41
42+ if (first)
43+ {
44+ if (this_path_len > 3
45+ && this_path[0] == '.'
46+ && this_path[1] == ':'
47+ && this_path[2] == ':')
48+ {
49+ char *new_multiarch_dir = XNEWVEC (char, this_path_len + 1);
50+
51+ strncpy (new_multiarch_dir, this_path, this_path_len);
52+ new_multiarch_dir[this_path_len] = '\0';
53+ multiarch_dir = &new_multiarch_dir[3];
54+ }
55+ }
56 if (ok && first)
57 {
58 if (this_path_len != 1
59diff -Naru a/gcc/incpath.c b/gcc/incpath.c
60--- a/gcc/incpath.c 2012-05-10 09:35:14.395349562 +0800
61+++ b/gcc/incpath.c 2012-05-11 11:00:08.813405495 +0800
62@@ -132,7 +132,6 @@
63 const struct default_include *p;
64 int relocated = cpp_relocated();
65 size_t len;
66-
67 if (iprefix && (len = cpp_GCC_INCLUDE_DIR_len) != 0)
68 {
69 /* Look for directories that start with the standard prefix.
70@@ -150,15 +149,20 @@
71 if (!filename_ncmp (p->fname, cpp_GCC_INCLUDE_DIR, len))
72 {
73 char *str = concat (iprefix, p->fname + len, NULL);
74- if (p->multilib == 1 && imultilib)
75- str = concat (str, dir_separator_str, imultilib, NULL);
76- else if (p->multilib == 2)
77+ if (p->multilib && imultilib)
78+ {
79+ str = concat (str, dir_separator_str, imultilib, NULL);
80+ add_path (str, SYSTEM, p->cxx_aware, false);
81+ }
82+ else
83+ add_path (str, SYSTEM, p->cxx_aware, false);
84+
85+ if (p->multilib && imultiarch)
86 {
87- if (!imultiarch)
88- continue;
89+ char *str = concat (iprefix, p->fname + len, NULL);
90 str = concat (str, dir_separator_str, imultiarch, NULL);
91+ add_path (str, SYSTEM, p->cxx_aware, false);
92 }
93- add_path (str, SYSTEM, p->cxx_aware, false);
94 }
95 }
96 }
97@@ -168,7 +172,7 @@
98 {
99 if (!p->cplusplus || cxx_stdinc)
100 {
101- char *str;
102+ char *str, *str2;
103
104 /* Should this directory start with the sysroot? */
105 if (sysroot && p->add_sysroot)
106@@ -209,16 +213,20 @@
107 else
108 str = update_path (p->fname, p->component);
109
110- if (p->multilib == 1 && imultilib)
111- str = concat (str, dir_separator_str, imultilib, NULL);
112- else if (p->multilib == 2)
113+ str2 = xstrdup(str);
114+ if (p->multilib && imultilib)
115 {
116- if (!imultiarch)
117- continue;
118- str = concat (str, dir_separator_str, imultiarch, NULL);
119+ str = concat (str, dir_separator_str, imultilib, NULL);
120+ add_path (str, SYSTEM, p->cxx_aware, false);
121 }
122+ else
123+ add_path (str, SYSTEM, p->cxx_aware, false);
124
125- add_path (str, SYSTEM, p->cxx_aware, false);
126+ if (p->multilib && imultiarch)
127+ {
128+ str2 = concat (str2, dir_separator_str, imultiarch, NULL);
129+ add_path (str2, SYSTEM, p->cxx_aware, false);
130+ }
131 }
132 }
133 }
0134
=== added file 'contrib/linaro/patches/gcc/linaro-4.7+bzr115029/triplet.patch'
--- contrib/linaro/patches/gcc/linaro-4.7+bzr115029/triplet.patch 1970-01-01 00:00:00 +0000
+++ contrib/linaro/patches/gcc/linaro-4.7+bzr115029/triplet.patch 2012-10-18 05:18:20 +0000
@@ -0,0 +1,91 @@
1=== modified file 'ChangeLog.linaro'
2=== modified file 'gcc/ada/gcc-interface/Makefile.in'
3--- a/gcc/ada/gcc-interface/Makefile.in 2012-02-24 16:17:01 +0000
4+++ b/gcc/ada/gcc-interface/Makefile.in 2012-05-14 03:26:00 +0000
5@@ -1869,7 +1869,7 @@
6 LIBRARY_VERSION := $(LIB_VERSION)
7 endif
8
9-ifeq ($(strip $(filter-out arm% linux-gnueabi,$(arch) $(osys)-$(word 4,$(targ)))),)
10+ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(arch) $(osys)-$(word 4,$(targ)))),)
11 LIBGNAT_TARGET_PAIRS = \
12 a-intnam.ads<a-intnam-linux.ads \
13 s-inmaop.adb<s-inmaop-posix.adb \
14
15=== modified file 'gcc/config.gcc'
16--- a/gcc/config.gcc 2012-04-02 13:36:04 +0000
17+++ b/gcc/config.gcc 2012-05-14 03:26:00 +0000
18@@ -842,7 +842,7 @@
19 esac
20 tmake_file="${tmake_file} arm/t-arm"
21 case ${target} in
22- arm*-*-linux-*eabi)
23+ arm*-*-linux-*eabi*)
24 tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
25 tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi arm/t-mlibs"
26 # Define multilib configuration for arm-linux-androideabi.
27@@ -851,6 +851,11 @@
28 tmake_file="$tmake_file arm/t-linux-androideabi"
29 ;;
30 esac
31+ case ${target} in
32+ arm*-*-*eabihf)
33+ with_float=${with_float:-hard}
34+ ;;
35+ esac
36 # The BPABI long long divmod functions return a 128-bit value in
37 # registers r0-r3. Correctly modeling that requires the use of
38 # TImode.
39
40=== modified file 'libgcc/config.host'
41--- a/libgcc/config.host 2012-02-20 21:19:55 +0000
42+++ b/libgcc/config.host 2012-05-14 03:26:01 +0000
43@@ -327,7 +327,7 @@
44 arm*-*-linux*) # ARM GNU/Linux with ELF
45 tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix"
46 case ${host} in
47- arm*-*-linux-*eabi)
48+ arm*-*-linux-*eabi*)
49 tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc"
50 tm_file="$tm_file arm/bpabi-lib.h"
51 unwind_header=config/arm/unwind-arm.h
52
53=== modified file 'libjava/configure'
54--- a/libjava/configure 2012-02-24 15:21:12 +0000
55+++ b/libjava/configure 2012-05-14 03:26:01 +0000
56@@ -20542,7 +20542,7 @@
57 # on Darwin -single_module speeds up loading of the dynamic libraries.
58 extra_ldflags_libjava=-Wl,-single_module
59 ;;
60-arm*linux*eabi)
61+arm*linux*eabi*)
62 # Some of the ARM unwinder code is actually in libstdc++. We
63 # could in principle replicate it in libgcj, but it's better to
64 # have a dependency on libstdc++.
65
66=== modified file 'libjava/configure.ac'
67--- a/libjava/configure.ac 2012-02-24 15:21:12 +0000
68+++ b/libjava/configure.ac 2012-05-14 03:26:01 +0000
69@@ -931,7 +931,7 @@
70 # on Darwin -single_module speeds up loading of the dynamic libraries.
71 extra_ldflags_libjava=-Wl,-single_module
72 ;;
73-arm*linux*eabi)
74+arm*linux*eabi*)
75 # Some of the ARM unwinder code is actually in libstdc++. We
76 # could in principle replicate it in libgcj, but it's better to
77 # have a dependency on libstdc++.
78
79=== modified file 'libstdc++-v3/configure.host'
80--- a/libstdc++-v3/configure.host 2012-02-10 18:10:12 +0000
81+++ b/libstdc++-v3/configure.host 2012-05-14 03:26:01 +0000
82@@ -340,7 +340,7 @@
83 fi
84 esac
85 case "${host}" in
86- arm*-*-linux-*eabi)
87+ arm*-*-linux-*eabi*)
88 port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver"
89 ;;
90 esac
91
092
=== modified file 'contrib/linaro/update-aarch64.sh'
--- contrib/linaro/update-aarch64.sh 2012-10-03 00:11:01 +0000
+++ contrib/linaro/update-aarch64.sh 2012-10-18 05:18:20 +0000
@@ -56,27 +56,42 @@
56$invoke ls "~/snapshots" | sort > snapshots.txt56$invoke ls "~/snapshots" | sort > snapshots.txt
5757
58binutils_latest=$(latest binutils-2.24~)58binutils_latest=$(latest binutils-2.24~)
59gcc_latest=$(latest gcc-arm-aarch64-4.7+svn)
60newlib_latest=$(latest newlib-1.21~)
61gdb_latest=$(latest gdb-7.6~)
62eglibc_latest=$(latest eglibc-2.16+svn)
63ports_latest=$(latest eglibc-ports-2.16+svn)
64
65# HACK: override to match OpenEmbedded
66binutils_latest="binutils-2.24~20120920+gitb05c76f"
67gcc_latest="gcc-arm-aarch64-4.7+svn191987"
68eglibc_latest="eglibc-2.16+svn20393"
69ports_latest="eglibc-ports-2.16+svn20393"
70
59binutils_version=$(get_version $binutils_latest)71binutils_version=$(get_version $binutils_latest)
60gcc_latest=$(latest gcc-arm-aarch64-4.7+svn)
61gcc_version=$(get_version $gcc_latest)72gcc_version=$(get_version $gcc_latest)
62newlib_latest=$(latest newlib-1.21~)
63newlib_version=$(get_version $newlib_latest)73newlib_version=$(get_version $newlib_latest)
64gdb_latest=$(latest gdb-7.6~)
65gdb_version=$(get_version $gdb_latest)74gdb_version=$(get_version $gdb_latest)
75eglibc_version=$(get_version $eglibc_latest)
76ports_version=$(get_version $ports_latest)
6677
67# Make tarballs of each78# Make tarballs of each
68make_tarball $binutils_latest79make_tarball $binutils_latest
69make_tarball $gcc_latest80make_tarball $gcc_latest
70make_tarball $newlib_latest81make_tarball $newlib_latest
71make_tarball $gdb_latest82make_tarball $gdb_latest
83make_tarball $eglibc_latest
84make_tarball $ports_latest
7285
73# Update the config files86# Update the config files
74sed -i -r "s#arm-aarch64-4[^ \"]*#$gcc_version#" config/cc/gcc.in87sed -i -r "s#arm-aarch64-4[^ \"]*#$gcc_version#" config/cc/gcc.in
75sed -i -r "s#2\.24~[^ \"]*#$binutils_version#" config/binutils/binutils.in88sed -i -r "s#2\.24~[^ \"]*#$binutils_version#" config/binutils/binutils.in
76sed -i -r "s#1\.21~[^ \"]*#$newlib_version#" config/libc/newlib.in89sed -i -r "s#1\.21~[^ \"]*#$newlib_version#" config/libc/newlib.in
77sed -i -r "s#7\.6~[^ \"]*#$gdb_version#" config/debug/gdb.in90sed -i -r "s#7\.6~[^ \"]*#$gdb_version#" config/debug/gdb.in
91sed -i -r "s#2\.16+[^ \"]*#$eglibc_version#" config/libc/eglibc.in
7892
79move_patches gcc arm-aarch64 $gcc_version93move_patches gcc arm-aarch64 $gcc_version
80move_patches binutils 2.24~ $binutils_version94move_patches binutils 2.24~ $binutils_version
81move_patches newlib 1.21~ $newlib_version95move_patches newlib 1.21~ $newlib_version
82move_patches gdb 7.3~ $gdb_version96move_patches gdb 7.3~ $gdb_version
97move_patches eglibc ports-2_16+ $ports_version
8398
=== modified file 'samples/linaro-aarch64-linux-gnu/crosstool.config'
--- samples/linaro-aarch64-linux-gnu/crosstool.config 2012-10-15 02:35:12 +0000
+++ samples/linaro-aarch64-linux-gnu/crosstool.config 2012-10-18 05:18:20 +0000
@@ -1,7 +1,7 @@
1#1#
2# Automatically generated make config: don't edit2# Automatically generated make config: don't edit
3# crosstool-NG linaro-1.13.1+bzr2485 Configuration3# crosstool-NG linaro-1.13.1+bzr2485 Configuration
4# Mon Oct 15 15:32:00 20124# Thu Oct 18 18:05:37 2012
5#5#
6CT_CONFIGURE_has_xzutils=y6CT_CONFIGURE_has_xzutils=y
7CT_CONFIGURE_has_cvs=y7CT_CONFIGURE_has_cvs=y
@@ -251,7 +251,7 @@
251# CT_BINUTILS_V_2_18a is not set251# CT_BINUTILS_V_2_18a is not set
252# CT_BINUTILS_V_2_17a is not set252# CT_BINUTILS_V_2_17a is not set
253# CT_BINUTILS_V_2_16_1a is not set253# CT_BINUTILS_V_2_16_1a is not set
254CT_BINUTILS_VERSION="2.24~20120920+gitb05c76f"254CT_BINUTILS_VERSION="2.24~20121016+git142208f"
255CT_BINUTILS_2_22_or_later=y255CT_BINUTILS_2_22_or_later=y
256CT_BINUTILS_2_21_or_later=y256CT_BINUTILS_2_21_or_later=y
257CT_BINUTILS_2_20_or_later=y257CT_BINUTILS_2_20_or_later=y
@@ -277,10 +277,11 @@
277# C compiler277# C compiler
278#278#
279CT_CC="gcc"279CT_CC="gcc"
280CT_CC_VERSION="linaro-4.7-2012.10"280CT_CC_VERSION="linaro-4.7+bzr115029"
281CT_CC_gcc=y281CT_CC_gcc=y
282CT_CC_GCC_SHOW_LINARO=y282CT_CC_GCC_SHOW_LINARO=y
283CT_CC_V_linaro_4_7_2012_10=y283# CT_CC_V_linaro_4_7_2012_10 is not set
284CT_CC_V_linaro_4_7_TIP=y
284# CT_CC_V_arm_aarch64_4_7_PRE is not set285# CT_CC_V_arm_aarch64_4_7_PRE is not set
285# CT_CC_V_4_7_0 is not set286# CT_CC_V_4_7_0 is not set
286# CT_CC_V_4_6_2 is not set287# CT_CC_V_4_6_2 is not set
287288
=== modified file 'samples/linaro-aarch64-none-elf/crosstool.config'
--- samples/linaro-aarch64-none-elf/crosstool.config 2012-10-15 02:35:12 +0000
+++ samples/linaro-aarch64-none-elf/crosstool.config 2012-10-18 05:18:20 +0000
@@ -1,7 +1,7 @@
1#1#
2# Automatically generated make config: don't edit2# Automatically generated make config: don't edit
3# crosstool-NG linaro-1.13.1+bzr2485 Configuration3# crosstool-NG linaro-1.13.1+bzr2485 Configuration
4# Mon Oct 15 15:32:35 20124# Thu Oct 18 18:14:06 2012
5#5#
6CT_CONFIGURE_has_xzutils=y6CT_CONFIGURE_has_xzutils=y
7CT_CONFIGURE_has_cvs=y7CT_CONFIGURE_has_cvs=y
@@ -223,7 +223,7 @@
223# CT_BINUTILS_V_2_18a is not set223# CT_BINUTILS_V_2_18a is not set
224# CT_BINUTILS_V_2_17a is not set224# CT_BINUTILS_V_2_17a is not set
225# CT_BINUTILS_V_2_16_1a is not set225# CT_BINUTILS_V_2_16_1a is not set
226CT_BINUTILS_VERSION="2.24~20120920+gitb05c76f"226CT_BINUTILS_VERSION="2.24~20121016+git142208f"
227CT_BINUTILS_2_22_or_later=y227CT_BINUTILS_2_22_or_later=y
228CT_BINUTILS_2_21_or_later=y228CT_BINUTILS_2_21_or_later=y
229CT_BINUTILS_2_20_or_later=y229CT_BINUTILS_2_20_or_later=y
@@ -247,10 +247,11 @@
247# C compiler247# C compiler
248#248#
249CT_CC="gcc"249CT_CC="gcc"
250CT_CC_VERSION="linaro-4.7-2012.10"250CT_CC_VERSION="linaro-4.7+bzr115029"
251CT_CC_gcc=y251CT_CC_gcc=y
252CT_CC_GCC_SHOW_LINARO=y252CT_CC_GCC_SHOW_LINARO=y
253CT_CC_V_linaro_4_7_2012_10=y253# CT_CC_V_linaro_4_7_2012_10 is not set
254CT_CC_V_linaro_4_7_TIP=y
254# CT_CC_V_arm_aarch64_4_7_PRE is not set255# CT_CC_V_arm_aarch64_4_7_PRE is not set
255# CT_CC_V_4_7_0 is not set256# CT_CC_V_4_7_0 is not set
256# CT_CC_V_4_6_2 is not set257# CT_CC_V_4_6_2 is not set

Subscribers

People subscribed via source and target branches