diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-27 15:14:24 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-27 15:29:45 +0100 |
commit | 29d6678fd546377459ef75cf54abeef5b969b5cf (patch) | |
tree | 8edd65790e37a00d01c3f203f773fe4b5012db18 /meta/recipes-devtools/gcc | |
parent | da49de6885ee1bc424e70bc02f21f6ab920efb55 (diff) | |
download | poky-29d6678fd546377459ef75cf54abeef5b969b5cf.tar.gz |
Major layout change to the packages directory
Having one monolithic packages directory makes it hard to find things
and is generally overwhelming. This commit splits it into several
logical sections roughly based on function, recipes.txt gives more
information about the classifications used.
The opportunity is also used to switch from "packages" to "recipes"
as used in OpenEmbedded as the term "packages" can be confusing to
people and has many different meanings.
Not all recipes have been classified yet, this is just a first pass
at separating things out. Some packages are moved to meta-extras as
they're no longer actively used or maintained.
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-devtools/gcc')
203 files changed, 31048 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/files/canadian-build-modules-configure.patch b/meta/recipes-devtools/gcc/files/canadian-build-modules-configure.patch new file mode 100644 index 0000000000..8aede105c5 --- /dev/null +++ b/meta/recipes-devtools/gcc/files/canadian-build-modules-configure.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | diff -urN gcc-4.2.2-orig/gcc/configure gcc-4.2.2/gcc/configure | ||
2 | --- gcc-4.2.2-orig/gcc/configure 2008-08-31 23:10:56.000000000 +0200 | ||
3 | +++ gcc-4.2.2/gcc/configure 2008-08-31 23:03:02.000000000 +0200 | ||
4 | @@ -12716,6 +12716,7 @@ | ||
5 | esac | ||
6 | saved_CFLAGS="${CFLAGS}" | ||
7 | CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ | ||
8 | + CPP="${CPP_FOR_BUILD}" CPPFLAGS="${CPPFLAGS_FOR_BUILD}" \ | ||
9 | CONFIG_SITE= ${realsrcdir}/configure --cache-file=./other.cache \ | ||
10 | --enable-languages=${enable_languages-all} \ | ||
11 | --target=$target_alias --host=$build_alias --build=$build_alias | ||
12 | diff -urN gcc-4.2.2-orig/gcc/configure.ac gcc-4.2.2/gcc/configure.ac | ||
13 | --- gcc-4.2.2-orig/gcc/configure.ac 2008-08-31 23:10:53.000000000 +0200 | ||
14 | +++ gcc-4.2.2/gcc/configure.ac 2008-08-31 23:03:29.000000000 +0200 | ||
15 | @@ -1490,6 +1490,7 @@ | ||
16 | esac | ||
17 | saved_CFLAGS="${CFLAGS}" | ||
18 | CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ | ||
19 | + CPP="${CPP_FOR_BUILD}" CPPFLAGS="${CPPFLAGS_FOR_BUILD}" \ | ||
20 | ${realsrcdir}/configure \ | ||
21 | --enable-languages=${enable_languages-all} \ | ||
22 | --target=$target_alias --host=$build_alias --build=$build_alias | ||
diff --git a/meta/recipes-devtools/gcc/files/gcc-4.3.3-fix-EXTRA_BUILD.patch b/meta/recipes-devtools/gcc/files/gcc-4.3.3-fix-EXTRA_BUILD.patch new file mode 100644 index 0000000000..8a2a4c4040 --- /dev/null +++ b/meta/recipes-devtools/gcc/files/gcc-4.3.3-fix-EXTRA_BUILD.patch | |||
@@ -0,0 +1,12 @@ | |||
1 | Index: gcc-4.3.3/Makefile.in | ||
2 | =================================================================== | ||
3 | --- gcc-4.3.3.orig/Makefile.in 2010-06-16 18:04:38.379008150 +0400 | ||
4 | +++ gcc-4.3.3/Makefile.in 2010-06-16 18:05:29.115006261 +0400 | ||
5 | @@ -148,6 +148,7 @@ | ||
6 | # built for the build system to override those in BASE_FLAGS_TO_PASSS. | ||
7 | EXTRA_BUILD_FLAGS = \ | ||
8 | CFLAGS="$(CFLAGS_FOR_BUILD)" \ | ||
9 | + LIBCFLAGS="$(CFLAGS_FOR_BUILD)" \ | ||
10 | LDFLAGS="$(LDFLAGS_FOR_BUILD)" | ||
11 | |||
12 | # This is the list of directories to built for the host system. | ||
diff --git a/meta/recipes-devtools/gcc/files/gcc-4.3.x-fix-EXTRA_BUILD.patch b/meta/recipes-devtools/gcc/files/gcc-4.3.x-fix-EXTRA_BUILD.patch new file mode 100644 index 0000000000..b3753364f8 --- /dev/null +++ b/meta/recipes-devtools/gcc/files/gcc-4.3.x-fix-EXTRA_BUILD.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | Index: gcc-4.3.1/Makefile.in | ||
2 | =================================================================== | ||
3 | --- gcc-4.3.1.orig/Makefile.in 2010-07-07 13:08:44.000000000 +0200 | ||
4 | +++ gcc-4.3.1/Makefile.in 2010-07-07 13:11:59.246625709 +0200 | ||
5 | @@ -149,7 +149,7 @@ | ||
6 | EXTRA_BUILD_FLAGS = \ | ||
7 | CFLAGS="$(CFLAGS_FOR_BUILD)" \ | ||
8 | LDFLAGS="$(LDFLAGS_FOR_BUILD)" \ | ||
9 | - LIBCFLAGS="" | ||
10 | + LIBCFLAGS="$(CFLAGS_FOR_BUILD)" | ||
11 | |||
12 | # This is the list of directories to built for the host system. | ||
13 | SUBDIRS = @configdirs@ | ||
diff --git a/meta/recipes-devtools/gcc/files/gcc-posix-open-fix.patch b/meta/recipes-devtools/gcc/files/gcc-posix-open-fix.patch new file mode 100644 index 0000000000..99f813e866 --- /dev/null +++ b/meta/recipes-devtools/gcc/files/gcc-posix-open-fix.patch | |||
@@ -0,0 +1,11 @@ | |||
1 | --- gcc-3.4.6/gcc/collect2.c 2008-10-04 18:17:17.796750393 +0400 | ||
2 | +++ gcc-3.4.6/gcc/collect2.new 2008-10-04 18:24:10.120748711 +0400 | ||
3 | @@ -1534,7 +1534,7 @@ collect_execute (const char *prog, char | ||
4 | if (redir) | ||
5 | { | ||
6 | /* Open response file. */ | ||
7 | - redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT); | ||
8 | + redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT, S_IWUSR); | ||
9 | |||
10 | /* Duplicate the stdout and stderr file handles | ||
11 | so they can be restored later. */ | ||
diff --git a/meta/recipes-devtools/gcc/files/gcc4-mtune-compat.patch b/meta/recipes-devtools/gcc/files/gcc4-mtune-compat.patch new file mode 100644 index 0000000000..0da2811d37 --- /dev/null +++ b/meta/recipes-devtools/gcc/files/gcc4-mtune-compat.patch | |||
@@ -0,0 +1,14 @@ | |||
1 | Patch for gcc3 to support gcc4-compatible (and consistent) values for -mtune= option. | ||
2 | |||
3 | --- gcc-3.4.4/gcc/config/arm/arm.c.org 2007-12-15 23:58:35.000000000 +0200 | ||
4 | +++ gcc-3.4.4/gcc/config/arm/arm.c 2007-12-16 00:20:39.000000000 +0200 | ||
5 | @@ -432,7 +432,9 @@ | ||
6 | {"arm10tdmi", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_ARCH5 }, | ||
7 | {"arm1020t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_ARCH5 }, | ||
8 | {"arm926ejs", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E }, | ||
9 | + {"arm926ej-s", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E }, | ||
10 | {"arm1026ejs", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E }, | ||
11 | + {"arm1026ej-s", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E }, | ||
12 | {"xscale", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE }, | ||
13 | {"iwmmxt", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE | FL_IWMMXT }, | ||
14 | /* V6 Architecture Processors */ | ||
diff --git a/meta/recipes-devtools/gcc/files/gfortran-4.3.x.patch b/meta/recipes-devtools/gcc/files/gfortran-4.3.x.patch new file mode 100644 index 0000000000..0c42851ce1 --- /dev/null +++ b/meta/recipes-devtools/gcc/files/gfortran-4.3.x.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | The patch below fixes a crash building libgfortran on arm-linux-gnueabi. | ||
2 | |||
3 | This target doesn't really have a 128-bit integer type, however it does use | ||
4 | TImode to represent the return value of certain special ABI defined library | ||
5 | functions. This results in type_for_size(TImode) being called. | ||
6 | |||
7 | Because TImode deosn't correspond to any gfortran integer kind | ||
8 | gfc_type_for_size returns NULL and we segfault shortly after. | ||
9 | |||
10 | The patch below fixes this by making gfc_type_for_size handle TImode in the | ||
11 | same way as the C frontend. | ||
12 | |||
13 | Tested on x86_64-linux and arm-linux-gnueabi. | ||
14 | Applied to trunk. | ||
15 | |||
16 | Paul | ||
17 | |||
18 | 2007-05-15 Paul Brook <paul@codesourcery.com> | ||
19 | |||
20 | gcc/fortran/ | ||
21 | * trans-types.c (gfc_type_for_size): Handle signed TImode. | ||
22 | |||
23 | Index: gcc-4.2.1/gcc/fortran/trans-types.c | ||
24 | =================================================================== | ||
25 | --- gcc-4.2.1/gcc/fortran/trans-types.c (revision 170435) | ||
26 | +++ gcc-4.2.1/gcc/fortran/trans-types.c (working copy) | ||
27 | @@ -1800,6 +1800,13 @@ gfc_type_for_size (unsigned bits, int un | ||
28 | if (type && bits == TYPE_PRECISION (type)) | ||
29 | return type; | ||
30 | } | ||
31 | + | ||
32 | + /* Handle TImode as a special case because it is used by some backends | ||
33 | + (eg. ARM) even though it is not available for normal use. */ | ||
34 | +#if HOST_BITS_PER_WIDE_INT >= 65 | ||
35 | + if (bits == TYPE_PRECISION (intTI_type_node)) | ||
36 | + return intTI_type_node; | ||
37 | +#endif | ||
38 | } | ||
39 | else | ||
40 | { | ||
diff --git a/meta/recipes-devtools/gcc/files/gfortran.patch b/meta/recipes-devtools/gcc/files/gfortran.patch new file mode 100644 index 0000000000..96905e5d7d --- /dev/null +++ b/meta/recipes-devtools/gcc/files/gfortran.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | The patch below fixes a crash building libgfortran on arm-linux-gnueabi. | ||
2 | |||
3 | This target doesn't really have a 128-bit integer type, however it does use | ||
4 | TImode to represent the return value of certain special ABI defined library | ||
5 | functions. This results in type_for_size(TImode) being called. | ||
6 | |||
7 | Because TImode deosn't correspond to any gfortran integer kind | ||
8 | gfc_type_for_size returns NULL and we segfault shortly after. | ||
9 | |||
10 | The patch below fixes this by making gfc_type_for_size handle TImode in the | ||
11 | same way as the C frontend. | ||
12 | |||
13 | Tested on x86_64-linux and arm-linux-gnueabi. | ||
14 | Applied to trunk. | ||
15 | |||
16 | Paul | ||
17 | |||
18 | 2007-05-15 Paul Brook <paul@codesourcery.com> | ||
19 | |||
20 | gcc/fortran/ | ||
21 | * trans-types.c (gfc_type_for_size): Handle signed TImode. | ||
22 | |||
23 | Index: gcc-4.2.1/gcc/fortran/trans-types.c | ||
24 | =================================================================== | ||
25 | --- gcc-4.2.1/gcc/fortran/trans-types.c (revision 170435) | ||
26 | +++ gcc-4.2.1/gcc/fortran/trans-types.c (working copy) | ||
27 | @@ -1800,6 +1800,13 @@ gfc_type_for_size (unsigned bits, int un | ||
28 | if (type && bits == TYPE_PRECISION (type)) | ||
29 | return type; | ||
30 | } | ||
31 | + | ||
32 | + /* Handle TImode as a special case because it is used by some backends | ||
33 | + (eg. ARM) even though it is not available for normal use. */ | ||
34 | +#if HOST_BITS_PER_WIDE_INT >= 64 | ||
35 | + if (bits == TYPE_PRECISION (intTI_type_node)) | ||
36 | + return intTI_type_node; | ||
37 | +#endif | ||
38 | } | ||
39 | else | ||
40 | { | ||
diff --git a/meta/recipes-devtools/gcc/files/pr22133-mingw-path-fixup.patch b/meta/recipes-devtools/gcc/files/pr22133-mingw-path-fixup.patch new file mode 100644 index 0000000000..429e9ffd0c --- /dev/null +++ b/meta/recipes-devtools/gcc/files/pr22133-mingw-path-fixup.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | diff -rupN gcc-4.2.orig/gcc/c-incpath.c gcc-4.2/gcc/c-incpath.c | ||
2 | --- gcc-4.2.orig/gcc/c-incpath.c 2007-09-01 11:28:30.000000000 -0400 | ||
3 | +++ gcc-4.2/gcc/c-incpath.c 2008-08-17 16:56:01.000000000 -0400 | ||
4 | @@ -340,13 +340,18 @@ add_path (char *path, int chain, int cxx | ||
5 | cpp_dir *p; | ||
6 | |||
7 | #if defined (HAVE_DOS_BASED_FILE_SYSTEM) | ||
8 | - /* Convert all backslashes to slashes. The native CRT stat() | ||
9 | - function does not recognize a directory that ends in a backslash | ||
10 | - (unless it is a drive root dir, such "c:\"). Forward slashes, | ||
11 | - trailing or otherwise, cause no problems for stat(). */ | ||
12 | - char* c; | ||
13 | - for (c = path; *c; c++) | ||
14 | - if (*c == '\\') *c = '/'; | ||
15 | + /* Remove unnecessary trailing slashes. On some versions of MS | ||
16 | + Windows, trailing _forward_ slashes cause no problems for stat(). | ||
17 | + On newer versions, stat() does not recognise a directory that ends | ||
18 | + in a '\\' or '/', unless it is a drive root dir, such as "c:/", | ||
19 | + where it is obligatory. */ | ||
20 | + int pathlen = strlen (path); | ||
21 | + char* end = path + pathlen - 1; | ||
22 | + /* Preserve the lead '/' or lead "c:/". */ | ||
23 | + char* start = path + (pathlen > 2 && path[1] == ':' ? 3 : 1); | ||
24 | + | ||
25 | + for (; end > start && IS_DIR_SEPARATOR (*end); end--) | ||
26 | + *end = 0; | ||
27 | #endif | ||
28 | |||
29 | p = XNEW (cpp_dir); | ||
diff --git a/meta/recipes-devtools/gcc/files/pr33281-mingw-host-fragment.patch b/meta/recipes-devtools/gcc/files/pr33281-mingw-host-fragment.patch new file mode 100644 index 0000000000..e16fb4464a --- /dev/null +++ b/meta/recipes-devtools/gcc/files/pr33281-mingw-host-fragment.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | --- | ||
2 | config/mh-mingw | 3 +++ | ||
3 | configure | 1 + | ||
4 | configure.in | 1 + | ||
5 | 3 files changed, 5 insertions(+) | ||
6 | |||
7 | Index: gcc-4.2.3/config/mh-mingw | ||
8 | =================================================================== | ||
9 | --- /dev/null | ||
10 | +++ gcc-4.2.3/config/mh-mingw | ||
11 | @@ -0,0 +1,3 @@ | ||
12 | +# Add -D__USE_MINGW_ACCESS to enable the built compiler to work on Windows | ||
13 | +# Vista (see PR33281 for details). | ||
14 | +BOOT_CFLAGS += -D__USE_MINGW_ACCESS | ||
15 | Index: gcc-4.2.3/configure.in | ||
16 | =================================================================== | ||
17 | --- gcc-4.2.3.orig/configure.in | ||
18 | +++ gcc-4.2.3/configure.in | ||
19 | @@ -929,6 +929,7 @@ case "${host}" in | ||
20 | host_makefile_frag="config/mh-cygwin" | ||
21 | ;; | ||
22 | *-mingw32*) | ||
23 | + host_makefile_frag="config/mh-mingw" | ||
24 | ;; | ||
25 | *-interix*) | ||
26 | host_makefile_frag="config/mh-interix" | ||
27 | Index: gcc-4.2.3/configure | ||
28 | =================================================================== | ||
29 | --- gcc-4.2.3.orig/configure | ||
30 | +++ gcc-4.2.3/configure | ||
31 | @@ -1769,6 +1769,7 @@ case "${host}" in | ||
32 | host_makefile_frag="config/mh-cygwin" | ||
33 | ;; | ||
34 | *-mingw32*) | ||
35 | + host_makefile_frag="config/mh-mingw" | ||
36 | ;; | ||
37 | *-interix*) | ||
38 | host_makefile_frag="config/mh-interix" | ||
diff --git a/meta/recipes-devtools/gcc/files/pr35916-mingw-__USE_MINGW_ACCESS-everywhere.patch b/meta/recipes-devtools/gcc/files/pr35916-mingw-__USE_MINGW_ACCESS-everywhere.patch new file mode 100644 index 0000000000..faf44c27f9 --- /dev/null +++ b/meta/recipes-devtools/gcc/files/pr35916-mingw-__USE_MINGW_ACCESS-everywhere.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | --- | ||
2 | config/mh-mingw | 1 + | ||
3 | 1 file changed, 1 insertion(+) | ||
4 | |||
5 | Index: gcc-4.2.3/config/mh-mingw | ||
6 | =================================================================== | ||
7 | --- gcc-4.2.3.orig/config/mh-mingw | ||
8 | +++ gcc-4.2.3/config/mh-mingw | ||
9 | @@ -1,3 +1,4 @@ | ||
10 | # Add -D__USE_MINGW_ACCESS to enable the built compiler to work on Windows | ||
11 | # Vista (see PR33281 for details). | ||
12 | BOOT_CFLAGS += -D__USE_MINGW_ACCESS | ||
13 | +CFLAGS += -D__USE_MINGW_ACCESS | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3.inc b/meta/recipes-devtools/gcc/gcc-4.3.3.inc new file mode 100644 index 0000000000..9b600a0f1f --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3.inc | |||
@@ -0,0 +1,69 @@ | |||
1 | require gcc-common.inc | ||
2 | LICENSE = "GPLv3" | ||
3 | |||
4 | DEPENDS =+ "mpfr gmp" | ||
5 | NATIVEDEPS = "mpfr-native gmp-native gettext-native" | ||
6 | |||
7 | SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \ | ||
8 | file://fedora/gcc43-c++-builtin-redecl.patch;patch=1;pnum=0 \ | ||
9 | file://fedora/gcc43-ia64-libunwind.patch;patch=1;pnum=0 \ | ||
10 | file://fedora/gcc43-java-nomulti.patch;patch=1;pnum=0 \ | ||
11 | file://fedora/gcc43-ppc32-retaddr.patch;patch=1;pnum=0 \ | ||
12 | file://fedora/gcc43-pr27898.patch;patch=1;pnum=0 \ | ||
13 | file://fedora/gcc43-pr32139.patch;patch=1;pnum=0 \ | ||
14 | file://fedora/gcc43-pr33763.patch;patch=1;pnum=0 \ | ||
15 | file://fedora/gcc43-rh330771.patch;patch=1;pnum=0 \ | ||
16 | file://fedora/gcc43-rh341221.patch;patch=1;pnum=0 \ | ||
17 | file://fedora/gcc43-cpp-pragma.patch;patch=1;pnum=0 \ | ||
18 | file://fedora/gcc43-java-debug-iface-type.patch;patch=1;pnum=0 \ | ||
19 | file://fedora/gcc43-libgomp-speedup.patch;patch=1;pnum=0 \ | ||
20 | file://fedora/gcc43-i386-libgomp.patch;patch=1;pnum=0 \ | ||
21 | file://fedora/gcc43-rh251682.patch;patch=1;pnum=0 \ | ||
22 | file://debian/arm-unbreak-eabi-armv4t.dpatch;patch=1 \ | ||
23 | file://debian/libstdc++-pic.dpatch;patch=1;pnum=0 \ | ||
24 | file://debian/gcc-ice-hack.dpatch;patch=1;pnum=0 \ | ||
25 | file://debian/pr30961.dpatch;patch=1;pnum=0 \ | ||
26 | file://100-uclibc-conf.patch;patch=1 \ | ||
27 | file://103-uclibc-conf-noupstream.patch;patch=1 \ | ||
28 | file://200-uclibc-locale.patch;patch=1 \ | ||
29 | file://203-uclibc-locale-no__x.patch;patch=1 \ | ||
30 | file://204-uclibc-locale-wchar_fix.patch;patch=1 \ | ||
31 | file://205-uclibc-locale-update.patch;patch=1 \ | ||
32 | file://301-missing-execinfo_h.patch;patch=1 \ | ||
33 | file://302-c99-snprintf.patch;patch=1 \ | ||
34 | file://303-c99-complex-ugly-hack.patch;patch=1 \ | ||
35 | file://304-index_macro.patch;patch=1 \ | ||
36 | file://305-libmudflap-susv3-legacy.patch;patch=1 \ | ||
37 | file://306-libstdc++-namespace.patch;patch=1 \ | ||
38 | file://307-locale_facets.patch;patch=1 \ | ||
39 | file://602-sdk-libstdc++-includes.patch;patch=1 \ | ||
40 | file://740-sh-pr24836.patch;patch=1 \ | ||
41 | file://800-arm-bigendian.patch;patch=1 \ | ||
42 | file://904-flatten-switch-stmt-00.patch;patch=1 \ | ||
43 | file://arm-nolibfloat.patch;patch=1 \ | ||
44 | file://arm-softfloat.patch;patch=1 \ | ||
45 | file://cache-amnesia.patch;patch=1 \ | ||
46 | # file://gfortran.patch;patch=1 \ | ||
47 | file://gcc-4.0.2-e300c2c3.patch;patch=1 \ | ||
48 | # file://pr34130.patch;patch=1 \ | ||
49 | # file://fortran-static-linking.patch;patch=1 \ | ||
50 | file://gcc-arm-frename-registers.patch;patch=1 \ | ||
51 | file://gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch;patch=1 \ | ||
52 | file://gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch;patch=1 \ | ||
53 | file://zecke-xgcc-cpp.patch;patch=1 \ | ||
54 | file://gcc-flags-for-build.patch;patch=1 \ | ||
55 | file://pr35942.patch;patch=1 \ | ||
56 | file://optional_libstdc.patch;patch=1 \ | ||
57 | file://sparseset_rule.patch;patch=1 \ | ||
58 | file://64bithack.patch;patch=1 \ | ||
59 | " | ||
60 | |||
61 | SRC_URI_append_sh3 = " file://sh3-installfix-fixheaders.patch;patch=1 " | ||
62 | |||
63 | # Language Overrides | ||
64 | FORTRAN = "" | ||
65 | JAVA = "" | ||
66 | |||
67 | EXTRA_OECONF_BASE = " --enable-cheaders=c_std --enable-libssp --disable-bootstrap --disable-libgomp --disable-libmudflap" | ||
68 | EXTRA_OECONF_INITIAL = "--disable-libmudflap --disable-libgomp --disable-libssp --enable-decimal-float=no" | ||
69 | EXTRA_OECONF_INTERMEDIATE = "--disable-libmudflap --disable-libgomp --disable-libssp" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/100-uclibc-conf.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/100-uclibc-conf.patch new file mode 100644 index 0000000000..0b799607e8 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/100-uclibc-conf.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | Index: gcc-4.3.1/contrib/regression/objs-gcc.sh | ||
2 | =================================================================== | ||
3 | --- gcc-4.3.1.orig/contrib/regression/objs-gcc.sh 2007-12-24 15:18:57.000000000 -0800 | ||
4 | +++ gcc-4.3.1/contrib/regression/objs-gcc.sh 2008-08-16 01:15:12.000000000 -0700 | ||
5 | @@ -105,6 +105,10 @@ | ||
6 | then | ||
7 | make all-gdb all-dejagnu all-ld || exit 1 | ||
8 | make install-gdb install-dejagnu install-ld || exit 1 | ||
9 | +elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ] | ||
10 | + then | ||
11 | + make all-gdb all-dejagnu all-ld || exit 1 | ||
12 | + make install-gdb install-dejagnu install-ld || exit 1 | ||
13 | elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then | ||
14 | make bootstrap || exit 1 | ||
15 | make install || exit 1 | ||
16 | Index: gcc-4.3.1/libjava/classpath/ltconfig | ||
17 | =================================================================== | ||
18 | --- gcc-4.3.1.orig/libjava/classpath/ltconfig 2007-06-03 16:18:43.000000000 -0700 | ||
19 | +++ gcc-4.3.1/libjava/classpath/ltconfig 2008-08-16 01:15:12.000000000 -0700 | ||
20 | @@ -603,7 +603,7 @@ | ||
21 | |||
22 | # Transform linux* to *-*-linux-gnu*, to support old configure scripts. | ||
23 | case $host_os in | ||
24 | -linux-gnu*) ;; | ||
25 | +linux-gnu*|linux-uclibc*) ;; | ||
26 | linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` | ||
27 | esac | ||
28 | |||
29 | @@ -1251,7 +1251,7 @@ | ||
30 | ;; | ||
31 | |||
32 | # This must be Linux ELF. | ||
33 | -linux-gnu*) | ||
34 | +linux*) | ||
35 | version_type=linux | ||
36 | need_lib_prefix=no | ||
37 | need_version=no | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/103-uclibc-conf-noupstream.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/103-uclibc-conf-noupstream.patch new file mode 100644 index 0000000000..09c9bbecfb --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/103-uclibc-conf-noupstream.patch | |||
@@ -0,0 +1,11 @@ | |||
1 | --- gcc/gcc/config.gcc.uclibc100-sh~ 2006-03-06 20:46:56 +0100 | ||
2 | +++ gcc/gcc/config.gcc 2006-03-10 15:02:41 +0100 | ||
3 | @@ -1905,7 +1905,7 @@ | ||
4 | ;; | ||
5 | sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \ | ||
6 | sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \ | ||
7 | - sh-*-linux* | sh[346lbe]*-*-linux* | \ | ||
8 | + sh*-*-linux* | sh[346lbe]*-*-linux* | \ | ||
9 | sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \ | ||
10 | sh64-*-netbsd* | sh64l*-*-netbsd*) | ||
11 | tmake_file="${tmake_file} sh/t-sh sh/t-elf" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/110-arm-eabi.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/110-arm-eabi.patch new file mode 100644 index 0000000000..acebe5308f --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/110-arm-eabi.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | --- gcc-2005q3-1.orig/gcc/config.gcc 2005-10-31 19:02:54.000000000 +0300 | ||
2 | +++ gcc-2005q3-1/gcc/config.gcc 2006-01-27 01:09:09.000000000 +0300 | ||
3 | @@ -674,7 +674,7 @@ | ||
4 | tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" | ||
5 | tmake_file="t-slibgcc-elf-ver t-linux arm/t-arm" | ||
6 | case ${target} in | ||
7 | - arm*-*-linux-gnueabi) | ||
8 | + arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi) | ||
9 | tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h" | ||
10 | tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi" | ||
11 | # The BPABI long long divmod functions return a 128-bit value in | ||
12 | |||
13 | diff -urN gcc-2005q3-2/gcc/config/arm/linux-eabi.h gcc-2005q3-2.new/gcc/config/arm/linux-eabi.h | ||
14 | --- gcc-2005q3-2/gcc/config/arm/linux-eabi.h 2005-12-07 23:14:16.000000000 +0300 | ||
15 | +++ gcc-2005q3-2.new/gcc/config/arm/linux-eabi.h 2006-03-29 19:02:34.000000000 +0400 | ||
16 | @@ -53,7 +53,11 @@ | ||
17 | /* Use ld-linux.so.3 so that it will be possible to run "classic" | ||
18 | GNU/Linux binaries on an EABI system. */ | ||
19 | #undef LINUX_TARGET_INTERPRETER | ||
20 | +#ifdef USE_UCLIBC | ||
21 | +#define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0" | ||
22 | +#else | ||
23 | #define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.3" | ||
24 | +#endif | ||
25 | |||
26 | /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to | ||
27 | use the GNU/Linux version, not the generic BPABI version. */ | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/200-uclibc-locale.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/200-uclibc-locale.patch new file mode 100644 index 0000000000..70ba98eed7 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/200-uclibc-locale.patch | |||
@@ -0,0 +1,2833 @@ | |||
1 | Index: gcc-4.3.2/libstdc++-v3/acinclude.m4 | ||
2 | =================================================================== | ||
3 | --- gcc-4.3.2.orig/libstdc++-v3/acinclude.m4 2008-04-25 09:52:57.000000000 -0700 | ||
4 | +++ gcc-4.3.2/libstdc++-v3/acinclude.m4 2008-08-28 17:55:56.000000000 -0700 | ||
5 | @@ -1349,7 +1349,7 @@ | ||
6 | AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [ | ||
7 | GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@], | ||
8 | [use MODEL for target locale package], | ||
9 | - [permit generic|gnu|ieee_1003.1-2001|yes|no|auto]) | ||
10 | + [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto]) | ||
11 | |||
12 | # Deal with gettext issues. Default to not using it (=no) until we detect | ||
13 | # support for it later. Let the user turn it off via --e/d, but let that | ||
14 | @@ -1370,6 +1370,9 @@ | ||
15 | # Default to "generic". | ||
16 | if test $enable_clocale_flag = auto; then | ||
17 | case ${target_os} in | ||
18 | + *-uclibc*) | ||
19 | + enable_clocale_flag=uclibc | ||
20 | + ;; | ||
21 | linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) | ||
22 | enable_clocale_flag=gnu | ||
23 | ;; | ||
24 | @@ -1541,6 +1544,40 @@ | ||
25 | CTIME_CC=config/locale/generic/time_members.cc | ||
26 | CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h | ||
27 | ;; | ||
28 | + uclibc) | ||
29 | + AC_MSG_RESULT(uclibc) | ||
30 | + | ||
31 | + # Declare intention to use gettext, and add support for specific | ||
32 | + # languages. | ||
33 | + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT | ||
34 | + ALL_LINGUAS="de fr" | ||
35 | + | ||
36 | + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. | ||
37 | + AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no) | ||
38 | + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then | ||
39 | + USE_NLS=yes | ||
40 | + fi | ||
41 | + # Export the build objects. | ||
42 | + for ling in $ALL_LINGUAS; do \ | ||
43 | + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ | ||
44 | + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ | ||
45 | + done | ||
46 | + AC_SUBST(glibcxx_MOFILES) | ||
47 | + AC_SUBST(glibcxx_POFILES) | ||
48 | + | ||
49 | + CLOCALE_H=config/locale/uclibc/c_locale.h | ||
50 | + CLOCALE_CC=config/locale/uclibc/c_locale.cc | ||
51 | + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc | ||
52 | + CCOLLATE_CC=config/locale/uclibc/collate_members.cc | ||
53 | + CCTYPE_CC=config/locale/uclibc/ctype_members.cc | ||
54 | + CMESSAGES_H=config/locale/uclibc/messages_members.h | ||
55 | + CMESSAGES_CC=config/locale/uclibc/messages_members.cc | ||
56 | + CMONEY_CC=config/locale/uclibc/monetary_members.cc | ||
57 | + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc | ||
58 | + CTIME_H=config/locale/uclibc/time_members.h | ||
59 | + CTIME_CC=config/locale/uclibc/time_members.cc | ||
60 | + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h | ||
61 | + ;; | ||
62 | esac | ||
63 | |||
64 | # This is where the testsuite looks for locale catalogs, using the | ||
65 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h | ||
66 | =================================================================== | ||
67 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
68 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-08-28 17:55:56.000000000 -0700 | ||
69 | @@ -0,0 +1,63 @@ | ||
70 | +// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*- | ||
71 | + | ||
72 | +// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. | ||
73 | +// | ||
74 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
75 | +// software; you can redistribute it and/or modify it under the | ||
76 | +// terms of the GNU General Public License as published by the | ||
77 | +// Free Software Foundation; either version 2, or (at your option) | ||
78 | +// any later version. | ||
79 | + | ||
80 | +// This library is distributed in the hope that it will be useful, | ||
81 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
82 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
83 | +// GNU General Public License for more details. | ||
84 | + | ||
85 | +// You should have received a copy of the GNU General Public License along | ||
86 | +// with this library; see the file COPYING. If not, write to the Free | ||
87 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
88 | +// USA. | ||
89 | + | ||
90 | +// As a special exception, you may use this file as part of a free software | ||
91 | +// library without restriction. Specifically, if other files instantiate | ||
92 | +// templates or use macros or inline functions from this file, or you compile | ||
93 | +// this file and link it with other files to produce an executable, this | ||
94 | +// file does not by itself cause the resulting executable to be covered by | ||
95 | +// the GNU General Public License. This exception does not however | ||
96 | +// invalidate any other reasons why the executable file might be covered by | ||
97 | +// the GNU General Public License. | ||
98 | + | ||
99 | +// Written by Jakub Jelinek <jakub@redhat.com> | ||
100 | + | ||
101 | +#include <bits/c++config.h> | ||
102 | +#include <clocale> | ||
103 | + | ||
104 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
105 | +#warning clean this up | ||
106 | +#endif | ||
107 | + | ||
108 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
109 | + | ||
110 | +extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l; | ||
111 | +extern "C" __typeof(strcoll_l) __strcoll_l; | ||
112 | +extern "C" __typeof(strftime_l) __strftime_l; | ||
113 | +extern "C" __typeof(strtod_l) __strtod_l; | ||
114 | +extern "C" __typeof(strtof_l) __strtof_l; | ||
115 | +extern "C" __typeof(strtold_l) __strtold_l; | ||
116 | +extern "C" __typeof(strxfrm_l) __strxfrm_l; | ||
117 | +extern "C" __typeof(newlocale) __newlocale; | ||
118 | +extern "C" __typeof(freelocale) __freelocale; | ||
119 | +extern "C" __typeof(duplocale) __duplocale; | ||
120 | +extern "C" __typeof(uselocale) __uselocale; | ||
121 | + | ||
122 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
123 | +extern "C" __typeof(iswctype_l) __iswctype_l; | ||
124 | +extern "C" __typeof(towlower_l) __towlower_l; | ||
125 | +extern "C" __typeof(towupper_l) __towupper_l; | ||
126 | +extern "C" __typeof(wcscoll_l) __wcscoll_l; | ||
127 | +extern "C" __typeof(wcsftime_l) __wcsftime_l; | ||
128 | +extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l; | ||
129 | +extern "C" __typeof(wctype_l) __wctype_l; | ||
130 | +#endif | ||
131 | + | ||
132 | +#endif // GLIBC 2.3 and later | ||
133 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc | ||
134 | =================================================================== | ||
135 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
136 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-08-28 17:55:56.000000000 -0700 | ||
137 | @@ -0,0 +1,160 @@ | ||
138 | +// Wrapper for underlying C-language localization -*- C++ -*- | ||
139 | + | ||
140 | +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. | ||
141 | +// | ||
142 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
143 | +// software; you can redistribute it and/or modify it under the | ||
144 | +// terms of the GNU General Public License as published by the | ||
145 | +// Free Software Foundation; either version 2, or (at your option) | ||
146 | +// any later version. | ||
147 | + | ||
148 | +// This library is distributed in the hope that it will be useful, | ||
149 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
150 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
151 | +// GNU General Public License for more details. | ||
152 | + | ||
153 | +// You should have received a copy of the GNU General Public License along | ||
154 | +// with this library; see the file COPYING. If not, write to the Free | ||
155 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
156 | +// USA. | ||
157 | + | ||
158 | +// As a special exception, you may use this file as part of a free software | ||
159 | +// library without restriction. Specifically, if other files instantiate | ||
160 | +// templates or use macros or inline functions from this file, or you compile | ||
161 | +// this file and link it with other files to produce an executable, this | ||
162 | +// file does not by itself cause the resulting executable to be covered by | ||
163 | +// the GNU General Public License. This exception does not however | ||
164 | +// invalidate any other reasons why the executable file might be covered by | ||
165 | +// the GNU General Public License. | ||
166 | + | ||
167 | +// | ||
168 | +// ISO C++ 14882: 22.8 Standard locale categories. | ||
169 | +// | ||
170 | + | ||
171 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
172 | + | ||
173 | +#include <cerrno> // For errno | ||
174 | +#include <locale> | ||
175 | +#include <stdexcept> | ||
176 | +#include <langinfo.h> | ||
177 | +#include <bits/c++locale_internal.h> | ||
178 | + | ||
179 | +#ifndef __UCLIBC_HAS_XLOCALE__ | ||
180 | +#define __strtol_l(S, E, B, L) strtol((S), (E), (B)) | ||
181 | +#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B)) | ||
182 | +#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B)) | ||
183 | +#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B)) | ||
184 | +#define __strtof_l(S, E, L) strtof((S), (E)) | ||
185 | +#define __strtod_l(S, E, L) strtod((S), (E)) | ||
186 | +#define __strtold_l(S, E, L) strtold((S), (E)) | ||
187 | +#warning should dummy __newlocale check for C|POSIX ? | ||
188 | +#define __newlocale(a, b, c) NULL | ||
189 | +#define __freelocale(a) ((void)0) | ||
190 | +#define __duplocale(a) __c_locale() | ||
191 | +#endif | ||
192 | + | ||
193 | +namespace std | ||
194 | +{ | ||
195 | + template<> | ||
196 | + void | ||
197 | + __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, | ||
198 | + const __c_locale& __cloc) | ||
199 | + { | ||
200 | + if (!(__err & ios_base::failbit)) | ||
201 | + { | ||
202 | + char* __sanity; | ||
203 | + errno = 0; | ||
204 | + float __f = __strtof_l(__s, &__sanity, __cloc); | ||
205 | + if (__sanity != __s && errno != ERANGE) | ||
206 | + __v = __f; | ||
207 | + else | ||
208 | + __err |= ios_base::failbit; | ||
209 | + } | ||
210 | + } | ||
211 | + | ||
212 | + template<> | ||
213 | + void | ||
214 | + __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, | ||
215 | + const __c_locale& __cloc) | ||
216 | + { | ||
217 | + if (!(__err & ios_base::failbit)) | ||
218 | + { | ||
219 | + char* __sanity; | ||
220 | + errno = 0; | ||
221 | + double __d = __strtod_l(__s, &__sanity, __cloc); | ||
222 | + if (__sanity != __s && errno != ERANGE) | ||
223 | + __v = __d; | ||
224 | + else | ||
225 | + __err |= ios_base::failbit; | ||
226 | + } | ||
227 | + } | ||
228 | + | ||
229 | + template<> | ||
230 | + void | ||
231 | + __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err, | ||
232 | + const __c_locale& __cloc) | ||
233 | + { | ||
234 | + if (!(__err & ios_base::failbit)) | ||
235 | + { | ||
236 | + char* __sanity; | ||
237 | + errno = 0; | ||
238 | + long double __ld = __strtold_l(__s, &__sanity, __cloc); | ||
239 | + if (__sanity != __s && errno != ERANGE) | ||
240 | + __v = __ld; | ||
241 | + else | ||
242 | + __err |= ios_base::failbit; | ||
243 | + } | ||
244 | + } | ||
245 | + | ||
246 | + void | ||
247 | + locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, | ||
248 | + __c_locale __old) | ||
249 | + { | ||
250 | + __cloc = __newlocale(1 << LC_ALL, __s, __old); | ||
251 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
252 | + if (!__cloc) | ||
253 | + { | ||
254 | + // This named locale is not supported by the underlying OS. | ||
255 | + __throw_runtime_error(__N("locale::facet::_S_create_c_locale " | ||
256 | + "name not valid")); | ||
257 | + } | ||
258 | +#endif | ||
259 | + } | ||
260 | + | ||
261 | + void | ||
262 | + locale::facet::_S_destroy_c_locale(__c_locale& __cloc) | ||
263 | + { | ||
264 | + if (_S_get_c_locale() != __cloc) | ||
265 | + __freelocale(__cloc); | ||
266 | + } | ||
267 | + | ||
268 | + __c_locale | ||
269 | + locale::facet::_S_clone_c_locale(__c_locale& __cloc) | ||
270 | + { return __duplocale(__cloc); } | ||
271 | +} // namespace std | ||
272 | + | ||
273 | +namespace __gnu_cxx | ||
274 | +{ | ||
275 | + const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] = | ||
276 | + { | ||
277 | + "LC_CTYPE", | ||
278 | + "LC_NUMERIC", | ||
279 | + "LC_TIME", | ||
280 | + "LC_COLLATE", | ||
281 | + "LC_MONETARY", | ||
282 | + "LC_MESSAGES", | ||
283 | +#if _GLIBCXX_NUM_CATEGORIES != 0 | ||
284 | + "LC_PAPER", | ||
285 | + "LC_NAME", | ||
286 | + "LC_ADDRESS", | ||
287 | + "LC_TELEPHONE", | ||
288 | + "LC_MEASUREMENT", | ||
289 | + "LC_IDENTIFICATION" | ||
290 | +#endif | ||
291 | + }; | ||
292 | +} | ||
293 | + | ||
294 | +namespace std | ||
295 | +{ | ||
296 | + const char* const* const locale::_S_categories = __gnu_cxx::category_names; | ||
297 | +} // namespace std | ||
298 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h | ||
299 | =================================================================== | ||
300 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
301 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-08-28 17:55:56.000000000 -0700 | ||
302 | @@ -0,0 +1,117 @@ | ||
303 | +// Wrapper for underlying C-language localization -*- C++ -*- | ||
304 | + | ||
305 | +// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. | ||
306 | +// | ||
307 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
308 | +// software; you can redistribute it and/or modify it under the | ||
309 | +// terms of the GNU General Public License as published by the | ||
310 | +// Free Software Foundation; either version 2, or (at your option) | ||
311 | +// any later version. | ||
312 | + | ||
313 | +// This library is distributed in the hope that it will be useful, | ||
314 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
315 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
316 | +// GNU General Public License for more details. | ||
317 | + | ||
318 | +// You should have received a copy of the GNU General Public License along | ||
319 | +// with this library; see the file COPYING. If not, write to the Free | ||
320 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
321 | +// USA. | ||
322 | + | ||
323 | +// As a special exception, you may use this file as part of a free software | ||
324 | +// library without restriction. Specifically, if other files instantiate | ||
325 | +// templates or use macros or inline functions from this file, or you compile | ||
326 | +// this file and link it with other files to produce an executable, this | ||
327 | +// file does not by itself cause the resulting executable to be covered by | ||
328 | +// the GNU General Public License. This exception does not however | ||
329 | +// invalidate any other reasons why the executable file might be covered by | ||
330 | +// the GNU General Public License. | ||
331 | + | ||
332 | +// | ||
333 | +// ISO C++ 14882: 22.8 Standard locale categories. | ||
334 | +// | ||
335 | + | ||
336 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
337 | + | ||
338 | +#ifndef _C_LOCALE_H | ||
339 | +#define _C_LOCALE_H 1 | ||
340 | + | ||
341 | +#pragma GCC system_header | ||
342 | + | ||
343 | +#include <cstring> // get std::strlen | ||
344 | +#include <cstdio> // get std::snprintf or std::sprintf | ||
345 | +#include <clocale> | ||
346 | +#include <langinfo.h> // For codecvt | ||
347 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
348 | +#warning fix this | ||
349 | +#endif | ||
350 | +#ifdef __UCLIBC_HAS_LOCALE__ | ||
351 | +#include <iconv.h> // For codecvt using iconv, iconv_t | ||
352 | +#endif | ||
353 | +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ | ||
354 | +#include <libintl.h> // For messages | ||
355 | +#endif | ||
356 | + | ||
357 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
358 | +#warning what is _GLIBCXX_C_LOCALE_GNU for | ||
359 | +#endif | ||
360 | +#define _GLIBCXX_C_LOCALE_GNU 1 | ||
361 | + | ||
362 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
363 | +#warning fix categories | ||
364 | +#endif | ||
365 | +// #define _GLIBCXX_NUM_CATEGORIES 6 | ||
366 | +#define _GLIBCXX_NUM_CATEGORIES 0 | ||
367 | + | ||
368 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
369 | +namespace __gnu_cxx | ||
370 | +{ | ||
371 | + extern "C" __typeof(uselocale) __uselocale; | ||
372 | +} | ||
373 | +#endif | ||
374 | + | ||
375 | +namespace std | ||
376 | +{ | ||
377 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
378 | + typedef __locale_t __c_locale; | ||
379 | +#else | ||
380 | + typedef int* __c_locale; | ||
381 | +#endif | ||
382 | + | ||
383 | + // Convert numeric value of type _Tv to string and return length of | ||
384 | + // string. If snprintf is available use it, otherwise fall back to | ||
385 | + // the unsafe sprintf which, in general, can be dangerous and should | ||
386 | + // be avoided. | ||
387 | + template<typename _Tv> | ||
388 | + int | ||
389 | + __convert_from_v(char* __out, | ||
390 | + const int __size __attribute__ ((__unused__)), | ||
391 | + const char* __fmt, | ||
392 | +#ifdef __UCLIBC_HAS_XCLOCALE__ | ||
393 | + _Tv __v, const __c_locale& __cloc, int __prec) | ||
394 | + { | ||
395 | + __c_locale __old = __gnu_cxx::__uselocale(__cloc); | ||
396 | +#else | ||
397 | + _Tv __v, const __c_locale&, int __prec) | ||
398 | + { | ||
399 | +# ifdef __UCLIBC_HAS_LOCALE__ | ||
400 | + char* __old = std::setlocale(LC_ALL, NULL); | ||
401 | + char* __sav = new char[std::strlen(__old) + 1]; | ||
402 | + std::strcpy(__sav, __old); | ||
403 | + std::setlocale(LC_ALL, "C"); | ||
404 | +# endif | ||
405 | +#endif | ||
406 | + | ||
407 | + const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); | ||
408 | + | ||
409 | +#ifdef __UCLIBC_HAS_XCLOCALE__ | ||
410 | + __gnu_cxx::__uselocale(__old); | ||
411 | +#elif defined __UCLIBC_HAS_LOCALE__ | ||
412 | + std::setlocale(LC_ALL, __sav); | ||
413 | + delete [] __sav; | ||
414 | +#endif | ||
415 | + return __ret; | ||
416 | + } | ||
417 | +} | ||
418 | + | ||
419 | +#endif | ||
420 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc | ||
421 | =================================================================== | ||
422 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
423 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2008-08-28 17:55:56.000000000 -0700 | ||
424 | @@ -0,0 +1,308 @@ | ||
425 | +// std::codecvt implementation details, GNU version -*- C++ -*- | ||
426 | + | ||
427 | +// Copyright (C) 2002, 2003 Free Software Foundation, Inc. | ||
428 | +// | ||
429 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
430 | +// software; you can redistribute it and/or modify it under the | ||
431 | +// terms of the GNU General Public License as published by the | ||
432 | +// Free Software Foundation; either version 2, or (at your option) | ||
433 | +// any later version. | ||
434 | + | ||
435 | +// This library is distributed in the hope that it will be useful, | ||
436 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
437 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
438 | +// GNU General Public License for more details. | ||
439 | + | ||
440 | +// You should have received a copy of the GNU General Public License along | ||
441 | +// with this library; see the file COPYING. If not, write to the Free | ||
442 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
443 | +// USA. | ||
444 | + | ||
445 | +// As a special exception, you may use this file as part of a free software | ||
446 | +// library without restriction. Specifically, if other files instantiate | ||
447 | +// templates or use macros or inline functions from this file, or you compile | ||
448 | +// this file and link it with other files to produce an executable, this | ||
449 | +// file does not by itself cause the resulting executable to be covered by | ||
450 | +// the GNU General Public License. This exception does not however | ||
451 | +// invalidate any other reasons why the executable file might be covered by | ||
452 | +// the GNU General Public License. | ||
453 | + | ||
454 | +// | ||
455 | +// ISO C++ 14882: 22.2.1.5 - Template class codecvt | ||
456 | +// | ||
457 | + | ||
458 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
459 | + | ||
460 | +#include <locale> | ||
461 | +#include <cstdlib> // For MB_CUR_MAX | ||
462 | +#include <climits> // For MB_LEN_MAX | ||
463 | +#include <bits/c++locale_internal.h> | ||
464 | + | ||
465 | +namespace std | ||
466 | +{ | ||
467 | + // Specializations. | ||
468 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
469 | + codecvt_base::result | ||
470 | + codecvt<wchar_t, char, mbstate_t>:: | ||
471 | + do_out(state_type& __state, const intern_type* __from, | ||
472 | + const intern_type* __from_end, const intern_type*& __from_next, | ||
473 | + extern_type* __to, extern_type* __to_end, | ||
474 | + extern_type*& __to_next) const | ||
475 | + { | ||
476 | + result __ret = ok; | ||
477 | + state_type __tmp_state(__state); | ||
478 | + | ||
479 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
480 | + __c_locale __old = __uselocale(_M_c_locale_codecvt); | ||
481 | +#endif | ||
482 | + | ||
483 | + // wcsnrtombs is *very* fast but stops if encounters NUL characters: | ||
484 | + // in case we fall back to wcrtomb and then continue, in a loop. | ||
485 | + // NB: wcsnrtombs is a GNU extension | ||
486 | + for (__from_next = __from, __to_next = __to; | ||
487 | + __from_next < __from_end && __to_next < __to_end | ||
488 | + && __ret == ok;) | ||
489 | + { | ||
490 | + const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0', | ||
491 | + __from_end - __from_next); | ||
492 | + if (!__from_chunk_end) | ||
493 | + __from_chunk_end = __from_end; | ||
494 | + | ||
495 | + __from = __from_next; | ||
496 | + const size_t __conv = wcsnrtombs(__to_next, &__from_next, | ||
497 | + __from_chunk_end - __from_next, | ||
498 | + __to_end - __to_next, &__state); | ||
499 | + if (__conv == static_cast<size_t>(-1)) | ||
500 | + { | ||
501 | + // In case of error, in order to stop at the exact place we | ||
502 | + // have to start again from the beginning with a series of | ||
503 | + // wcrtomb. | ||
504 | + for (; __from < __from_next; ++__from) | ||
505 | + __to_next += wcrtomb(__to_next, *__from, &__tmp_state); | ||
506 | + __state = __tmp_state; | ||
507 | + __ret = error; | ||
508 | + } | ||
509 | + else if (__from_next && __from_next < __from_chunk_end) | ||
510 | + { | ||
511 | + __to_next += __conv; | ||
512 | + __ret = partial; | ||
513 | + } | ||
514 | + else | ||
515 | + { | ||
516 | + __from_next = __from_chunk_end; | ||
517 | + __to_next += __conv; | ||
518 | + } | ||
519 | + | ||
520 | + if (__from_next < __from_end && __ret == ok) | ||
521 | + { | ||
522 | + extern_type __buf[MB_LEN_MAX]; | ||
523 | + __tmp_state = __state; | ||
524 | + const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state); | ||
525 | + if (__conv > static_cast<size_t>(__to_end - __to_next)) | ||
526 | + __ret = partial; | ||
527 | + else | ||
528 | + { | ||
529 | + memcpy(__to_next, __buf, __conv); | ||
530 | + __state = __tmp_state; | ||
531 | + __to_next += __conv; | ||
532 | + ++__from_next; | ||
533 | + } | ||
534 | + } | ||
535 | + } | ||
536 | + | ||
537 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
538 | + __uselocale(__old); | ||
539 | +#endif | ||
540 | + | ||
541 | + return __ret; | ||
542 | + } | ||
543 | + | ||
544 | + codecvt_base::result | ||
545 | + codecvt<wchar_t, char, mbstate_t>:: | ||
546 | + do_in(state_type& __state, const extern_type* __from, | ||
547 | + const extern_type* __from_end, const extern_type*& __from_next, | ||
548 | + intern_type* __to, intern_type* __to_end, | ||
549 | + intern_type*& __to_next) const | ||
550 | + { | ||
551 | + result __ret = ok; | ||
552 | + state_type __tmp_state(__state); | ||
553 | + | ||
554 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
555 | + __c_locale __old = __uselocale(_M_c_locale_codecvt); | ||
556 | +#endif | ||
557 | + | ||
558 | + // mbsnrtowcs is *very* fast but stops if encounters NUL characters: | ||
559 | + // in case we store a L'\0' and then continue, in a loop. | ||
560 | + // NB: mbsnrtowcs is a GNU extension | ||
561 | + for (__from_next = __from, __to_next = __to; | ||
562 | + __from_next < __from_end && __to_next < __to_end | ||
563 | + && __ret == ok;) | ||
564 | + { | ||
565 | + const extern_type* __from_chunk_end; | ||
566 | + __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0', | ||
567 | + __from_end | ||
568 | + - __from_next)); | ||
569 | + if (!__from_chunk_end) | ||
570 | + __from_chunk_end = __from_end; | ||
571 | + | ||
572 | + __from = __from_next; | ||
573 | + size_t __conv = mbsnrtowcs(__to_next, &__from_next, | ||
574 | + __from_chunk_end - __from_next, | ||
575 | + __to_end - __to_next, &__state); | ||
576 | + if (__conv == static_cast<size_t>(-1)) | ||
577 | + { | ||
578 | + // In case of error, in order to stop at the exact place we | ||
579 | + // have to start again from the beginning with a series of | ||
580 | + // mbrtowc. | ||
581 | + for (;; ++__to_next, __from += __conv) | ||
582 | + { | ||
583 | + __conv = mbrtowc(__to_next, __from, __from_end - __from, | ||
584 | + &__tmp_state); | ||
585 | + if (__conv == static_cast<size_t>(-1) | ||
586 | + || __conv == static_cast<size_t>(-2)) | ||
587 | + break; | ||
588 | + } | ||
589 | + __from_next = __from; | ||
590 | + __state = __tmp_state; | ||
591 | + __ret = error; | ||
592 | + } | ||
593 | + else if (__from_next && __from_next < __from_chunk_end) | ||
594 | + { | ||
595 | + // It is unclear what to return in this case (see DR 382). | ||
596 | + __to_next += __conv; | ||
597 | + __ret = partial; | ||
598 | + } | ||
599 | + else | ||
600 | + { | ||
601 | + __from_next = __from_chunk_end; | ||
602 | + __to_next += __conv; | ||
603 | + } | ||
604 | + | ||
605 | + if (__from_next < __from_end && __ret == ok) | ||
606 | + { | ||
607 | + if (__to_next < __to_end) | ||
608 | + { | ||
609 | + // XXX Probably wrong for stateful encodings | ||
610 | + __tmp_state = __state; | ||
611 | + ++__from_next; | ||
612 | + *__to_next++ = L'\0'; | ||
613 | + } | ||
614 | + else | ||
615 | + __ret = partial; | ||
616 | + } | ||
617 | + } | ||
618 | + | ||
619 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
620 | + __uselocale(__old); | ||
621 | +#endif | ||
622 | + | ||
623 | + return __ret; | ||
624 | + } | ||
625 | + | ||
626 | + int | ||
627 | + codecvt<wchar_t, char, mbstate_t>:: | ||
628 | + do_encoding() const throw() | ||
629 | + { | ||
630 | + // XXX This implementation assumes that the encoding is | ||
631 | + // stateless and is either single-byte or variable-width. | ||
632 | + int __ret = 0; | ||
633 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
634 | + __c_locale __old = __uselocale(_M_c_locale_codecvt); | ||
635 | +#endif | ||
636 | + if (MB_CUR_MAX == 1) | ||
637 | + __ret = 1; | ||
638 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
639 | + __uselocale(__old); | ||
640 | +#endif | ||
641 | + return __ret; | ||
642 | + } | ||
643 | + | ||
644 | + int | ||
645 | + codecvt<wchar_t, char, mbstate_t>:: | ||
646 | + do_max_length() const throw() | ||
647 | + { | ||
648 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
649 | + __c_locale __old = __uselocale(_M_c_locale_codecvt); | ||
650 | +#endif | ||
651 | + // XXX Probably wrong for stateful encodings. | ||
652 | + int __ret = MB_CUR_MAX; | ||
653 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
654 | + __uselocale(__old); | ||
655 | +#endif | ||
656 | + return __ret; | ||
657 | + } | ||
658 | + | ||
659 | + int | ||
660 | + codecvt<wchar_t, char, mbstate_t>:: | ||
661 | + do_length(state_type& __state, const extern_type* __from, | ||
662 | + const extern_type* __end, size_t __max) const | ||
663 | + { | ||
664 | + int __ret = 0; | ||
665 | + state_type __tmp_state(__state); | ||
666 | + | ||
667 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
668 | + __c_locale __old = __uselocale(_M_c_locale_codecvt); | ||
669 | +#endif | ||
670 | + | ||
671 | + // mbsnrtowcs is *very* fast but stops if encounters NUL characters: | ||
672 | + // in case we advance past it and then continue, in a loop. | ||
673 | + // NB: mbsnrtowcs is a GNU extension | ||
674 | + | ||
675 | + // A dummy internal buffer is needed in order for mbsnrtocws to consider | ||
676 | + // its fourth parameter (it wouldn't with NULL as first parameter). | ||
677 | + wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) | ||
678 | + * __max)); | ||
679 | + while (__from < __end && __max) | ||
680 | + { | ||
681 | + const extern_type* __from_chunk_end; | ||
682 | + __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0', | ||
683 | + __end | ||
684 | + - __from)); | ||
685 | + if (!__from_chunk_end) | ||
686 | + __from_chunk_end = __end; | ||
687 | + | ||
688 | + const extern_type* __tmp_from = __from; | ||
689 | + size_t __conv = mbsnrtowcs(__to, &__from, | ||
690 | + __from_chunk_end - __from, | ||
691 | + __max, &__state); | ||
692 | + if (__conv == static_cast<size_t>(-1)) | ||
693 | + { | ||
694 | + // In case of error, in order to stop at the exact place we | ||
695 | + // have to start again from the beginning with a series of | ||
696 | + // mbrtowc. | ||
697 | + for (__from = __tmp_from;; __from += __conv) | ||
698 | + { | ||
699 | + __conv = mbrtowc(NULL, __from, __end - __from, | ||
700 | + &__tmp_state); | ||
701 | + if (__conv == static_cast<size_t>(-1) | ||
702 | + || __conv == static_cast<size_t>(-2)) | ||
703 | + break; | ||
704 | + } | ||
705 | + __state = __tmp_state; | ||
706 | + __ret += __from - __tmp_from; | ||
707 | + break; | ||
708 | + } | ||
709 | + if (!__from) | ||
710 | + __from = __from_chunk_end; | ||
711 | + | ||
712 | + __ret += __from - __tmp_from; | ||
713 | + __max -= __conv; | ||
714 | + | ||
715 | + if (__from < __end && __max) | ||
716 | + { | ||
717 | + // XXX Probably wrong for stateful encodings | ||
718 | + __tmp_state = __state; | ||
719 | + ++__from; | ||
720 | + ++__ret; | ||
721 | + --__max; | ||
722 | + } | ||
723 | + } | ||
724 | + | ||
725 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
726 | + __uselocale(__old); | ||
727 | +#endif | ||
728 | + | ||
729 | + return __ret; | ||
730 | + } | ||
731 | +#endif | ||
732 | +} | ||
733 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/collate_members.cc | ||
734 | =================================================================== | ||
735 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
736 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-08-28 17:55:56.000000000 -0700 | ||
737 | @@ -0,0 +1,80 @@ | ||
738 | +// std::collate implementation details, GNU version -*- C++ -*- | ||
739 | + | ||
740 | +// Copyright (C) 2001, 2002 Free Software Foundation, Inc. | ||
741 | +// | ||
742 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
743 | +// software; you can redistribute it and/or modify it under the | ||
744 | +// terms of the GNU General Public License as published by the | ||
745 | +// Free Software Foundation; either version 2, or (at your option) | ||
746 | +// any later version. | ||
747 | + | ||
748 | +// This library is distributed in the hope that it will be useful, | ||
749 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
750 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
751 | +// GNU General Public License for more details. | ||
752 | + | ||
753 | +// You should have received a copy of the GNU General Public License along | ||
754 | +// with this library; see the file COPYING. If not, write to the Free | ||
755 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
756 | +// USA. | ||
757 | + | ||
758 | +// As a special exception, you may use this file as part of a free software | ||
759 | +// library without restriction. Specifically, if other files instantiate | ||
760 | +// templates or use macros or inline functions from this file, or you compile | ||
761 | +// this file and link it with other files to produce an executable, this | ||
762 | +// file does not by itself cause the resulting executable to be covered by | ||
763 | +// the GNU General Public License. This exception does not however | ||
764 | +// invalidate any other reasons why the executable file might be covered by | ||
765 | +// the GNU General Public License. | ||
766 | + | ||
767 | +// | ||
768 | +// ISO C++ 14882: 22.2.4.1.2 collate virtual functions | ||
769 | +// | ||
770 | + | ||
771 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
772 | + | ||
773 | +#include <locale> | ||
774 | +#include <bits/c++locale_internal.h> | ||
775 | + | ||
776 | +#ifndef __UCLIBC_HAS_XLOCALE__ | ||
777 | +#define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) | ||
778 | +#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) | ||
779 | +#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) | ||
780 | +#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) | ||
781 | +#endif | ||
782 | + | ||
783 | +namespace std | ||
784 | +{ | ||
785 | + // These are basically extensions to char_traits, and perhaps should | ||
786 | + // be put there instead of here. | ||
787 | + template<> | ||
788 | + int | ||
789 | + collate<char>::_M_compare(const char* __one, const char* __two) const | ||
790 | + { | ||
791 | + int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate); | ||
792 | + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); | ||
793 | + } | ||
794 | + | ||
795 | + template<> | ||
796 | + size_t | ||
797 | + collate<char>::_M_transform(char* __to, const char* __from, | ||
798 | + size_t __n) const | ||
799 | + { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); } | ||
800 | + | ||
801 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
802 | + template<> | ||
803 | + int | ||
804 | + collate<wchar_t>::_M_compare(const wchar_t* __one, | ||
805 | + const wchar_t* __two) const | ||
806 | + { | ||
807 | + int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate); | ||
808 | + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); | ||
809 | + } | ||
810 | + | ||
811 | + template<> | ||
812 | + size_t | ||
813 | + collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from, | ||
814 | + size_t __n) const | ||
815 | + { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); } | ||
816 | +#endif | ||
817 | +} | ||
818 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc | ||
819 | =================================================================== | ||
820 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
821 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-08-28 17:55:56.000000000 -0700 | ||
822 | @@ -0,0 +1,300 @@ | ||
823 | +// std::ctype implementation details, GNU version -*- C++ -*- | ||
824 | + | ||
825 | +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | ||
826 | +// | ||
827 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
828 | +// software; you can redistribute it and/or modify it under the | ||
829 | +// terms of the GNU General Public License as published by the | ||
830 | +// Free Software Foundation; either version 2, or (at your option) | ||
831 | +// any later version. | ||
832 | + | ||
833 | +// This library is distributed in the hope that it will be useful, | ||
834 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
835 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
836 | +// GNU General Public License for more details. | ||
837 | + | ||
838 | +// You should have received a copy of the GNU General Public License along | ||
839 | +// with this library; see the file COPYING. If not, write to the Free | ||
840 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
841 | +// USA. | ||
842 | + | ||
843 | +// As a special exception, you may use this file as part of a free software | ||
844 | +// library without restriction. Specifically, if other files instantiate | ||
845 | +// templates or use macros or inline functions from this file, or you compile | ||
846 | +// this file and link it with other files to produce an executable, this | ||
847 | +// file does not by itself cause the resulting executable to be covered by | ||
848 | +// the GNU General Public License. This exception does not however | ||
849 | +// invalidate any other reasons why the executable file might be covered by | ||
850 | +// the GNU General Public License. | ||
851 | + | ||
852 | +// | ||
853 | +// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions. | ||
854 | +// | ||
855 | + | ||
856 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
857 | + | ||
858 | +#define _LIBC | ||
859 | +#include <locale> | ||
860 | +#undef _LIBC | ||
861 | +#include <bits/c++locale_internal.h> | ||
862 | + | ||
863 | +#ifndef __UCLIBC_HAS_XLOCALE__ | ||
864 | +#define __wctype_l(S, L) wctype((S)) | ||
865 | +#define __towupper_l(C, L) towupper((C)) | ||
866 | +#define __towlower_l(C, L) towlower((C)) | ||
867 | +#define __iswctype_l(C, M, L) iswctype((C), (M)) | ||
868 | +#endif | ||
869 | + | ||
870 | +namespace std | ||
871 | +{ | ||
872 | + // NB: The other ctype<char> specializations are in src/locale.cc and | ||
873 | + // various /config/os/* files. | ||
874 | + template<> | ||
875 | + ctype_byname<char>::ctype_byname(const char* __s, size_t __refs) | ||
876 | + : ctype<char>(0, false, __refs) | ||
877 | + { | ||
878 | + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) | ||
879 | + { | ||
880 | + this->_S_destroy_c_locale(this->_M_c_locale_ctype); | ||
881 | + this->_S_create_c_locale(this->_M_c_locale_ctype, __s); | ||
882 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
883 | + this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper; | ||
884 | + this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower; | ||
885 | + this->_M_table = this->_M_c_locale_ctype->__ctype_b; | ||
886 | +#endif | ||
887 | + } | ||
888 | + } | ||
889 | + | ||
890 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
891 | + ctype<wchar_t>::__wmask_type | ||
892 | + ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const | ||
893 | + { | ||
894 | + __wmask_type __ret; | ||
895 | + switch (__m) | ||
896 | + { | ||
897 | + case space: | ||
898 | + __ret = __wctype_l("space", _M_c_locale_ctype); | ||
899 | + break; | ||
900 | + case print: | ||
901 | + __ret = __wctype_l("print", _M_c_locale_ctype); | ||
902 | + break; | ||
903 | + case cntrl: | ||
904 | + __ret = __wctype_l("cntrl", _M_c_locale_ctype); | ||
905 | + break; | ||
906 | + case upper: | ||
907 | + __ret = __wctype_l("upper", _M_c_locale_ctype); | ||
908 | + break; | ||
909 | + case lower: | ||
910 | + __ret = __wctype_l("lower", _M_c_locale_ctype); | ||
911 | + break; | ||
912 | + case alpha: | ||
913 | + __ret = __wctype_l("alpha", _M_c_locale_ctype); | ||
914 | + break; | ||
915 | + case digit: | ||
916 | + __ret = __wctype_l("digit", _M_c_locale_ctype); | ||
917 | + break; | ||
918 | + case punct: | ||
919 | + __ret = __wctype_l("punct", _M_c_locale_ctype); | ||
920 | + break; | ||
921 | + case xdigit: | ||
922 | + __ret = __wctype_l("xdigit", _M_c_locale_ctype); | ||
923 | + break; | ||
924 | + case alnum: | ||
925 | + __ret = __wctype_l("alnum", _M_c_locale_ctype); | ||
926 | + break; | ||
927 | + case graph: | ||
928 | + __ret = __wctype_l("graph", _M_c_locale_ctype); | ||
929 | + break; | ||
930 | + default: | ||
931 | + __ret = __wmask_type(); | ||
932 | + } | ||
933 | + return __ret; | ||
934 | + } | ||
935 | + | ||
936 | + wchar_t | ||
937 | + ctype<wchar_t>::do_toupper(wchar_t __c) const | ||
938 | + { return __towupper_l(__c, _M_c_locale_ctype); } | ||
939 | + | ||
940 | + const wchar_t* | ||
941 | + ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const | ||
942 | + { | ||
943 | + while (__lo < __hi) | ||
944 | + { | ||
945 | + *__lo = __towupper_l(*__lo, _M_c_locale_ctype); | ||
946 | + ++__lo; | ||
947 | + } | ||
948 | + return __hi; | ||
949 | + } | ||
950 | + | ||
951 | + wchar_t | ||
952 | + ctype<wchar_t>::do_tolower(wchar_t __c) const | ||
953 | + { return __towlower_l(__c, _M_c_locale_ctype); } | ||
954 | + | ||
955 | + const wchar_t* | ||
956 | + ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const | ||
957 | + { | ||
958 | + while (__lo < __hi) | ||
959 | + { | ||
960 | + *__lo = __towlower_l(*__lo, _M_c_locale_ctype); | ||
961 | + ++__lo; | ||
962 | + } | ||
963 | + return __hi; | ||
964 | + } | ||
965 | + | ||
966 | + bool | ||
967 | + ctype<wchar_t>:: | ||
968 | + do_is(mask __m, wchar_t __c) const | ||
969 | + { | ||
970 | + // Highest bitmask in ctype_base == 10, but extra in "C" | ||
971 | + // library for blank. | ||
972 | + bool __ret = false; | ||
973 | + const size_t __bitmasksize = 11; | ||
974 | + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) | ||
975 | + if (__m & _M_bit[__bitcur] | ||
976 | + && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) | ||
977 | + { | ||
978 | + __ret = true; | ||
979 | + break; | ||
980 | + } | ||
981 | + return __ret; | ||
982 | + } | ||
983 | + | ||
984 | + const wchar_t* | ||
985 | + ctype<wchar_t>:: | ||
986 | + do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const | ||
987 | + { | ||
988 | + for (; __lo < __hi; ++__vec, ++__lo) | ||
989 | + { | ||
990 | + // Highest bitmask in ctype_base == 10, but extra in "C" | ||
991 | + // library for blank. | ||
992 | + const size_t __bitmasksize = 11; | ||
993 | + mask __m = 0; | ||
994 | + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) | ||
995 | + if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype)) | ||
996 | + __m |= _M_bit[__bitcur]; | ||
997 | + *__vec = __m; | ||
998 | + } | ||
999 | + return __hi; | ||
1000 | + } | ||
1001 | + | ||
1002 | + const wchar_t* | ||
1003 | + ctype<wchar_t>:: | ||
1004 | + do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const | ||
1005 | + { | ||
1006 | + while (__lo < __hi && !this->do_is(__m, *__lo)) | ||
1007 | + ++__lo; | ||
1008 | + return __lo; | ||
1009 | + } | ||
1010 | + | ||
1011 | + const wchar_t* | ||
1012 | + ctype<wchar_t>:: | ||
1013 | + do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const | ||
1014 | + { | ||
1015 | + while (__lo < __hi && this->do_is(__m, *__lo) != 0) | ||
1016 | + ++__lo; | ||
1017 | + return __lo; | ||
1018 | + } | ||
1019 | + | ||
1020 | + wchar_t | ||
1021 | + ctype<wchar_t>:: | ||
1022 | + do_widen(char __c) const | ||
1023 | + { return _M_widen[static_cast<unsigned char>(__c)]; } | ||
1024 | + | ||
1025 | + const char* | ||
1026 | + ctype<wchar_t>:: | ||
1027 | + do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const | ||
1028 | + { | ||
1029 | + while (__lo < __hi) | ||
1030 | + { | ||
1031 | + *__dest = _M_widen[static_cast<unsigned char>(*__lo)]; | ||
1032 | + ++__lo; | ||
1033 | + ++__dest; | ||
1034 | + } | ||
1035 | + return __hi; | ||
1036 | + } | ||
1037 | + | ||
1038 | + char | ||
1039 | + ctype<wchar_t>:: | ||
1040 | + do_narrow(wchar_t __wc, char __dfault) const | ||
1041 | + { | ||
1042 | + if (__wc >= 0 && __wc < 128 && _M_narrow_ok) | ||
1043 | + return _M_narrow[__wc]; | ||
1044 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1045 | + __c_locale __old = __uselocale(_M_c_locale_ctype); | ||
1046 | +#endif | ||
1047 | + const int __c = wctob(__wc); | ||
1048 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1049 | + __uselocale(__old); | ||
1050 | +#endif | ||
1051 | + return (__c == EOF ? __dfault : static_cast<char>(__c)); | ||
1052 | + } | ||
1053 | + | ||
1054 | + const wchar_t* | ||
1055 | + ctype<wchar_t>:: | ||
1056 | + do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, | ||
1057 | + char* __dest) const | ||
1058 | + { | ||
1059 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1060 | + __c_locale __old = __uselocale(_M_c_locale_ctype); | ||
1061 | +#endif | ||
1062 | + if (_M_narrow_ok) | ||
1063 | + while (__lo < __hi) | ||
1064 | + { | ||
1065 | + if (*__lo >= 0 && *__lo < 128) | ||
1066 | + *__dest = _M_narrow[*__lo]; | ||
1067 | + else | ||
1068 | + { | ||
1069 | + const int __c = wctob(*__lo); | ||
1070 | + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c)); | ||
1071 | + } | ||
1072 | + ++__lo; | ||
1073 | + ++__dest; | ||
1074 | + } | ||
1075 | + else | ||
1076 | + while (__lo < __hi) | ||
1077 | + { | ||
1078 | + const int __c = wctob(*__lo); | ||
1079 | + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c)); | ||
1080 | + ++__lo; | ||
1081 | + ++__dest; | ||
1082 | + } | ||
1083 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1084 | + __uselocale(__old); | ||
1085 | +#endif | ||
1086 | + return __hi; | ||
1087 | + } | ||
1088 | + | ||
1089 | + void | ||
1090 | + ctype<wchar_t>::_M_initialize_ctype() | ||
1091 | + { | ||
1092 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1093 | + __c_locale __old = __uselocale(_M_c_locale_ctype); | ||
1094 | +#endif | ||
1095 | + wint_t __i; | ||
1096 | + for (__i = 0; __i < 128; ++__i) | ||
1097 | + { | ||
1098 | + const int __c = wctob(__i); | ||
1099 | + if (__c == EOF) | ||
1100 | + break; | ||
1101 | + else | ||
1102 | + _M_narrow[__i] = static_cast<char>(__c); | ||
1103 | + } | ||
1104 | + if (__i == 128) | ||
1105 | + _M_narrow_ok = true; | ||
1106 | + else | ||
1107 | + _M_narrow_ok = false; | ||
1108 | + for (size_t __j = 0; | ||
1109 | + __j < sizeof(_M_widen) / sizeof(wint_t); ++__j) | ||
1110 | + _M_widen[__j] = btowc(__j); | ||
1111 | + | ||
1112 | + for (size_t __k = 0; __k <= 11; ++__k) | ||
1113 | + { | ||
1114 | + _M_bit[__k] = static_cast<mask>(_ISbit(__k)); | ||
1115 | + _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]); | ||
1116 | + } | ||
1117 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1118 | + __uselocale(__old); | ||
1119 | +#endif | ||
1120 | + } | ||
1121 | +#endif // _GLIBCXX_USE_WCHAR_T | ||
1122 | +} | ||
1123 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/messages_members.cc | ||
1124 | =================================================================== | ||
1125 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
1126 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-08-28 17:55:56.000000000 -0700 | ||
1127 | @@ -0,0 +1,100 @@ | ||
1128 | +// std::messages implementation details, GNU version -*- C++ -*- | ||
1129 | + | ||
1130 | +// Copyright (C) 2001, 2002 Free Software Foundation, Inc. | ||
1131 | +// | ||
1132 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
1133 | +// software; you can redistribute it and/or modify it under the | ||
1134 | +// terms of the GNU General Public License as published by the | ||
1135 | +// Free Software Foundation; either version 2, or (at your option) | ||
1136 | +// any later version. | ||
1137 | + | ||
1138 | +// This library is distributed in the hope that it will be useful, | ||
1139 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1140 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1141 | +// GNU General Public License for more details. | ||
1142 | + | ||
1143 | +// You should have received a copy of the GNU General Public License along | ||
1144 | +// with this library; see the file COPYING. If not, write to the Free | ||
1145 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
1146 | +// USA. | ||
1147 | + | ||
1148 | +// As a special exception, you may use this file as part of a free software | ||
1149 | +// library without restriction. Specifically, if other files instantiate | ||
1150 | +// templates or use macros or inline functions from this file, or you compile | ||
1151 | +// this file and link it with other files to produce an executable, this | ||
1152 | +// file does not by itself cause the resulting executable to be covered by | ||
1153 | +// the GNU General Public License. This exception does not however | ||
1154 | +// invalidate any other reasons why the executable file might be covered by | ||
1155 | +// the GNU General Public License. | ||
1156 | + | ||
1157 | +// | ||
1158 | +// ISO C++ 14882: 22.2.7.1.2 messages virtual functions | ||
1159 | +// | ||
1160 | + | ||
1161 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
1162 | + | ||
1163 | +#include <locale> | ||
1164 | +#include <bits/c++locale_internal.h> | ||
1165 | + | ||
1166 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
1167 | +#warning fix gettext stuff | ||
1168 | +#endif | ||
1169 | +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ | ||
1170 | +extern "C" char *__dcgettext(const char *domainname, | ||
1171 | + const char *msgid, int category); | ||
1172 | +#undef gettext | ||
1173 | +#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES) | ||
1174 | +#else | ||
1175 | +#undef gettext | ||
1176 | +#define gettext(msgid) (msgid) | ||
1177 | +#endif | ||
1178 | + | ||
1179 | +namespace std | ||
1180 | +{ | ||
1181 | + // Specializations. | ||
1182 | + template<> | ||
1183 | + string | ||
1184 | + messages<char>::do_get(catalog, int, int, const string& __dfault) const | ||
1185 | + { | ||
1186 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1187 | + __c_locale __old = __uselocale(_M_c_locale_messages); | ||
1188 | + const char* __msg = const_cast<const char*>(gettext(__dfault.c_str())); | ||
1189 | + __uselocale(__old); | ||
1190 | + return string(__msg); | ||
1191 | +#elif defined __UCLIBC_HAS_LOCALE__ | ||
1192 | + char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
1193 | + setlocale(LC_ALL, _M_name_messages); | ||
1194 | + const char* __msg = gettext(__dfault.c_str()); | ||
1195 | + setlocale(LC_ALL, __old); | ||
1196 | + free(__old); | ||
1197 | + return string(__msg); | ||
1198 | +#else | ||
1199 | + const char* __msg = gettext(__dfault.c_str()); | ||
1200 | + return string(__msg); | ||
1201 | +#endif | ||
1202 | + } | ||
1203 | + | ||
1204 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
1205 | + template<> | ||
1206 | + wstring | ||
1207 | + messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const | ||
1208 | + { | ||
1209 | +# ifdef __UCLIBC_HAS_XLOCALE__ | ||
1210 | + __c_locale __old = __uselocale(_M_c_locale_messages); | ||
1211 | + char* __msg = gettext(_M_convert_to_char(__dfault)); | ||
1212 | + __uselocale(__old); | ||
1213 | + return _M_convert_from_char(__msg); | ||
1214 | +# elif defined __UCLIBC_HAS_LOCALE__ | ||
1215 | + char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
1216 | + setlocale(LC_ALL, _M_name_messages); | ||
1217 | + char* __msg = gettext(_M_convert_to_char(__dfault)); | ||
1218 | + setlocale(LC_ALL, __old); | ||
1219 | + free(__old); | ||
1220 | + return _M_convert_from_char(__msg); | ||
1221 | +# else | ||
1222 | + char* __msg = gettext(_M_convert_to_char(__dfault)); | ||
1223 | + return _M_convert_from_char(__msg); | ||
1224 | +# endif | ||
1225 | + } | ||
1226 | +#endif | ||
1227 | +} | ||
1228 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h | ||
1229 | =================================================================== | ||
1230 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
1231 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-08-28 17:55:56.000000000 -0700 | ||
1232 | @@ -0,0 +1,118 @@ | ||
1233 | +// std::messages implementation details, GNU version -*- C++ -*- | ||
1234 | + | ||
1235 | +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | ||
1236 | +// | ||
1237 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
1238 | +// software; you can redistribute it and/or modify it under the | ||
1239 | +// terms of the GNU General Public License as published by the | ||
1240 | +// Free Software Foundation; either version 2, or (at your option) | ||
1241 | +// any later version. | ||
1242 | + | ||
1243 | +// This library is distributed in the hope that it will be useful, | ||
1244 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1245 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1246 | +// GNU General Public License for more details. | ||
1247 | + | ||
1248 | +// You should have received a copy of the GNU General Public License along | ||
1249 | +// with this library; see the file COPYING. If not, write to the Free | ||
1250 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
1251 | +// USA. | ||
1252 | + | ||
1253 | +// As a special exception, you may use this file as part of a free software | ||
1254 | +// library without restriction. Specifically, if other files instantiate | ||
1255 | +// templates or use macros or inline functions from this file, or you compile | ||
1256 | +// this file and link it with other files to produce an executable, this | ||
1257 | +// file does not by itself cause the resulting executable to be covered by | ||
1258 | +// the GNU General Public License. This exception does not however | ||
1259 | +// invalidate any other reasons why the executable file might be covered by | ||
1260 | +// the GNU General Public License. | ||
1261 | + | ||
1262 | +// | ||
1263 | +// ISO C++ 14882: 22.2.7.1.2 messages functions | ||
1264 | +// | ||
1265 | + | ||
1266 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
1267 | + | ||
1268 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
1269 | +#warning fix prototypes for *textdomain funcs | ||
1270 | +#endif | ||
1271 | +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ | ||
1272 | +extern "C" char *__textdomain(const char *domainname); | ||
1273 | +extern "C" char *__bindtextdomain(const char *domainname, | ||
1274 | + const char *dirname); | ||
1275 | +#else | ||
1276 | +#undef __textdomain | ||
1277 | +#undef __bindtextdomain | ||
1278 | +#define __textdomain(D) ((void)0) | ||
1279 | +#define __bindtextdomain(D,P) ((void)0) | ||
1280 | +#endif | ||
1281 | + | ||
1282 | + // Non-virtual member functions. | ||
1283 | + template<typename _CharT> | ||
1284 | + messages<_CharT>::messages(size_t __refs) | ||
1285 | + : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), | ||
1286 | + _M_name_messages(_S_get_c_name()) | ||
1287 | + { } | ||
1288 | + | ||
1289 | + template<typename _CharT> | ||
1290 | + messages<_CharT>::messages(__c_locale __cloc, const char* __s, | ||
1291 | + size_t __refs) | ||
1292 | + : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)), | ||
1293 | + _M_name_messages(__s) | ||
1294 | + { | ||
1295 | + char* __tmp = new char[std::strlen(__s) + 1]; | ||
1296 | + std::strcpy(__tmp, __s); | ||
1297 | + _M_name_messages = __tmp; | ||
1298 | + } | ||
1299 | + | ||
1300 | + template<typename _CharT> | ||
1301 | + typename messages<_CharT>::catalog | ||
1302 | + messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, | ||
1303 | + const char* __dir) const | ||
1304 | + { | ||
1305 | + __bindtextdomain(__s.c_str(), __dir); | ||
1306 | + return this->do_open(__s, __loc); | ||
1307 | + } | ||
1308 | + | ||
1309 | + // Virtual member functions. | ||
1310 | + template<typename _CharT> | ||
1311 | + messages<_CharT>::~messages() | ||
1312 | + { | ||
1313 | + if (_M_name_messages != _S_get_c_name()) | ||
1314 | + delete [] _M_name_messages; | ||
1315 | + _S_destroy_c_locale(_M_c_locale_messages); | ||
1316 | + } | ||
1317 | + | ||
1318 | + template<typename _CharT> | ||
1319 | + typename messages<_CharT>::catalog | ||
1320 | + messages<_CharT>::do_open(const basic_string<char>& __s, | ||
1321 | + const locale&) const | ||
1322 | + { | ||
1323 | + // No error checking is done, assume the catalog exists and can | ||
1324 | + // be used. | ||
1325 | + __textdomain(__s.c_str()); | ||
1326 | + return 0; | ||
1327 | + } | ||
1328 | + | ||
1329 | + template<typename _CharT> | ||
1330 | + void | ||
1331 | + messages<_CharT>::do_close(catalog) const | ||
1332 | + { } | ||
1333 | + | ||
1334 | + // messages_byname | ||
1335 | + template<typename _CharT> | ||
1336 | + messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs) | ||
1337 | + : messages<_CharT>(__refs) | ||
1338 | + { | ||
1339 | + if (this->_M_name_messages != locale::facet::_S_get_c_name()) | ||
1340 | + delete [] this->_M_name_messages; | ||
1341 | + char* __tmp = new char[std::strlen(__s) + 1]; | ||
1342 | + std::strcpy(__tmp, __s); | ||
1343 | + this->_M_name_messages = __tmp; | ||
1344 | + | ||
1345 | + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) | ||
1346 | + { | ||
1347 | + this->_S_destroy_c_locale(this->_M_c_locale_messages); | ||
1348 | + this->_S_create_c_locale(this->_M_c_locale_messages, __s); | ||
1349 | + } | ||
1350 | + } | ||
1351 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc | ||
1352 | =================================================================== | ||
1353 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
1354 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-08-28 17:55:56.000000000 -0700 | ||
1355 | @@ -0,0 +1,692 @@ | ||
1356 | +// std::moneypunct implementation details, GNU version -*- C++ -*- | ||
1357 | + | ||
1358 | +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | ||
1359 | +// | ||
1360 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
1361 | +// software; you can redistribute it and/or modify it under the | ||
1362 | +// terms of the GNU General Public License as published by the | ||
1363 | +// Free Software Foundation; either version 2, or (at your option) | ||
1364 | +// any later version. | ||
1365 | + | ||
1366 | +// This library is distributed in the hope that it will be useful, | ||
1367 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1368 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1369 | +// GNU General Public License for more details. | ||
1370 | + | ||
1371 | +// You should have received a copy of the GNU General Public License along | ||
1372 | +// with this library; see the file COPYING. If not, write to the Free | ||
1373 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
1374 | +// USA. | ||
1375 | + | ||
1376 | +// As a special exception, you may use this file as part of a free software | ||
1377 | +// library without restriction. Specifically, if other files instantiate | ||
1378 | +// templates or use macros or inline functions from this file, or you compile | ||
1379 | +// this file and link it with other files to produce an executable, this | ||
1380 | +// file does not by itself cause the resulting executable to be covered by | ||
1381 | +// the GNU General Public License. This exception does not however | ||
1382 | +// invalidate any other reasons why the executable file might be covered by | ||
1383 | +// the GNU General Public License. | ||
1384 | + | ||
1385 | +// | ||
1386 | +// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions | ||
1387 | +// | ||
1388 | + | ||
1389 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
1390 | + | ||
1391 | +#define _LIBC | ||
1392 | +#include <locale> | ||
1393 | +#undef _LIBC | ||
1394 | +#include <bits/c++locale_internal.h> | ||
1395 | + | ||
1396 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
1397 | +#warning optimize this for uclibc | ||
1398 | +#warning tailor for stub locale support | ||
1399 | +#endif | ||
1400 | + | ||
1401 | +#ifndef __UCLIBC_HAS_XLOCALE__ | ||
1402 | +#define __nl_langinfo_l(N, L) nl_langinfo((N)) | ||
1403 | +#endif | ||
1404 | + | ||
1405 | +namespace std | ||
1406 | +{ | ||
1407 | + // Construct and return valid pattern consisting of some combination of: | ||
1408 | + // space none symbol sign value | ||
1409 | + money_base::pattern | ||
1410 | + money_base::_S_construct_pattern(char __precedes, char __space, char __posn) | ||
1411 | + { | ||
1412 | + pattern __ret; | ||
1413 | + | ||
1414 | + // This insanely complicated routine attempts to construct a valid | ||
1415 | + // pattern for use with monyepunct. A couple of invariants: | ||
1416 | + | ||
1417 | + // if (__precedes) symbol -> value | ||
1418 | + // else value -> symbol | ||
1419 | + | ||
1420 | + // if (__space) space | ||
1421 | + // else none | ||
1422 | + | ||
1423 | + // none == never first | ||
1424 | + // space never first or last | ||
1425 | + | ||
1426 | + // Any elegant implementations of this are welcome. | ||
1427 | + switch (__posn) | ||
1428 | + { | ||
1429 | + case 0: | ||
1430 | + case 1: | ||
1431 | + // 1 The sign precedes the value and symbol. | ||
1432 | + __ret.field[0] = sign; | ||
1433 | + if (__space) | ||
1434 | + { | ||
1435 | + // Pattern starts with sign. | ||
1436 | + if (__precedes) | ||
1437 | + { | ||
1438 | + __ret.field[1] = symbol; | ||
1439 | + __ret.field[3] = value; | ||
1440 | + } | ||
1441 | + else | ||
1442 | + { | ||
1443 | + __ret.field[1] = value; | ||
1444 | + __ret.field[3] = symbol; | ||
1445 | + } | ||
1446 | + __ret.field[2] = space; | ||
1447 | + } | ||
1448 | + else | ||
1449 | + { | ||
1450 | + // Pattern starts with sign and ends with none. | ||
1451 | + if (__precedes) | ||
1452 | + { | ||
1453 | + __ret.field[1] = symbol; | ||
1454 | + __ret.field[2] = value; | ||
1455 | + } | ||
1456 | + else | ||
1457 | + { | ||
1458 | + __ret.field[1] = value; | ||
1459 | + __ret.field[2] = symbol; | ||
1460 | + } | ||
1461 | + __ret.field[3] = none; | ||
1462 | + } | ||
1463 | + break; | ||
1464 | + case 2: | ||
1465 | + // 2 The sign follows the value and symbol. | ||
1466 | + if (__space) | ||
1467 | + { | ||
1468 | + // Pattern either ends with sign. | ||
1469 | + if (__precedes) | ||
1470 | + { | ||
1471 | + __ret.field[0] = symbol; | ||
1472 | + __ret.field[2] = value; | ||
1473 | + } | ||
1474 | + else | ||
1475 | + { | ||
1476 | + __ret.field[0] = value; | ||
1477 | + __ret.field[2] = symbol; | ||
1478 | + } | ||
1479 | + __ret.field[1] = space; | ||
1480 | + __ret.field[3] = sign; | ||
1481 | + } | ||
1482 | + else | ||
1483 | + { | ||
1484 | + // Pattern ends with sign then none. | ||
1485 | + if (__precedes) | ||
1486 | + { | ||
1487 | + __ret.field[0] = symbol; | ||
1488 | + __ret.field[1] = value; | ||
1489 | + } | ||
1490 | + else | ||
1491 | + { | ||
1492 | + __ret.field[0] = value; | ||
1493 | + __ret.field[1] = symbol; | ||
1494 | + } | ||
1495 | + __ret.field[2] = sign; | ||
1496 | + __ret.field[3] = none; | ||
1497 | + } | ||
1498 | + break; | ||
1499 | + case 3: | ||
1500 | + // 3 The sign immediately precedes the symbol. | ||
1501 | + if (__precedes) | ||
1502 | + { | ||
1503 | + __ret.field[0] = sign; | ||
1504 | + __ret.field[1] = symbol; | ||
1505 | + if (__space) | ||
1506 | + { | ||
1507 | + __ret.field[2] = space; | ||
1508 | + __ret.field[3] = value; | ||
1509 | + } | ||
1510 | + else | ||
1511 | + { | ||
1512 | + __ret.field[2] = value; | ||
1513 | + __ret.field[3] = none; | ||
1514 | + } | ||
1515 | + } | ||
1516 | + else | ||
1517 | + { | ||
1518 | + __ret.field[0] = value; | ||
1519 | + if (__space) | ||
1520 | + { | ||
1521 | + __ret.field[1] = space; | ||
1522 | + __ret.field[2] = sign; | ||
1523 | + __ret.field[3] = symbol; | ||
1524 | + } | ||
1525 | + else | ||
1526 | + { | ||
1527 | + __ret.field[1] = sign; | ||
1528 | + __ret.field[2] = symbol; | ||
1529 | + __ret.field[3] = none; | ||
1530 | + } | ||
1531 | + } | ||
1532 | + break; | ||
1533 | + case 4: | ||
1534 | + // 4 The sign immediately follows the symbol. | ||
1535 | + if (__precedes) | ||
1536 | + { | ||
1537 | + __ret.field[0] = symbol; | ||
1538 | + __ret.field[1] = sign; | ||
1539 | + if (__space) | ||
1540 | + { | ||
1541 | + __ret.field[2] = space; | ||
1542 | + __ret.field[3] = value; | ||
1543 | + } | ||
1544 | + else | ||
1545 | + { | ||
1546 | + __ret.field[2] = value; | ||
1547 | + __ret.field[3] = none; | ||
1548 | + } | ||
1549 | + } | ||
1550 | + else | ||
1551 | + { | ||
1552 | + __ret.field[0] = value; | ||
1553 | + if (__space) | ||
1554 | + { | ||
1555 | + __ret.field[1] = space; | ||
1556 | + __ret.field[2] = symbol; | ||
1557 | + __ret.field[3] = sign; | ||
1558 | + } | ||
1559 | + else | ||
1560 | + { | ||
1561 | + __ret.field[1] = symbol; | ||
1562 | + __ret.field[2] = sign; | ||
1563 | + __ret.field[3] = none; | ||
1564 | + } | ||
1565 | + } | ||
1566 | + break; | ||
1567 | + default: | ||
1568 | + ; | ||
1569 | + } | ||
1570 | + return __ret; | ||
1571 | + } | ||
1572 | + | ||
1573 | + template<> | ||
1574 | + void | ||
1575 | + moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, | ||
1576 | + const char*) | ||
1577 | + { | ||
1578 | + if (!_M_data) | ||
1579 | + _M_data = new __moneypunct_cache<char, true>; | ||
1580 | + | ||
1581 | + if (!__cloc) | ||
1582 | + { | ||
1583 | + // "C" locale | ||
1584 | + _M_data->_M_decimal_point = '.'; | ||
1585 | + _M_data->_M_thousands_sep = ','; | ||
1586 | + _M_data->_M_grouping = ""; | ||
1587 | + _M_data->_M_grouping_size = 0; | ||
1588 | + _M_data->_M_curr_symbol = ""; | ||
1589 | + _M_data->_M_curr_symbol_size = 0; | ||
1590 | + _M_data->_M_positive_sign = ""; | ||
1591 | + _M_data->_M_positive_sign_size = 0; | ||
1592 | + _M_data->_M_negative_sign = ""; | ||
1593 | + _M_data->_M_negative_sign_size = 0; | ||
1594 | + _M_data->_M_frac_digits = 0; | ||
1595 | + _M_data->_M_pos_format = money_base::_S_default_pattern; | ||
1596 | + _M_data->_M_neg_format = money_base::_S_default_pattern; | ||
1597 | + | ||
1598 | + for (size_t __i = 0; __i < money_base::_S_end; ++__i) | ||
1599 | + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; | ||
1600 | + } | ||
1601 | + else | ||
1602 | + { | ||
1603 | + // Named locale. | ||
1604 | + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, | ||
1605 | + __cloc)); | ||
1606 | + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, | ||
1607 | + __cloc)); | ||
1608 | + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); | ||
1609 | + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); | ||
1610 | + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); | ||
1611 | + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); | ||
1612 | + | ||
1613 | + char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); | ||
1614 | + if (!__nposn) | ||
1615 | + _M_data->_M_negative_sign = "()"; | ||
1616 | + else | ||
1617 | + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, | ||
1618 | + __cloc); | ||
1619 | + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); | ||
1620 | + | ||
1621 | + // _Intl == true | ||
1622 | + _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); | ||
1623 | + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); | ||
1624 | + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, | ||
1625 | + __cloc)); | ||
1626 | + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); | ||
1627 | + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); | ||
1628 | + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); | ||
1629 | + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, | ||
1630 | + __pposn); | ||
1631 | + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); | ||
1632 | + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); | ||
1633 | + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, | ||
1634 | + __nposn); | ||
1635 | + } | ||
1636 | + } | ||
1637 | + | ||
1638 | + template<> | ||
1639 | + void | ||
1640 | + moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, | ||
1641 | + const char*) | ||
1642 | + { | ||
1643 | + if (!_M_data) | ||
1644 | + _M_data = new __moneypunct_cache<char, false>; | ||
1645 | + | ||
1646 | + if (!__cloc) | ||
1647 | + { | ||
1648 | + // "C" locale | ||
1649 | + _M_data->_M_decimal_point = '.'; | ||
1650 | + _M_data->_M_thousands_sep = ','; | ||
1651 | + _M_data->_M_grouping = ""; | ||
1652 | + _M_data->_M_grouping_size = 0; | ||
1653 | + _M_data->_M_curr_symbol = ""; | ||
1654 | + _M_data->_M_curr_symbol_size = 0; | ||
1655 | + _M_data->_M_positive_sign = ""; | ||
1656 | + _M_data->_M_positive_sign_size = 0; | ||
1657 | + _M_data->_M_negative_sign = ""; | ||
1658 | + _M_data->_M_negative_sign_size = 0; | ||
1659 | + _M_data->_M_frac_digits = 0; | ||
1660 | + _M_data->_M_pos_format = money_base::_S_default_pattern; | ||
1661 | + _M_data->_M_neg_format = money_base::_S_default_pattern; | ||
1662 | + | ||
1663 | + for (size_t __i = 0; __i < money_base::_S_end; ++__i) | ||
1664 | + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; | ||
1665 | + } | ||
1666 | + else | ||
1667 | + { | ||
1668 | + // Named locale. | ||
1669 | + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, | ||
1670 | + __cloc)); | ||
1671 | + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, | ||
1672 | + __cloc)); | ||
1673 | + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); | ||
1674 | + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); | ||
1675 | + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); | ||
1676 | + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); | ||
1677 | + | ||
1678 | + char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); | ||
1679 | + if (!__nposn) | ||
1680 | + _M_data->_M_negative_sign = "()"; | ||
1681 | + else | ||
1682 | + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, | ||
1683 | + __cloc); | ||
1684 | + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); | ||
1685 | + | ||
1686 | + // _Intl == false | ||
1687 | + _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); | ||
1688 | + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); | ||
1689 | + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); | ||
1690 | + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); | ||
1691 | + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); | ||
1692 | + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); | ||
1693 | + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, | ||
1694 | + __pposn); | ||
1695 | + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); | ||
1696 | + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); | ||
1697 | + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, | ||
1698 | + __nposn); | ||
1699 | + } | ||
1700 | + } | ||
1701 | + | ||
1702 | + template<> | ||
1703 | + moneypunct<char, true>::~moneypunct() | ||
1704 | + { delete _M_data; } | ||
1705 | + | ||
1706 | + template<> | ||
1707 | + moneypunct<char, false>::~moneypunct() | ||
1708 | + { delete _M_data; } | ||
1709 | + | ||
1710 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
1711 | + template<> | ||
1712 | + void | ||
1713 | + moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, | ||
1714 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1715 | + const char*) | ||
1716 | +#else | ||
1717 | + const char* __name) | ||
1718 | +#endif | ||
1719 | + { | ||
1720 | + if (!_M_data) | ||
1721 | + _M_data = new __moneypunct_cache<wchar_t, true>; | ||
1722 | + | ||
1723 | + if (!__cloc) | ||
1724 | + { | ||
1725 | + // "C" locale | ||
1726 | + _M_data->_M_decimal_point = L'.'; | ||
1727 | + _M_data->_M_thousands_sep = L','; | ||
1728 | + _M_data->_M_grouping = ""; | ||
1729 | + _M_data->_M_grouping_size = 0; | ||
1730 | + _M_data->_M_curr_symbol = L""; | ||
1731 | + _M_data->_M_curr_symbol_size = 0; | ||
1732 | + _M_data->_M_positive_sign = L""; | ||
1733 | + _M_data->_M_positive_sign_size = 0; | ||
1734 | + _M_data->_M_negative_sign = L""; | ||
1735 | + _M_data->_M_negative_sign_size = 0; | ||
1736 | + _M_data->_M_frac_digits = 0; | ||
1737 | + _M_data->_M_pos_format = money_base::_S_default_pattern; | ||
1738 | + _M_data->_M_neg_format = money_base::_S_default_pattern; | ||
1739 | + | ||
1740 | + // Use ctype::widen code without the facet... | ||
1741 | + for (size_t __i = 0; __i < money_base::_S_end; ++__i) | ||
1742 | + _M_data->_M_atoms[__i] = | ||
1743 | + static_cast<wchar_t>(money_base::_S_atoms[__i]); | ||
1744 | + } | ||
1745 | + else | ||
1746 | + { | ||
1747 | + // Named locale. | ||
1748 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1749 | + __c_locale __old = __uselocale(__cloc); | ||
1750 | +#else | ||
1751 | + // Switch to named locale so that mbsrtowcs will work. | ||
1752 | + char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
1753 | + setlocale(LC_ALL, __name); | ||
1754 | +#endif | ||
1755 | + | ||
1756 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
1757 | +#warning fix this... should be monetary | ||
1758 | +#endif | ||
1759 | +#ifdef __UCLIBC__ | ||
1760 | +# ifdef __UCLIBC_HAS_XLOCALE__ | ||
1761 | + _M_data->_M_decimal_point = __cloc->decimal_point_wc; | ||
1762 | + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; | ||
1763 | +# else | ||
1764 | + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; | ||
1765 | + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; | ||
1766 | +# endif | ||
1767 | +#else | ||
1768 | + union { char *__s; wchar_t __w; } __u; | ||
1769 | + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); | ||
1770 | + _M_data->_M_decimal_point = __u.__w; | ||
1771 | + | ||
1772 | + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); | ||
1773 | + _M_data->_M_thousands_sep = __u.__w; | ||
1774 | +#endif | ||
1775 | + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); | ||
1776 | + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); | ||
1777 | + | ||
1778 | + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); | ||
1779 | + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); | ||
1780 | + const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); | ||
1781 | + | ||
1782 | + wchar_t* __wcs_ps = 0; | ||
1783 | + wchar_t* __wcs_ns = 0; | ||
1784 | + const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); | ||
1785 | + try | ||
1786 | + { | ||
1787 | + mbstate_t __state; | ||
1788 | + size_t __len = strlen(__cpossign); | ||
1789 | + if (__len) | ||
1790 | + { | ||
1791 | + ++__len; | ||
1792 | + memset(&__state, 0, sizeof(mbstate_t)); | ||
1793 | + __wcs_ps = new wchar_t[__len]; | ||
1794 | + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); | ||
1795 | + _M_data->_M_positive_sign = __wcs_ps; | ||
1796 | + } | ||
1797 | + else | ||
1798 | + _M_data->_M_positive_sign = L""; | ||
1799 | + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); | ||
1800 | + | ||
1801 | + __len = strlen(__cnegsign); | ||
1802 | + if (!__nposn) | ||
1803 | + _M_data->_M_negative_sign = L"()"; | ||
1804 | + else if (__len) | ||
1805 | + { | ||
1806 | + ++__len; | ||
1807 | + memset(&__state, 0, sizeof(mbstate_t)); | ||
1808 | + __wcs_ns = new wchar_t[__len]; | ||
1809 | + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); | ||
1810 | + _M_data->_M_negative_sign = __wcs_ns; | ||
1811 | + } | ||
1812 | + else | ||
1813 | + _M_data->_M_negative_sign = L""; | ||
1814 | + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); | ||
1815 | + | ||
1816 | + // _Intl == true. | ||
1817 | + __len = strlen(__ccurr); | ||
1818 | + if (__len) | ||
1819 | + { | ||
1820 | + ++__len; | ||
1821 | + memset(&__state, 0, sizeof(mbstate_t)); | ||
1822 | + wchar_t* __wcs = new wchar_t[__len]; | ||
1823 | + mbsrtowcs(__wcs, &__ccurr, __len, &__state); | ||
1824 | + _M_data->_M_curr_symbol = __wcs; | ||
1825 | + } | ||
1826 | + else | ||
1827 | + _M_data->_M_curr_symbol = L""; | ||
1828 | + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); | ||
1829 | + } | ||
1830 | + catch (...) | ||
1831 | + { | ||
1832 | + delete _M_data; | ||
1833 | + _M_data = 0; | ||
1834 | + delete __wcs_ps; | ||
1835 | + delete __wcs_ns; | ||
1836 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1837 | + __uselocale(__old); | ||
1838 | +#else | ||
1839 | + setlocale(LC_ALL, __old); | ||
1840 | + free(__old); | ||
1841 | +#endif | ||
1842 | + __throw_exception_again; | ||
1843 | + } | ||
1844 | + | ||
1845 | + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, | ||
1846 | + __cloc)); | ||
1847 | + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); | ||
1848 | + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); | ||
1849 | + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); | ||
1850 | + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, | ||
1851 | + __pposn); | ||
1852 | + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); | ||
1853 | + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); | ||
1854 | + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, | ||
1855 | + __nposn); | ||
1856 | + | ||
1857 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1858 | + __uselocale(__old); | ||
1859 | +#else | ||
1860 | + setlocale(LC_ALL, __old); | ||
1861 | + free(__old); | ||
1862 | +#endif | ||
1863 | + } | ||
1864 | + } | ||
1865 | + | ||
1866 | + template<> | ||
1867 | + void | ||
1868 | + moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc, | ||
1869 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1870 | + const char*) | ||
1871 | +#else | ||
1872 | + const char* __name) | ||
1873 | +#endif | ||
1874 | + { | ||
1875 | + if (!_M_data) | ||
1876 | + _M_data = new __moneypunct_cache<wchar_t, false>; | ||
1877 | + | ||
1878 | + if (!__cloc) | ||
1879 | + { | ||
1880 | + // "C" locale | ||
1881 | + _M_data->_M_decimal_point = L'.'; | ||
1882 | + _M_data->_M_thousands_sep = L','; | ||
1883 | + _M_data->_M_grouping = ""; | ||
1884 | + _M_data->_M_grouping_size = 0; | ||
1885 | + _M_data->_M_curr_symbol = L""; | ||
1886 | + _M_data->_M_curr_symbol_size = 0; | ||
1887 | + _M_data->_M_positive_sign = L""; | ||
1888 | + _M_data->_M_positive_sign_size = 0; | ||
1889 | + _M_data->_M_negative_sign = L""; | ||
1890 | + _M_data->_M_negative_sign_size = 0; | ||
1891 | + _M_data->_M_frac_digits = 0; | ||
1892 | + _M_data->_M_pos_format = money_base::_S_default_pattern; | ||
1893 | + _M_data->_M_neg_format = money_base::_S_default_pattern; | ||
1894 | + | ||
1895 | + // Use ctype::widen code without the facet... | ||
1896 | + for (size_t __i = 0; __i < money_base::_S_end; ++__i) | ||
1897 | + _M_data->_M_atoms[__i] = | ||
1898 | + static_cast<wchar_t>(money_base::_S_atoms[__i]); | ||
1899 | + } | ||
1900 | + else | ||
1901 | + { | ||
1902 | + // Named locale. | ||
1903 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1904 | + __c_locale __old = __uselocale(__cloc); | ||
1905 | +#else | ||
1906 | + // Switch to named locale so that mbsrtowcs will work. | ||
1907 | + char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
1908 | + setlocale(LC_ALL, __name); | ||
1909 | +#endif | ||
1910 | + | ||
1911 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
1912 | +#warning fix this... should be monetary | ||
1913 | +#endif | ||
1914 | +#ifdef __UCLIBC__ | ||
1915 | +# ifdef __UCLIBC_HAS_XLOCALE__ | ||
1916 | + _M_data->_M_decimal_point = __cloc->decimal_point_wc; | ||
1917 | + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; | ||
1918 | +# else | ||
1919 | + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; | ||
1920 | + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; | ||
1921 | +# endif | ||
1922 | +#else | ||
1923 | + union { char *__s; wchar_t __w; } __u; | ||
1924 | + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); | ||
1925 | + _M_data->_M_decimal_point = __u.__w; | ||
1926 | + | ||
1927 | + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); | ||
1928 | + _M_data->_M_thousands_sep = __u.__w; | ||
1929 | +#endif | ||
1930 | + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); | ||
1931 | + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); | ||
1932 | + | ||
1933 | + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); | ||
1934 | + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); | ||
1935 | + const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); | ||
1936 | + | ||
1937 | + wchar_t* __wcs_ps = 0; | ||
1938 | + wchar_t* __wcs_ns = 0; | ||
1939 | + const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); | ||
1940 | + try | ||
1941 | + { | ||
1942 | + mbstate_t __state; | ||
1943 | + size_t __len; | ||
1944 | + __len = strlen(__cpossign); | ||
1945 | + if (__len) | ||
1946 | + { | ||
1947 | + ++__len; | ||
1948 | + memset(&__state, 0, sizeof(mbstate_t)); | ||
1949 | + __wcs_ps = new wchar_t[__len]; | ||
1950 | + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); | ||
1951 | + _M_data->_M_positive_sign = __wcs_ps; | ||
1952 | + } | ||
1953 | + else | ||
1954 | + _M_data->_M_positive_sign = L""; | ||
1955 | + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); | ||
1956 | + | ||
1957 | + __len = strlen(__cnegsign); | ||
1958 | + if (!__nposn) | ||
1959 | + _M_data->_M_negative_sign = L"()"; | ||
1960 | + else if (__len) | ||
1961 | + { | ||
1962 | + ++__len; | ||
1963 | + memset(&__state, 0, sizeof(mbstate_t)); | ||
1964 | + __wcs_ns = new wchar_t[__len]; | ||
1965 | + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); | ||
1966 | + _M_data->_M_negative_sign = __wcs_ns; | ||
1967 | + } | ||
1968 | + else | ||
1969 | + _M_data->_M_negative_sign = L""; | ||
1970 | + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); | ||
1971 | + | ||
1972 | + // _Intl == true. | ||
1973 | + __len = strlen(__ccurr); | ||
1974 | + if (__len) | ||
1975 | + { | ||
1976 | + ++__len; | ||
1977 | + memset(&__state, 0, sizeof(mbstate_t)); | ||
1978 | + wchar_t* __wcs = new wchar_t[__len]; | ||
1979 | + mbsrtowcs(__wcs, &__ccurr, __len, &__state); | ||
1980 | + _M_data->_M_curr_symbol = __wcs; | ||
1981 | + } | ||
1982 | + else | ||
1983 | + _M_data->_M_curr_symbol = L""; | ||
1984 | + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); | ||
1985 | + } | ||
1986 | + catch (...) | ||
1987 | + { | ||
1988 | + delete _M_data; | ||
1989 | + _M_data = 0; | ||
1990 | + delete __wcs_ps; | ||
1991 | + delete __wcs_ns; | ||
1992 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1993 | + __uselocale(__old); | ||
1994 | +#else | ||
1995 | + setlocale(LC_ALL, __old); | ||
1996 | + free(__old); | ||
1997 | +#endif | ||
1998 | + __throw_exception_again; | ||
1999 | + } | ||
2000 | + | ||
2001 | + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); | ||
2002 | + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); | ||
2003 | + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); | ||
2004 | + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); | ||
2005 | + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, | ||
2006 | + __pposn); | ||
2007 | + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); | ||
2008 | + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); | ||
2009 | + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, | ||
2010 | + __nposn); | ||
2011 | + | ||
2012 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
2013 | + __uselocale(__old); | ||
2014 | +#else | ||
2015 | + setlocale(LC_ALL, __old); | ||
2016 | + free(__old); | ||
2017 | +#endif | ||
2018 | + } | ||
2019 | + } | ||
2020 | + | ||
2021 | + template<> | ||
2022 | + moneypunct<wchar_t, true>::~moneypunct() | ||
2023 | + { | ||
2024 | + if (_M_data->_M_positive_sign_size) | ||
2025 | + delete [] _M_data->_M_positive_sign; | ||
2026 | + if (_M_data->_M_negative_sign_size | ||
2027 | + && wcscmp(_M_data->_M_negative_sign, L"()") != 0) | ||
2028 | + delete [] _M_data->_M_negative_sign; | ||
2029 | + if (_M_data->_M_curr_symbol_size) | ||
2030 | + delete [] _M_data->_M_curr_symbol; | ||
2031 | + delete _M_data; | ||
2032 | + } | ||
2033 | + | ||
2034 | + template<> | ||
2035 | + moneypunct<wchar_t, false>::~moneypunct() | ||
2036 | + { | ||
2037 | + if (_M_data->_M_positive_sign_size) | ||
2038 | + delete [] _M_data->_M_positive_sign; | ||
2039 | + if (_M_data->_M_negative_sign_size | ||
2040 | + && wcscmp(_M_data->_M_negative_sign, L"()") != 0) | ||
2041 | + delete [] _M_data->_M_negative_sign; | ||
2042 | + if (_M_data->_M_curr_symbol_size) | ||
2043 | + delete [] _M_data->_M_curr_symbol; | ||
2044 | + delete _M_data; | ||
2045 | + } | ||
2046 | +#endif | ||
2047 | +} | ||
2048 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc | ||
2049 | =================================================================== | ||
2050 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
2051 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-08-28 17:55:56.000000000 -0700 | ||
2052 | @@ -0,0 +1,160 @@ | ||
2053 | +// std::numpunct implementation details, GNU version -*- C++ -*- | ||
2054 | + | ||
2055 | +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | ||
2056 | +// | ||
2057 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
2058 | +// software; you can redistribute it and/or modify it under the | ||
2059 | +// terms of the GNU General Public License as published by the | ||
2060 | +// Free Software Foundation; either version 2, or (at your option) | ||
2061 | +// any later version. | ||
2062 | + | ||
2063 | +// This library is distributed in the hope that it will be useful, | ||
2064 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2065 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2066 | +// GNU General Public License for more details. | ||
2067 | + | ||
2068 | +// You should have received a copy of the GNU General Public License along | ||
2069 | +// with this library; see the file COPYING. If not, write to the Free | ||
2070 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
2071 | +// USA. | ||
2072 | + | ||
2073 | +// As a special exception, you may use this file as part of a free software | ||
2074 | +// library without restriction. Specifically, if other files instantiate | ||
2075 | +// templates or use macros or inline functions from this file, or you compile | ||
2076 | +// this file and link it with other files to produce an executable, this | ||
2077 | +// file does not by itself cause the resulting executable to be covered by | ||
2078 | +// the GNU General Public License. This exception does not however | ||
2079 | +// invalidate any other reasons why the executable file might be covered by | ||
2080 | +// the GNU General Public License. | ||
2081 | + | ||
2082 | +// | ||
2083 | +// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions | ||
2084 | +// | ||
2085 | + | ||
2086 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
2087 | + | ||
2088 | +#define _LIBC | ||
2089 | +#include <locale> | ||
2090 | +#undef _LIBC | ||
2091 | +#include <bits/c++locale_internal.h> | ||
2092 | + | ||
2093 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
2094 | +#warning tailor for stub locale support | ||
2095 | +#endif | ||
2096 | +#ifndef __UCLIBC_HAS_XLOCALE__ | ||
2097 | +#define __nl_langinfo_l(N, L) nl_langinfo((N)) | ||
2098 | +#endif | ||
2099 | + | ||
2100 | +namespace std | ||
2101 | +{ | ||
2102 | + template<> | ||
2103 | + void | ||
2104 | + numpunct<char>::_M_initialize_numpunct(__c_locale __cloc) | ||
2105 | + { | ||
2106 | + if (!_M_data) | ||
2107 | + _M_data = new __numpunct_cache<char>; | ||
2108 | + | ||
2109 | + if (!__cloc) | ||
2110 | + { | ||
2111 | + // "C" locale | ||
2112 | + _M_data->_M_grouping = ""; | ||
2113 | + _M_data->_M_grouping_size = 0; | ||
2114 | + _M_data->_M_use_grouping = false; | ||
2115 | + | ||
2116 | + _M_data->_M_decimal_point = '.'; | ||
2117 | + _M_data->_M_thousands_sep = ','; | ||
2118 | + | ||
2119 | + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) | ||
2120 | + _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i]; | ||
2121 | + | ||
2122 | + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) | ||
2123 | + _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j]; | ||
2124 | + } | ||
2125 | + else | ||
2126 | + { | ||
2127 | + // Named locale. | ||
2128 | + _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, | ||
2129 | + __cloc)); | ||
2130 | + _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, | ||
2131 | + __cloc)); | ||
2132 | + | ||
2133 | + // Check for NULL, which implies no grouping. | ||
2134 | + if (_M_data->_M_thousands_sep == '\0') | ||
2135 | + _M_data->_M_grouping = ""; | ||
2136 | + else | ||
2137 | + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); | ||
2138 | + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); | ||
2139 | + } | ||
2140 | + | ||
2141 | + // NB: There is no way to extact this info from posix locales. | ||
2142 | + // _M_truename = __nl_langinfo_l(YESSTR, __cloc); | ||
2143 | + _M_data->_M_truename = "true"; | ||
2144 | + _M_data->_M_truename_size = 4; | ||
2145 | + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); | ||
2146 | + _M_data->_M_falsename = "false"; | ||
2147 | + _M_data->_M_falsename_size = 5; | ||
2148 | + } | ||
2149 | + | ||
2150 | + template<> | ||
2151 | + numpunct<char>::~numpunct() | ||
2152 | + { delete _M_data; } | ||
2153 | + | ||
2154 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
2155 | + template<> | ||
2156 | + void | ||
2157 | + numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc) | ||
2158 | + { | ||
2159 | + if (!_M_data) | ||
2160 | + _M_data = new __numpunct_cache<wchar_t>; | ||
2161 | + | ||
2162 | + if (!__cloc) | ||
2163 | + { | ||
2164 | + // "C" locale | ||
2165 | + _M_data->_M_grouping = ""; | ||
2166 | + _M_data->_M_grouping_size = 0; | ||
2167 | + _M_data->_M_use_grouping = false; | ||
2168 | + | ||
2169 | + _M_data->_M_decimal_point = L'.'; | ||
2170 | + _M_data->_M_thousands_sep = L','; | ||
2171 | + | ||
2172 | + // Use ctype::widen code without the facet... | ||
2173 | + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) | ||
2174 | + _M_data->_M_atoms_out[__i] = | ||
2175 | + static_cast<wchar_t>(__num_base::_S_atoms_out[__i]); | ||
2176 | + | ||
2177 | + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) | ||
2178 | + _M_data->_M_atoms_in[__j] = | ||
2179 | + static_cast<wchar_t>(__num_base::_S_atoms_in[__j]); | ||
2180 | + } | ||
2181 | + else | ||
2182 | + { | ||
2183 | + // Named locale. | ||
2184 | + // NB: In the GNU model wchar_t is always 32 bit wide. | ||
2185 | + union { char *__s; wchar_t __w; } __u; | ||
2186 | + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc); | ||
2187 | + _M_data->_M_decimal_point = __u.__w; | ||
2188 | + | ||
2189 | + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc); | ||
2190 | + _M_data->_M_thousands_sep = __u.__w; | ||
2191 | + | ||
2192 | + if (_M_data->_M_thousands_sep == L'\0') | ||
2193 | + _M_data->_M_grouping = ""; | ||
2194 | + else | ||
2195 | + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); | ||
2196 | + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); | ||
2197 | + } | ||
2198 | + | ||
2199 | + // NB: There is no way to extact this info from posix locales. | ||
2200 | + // _M_truename = __nl_langinfo_l(YESSTR, __cloc); | ||
2201 | + _M_data->_M_truename = L"true"; | ||
2202 | + _M_data->_M_truename_size = 4; | ||
2203 | + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); | ||
2204 | + _M_data->_M_falsename = L"false"; | ||
2205 | + _M_data->_M_falsename_size = 5; | ||
2206 | + } | ||
2207 | + | ||
2208 | + template<> | ||
2209 | + numpunct<wchar_t>::~numpunct() | ||
2210 | + { delete _M_data; } | ||
2211 | + #endif | ||
2212 | +} | ||
2213 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc | ||
2214 | =================================================================== | ||
2215 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
2216 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-08-28 17:55:56.000000000 -0700 | ||
2217 | @@ -0,0 +1,406 @@ | ||
2218 | +// std::time_get, std::time_put implementation, GNU version -*- C++ -*- | ||
2219 | + | ||
2220 | +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | ||
2221 | +// | ||
2222 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
2223 | +// software; you can redistribute it and/or modify it under the | ||
2224 | +// terms of the GNU General Public License as published by the | ||
2225 | +// Free Software Foundation; either version 2, or (at your option) | ||
2226 | +// any later version. | ||
2227 | + | ||
2228 | +// This library is distributed in the hope that it will be useful, | ||
2229 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2230 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2231 | +// GNU General Public License for more details. | ||
2232 | + | ||
2233 | +// You should have received a copy of the GNU General Public License along | ||
2234 | +// with this library; see the file COPYING. If not, write to the Free | ||
2235 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
2236 | +// USA. | ||
2237 | + | ||
2238 | +// As a special exception, you may use this file as part of a free software | ||
2239 | +// library without restriction. Specifically, if other files instantiate | ||
2240 | +// templates or use macros or inline functions from this file, or you compile | ||
2241 | +// this file and link it with other files to produce an executable, this | ||
2242 | +// file does not by itself cause the resulting executable to be covered by | ||
2243 | +// the GNU General Public License. This exception does not however | ||
2244 | +// invalidate any other reasons why the executable file might be covered by | ||
2245 | +// the GNU General Public License. | ||
2246 | + | ||
2247 | +// | ||
2248 | +// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions | ||
2249 | +// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions | ||
2250 | +// | ||
2251 | + | ||
2252 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
2253 | + | ||
2254 | +#include <locale> | ||
2255 | +#include <bits/c++locale_internal.h> | ||
2256 | + | ||
2257 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
2258 | +#warning tailor for stub locale support | ||
2259 | +#endif | ||
2260 | +#ifndef __UCLIBC_HAS_XLOCALE__ | ||
2261 | +#define __nl_langinfo_l(N, L) nl_langinfo((N)) | ||
2262 | +#endif | ||
2263 | + | ||
2264 | +namespace std | ||
2265 | +{ | ||
2266 | + template<> | ||
2267 | + void | ||
2268 | + __timepunct<char>:: | ||
2269 | + _M_put(char* __s, size_t __maxlen, const char* __format, | ||
2270 | + const tm* __tm) const | ||
2271 | + { | ||
2272 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
2273 | + const size_t __len = __strftime_l(__s, __maxlen, __format, __tm, | ||
2274 | + _M_c_locale_timepunct); | ||
2275 | +#else | ||
2276 | + char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
2277 | + setlocale(LC_ALL, _M_name_timepunct); | ||
2278 | + const size_t __len = strftime(__s, __maxlen, __format, __tm); | ||
2279 | + setlocale(LC_ALL, __old); | ||
2280 | + free(__old); | ||
2281 | +#endif | ||
2282 | + // Make sure __s is null terminated. | ||
2283 | + if (__len == 0) | ||
2284 | + __s[0] = '\0'; | ||
2285 | + } | ||
2286 | + | ||
2287 | + template<> | ||
2288 | + void | ||
2289 | + __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc) | ||
2290 | + { | ||
2291 | + if (!_M_data) | ||
2292 | + _M_data = new __timepunct_cache<char>; | ||
2293 | + | ||
2294 | + if (!__cloc) | ||
2295 | + { | ||
2296 | + // "C" locale | ||
2297 | + _M_c_locale_timepunct = _S_get_c_locale(); | ||
2298 | + | ||
2299 | + _M_data->_M_date_format = "%m/%d/%y"; | ||
2300 | + _M_data->_M_date_era_format = "%m/%d/%y"; | ||
2301 | + _M_data->_M_time_format = "%H:%M:%S"; | ||
2302 | + _M_data->_M_time_era_format = "%H:%M:%S"; | ||
2303 | + _M_data->_M_date_time_format = ""; | ||
2304 | + _M_data->_M_date_time_era_format = ""; | ||
2305 | + _M_data->_M_am = "AM"; | ||
2306 | + _M_data->_M_pm = "PM"; | ||
2307 | + _M_data->_M_am_pm_format = ""; | ||
2308 | + | ||
2309 | + // Day names, starting with "C"'s Sunday. | ||
2310 | + _M_data->_M_day1 = "Sunday"; | ||
2311 | + _M_data->_M_day2 = "Monday"; | ||
2312 | + _M_data->_M_day3 = "Tuesday"; | ||
2313 | + _M_data->_M_day4 = "Wednesday"; | ||
2314 | + _M_data->_M_day5 = "Thursday"; | ||
2315 | + _M_data->_M_day6 = "Friday"; | ||
2316 | + _M_data->_M_day7 = "Saturday"; | ||
2317 | + | ||
2318 | + // Abbreviated day names, starting with "C"'s Sun. | ||
2319 | + _M_data->_M_aday1 = "Sun"; | ||
2320 | + _M_data->_M_aday2 = "Mon"; | ||
2321 | + _M_data->_M_aday3 = "Tue"; | ||
2322 | + _M_data->_M_aday4 = "Wed"; | ||
2323 | + _M_data->_M_aday5 = "Thu"; | ||
2324 | + _M_data->_M_aday6 = "Fri"; | ||
2325 | + _M_data->_M_aday7 = "Sat"; | ||
2326 | + | ||
2327 | + // Month names, starting with "C"'s January. | ||
2328 | + _M_data->_M_month01 = "January"; | ||
2329 | + _M_data->_M_month02 = "February"; | ||
2330 | + _M_data->_M_month03 = "March"; | ||
2331 | + _M_data->_M_month04 = "April"; | ||
2332 | + _M_data->_M_month05 = "May"; | ||
2333 | + _M_data->_M_month06 = "June"; | ||
2334 | + _M_data->_M_month07 = "July"; | ||
2335 | + _M_data->_M_month08 = "August"; | ||
2336 | + _M_data->_M_month09 = "September"; | ||
2337 | + _M_data->_M_month10 = "October"; | ||
2338 | + _M_data->_M_month11 = "November"; | ||
2339 | + _M_data->_M_month12 = "December"; | ||
2340 | + | ||
2341 | + // Abbreviated month names, starting with "C"'s Jan. | ||
2342 | + _M_data->_M_amonth01 = "Jan"; | ||
2343 | + _M_data->_M_amonth02 = "Feb"; | ||
2344 | + _M_data->_M_amonth03 = "Mar"; | ||
2345 | + _M_data->_M_amonth04 = "Apr"; | ||
2346 | + _M_data->_M_amonth05 = "May"; | ||
2347 | + _M_data->_M_amonth06 = "Jun"; | ||
2348 | + _M_data->_M_amonth07 = "Jul"; | ||
2349 | + _M_data->_M_amonth08 = "Aug"; | ||
2350 | + _M_data->_M_amonth09 = "Sep"; | ||
2351 | + _M_data->_M_amonth10 = "Oct"; | ||
2352 | + _M_data->_M_amonth11 = "Nov"; | ||
2353 | + _M_data->_M_amonth12 = "Dec"; | ||
2354 | + } | ||
2355 | + else | ||
2356 | + { | ||
2357 | + _M_c_locale_timepunct = _S_clone_c_locale(__cloc); | ||
2358 | + | ||
2359 | + _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc); | ||
2360 | + _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc); | ||
2361 | + _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc); | ||
2362 | + _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc); | ||
2363 | + _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc); | ||
2364 | + _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, | ||
2365 | + __cloc); | ||
2366 | + _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc); | ||
2367 | + _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc); | ||
2368 | + _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc); | ||
2369 | + | ||
2370 | + // Day names, starting with "C"'s Sunday. | ||
2371 | + _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc); | ||
2372 | + _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc); | ||
2373 | + _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc); | ||
2374 | + _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc); | ||
2375 | + _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc); | ||
2376 | + _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc); | ||
2377 | + _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc); | ||
2378 | + | ||
2379 | + // Abbreviated day names, starting with "C"'s Sun. | ||
2380 | + _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc); | ||
2381 | + _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc); | ||
2382 | + _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc); | ||
2383 | + _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc); | ||
2384 | + _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc); | ||
2385 | + _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc); | ||
2386 | + _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc); | ||
2387 | + | ||
2388 | + // Month names, starting with "C"'s January. | ||
2389 | + _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc); | ||
2390 | + _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc); | ||
2391 | + _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc); | ||
2392 | + _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc); | ||
2393 | + _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc); | ||
2394 | + _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc); | ||
2395 | + _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc); | ||
2396 | + _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc); | ||
2397 | + _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc); | ||
2398 | + _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc); | ||
2399 | + _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc); | ||
2400 | + _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc); | ||
2401 | + | ||
2402 | + // Abbreviated month names, starting with "C"'s Jan. | ||
2403 | + _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc); | ||
2404 | + _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc); | ||
2405 | + _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc); | ||
2406 | + _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc); | ||
2407 | + _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc); | ||
2408 | + _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc); | ||
2409 | + _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc); | ||
2410 | + _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc); | ||
2411 | + _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc); | ||
2412 | + _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc); | ||
2413 | + _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc); | ||
2414 | + _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc); | ||
2415 | + } | ||
2416 | + } | ||
2417 | + | ||
2418 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
2419 | + template<> | ||
2420 | + void | ||
2421 | + __timepunct<wchar_t>:: | ||
2422 | + _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, | ||
2423 | + const tm* __tm) const | ||
2424 | + { | ||
2425 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
2426 | + __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct); | ||
2427 | + const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm, | ||
2428 | + _M_c_locale_timepunct); | ||
2429 | +#else | ||
2430 | + char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
2431 | + setlocale(LC_ALL, _M_name_timepunct); | ||
2432 | + const size_t __len = wcsftime(__s, __maxlen, __format, __tm); | ||
2433 | + setlocale(LC_ALL, __old); | ||
2434 | + free(__old); | ||
2435 | +#endif | ||
2436 | + // Make sure __s is null terminated. | ||
2437 | + if (__len == 0) | ||
2438 | + __s[0] = L'\0'; | ||
2439 | + } | ||
2440 | + | ||
2441 | + template<> | ||
2442 | + void | ||
2443 | + __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc) | ||
2444 | + { | ||
2445 | + if (!_M_data) | ||
2446 | + _M_data = new __timepunct_cache<wchar_t>; | ||
2447 | + | ||
2448 | +#warning wide time stuff | ||
2449 | +// if (!__cloc) | ||
2450 | + { | ||
2451 | + // "C" locale | ||
2452 | + _M_c_locale_timepunct = _S_get_c_locale(); | ||
2453 | + | ||
2454 | + _M_data->_M_date_format = L"%m/%d/%y"; | ||
2455 | + _M_data->_M_date_era_format = L"%m/%d/%y"; | ||
2456 | + _M_data->_M_time_format = L"%H:%M:%S"; | ||
2457 | + _M_data->_M_time_era_format = L"%H:%M:%S"; | ||
2458 | + _M_data->_M_date_time_format = L""; | ||
2459 | + _M_data->_M_date_time_era_format = L""; | ||
2460 | + _M_data->_M_am = L"AM"; | ||
2461 | + _M_data->_M_pm = L"PM"; | ||
2462 | + _M_data->_M_am_pm_format = L""; | ||
2463 | + | ||
2464 | + // Day names, starting with "C"'s Sunday. | ||
2465 | + _M_data->_M_day1 = L"Sunday"; | ||
2466 | + _M_data->_M_day2 = L"Monday"; | ||
2467 | + _M_data->_M_day3 = L"Tuesday"; | ||
2468 | + _M_data->_M_day4 = L"Wednesday"; | ||
2469 | + _M_data->_M_day5 = L"Thursday"; | ||
2470 | + _M_data->_M_day6 = L"Friday"; | ||
2471 | + _M_data->_M_day7 = L"Saturday"; | ||
2472 | + | ||
2473 | + // Abbreviated day names, starting with "C"'s Sun. | ||
2474 | + _M_data->_M_aday1 = L"Sun"; | ||
2475 | + _M_data->_M_aday2 = L"Mon"; | ||
2476 | + _M_data->_M_aday3 = L"Tue"; | ||
2477 | + _M_data->_M_aday4 = L"Wed"; | ||
2478 | + _M_data->_M_aday5 = L"Thu"; | ||
2479 | + _M_data->_M_aday6 = L"Fri"; | ||
2480 | + _M_data->_M_aday7 = L"Sat"; | ||
2481 | + | ||
2482 | + // Month names, starting with "C"'s January. | ||
2483 | + _M_data->_M_month01 = L"January"; | ||
2484 | + _M_data->_M_month02 = L"February"; | ||
2485 | + _M_data->_M_month03 = L"March"; | ||
2486 | + _M_data->_M_month04 = L"April"; | ||
2487 | + _M_data->_M_month05 = L"May"; | ||
2488 | + _M_data->_M_month06 = L"June"; | ||
2489 | + _M_data->_M_month07 = L"July"; | ||
2490 | + _M_data->_M_month08 = L"August"; | ||
2491 | + _M_data->_M_month09 = L"September"; | ||
2492 | + _M_data->_M_month10 = L"October"; | ||
2493 | + _M_data->_M_month11 = L"November"; | ||
2494 | + _M_data->_M_month12 = L"December"; | ||
2495 | + | ||
2496 | + // Abbreviated month names, starting with "C"'s Jan. | ||
2497 | + _M_data->_M_amonth01 = L"Jan"; | ||
2498 | + _M_data->_M_amonth02 = L"Feb"; | ||
2499 | + _M_data->_M_amonth03 = L"Mar"; | ||
2500 | + _M_data->_M_amonth04 = L"Apr"; | ||
2501 | + _M_data->_M_amonth05 = L"May"; | ||
2502 | + _M_data->_M_amonth06 = L"Jun"; | ||
2503 | + _M_data->_M_amonth07 = L"Jul"; | ||
2504 | + _M_data->_M_amonth08 = L"Aug"; | ||
2505 | + _M_data->_M_amonth09 = L"Sep"; | ||
2506 | + _M_data->_M_amonth10 = L"Oct"; | ||
2507 | + _M_data->_M_amonth11 = L"Nov"; | ||
2508 | + _M_data->_M_amonth12 = L"Dec"; | ||
2509 | + } | ||
2510 | +#if 0 | ||
2511 | + else | ||
2512 | + { | ||
2513 | + _M_c_locale_timepunct = _S_clone_c_locale(__cloc); | ||
2514 | + | ||
2515 | + union { char *__s; wchar_t *__w; } __u; | ||
2516 | + | ||
2517 | + __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc); | ||
2518 | + _M_data->_M_date_format = __u.__w; | ||
2519 | + __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc); | ||
2520 | + _M_data->_M_date_era_format = __u.__w; | ||
2521 | + __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc); | ||
2522 | + _M_data->_M_time_format = __u.__w; | ||
2523 | + __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc); | ||
2524 | + _M_data->_M_time_era_format = __u.__w; | ||
2525 | + __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc); | ||
2526 | + _M_data->_M_date_time_format = __u.__w; | ||
2527 | + __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc); | ||
2528 | + _M_data->_M_date_time_era_format = __u.__w; | ||
2529 | + __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc); | ||
2530 | + _M_data->_M_am = __u.__w; | ||
2531 | + __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc); | ||
2532 | + _M_data->_M_pm = __u.__w; | ||
2533 | + __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc); | ||
2534 | + _M_data->_M_am_pm_format = __u.__w; | ||
2535 | + | ||
2536 | + // Day names, starting with "C"'s Sunday. | ||
2537 | + __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc); | ||
2538 | + _M_data->_M_day1 = __u.__w; | ||
2539 | + __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc); | ||
2540 | + _M_data->_M_day2 = __u.__w; | ||
2541 | + __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc); | ||
2542 | + _M_data->_M_day3 = __u.__w; | ||
2543 | + __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc); | ||
2544 | + _M_data->_M_day4 = __u.__w; | ||
2545 | + __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc); | ||
2546 | + _M_data->_M_day5 = __u.__w; | ||
2547 | + __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc); | ||
2548 | + _M_data->_M_day6 = __u.__w; | ||
2549 | + __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc); | ||
2550 | + _M_data->_M_day7 = __u.__w; | ||
2551 | + | ||
2552 | + // Abbreviated day names, starting with "C"'s Sun. | ||
2553 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc); | ||
2554 | + _M_data->_M_aday1 = __u.__w; | ||
2555 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc); | ||
2556 | + _M_data->_M_aday2 = __u.__w; | ||
2557 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc); | ||
2558 | + _M_data->_M_aday3 = __u.__w; | ||
2559 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc); | ||
2560 | + _M_data->_M_aday4 = __u.__w; | ||
2561 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc); | ||
2562 | + _M_data->_M_aday5 = __u.__w; | ||
2563 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc); | ||
2564 | + _M_data->_M_aday6 = __u.__w; | ||
2565 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc); | ||
2566 | + _M_data->_M_aday7 = __u.__w; | ||
2567 | + | ||
2568 | + // Month names, starting with "C"'s January. | ||
2569 | + __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc); | ||
2570 | + _M_data->_M_month01 = __u.__w; | ||
2571 | + __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc); | ||
2572 | + _M_data->_M_month02 = __u.__w; | ||
2573 | + __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc); | ||
2574 | + _M_data->_M_month03 = __u.__w; | ||
2575 | + __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc); | ||
2576 | + _M_data->_M_month04 = __u.__w; | ||
2577 | + __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc); | ||
2578 | + _M_data->_M_month05 = __u.__w; | ||
2579 | + __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc); | ||
2580 | + _M_data->_M_month06 = __u.__w; | ||
2581 | + __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc); | ||
2582 | + _M_data->_M_month07 = __u.__w; | ||
2583 | + __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc); | ||
2584 | + _M_data->_M_month08 = __u.__w; | ||
2585 | + __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc); | ||
2586 | + _M_data->_M_month09 = __u.__w; | ||
2587 | + __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc); | ||
2588 | + _M_data->_M_month10 = __u.__w; | ||
2589 | + __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc); | ||
2590 | + _M_data->_M_month11 = __u.__w; | ||
2591 | + __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc); | ||
2592 | + _M_data->_M_month12 = __u.__w; | ||
2593 | + | ||
2594 | + // Abbreviated month names, starting with "C"'s Jan. | ||
2595 | + __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc); | ||
2596 | + _M_data->_M_amonth01 = __u.__w; | ||
2597 | + __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc); | ||
2598 | + _M_data->_M_amonth02 = __u.__w; | ||
2599 | + __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc); | ||
2600 | + _M_data->_M_amonth03 = __u.__w; | ||
2601 | + __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc); | ||
2602 | + _M_data->_M_amonth04 = __u.__w; | ||
2603 | + __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc); | ||
2604 | + _M_data->_M_amonth05 = __u.__w; | ||
2605 | + __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc); | ||
2606 | + _M_data->_M_amonth06 = __u.__w; | ||
2607 | + __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc); | ||
2608 | + _M_data->_M_amonth07 = __u.__w; | ||
2609 | + __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc); | ||
2610 | + _M_data->_M_amonth08 = __u.__w; | ||
2611 | + __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc); | ||
2612 | + _M_data->_M_amonth09 = __u.__w; | ||
2613 | + __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc); | ||
2614 | + _M_data->_M_amonth10 = __u.__w; | ||
2615 | + __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc); | ||
2616 | + _M_data->_M_amonth11 = __u.__w; | ||
2617 | + __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc); | ||
2618 | + _M_data->_M_amonth12 = __u.__w; | ||
2619 | + } | ||
2620 | +#endif // 0 | ||
2621 | + } | ||
2622 | +#endif | ||
2623 | +} | ||
2624 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/time_members.h | ||
2625 | =================================================================== | ||
2626 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
2627 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/time_members.h 2008-08-28 17:55:56.000000000 -0700 | ||
2628 | @@ -0,0 +1,68 @@ | ||
2629 | +// std::time_get, std::time_put implementation, GNU version -*- C++ -*- | ||
2630 | + | ||
2631 | +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | ||
2632 | +// | ||
2633 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
2634 | +// software; you can redistribute it and/or modify it under the | ||
2635 | +// terms of the GNU General Public License as published by the | ||
2636 | +// Free Software Foundation; either version 2, or (at your option) | ||
2637 | +// any later version. | ||
2638 | + | ||
2639 | +// This library is distributed in the hope that it will be useful, | ||
2640 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2641 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2642 | +// GNU General Public License for more details. | ||
2643 | + | ||
2644 | +// You should have received a copy of the GNU General Public License along | ||
2645 | +// with this library; see the file COPYING. If not, write to the Free | ||
2646 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
2647 | +// USA. | ||
2648 | + | ||
2649 | +// As a special exception, you may use this file as part of a free software | ||
2650 | +// library without restriction. Specifically, if other files instantiate | ||
2651 | +// templates or use macros or inline functions from this file, or you compile | ||
2652 | +// this file and link it with other files to produce an executable, this | ||
2653 | +// file does not by itself cause the resulting executable to be covered by | ||
2654 | +// the GNU General Public License. This exception does not however | ||
2655 | +// invalidate any other reasons why the executable file might be covered by | ||
2656 | +// the GNU General Public License. | ||
2657 | + | ||
2658 | +// | ||
2659 | +// ISO C++ 14882: 22.2.5.1.2 - time_get functions | ||
2660 | +// ISO C++ 14882: 22.2.5.3.2 - time_put functions | ||
2661 | +// | ||
2662 | + | ||
2663 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
2664 | + | ||
2665 | + template<typename _CharT> | ||
2666 | + __timepunct<_CharT>::__timepunct(size_t __refs) | ||
2667 | + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), | ||
2668 | + _M_name_timepunct(_S_get_c_name()) | ||
2669 | + { _M_initialize_timepunct(); } | ||
2670 | + | ||
2671 | + template<typename _CharT> | ||
2672 | + __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) | ||
2673 | + : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), | ||
2674 | + _M_name_timepunct(_S_get_c_name()) | ||
2675 | + { _M_initialize_timepunct(); } | ||
2676 | + | ||
2677 | + template<typename _CharT> | ||
2678 | + __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, | ||
2679 | + size_t __refs) | ||
2680 | + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), | ||
2681 | + _M_name_timepunct(__s) | ||
2682 | + { | ||
2683 | + char* __tmp = new char[std::strlen(__s) + 1]; | ||
2684 | + std::strcpy(__tmp, __s); | ||
2685 | + _M_name_timepunct = __tmp; | ||
2686 | + _M_initialize_timepunct(__cloc); | ||
2687 | + } | ||
2688 | + | ||
2689 | + template<typename _CharT> | ||
2690 | + __timepunct<_CharT>::~__timepunct() | ||
2691 | + { | ||
2692 | + if (_M_name_timepunct != _S_get_c_name()) | ||
2693 | + delete [] _M_name_timepunct; | ||
2694 | + delete _M_data; | ||
2695 | + _S_destroy_c_locale(_M_c_locale_timepunct); | ||
2696 | + } | ||
2697 | Index: gcc-4.3.2/libstdc++-v3/configure | ||
2698 | =================================================================== | ||
2699 | --- gcc-4.3.2.orig/libstdc++-v3/configure 2008-07-07 12:49:54.000000000 -0700 | ||
2700 | +++ gcc-4.3.2/libstdc++-v3/configure 2008-08-28 18:02:13.000000000 -0700 | ||
2701 | @@ -14003,7 +14003,7 @@ | ||
2702 | enableval="$enable_clocale" | ||
2703 | |||
2704 | case "$enableval" in | ||
2705 | - generic|gnu|ieee_1003.1-2001|yes|no|auto) ;; | ||
2706 | + generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;; | ||
2707 | *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5 | ||
2708 | echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;} | ||
2709 | { (exit 1); exit 1; }; } ;; | ||
2710 | @@ -14036,6 +14036,9 @@ | ||
2711 | # Default to "generic". | ||
2712 | if test $enable_clocale_flag = auto; then | ||
2713 | case ${target_os} in | ||
2714 | + *-uclibc*) | ||
2715 | + enable_clocale_flag=uclibc | ||
2716 | + ;; | ||
2717 | linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) | ||
2718 | enable_clocale_flag=gnu | ||
2719 | ;; | ||
2720 | @@ -14424,6 +14427,76 @@ | ||
2721 | CTIME_CC=config/locale/generic/time_members.cc | ||
2722 | CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h | ||
2723 | ;; | ||
2724 | + uclibc) | ||
2725 | + echo "$as_me:$LINENO: result: uclibc" >&5 | ||
2726 | +echo "${ECHO_T}uclibc" >&6 | ||
2727 | + | ||
2728 | + # Declare intention to use gettext, and add support for specific | ||
2729 | + # languages. | ||
2730 | + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT | ||
2731 | + ALL_LINGUAS="de fr" | ||
2732 | + | ||
2733 | + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. | ||
2734 | + # Extract the first word of "msgfmt", so it can be a program name with args. | ||
2735 | +set dummy msgfmt; ac_word=$2 | ||
2736 | +echo "$as_me:$LINENO: checking for $ac_word" >&5 | ||
2737 | +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 | ||
2738 | +if test "${ac_cv_prog_check_msgfmt+set}" = set; then | ||
2739 | + echo $ECHO_N "(cached) $ECHO_C" >&6 | ||
2740 | +else | ||
2741 | + if test -n "$check_msgfmt"; then | ||
2742 | + ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test. | ||
2743 | +else | ||
2744 | +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | ||
2745 | +for as_dir in $PATH | ||
2746 | +do | ||
2747 | + IFS=$as_save_IFS | ||
2748 | + test -z "$as_dir" && as_dir=. | ||
2749 | + for ac_exec_ext in '' $ac_executable_extensions; do | ||
2750 | + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | ||
2751 | + ac_cv_prog_check_msgfmt="yes" | ||
2752 | + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 | ||
2753 | + break 2 | ||
2754 | + fi | ||
2755 | +done | ||
2756 | +done | ||
2757 | + | ||
2758 | + test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no" | ||
2759 | +fi | ||
2760 | +fi | ||
2761 | +check_msgfmt=$ac_cv_prog_check_msgfmt | ||
2762 | +if test -n "$check_msgfmt"; then | ||
2763 | + echo "$as_me:$LINENO: result: $check_msgfmt" >&5 | ||
2764 | +echo "${ECHO_T}$check_msgfmt" >&6 | ||
2765 | +else | ||
2766 | + echo "$as_me:$LINENO: result: no" >&5 | ||
2767 | +echo "${ECHO_T}no" >&6 | ||
2768 | +fi | ||
2769 | + | ||
2770 | + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then | ||
2771 | + USE_NLS=yes | ||
2772 | + fi | ||
2773 | + # Export the build objects. | ||
2774 | + for ling in $ALL_LINGUAS; do \ | ||
2775 | + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ | ||
2776 | + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ | ||
2777 | + done | ||
2778 | + | ||
2779 | + | ||
2780 | + | ||
2781 | + CLOCALE_H=config/locale/uclibc/c_locale.h | ||
2782 | + CLOCALE_CC=config/locale/uclibc/c_locale.cc | ||
2783 | + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc | ||
2784 | + CCOLLATE_CC=config/locale/uclibc/collate_members.cc | ||
2785 | + CCTYPE_CC=config/locale/uclibc/ctype_members.cc | ||
2786 | + CMESSAGES_H=config/locale/uclibc/messages_members.h | ||
2787 | + CMESSAGES_CC=config/locale/uclibc/messages_members.cc | ||
2788 | + CMONEY_CC=config/locale/uclibc/monetary_members.cc | ||
2789 | + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc | ||
2790 | + CTIME_H=config/locale/uclibc/time_members.h | ||
2791 | + CTIME_CC=config/locale/uclibc/time_members.cc | ||
2792 | + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h | ||
2793 | + ;; | ||
2794 | esac | ||
2795 | |||
2796 | # This is where the testsuite looks for locale catalogs, using the | ||
2797 | @@ -17016,7 +17089,7 @@ | ||
2798 | |||
2799 | # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style. | ||
2800 | cat > conftest.$ac_ext << EOF | ||
2801 | -#line 17019 "configure" | ||
2802 | +#line 17092 "configure" | ||
2803 | int main() | ||
2804 | { | ||
2805 | // NB: _Atomic_word not necessarily int. | ||
2806 | Index: gcc-4.3.2/libstdc++-v3/include/c_compatibility/wchar.h | ||
2807 | =================================================================== | ||
2808 | --- gcc-4.3.2.orig/libstdc++-v3/include/c_compatibility/wchar.h 2007-03-04 14:59:49.000000000 -0800 | ||
2809 | +++ gcc-4.3.2/libstdc++-v3/include/c_compatibility/wchar.h 2008-08-28 17:55:56.000000000 -0700 | ||
2810 | @@ -106,7 +106,9 @@ | ||
2811 | using std::wmemcpy; | ||
2812 | using std::wmemmove; | ||
2813 | using std::wmemset; | ||
2814 | +#if _GLIBCXX_HAVE_WCSFTIME | ||
2815 | using std::wcsftime; | ||
2816 | +#endif | ||
2817 | |||
2818 | #if _GLIBCXX_USE_C99 | ||
2819 | using std::wcstold; | ||
2820 | Index: gcc-4.3.2/libstdc++-v3/include/c_std/cwchar | ||
2821 | =================================================================== | ||
2822 | --- gcc-4.3.2.orig/libstdc++-v3/include/c_std/cwchar 2007-05-27 07:50:21.000000000 -0700 | ||
2823 | +++ gcc-4.3.2/libstdc++-v3/include/c_std/cwchar 2008-08-28 17:55:56.000000000 -0700 | ||
2824 | @@ -182,7 +182,9 @@ | ||
2825 | using ::wcscoll; | ||
2826 | using ::wcscpy; | ||
2827 | using ::wcscspn; | ||
2828 | +#if _GLIBCXX_HAVE_WCSFTIME | ||
2829 | using ::wcsftime; | ||
2830 | +#endif | ||
2831 | using ::wcslen; | ||
2832 | using ::wcsncat; | ||
2833 | using ::wcsncmp; | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/203-uclibc-locale-no__x.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/203-uclibc-locale-no__x.patch new file mode 100644 index 0000000000..f39e65220c --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/203-uclibc-locale-no__x.patch | |||
@@ -0,0 +1,233 @@ | |||
1 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h | ||
2 | =================================================================== | ||
3 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-08-16 01:29:20.000000000 -0700 | ||
4 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-08-16 01:33:23.000000000 -0700 | ||
5 | @@ -60,4 +60,49 @@ | ||
6 | extern "C" __typeof(wctype_l) __wctype_l; | ||
7 | #endif | ||
8 | |||
9 | +# define __nl_langinfo_l nl_langinfo_l | ||
10 | +# define __strcoll_l strcoll_l | ||
11 | +# define __strftime_l strftime_l | ||
12 | +# define __strtod_l strtod_l | ||
13 | +# define __strtof_l strtof_l | ||
14 | +# define __strtold_l strtold_l | ||
15 | +# define __strxfrm_l strxfrm_l | ||
16 | +# define __newlocale newlocale | ||
17 | +# define __freelocale freelocale | ||
18 | +# define __duplocale duplocale | ||
19 | +# define __uselocale uselocale | ||
20 | + | ||
21 | +# ifdef _GLIBCXX_USE_WCHAR_T | ||
22 | +# define __iswctype_l iswctype_l | ||
23 | +# define __towlower_l towlower_l | ||
24 | +# define __towupper_l towupper_l | ||
25 | +# define __wcscoll_l wcscoll_l | ||
26 | +# define __wcsftime_l wcsftime_l | ||
27 | +# define __wcsxfrm_l wcsxfrm_l | ||
28 | +# define __wctype_l wctype_l | ||
29 | +# endif | ||
30 | + | ||
31 | +#else | ||
32 | +# define __nl_langinfo_l(N, L) nl_langinfo((N)) | ||
33 | +# define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) | ||
34 | +# define __strtod_l(S, E, L) strtod((S), (E)) | ||
35 | +# define __strtof_l(S, E, L) strtof((S), (E)) | ||
36 | +# define __strtold_l(S, E, L) strtold((S), (E)) | ||
37 | +# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) | ||
38 | +# warning should dummy __newlocale check for C|POSIX ? | ||
39 | +# define __newlocale(a, b, c) NULL | ||
40 | +# define __freelocale(a) ((void)0) | ||
41 | +# define __duplocale(a) __c_locale() | ||
42 | +//# define __uselocale ? | ||
43 | +// | ||
44 | +# ifdef _GLIBCXX_USE_WCHAR_T | ||
45 | +# define __iswctype_l(C, M, L) iswctype((C), (M)) | ||
46 | +# define __towlower_l(C, L) towlower((C)) | ||
47 | +# define __towupper_l(C, L) towupper((C)) | ||
48 | +# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) | ||
49 | +//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T)) | ||
50 | +# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) | ||
51 | +# define __wctype_l(S, L) wctype((S)) | ||
52 | +# endif | ||
53 | + | ||
54 | #endif // GLIBC 2.3 and later | ||
55 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc | ||
56 | =================================================================== | ||
57 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-08-16 01:29:20.000000000 -0700 | ||
58 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-08-16 01:33:00.000000000 -0700 | ||
59 | @@ -39,20 +39,6 @@ | ||
60 | #include <langinfo.h> | ||
61 | #include <bits/c++locale_internal.h> | ||
62 | |||
63 | -#ifndef __UCLIBC_HAS_XLOCALE__ | ||
64 | -#define __strtol_l(S, E, B, L) strtol((S), (E), (B)) | ||
65 | -#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B)) | ||
66 | -#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B)) | ||
67 | -#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B)) | ||
68 | -#define __strtof_l(S, E, L) strtof((S), (E)) | ||
69 | -#define __strtod_l(S, E, L) strtod((S), (E)) | ||
70 | -#define __strtold_l(S, E, L) strtold((S), (E)) | ||
71 | -#warning should dummy __newlocale check for C|POSIX ? | ||
72 | -#define __newlocale(a, b, c) NULL | ||
73 | -#define __freelocale(a) ((void)0) | ||
74 | -#define __duplocale(a) __c_locale() | ||
75 | -#endif | ||
76 | - | ||
77 | namespace std | ||
78 | { | ||
79 | template<> | ||
80 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc | ||
81 | =================================================================== | ||
82 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-08-16 01:29:20.000000000 -0700 | ||
83 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-08-16 01:30:31.000000000 -0700 | ||
84 | @@ -36,13 +36,6 @@ | ||
85 | #include <locale> | ||
86 | #include <bits/c++locale_internal.h> | ||
87 | |||
88 | -#ifndef __UCLIBC_HAS_XLOCALE__ | ||
89 | -#define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) | ||
90 | -#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) | ||
91 | -#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) | ||
92 | -#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) | ||
93 | -#endif | ||
94 | - | ||
95 | namespace std | ||
96 | { | ||
97 | // These are basically extensions to char_traits, and perhaps should | ||
98 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc | ||
99 | =================================================================== | ||
100 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-08-16 01:29:20.000000000 -0700 | ||
101 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-08-16 01:30:31.000000000 -0700 | ||
102 | @@ -43,10 +43,6 @@ | ||
103 | #warning tailor for stub locale support | ||
104 | #endif | ||
105 | |||
106 | -#ifndef __UCLIBC_HAS_XLOCALE__ | ||
107 | -#define __nl_langinfo_l(N, L) nl_langinfo((N)) | ||
108 | -#endif | ||
109 | - | ||
110 | namespace std | ||
111 | { | ||
112 | // Construct and return valid pattern consisting of some combination of: | ||
113 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc | ||
114 | =================================================================== | ||
115 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-08-16 01:29:20.000000000 -0700 | ||
116 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-08-16 01:30:31.000000000 -0700 | ||
117 | @@ -41,9 +41,6 @@ | ||
118 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
119 | #warning tailor for stub locale support | ||
120 | #endif | ||
121 | -#ifndef __UCLIBC_HAS_XLOCALE__ | ||
122 | -#define __nl_langinfo_l(N, L) nl_langinfo((N)) | ||
123 | -#endif | ||
124 | |||
125 | namespace std | ||
126 | { | ||
127 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc | ||
128 | =================================================================== | ||
129 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-08-16 01:29:20.000000000 -0700 | ||
130 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-08-16 01:30:31.000000000 -0700 | ||
131 | @@ -40,9 +40,6 @@ | ||
132 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
133 | #warning tailor for stub locale support | ||
134 | #endif | ||
135 | -#ifndef __UCLIBC_HAS_XLOCALE__ | ||
136 | -#define __nl_langinfo_l(N, L) nl_langinfo((N)) | ||
137 | -#endif | ||
138 | |||
139 | namespace std | ||
140 | { | ||
141 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc | ||
142 | =================================================================== | ||
143 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-08-16 01:29:20.000000000 -0700 | ||
144 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-08-16 01:30:31.000000000 -0700 | ||
145 | @@ -38,13 +38,6 @@ | ||
146 | #undef _LIBC | ||
147 | #include <bits/c++locale_internal.h> | ||
148 | |||
149 | -#ifndef __UCLIBC_HAS_XLOCALE__ | ||
150 | -#define __wctype_l(S, L) wctype((S)) | ||
151 | -#define __towupper_l(C, L) towupper((C)) | ||
152 | -#define __towlower_l(C, L) towlower((C)) | ||
153 | -#define __iswctype_l(C, M, L) iswctype((C), (M)) | ||
154 | -#endif | ||
155 | - | ||
156 | namespace std | ||
157 | { | ||
158 | // NB: The other ctype<char> specializations are in src/locale.cc and | ||
159 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc | ||
160 | =================================================================== | ||
161 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-08-16 01:27:18.000000000 -0700 | ||
162 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-08-16 01:30:31.000000000 -0700 | ||
163 | @@ -39,13 +39,10 @@ | ||
164 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
165 | #warning fix gettext stuff | ||
166 | #endif | ||
167 | -#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ | ||
168 | -extern "C" char *__dcgettext(const char *domainname, | ||
169 | - const char *msgid, int category); | ||
170 | #undef gettext | ||
171 | -#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES) | ||
172 | +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ | ||
173 | +#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES) | ||
174 | #else | ||
175 | -#undef gettext | ||
176 | #define gettext(msgid) (msgid) | ||
177 | #endif | ||
178 | |||
179 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h | ||
180 | =================================================================== | ||
181 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-08-16 01:29:20.000000000 -0700 | ||
182 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-08-16 01:31:43.000000000 -0700 | ||
183 | @@ -36,15 +36,11 @@ | ||
184 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
185 | #warning fix prototypes for *textdomain funcs | ||
186 | #endif | ||
187 | -#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ | ||
188 | -extern "C" char *__textdomain(const char *domainname); | ||
189 | -extern "C" char *__bindtextdomain(const char *domainname, | ||
190 | - const char *dirname); | ||
191 | -#else | ||
192 | -#undef __textdomain | ||
193 | -#undef __bindtextdomain | ||
194 | -#define __textdomain(D) ((void)0) | ||
195 | -#define __bindtextdomain(D,P) ((void)0) | ||
196 | +#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__ | ||
197 | +#undef textdomain | ||
198 | +#undef bindtextdomain | ||
199 | +#define textdomain(D) ((void)0) | ||
200 | +#define bindtextdomain(D,P) ((void)0) | ||
201 | #endif | ||
202 | |||
203 | // Non-virtual member functions. | ||
204 | @@ -70,7 +66,7 @@ | ||
205 | messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, | ||
206 | const char* __dir) const | ||
207 | { | ||
208 | - __bindtextdomain(__s.c_str(), __dir); | ||
209 | + bindtextdomain(__s.c_str(), __dir); | ||
210 | return this->do_open(__s, __loc); | ||
211 | } | ||
212 | |||
213 | @@ -90,7 +86,7 @@ | ||
214 | { | ||
215 | // No error checking is done, assume the catalog exists and can | ||
216 | // be used. | ||
217 | - __textdomain(__s.c_str()); | ||
218 | + textdomain(__s.c_str()); | ||
219 | return 0; | ||
220 | } | ||
221 | |||
222 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h | ||
223 | =================================================================== | ||
224 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-08-16 01:29:20.000000000 -0700 | ||
225 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-08-16 01:30:31.000000000 -0700 | ||
226 | @@ -68,6 +68,7 @@ | ||
227 | { | ||
228 | extern "C" __typeof(uselocale) __uselocale; | ||
229 | } | ||
230 | +#define __uselocale uselocale | ||
231 | #endif | ||
232 | |||
233 | namespace std | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/204-uclibc-locale-wchar_fix.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/204-uclibc-locale-wchar_fix.patch new file mode 100644 index 0000000000..160ab35bb3 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/204-uclibc-locale-wchar_fix.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | --- gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc.uclibc200_wchar~ 2006-03-10 15:32:37 +0100 | ||
2 | +++ gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2006-03-10 15:37:27 +0100 | ||
3 | @@ -401,7 +401,7 @@ | ||
4 | # ifdef __UCLIBC_HAS_XLOCALE__ | ||
5 | _M_data->_M_decimal_point = __cloc->decimal_point_wc; | ||
6 | _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; | ||
7 | -# else | ||
8 | +# elif defined __UCLIBC_HAS_LOCALE__ | ||
9 | _M_data->_M_decimal_point = __global_locale->decimal_point_wc; | ||
10 | _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; | ||
11 | # endif | ||
12 | @@ -556,7 +556,7 @@ | ||
13 | # ifdef __UCLIBC_HAS_XLOCALE__ | ||
14 | _M_data->_M_decimal_point = __cloc->decimal_point_wc; | ||
15 | _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; | ||
16 | -# else | ||
17 | +# elif defined __UCLIBC_HAS_LOCALE__ | ||
18 | _M_data->_M_decimal_point = __global_locale->decimal_point_wc; | ||
19 | _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; | ||
20 | # endif | ||
21 | --- gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc.uclibc200_wchar~ 2006-03-10 15:32:37 +0100 | ||
22 | +++ gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2006-03-10 15:37:27 +0100 | ||
23 | @@ -127,12 +127,25 @@ | ||
24 | { | ||
25 | // Named locale. | ||
26 | // NB: In the GNU model wchar_t is always 32 bit wide. | ||
27 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
28 | +#warning fix this... should be numeric | ||
29 | +#endif | ||
30 | +#ifdef __UCLIBC__ | ||
31 | +# ifdef __UCLIBC_HAS_XLOCALE__ | ||
32 | + _M_data->_M_decimal_point = __cloc->decimal_point_wc; | ||
33 | + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; | ||
34 | +# elif defined __UCLIBC_HAS_LOCALE__ | ||
35 | + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; | ||
36 | + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; | ||
37 | +# endif | ||
38 | +#else | ||
39 | union { char *__s; wchar_t __w; } __u; | ||
40 | __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc); | ||
41 | _M_data->_M_decimal_point = __u.__w; | ||
42 | |||
43 | __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc); | ||
44 | _M_data->_M_thousands_sep = __u.__w; | ||
45 | +#endif | ||
46 | |||
47 | if (_M_data->_M_thousands_sep == L'\0') | ||
48 | _M_data->_M_grouping = ""; | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/205-uclibc-locale-update.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/205-uclibc-locale-update.patch new file mode 100644 index 0000000000..48eaa1d442 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/205-uclibc-locale-update.patch | |||
@@ -0,0 +1,519 @@ | |||
1 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc | ||
2 | =================================================================== | ||
3 | --- gcc-4.3.2.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-09-17 22:35:28.000000000 -0700 | ||
4 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-09-17 22:35:29.000000000 -0700 | ||
5 | @@ -39,23 +39,20 @@ | ||
6 | #include <langinfo.h> | ||
7 | #include <bits/c++locale_internal.h> | ||
8 | |||
9 | -namespace std | ||
10 | -{ | ||
11 | +_GLIBCXX_BEGIN_NAMESPACE(std) | ||
12 | + | ||
13 | template<> | ||
14 | void | ||
15 | __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, | ||
16 | const __c_locale& __cloc) | ||
17 | { | ||
18 | - if (!(__err & ios_base::failbit)) | ||
19 | - { | ||
20 | - char* __sanity; | ||
21 | - errno = 0; | ||
22 | - float __f = __strtof_l(__s, &__sanity, __cloc); | ||
23 | - if (__sanity != __s && errno != ERANGE) | ||
24 | - __v = __f; | ||
25 | - else | ||
26 | - __err |= ios_base::failbit; | ||
27 | - } | ||
28 | + char* __sanity; | ||
29 | + errno = 0; | ||
30 | + float __f = __strtof_l(__s, &__sanity, __cloc); | ||
31 | + if (__sanity != __s && errno != ERANGE) | ||
32 | + __v = __f; | ||
33 | + else | ||
34 | + __err |= ios_base::failbit; | ||
35 | } | ||
36 | |||
37 | template<> | ||
38 | @@ -63,16 +60,13 @@ | ||
39 | __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, | ||
40 | const __c_locale& __cloc) | ||
41 | { | ||
42 | - if (!(__err & ios_base::failbit)) | ||
43 | - { | ||
44 | - char* __sanity; | ||
45 | - errno = 0; | ||
46 | - double __d = __strtod_l(__s, &__sanity, __cloc); | ||
47 | - if (__sanity != __s && errno != ERANGE) | ||
48 | - __v = __d; | ||
49 | - else | ||
50 | - __err |= ios_base::failbit; | ||
51 | - } | ||
52 | + char* __sanity; | ||
53 | + errno = 0; | ||
54 | + double __d = __strtod_l(__s, &__sanity, __cloc); | ||
55 | + if (__sanity != __s && errno != ERANGE) | ||
56 | + __v = __d; | ||
57 | + else | ||
58 | + __err |= ios_base::failbit; | ||
59 | } | ||
60 | |||
61 | template<> | ||
62 | @@ -80,16 +74,13 @@ | ||
63 | __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err, | ||
64 | const __c_locale& __cloc) | ||
65 | { | ||
66 | - if (!(__err & ios_base::failbit)) | ||
67 | - { | ||
68 | - char* __sanity; | ||
69 | - errno = 0; | ||
70 | - long double __ld = __strtold_l(__s, &__sanity, __cloc); | ||
71 | - if (__sanity != __s && errno != ERANGE) | ||
72 | - __v = __ld; | ||
73 | - else | ||
74 | - __err |= ios_base::failbit; | ||
75 | - } | ||
76 | + char* __sanity; | ||
77 | + errno = 0; | ||
78 | + long double __ld = __strtold_l(__s, &__sanity, __cloc); | ||
79 | + if (__sanity != __s && errno != ERANGE) | ||
80 | + __v = __ld; | ||
81 | + else | ||
82 | + __err |= ios_base::failbit; | ||
83 | } | ||
84 | |||
85 | void | ||
86 | @@ -110,17 +101,18 @@ | ||
87 | void | ||
88 | locale::facet::_S_destroy_c_locale(__c_locale& __cloc) | ||
89 | { | ||
90 | - if (_S_get_c_locale() != __cloc) | ||
91 | + if (__cloc && _S_get_c_locale() != __cloc) | ||
92 | __freelocale(__cloc); | ||
93 | } | ||
94 | |||
95 | __c_locale | ||
96 | locale::facet::_S_clone_c_locale(__c_locale& __cloc) | ||
97 | { return __duplocale(__cloc); } | ||
98 | -} // namespace std | ||
99 | |||
100 | -namespace __gnu_cxx | ||
101 | -{ | ||
102 | +_GLIBCXX_END_NAMESPACE | ||
103 | + | ||
104 | +_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) | ||
105 | + | ||
106 | const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] = | ||
107 | { | ||
108 | "LC_CTYPE", | ||
109 | @@ -138,9 +130,11 @@ | ||
110 | "LC_IDENTIFICATION" | ||
111 | #endif | ||
112 | }; | ||
113 | -} | ||
114 | |||
115 | -namespace std | ||
116 | -{ | ||
117 | +_GLIBCXX_END_NAMESPACE | ||
118 | + | ||
119 | +_GLIBCXX_BEGIN_NAMESPACE(std) | ||
120 | + | ||
121 | const char* const* const locale::_S_categories = __gnu_cxx::category_names; | ||
122 | -} // namespace std | ||
123 | + | ||
124 | +_GLIBCXX_END_NAMESPACE | ||
125 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc | ||
126 | =================================================================== | ||
127 | --- gcc-4.3.2.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-09-17 22:35:28.000000000 -0700 | ||
128 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-09-17 23:09:49.000000000 -0700 | ||
129 | @@ -33,16 +33,20 @@ | ||
130 | |||
131 | // Written by Benjamin Kosnik <bkoz@redhat.com> | ||
132 | |||
133 | +#include <features.h> | ||
134 | +#ifdef __UCLIBC_HAS_LOCALE__ | ||
135 | #define _LIBC | ||
136 | #include <locale> | ||
137 | #undef _LIBC | ||
138 | +#else | ||
139 | +#include <locale> | ||
140 | +#endif | ||
141 | #include <bits/c++locale_internal.h> | ||
142 | |||
143 | -namespace std | ||
144 | -{ | ||
145 | +_GLIBCXX_BEGIN_NAMESPACE(std) | ||
146 | + | ||
147 | // NB: The other ctype<char> specializations are in src/locale.cc and | ||
148 | // various /config/os/* files. | ||
149 | - template<> | ||
150 | ctype_byname<char>::ctype_byname(const char* __s, size_t __refs) | ||
151 | : ctype<char>(0, false, __refs) | ||
152 | { | ||
153 | @@ -57,6 +61,8 @@ | ||
154 | #endif | ||
155 | } | ||
156 | } | ||
157 | + ctype_byname<char>::~ctype_byname() | ||
158 | + { } | ||
159 | |||
160 | #ifdef _GLIBCXX_USE_WCHAR_T | ||
161 | ctype<wchar_t>::__wmask_type | ||
162 | @@ -138,17 +144,33 @@ | ||
163 | ctype<wchar_t>:: | ||
164 | do_is(mask __m, wchar_t __c) const | ||
165 | { | ||
166 | - // Highest bitmask in ctype_base == 10, but extra in "C" | ||
167 | - // library for blank. | ||
168 | + // The case of __m == ctype_base::space is particularly important, | ||
169 | + // due to its use in many istream functions. Therefore we deal with | ||
170 | + // it first, exploiting the knowledge that on GNU systems _M_bit[5] | ||
171 | + // is the mask corresponding to ctype_base::space. NB: an encoding | ||
172 | + // change would not affect correctness! | ||
173 | + | ||
174 | bool __ret = false; | ||
175 | - const size_t __bitmasksize = 11; | ||
176 | - for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) | ||
177 | - if (__m & _M_bit[__bitcur] | ||
178 | - && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) | ||
179 | - { | ||
180 | - __ret = true; | ||
181 | - break; | ||
182 | - } | ||
183 | + if (__m == _M_bit[5]) | ||
184 | + __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype); | ||
185 | + else | ||
186 | + { | ||
187 | + // Highest bitmask in ctype_base == 10, but extra in "C" | ||
188 | + // library for blank. | ||
189 | + const size_t __bitmasksize = 11; | ||
190 | + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) | ||
191 | + if (__m & _M_bit[__bitcur]) | ||
192 | + { | ||
193 | + if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) | ||
194 | + { | ||
195 | + __ret = true; | ||
196 | + break; | ||
197 | + } | ||
198 | + else if (__m == _M_bit[__bitcur]) | ||
199 | + break; | ||
200 | + } | ||
201 | + } | ||
202 | + | ||
203 | return __ret; | ||
204 | } | ||
205 | |||
206 | @@ -290,4 +312,5 @@ | ||
207 | #endif | ||
208 | } | ||
209 | #endif // _GLIBCXX_USE_WCHAR_T | ||
210 | -} | ||
211 | + | ||
212 | +_GLIBCXX_END_NAMESPACE | ||
213 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h | ||
214 | =================================================================== | ||
215 | --- gcc-4.3.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-09-17 22:35:28.000000000 -0700 | ||
216 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-09-17 23:13:34.000000000 -0700 | ||
217 | @@ -53,12 +53,16 @@ | ||
218 | template<typename _CharT> | ||
219 | messages<_CharT>::messages(__c_locale __cloc, const char* __s, | ||
220 | size_t __refs) | ||
221 | - : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)), | ||
222 | - _M_name_messages(__s) | ||
223 | + : facet(__refs), _M_c_locale_messages(NULL), | ||
224 | + _M_name_messages(NULL) | ||
225 | { | ||
226 | - char* __tmp = new char[std::strlen(__s) + 1]; | ||
227 | - std::strcpy(__tmp, __s); | ||
228 | + const size_t __len = std::strlen(__s) + 1; | ||
229 | + char* __tmp = new char[__len]; | ||
230 | + std::memcpy(__tmp, __s, __len); | ||
231 | _M_name_messages = __tmp; | ||
232 | + | ||
233 | + // Last to avoid leaking memory if new throws. | ||
234 | + _M_c_locale_messages = _S_clone_c_locale(__cloc); | ||
235 | } | ||
236 | |||
237 | template<typename _CharT> | ||
238 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc | ||
239 | =================================================================== | ||
240 | --- gcc-4.3.2.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-09-17 22:35:28.000000000 -0700 | ||
241 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-09-17 22:35:29.000000000 -0700 | ||
242 | @@ -33,9 +33,14 @@ | ||
243 | |||
244 | // Written by Benjamin Kosnik <bkoz@redhat.com> | ||
245 | |||
246 | +#include <features.h> | ||
247 | +#ifdef __UCLIBC_HAS_LOCALE__ | ||
248 | #define _LIBC | ||
249 | #include <locale> | ||
250 | #undef _LIBC | ||
251 | +#else | ||
252 | +#include <locale> | ||
253 | +#endif | ||
254 | #include <bits/c++locale_internal.h> | ||
255 | |||
256 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
257 | @@ -206,7 +211,7 @@ | ||
258 | } | ||
259 | break; | ||
260 | default: | ||
261 | - ; | ||
262 | + __ret = pattern(); | ||
263 | } | ||
264 | return __ret; | ||
265 | } | ||
266 | @@ -390,7 +395,9 @@ | ||
267 | __c_locale __old = __uselocale(__cloc); | ||
268 | #else | ||
269 | // Switch to named locale so that mbsrtowcs will work. | ||
270 | - char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
271 | + char* __old = setlocale(LC_ALL, NULL); | ||
272 | + const size_t __llen = strlen(__old) + 1; | ||
273 | + char* __sav = new char[__llen]; | ||
274 | setlocale(LC_ALL, __name); | ||
275 | #endif | ||
276 | |||
277 | @@ -477,8 +484,8 @@ | ||
278 | #ifdef __UCLIBC_HAS_XLOCALE__ | ||
279 | __uselocale(__old); | ||
280 | #else | ||
281 | - setlocale(LC_ALL, __old); | ||
282 | - free(__old); | ||
283 | + setlocale(LC_ALL, __sav); | ||
284 | + delete [] __sav; | ||
285 | #endif | ||
286 | __throw_exception_again; | ||
287 | } | ||
288 | @@ -498,8 +505,8 @@ | ||
289 | #ifdef __UCLIBC_HAS_XLOCALE__ | ||
290 | __uselocale(__old); | ||
291 | #else | ||
292 | - setlocale(LC_ALL, __old); | ||
293 | - free(__old); | ||
294 | + setlocale(LC_ALL, __sav); | ||
295 | + delete [] __sav; | ||
296 | #endif | ||
297 | } | ||
298 | } | ||
299 | @@ -545,8 +552,11 @@ | ||
300 | __c_locale __old = __uselocale(__cloc); | ||
301 | #else | ||
302 | // Switch to named locale so that mbsrtowcs will work. | ||
303 | - char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
304 | - setlocale(LC_ALL, __name); | ||
305 | + char* __old = setlocale(LC_ALL, NULL); | ||
306 | + const size_t __llen = strlen(__old) + 1; | ||
307 | + char* __sav = new char[__llen]; | ||
308 | + memcpy(__sav, __old, __llen); | ||
309 | + setlocale(LC_ALL, __name); | ||
310 | #endif | ||
311 | |||
312 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
313 | @@ -633,8 +643,8 @@ | ||
314 | #ifdef __UCLIBC_HAS_XLOCALE__ | ||
315 | __uselocale(__old); | ||
316 | #else | ||
317 | - setlocale(LC_ALL, __old); | ||
318 | - free(__old); | ||
319 | + setlocale(LC_ALL, __sav); | ||
320 | + delete [] __sav; | ||
321 | #endif | ||
322 | __throw_exception_again; | ||
323 | } | ||
324 | @@ -653,8 +663,8 @@ | ||
325 | #ifdef __UCLIBC_HAS_XLOCALE__ | ||
326 | __uselocale(__old); | ||
327 | #else | ||
328 | - setlocale(LC_ALL, __old); | ||
329 | - free(__old); | ||
330 | + setlocale(LC_ALL, __sav); | ||
331 | + delete [] __sav; | ||
332 | #endif | ||
333 | } | ||
334 | } | ||
335 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc | ||
336 | =================================================================== | ||
337 | --- gcc-4.3.2.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-09-17 22:35:28.000000000 -0700 | ||
338 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-09-17 22:35:29.000000000 -0700 | ||
339 | @@ -33,9 +33,14 @@ | ||
340 | |||
341 | // Written by Benjamin Kosnik <bkoz@redhat.com> | ||
342 | |||
343 | +#include <features.h> | ||
344 | +#ifdef __UCLIBC_HAS_LOCALE__ | ||
345 | #define _LIBC | ||
346 | #include <locale> | ||
347 | #undef _LIBC | ||
348 | +#else | ||
349 | +#include <locale> | ||
350 | +#endif | ||
351 | #include <bits/c++locale_internal.h> | ||
352 | |||
353 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
354 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/time_members.h | ||
355 | =================================================================== | ||
356 | --- gcc-4.3.2.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-09-17 22:35:27.000000000 -0700 | ||
357 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/time_members.h 2008-09-17 23:13:34.000000000 -0700 | ||
358 | @@ -50,12 +50,21 @@ | ||
359 | __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, | ||
360 | size_t __refs) | ||
361 | : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), | ||
362 | - _M_name_timepunct(__s) | ||
363 | + _M_name_timepunct(NULL) | ||
364 | { | ||
365 | - char* __tmp = new char[std::strlen(__s) + 1]; | ||
366 | - std::strcpy(__tmp, __s); | ||
367 | + const size_t __len = std::strlen(__s) + 1; | ||
368 | + char* __tmp = new char[__len]; | ||
369 | + std::memcpy(__tmp, __s, __len); | ||
370 | _M_name_timepunct = __tmp; | ||
371 | - _M_initialize_timepunct(__cloc); | ||
372 | + | ||
373 | + try | ||
374 | + { _M_initialize_timepunct(__cloc); } | ||
375 | + catch(...) | ||
376 | + { | ||
377 | + delete [] _M_name_timepunct; | ||
378 | + __throw_exception_again; | ||
379 | + } | ||
380 | + | ||
381 | } | ||
382 | |||
383 | template<typename _CharT> | ||
384 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h | ||
385 | =================================================================== | ||
386 | --- gcc-4.3.2.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-09-17 22:35:28.000000000 -0700 | ||
387 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-09-17 22:35:29.000000000 -0700 | ||
388 | @@ -39,21 +39,23 @@ | ||
389 | #pragma GCC system_header | ||
390 | |||
391 | #include <cstring> // get std::strlen | ||
392 | -#include <cstdio> // get std::snprintf or std::sprintf | ||
393 | +#include <cstdio> // get std::vsnprintf or std::vsprintf | ||
394 | #include <clocale> | ||
395 | #include <langinfo.h> // For codecvt | ||
396 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
397 | #warning fix this | ||
398 | #endif | ||
399 | -#ifdef __UCLIBC_HAS_LOCALE__ | ||
400 | +#ifdef _GLIBCXX_USE_ICONV | ||
401 | #include <iconv.h> // For codecvt using iconv, iconv_t | ||
402 | #endif | ||
403 | -#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ | ||
404 | -#include <libintl.h> // For messages | ||
405 | +#ifdef HAVE_LIBINTL_H | ||
406 | +#include <libintl.h> // For messages | ||
407 | #endif | ||
408 | +#include <cstdarg> | ||
409 | |||
410 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
411 | #warning what is _GLIBCXX_C_LOCALE_GNU for | ||
412 | +// psm: used in os/gnu-linux/ctype_noninline.h | ||
413 | #endif | ||
414 | #define _GLIBCXX_C_LOCALE_GNU 1 | ||
415 | |||
416 | @@ -78,23 +80,25 @@ | ||
417 | #else | ||
418 | typedef int* __c_locale; | ||
419 | #endif | ||
420 | - | ||
421 | - // Convert numeric value of type _Tv to string and return length of | ||
422 | - // string. If snprintf is available use it, otherwise fall back to | ||
423 | - // the unsafe sprintf which, in general, can be dangerous and should | ||
424 | + // Convert numeric value of type double to string and return length of | ||
425 | + // string. If vsnprintf is available use it, otherwise fall back to | ||
426 | + // the unsafe vsprintf which, in general, can be dangerous and should | ||
427 | // be avoided. | ||
428 | - template<typename _Tv> | ||
429 | - int | ||
430 | - __convert_from_v(char* __out, | ||
431 | - const int __size __attribute__ ((__unused__)), | ||
432 | - const char* __fmt, | ||
433 | -#ifdef __UCLIBC_HAS_XCLOCALE__ | ||
434 | - _Tv __v, const __c_locale& __cloc, int __prec) | ||
435 | + inline int | ||
436 | + __convert_from_v(const __c_locale& | ||
437 | +#ifndef __UCLIBC_HAS_XCLOCALE__ | ||
438 | + __cloc __attribute__ ((__unused__)) | ||
439 | +#endif | ||
440 | + , | ||
441 | + char* __out, | ||
442 | + const int __size, | ||
443 | + const char* __fmt, ...) | ||
444 | { | ||
445 | + va_list __args; | ||
446 | +#ifdef __UCLIBC_HAS_XCLOCALE__ | ||
447 | + | ||
448 | __c_locale __old = __gnu_cxx::__uselocale(__cloc); | ||
449 | #else | ||
450 | - _Tv __v, const __c_locale&, int __prec) | ||
451 | - { | ||
452 | # ifdef __UCLIBC_HAS_LOCALE__ | ||
453 | char* __old = std::setlocale(LC_ALL, NULL); | ||
454 | char* __sav = new char[std::strlen(__old) + 1]; | ||
455 | @@ -103,7 +107,9 @@ | ||
456 | # endif | ||
457 | #endif | ||
458 | |||
459 | - const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); | ||
460 | + va_start(__args, __fmt); | ||
461 | + const int __ret = std::vsnprintf(__out, __size, __fmt, __args); | ||
462 | + va_end(__args); | ||
463 | |||
464 | #ifdef __UCLIBC_HAS_XCLOCALE__ | ||
465 | __gnu_cxx::__uselocale(__old); | ||
466 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc | ||
467 | =================================================================== | ||
468 | --- gcc-4.3.2.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-09-17 22:35:28.000000000 -0700 | ||
469 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-09-17 22:35:29.000000000 -0700 | ||
470 | @@ -53,11 +53,14 @@ | ||
471 | const size_t __len = __strftime_l(__s, __maxlen, __format, __tm, | ||
472 | _M_c_locale_timepunct); | ||
473 | #else | ||
474 | - char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
475 | + char* __old = setlocale(LC_ALL, NULL); | ||
476 | + const size_t __llen = strlen(__old) + 1; | ||
477 | + char* __sav = new char[__llen]; | ||
478 | + memcpy(__sav, __old, __llen); | ||
479 | setlocale(LC_ALL, _M_name_timepunct); | ||
480 | const size_t __len = strftime(__s, __maxlen, __format, __tm); | ||
481 | - setlocale(LC_ALL, __old); | ||
482 | - free(__old); | ||
483 | + setlocale(LC_ALL, __sav); | ||
484 | + delete [] __sav; | ||
485 | #endif | ||
486 | // Make sure __s is null terminated. | ||
487 | if (__len == 0) | ||
488 | @@ -207,11 +210,14 @@ | ||
489 | const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm, | ||
490 | _M_c_locale_timepunct); | ||
491 | #else | ||
492 | - char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
493 | + char* __old = setlocale(LC_ALL, NULL); | ||
494 | + const size_t __llen = strlen(__old) + 1; | ||
495 | + char* __sav = new char[__llen]; | ||
496 | + memcpy(__sav, __old, __llen); | ||
497 | setlocale(LC_ALL, _M_name_timepunct); | ||
498 | const size_t __len = wcsftime(__s, __maxlen, __format, __tm); | ||
499 | - setlocale(LC_ALL, __old); | ||
500 | - free(__old); | ||
501 | + setlocale(LC_ALL, __sav); | ||
502 | + delete [] __sav; | ||
503 | #endif | ||
504 | // Make sure __s is null terminated. | ||
505 | if (__len == 0) | ||
506 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h | ||
507 | =================================================================== | ||
508 | --- gcc-4.3.2.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-09-17 22:35:28.000000000 -0700 | ||
509 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-09-17 22:35:29.000000000 -0700 | ||
510 | @@ -31,6 +31,9 @@ | ||
511 | |||
512 | #include <bits/c++config.h> | ||
513 | #include <clocale> | ||
514 | +#include <cstdlib> | ||
515 | +#include <cstring> | ||
516 | +#include <cstddef> | ||
517 | |||
518 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
519 | #warning clean this up | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/300-libstdc++-pic.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/300-libstdc++-pic.patch new file mode 100644 index 0000000000..89d03a85e5 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/300-libstdc++-pic.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | # DP: Build and install libstdc++_pic.a library. | ||
2 | |||
3 | --- gcc-4.1.0/libstdc++-v3/src/Makefile.am 2004-11-15 17:33:05.000000000 -0600 | ||
4 | +++ gcc-4.1.0-patched/libstdc++-v3/src/Makefile.am 2005-04-25 20:05:59.186930896 -0500 | ||
5 | @@ -214,6 +214,10 @@ | ||
6 | $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@ | ||
7 | |||
8 | |||
9 | +install-exec-local: | ||
10 | + $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o | ||
11 | + $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) | ||
12 | + | ||
13 | # Added bits to build debug library. | ||
14 | if GLIBCXX_BUILD_DEBUG | ||
15 | all-local: build_debug | ||
16 | --- gcc-4.1.0/libstdc++-v3/src/Makefile.in 2005-04-11 19:13:08.000000000 -0500 | ||
17 | +++ gcc-4.1.0-patched/libstdc++-v3/src/Makefile.in 2005-04-25 20:12:33.284316275 -0500 | ||
18 | @@ -627,7 +627,7 @@ | ||
19 | |||
20 | install-data-am: install-data-local | ||
21 | |||
22 | -install-exec-am: install-toolexeclibLTLIBRARIES | ||
23 | +install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local | ||
24 | |||
25 | install-info: install-info-am | ||
26 | |||
27 | @@ -660,6 +660,7 @@ | ||
28 | distclean-libtool distclean-tags distdir dvi dvi-am html \ | ||
29 | html-am info info-am install install-am install-data \ | ||
30 | install-data-am install-data-local install-exec \ | ||
31 | + install-exec-local \ | ||
32 | install-exec-am install-info install-info-am install-man \ | ||
33 | install-strip install-toolexeclibLTLIBRARIES installcheck \ | ||
34 | installcheck-am installdirs maintainer-clean \ | ||
35 | @@ -745,6 +746,11 @@ | ||
36 | install_debug: | ||
37 | (cd ${debugdir} && $(MAKE) \ | ||
38 | toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install) | ||
39 | + | ||
40 | +install-exec-local: | ||
41 | + $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o | ||
42 | + $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) | ||
43 | + | ||
44 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
45 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
46 | .NOEXPORT: | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/301-missing-execinfo_h.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/301-missing-execinfo_h.patch new file mode 100644 index 0000000000..0e2092f3fb --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/301-missing-execinfo_h.patch | |||
@@ -0,0 +1,11 @@ | |||
1 | --- gcc-4.0.0/boehm-gc/include/gc.h-orig 2005-04-28 22:28:57.000000000 -0500 | ||
2 | +++ gcc-4.0.0/boehm-gc/include/gc.h 2005-04-28 22:30:38.000000000 -0500 | ||
3 | @@ -500,7 +500,7 @@ | ||
4 | #ifdef __linux__ | ||
5 | # include <features.h> | ||
6 | # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \ | ||
7 | - && !defined(__ia64__) | ||
8 | + && !defined(__ia64__) && !defined(__UCLIBC__) | ||
9 | # ifndef GC_HAVE_BUILTIN_BACKTRACE | ||
10 | # define GC_HAVE_BUILTIN_BACKTRACE | ||
11 | # endif | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/302-c99-snprintf.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/302-c99-snprintf.patch new file mode 100644 index 0000000000..02865865e5 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/302-c99-snprintf.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | Index: gcc-4.3.1/libstdc++-v3/include/c_std/cstdio | ||
2 | =================================================================== | ||
3 | --- gcc-4.3.1.orig/libstdc++-v3/include/c_std/cstdio 2006-12-07 01:35:57.000000000 -0800 | ||
4 | +++ gcc-4.3.1/libstdc++-v3/include/c_std/cstdio 2008-08-16 02:11:37.000000000 -0700 | ||
5 | @@ -144,7 +144,7 @@ | ||
6 | |||
7 | _GLIBCXX_END_NAMESPACE | ||
8 | |||
9 | -#if _GLIBCXX_USE_C99 | ||
10 | +#if _GLIBCXX_USE_C99 || defined(__UCLIBC__) | ||
11 | |||
12 | #undef snprintf | ||
13 | #undef vfscanf | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/303-c99-complex-ugly-hack.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/303-c99-complex-ugly-hack.patch new file mode 100644 index 0000000000..2ccc80d9bb --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/303-c99-complex-ugly-hack.patch | |||
@@ -0,0 +1,12 @@ | |||
1 | --- gcc-4.0.0/libstdc++-v3/configure-old 2005-04-30 22:04:48.061603912 -0500 | ||
2 | +++ gcc-4.0.0/libstdc++-v3/configure 2005-04-30 22:06:13.678588152 -0500 | ||
3 | @@ -7194,6 +7194,9 @@ | ||
4 | cat >>conftest.$ac_ext <<_ACEOF | ||
5 | /* end confdefs.h. */ | ||
6 | #include <complex.h> | ||
7 | +#ifdef __UCLIBC__ | ||
8 | +#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs | ||
9 | +#endif | ||
10 | int | ||
11 | main () | ||
12 | { | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/304-index_macro.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/304-index_macro.patch new file mode 100644 index 0000000000..d8e476555d --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/304-index_macro.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | --- gcc-4.1.0/libstdc++-v3/include/ext/rope.mps 2006-03-24 01:49:51 +0100 | ||
2 | +++ gcc-4.1.0/libstdc++-v3/include/ext/rope 2006-03-24 01:49:37 +0100 | ||
3 | @@ -59,6 +59,9 @@ | ||
4 | #include <bits/allocator.h> | ||
5 | #include <ext/hash_fun.h> | ||
6 | |||
7 | +/* cope w/ index defined as macro, SuSv3 proposal */ | ||
8 | +#undef index | ||
9 | + | ||
10 | # ifdef __GC | ||
11 | # define __GC_CONST const | ||
12 | # else | ||
13 | --- gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h.mps 2006-03-24 01:50:04 +0100 | ||
14 | +++ gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h 2006-03-24 01:50:28 +0100 | ||
15 | @@ -53,6 +53,9 @@ | ||
16 | #include <ext/memory> // For uninitialized_copy_n | ||
17 | #include <ext/numeric> // For power | ||
18 | |||
19 | +/* cope w/ index defined as macro, SuSv3 proposal */ | ||
20 | +#undef index | ||
21 | + | ||
22 | _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) | ||
23 | |||
24 | using std::size_t; | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/305-libmudflap-susv3-legacy.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/305-libmudflap-susv3-legacy.patch new file mode 100644 index 0000000000..374b1f8659 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/305-libmudflap-susv3-legacy.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | Index: gcc-4.2/libmudflap/mf-hooks2.c | ||
2 | =================================================================== | ||
3 | --- gcc-4.2/libmudflap/mf-hooks2.c (revision 119834) | ||
4 | +++ gcc-4.2/libmudflap/mf-hooks2.c (working copy) | ||
5 | @@ -427,7 +427,7 @@ | ||
6 | { | ||
7 | TRACE ("%s\n", __PRETTY_FUNCTION__); | ||
8 | MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region"); | ||
9 | - bzero (s, n); | ||
10 | + memset (s, 0, n); | ||
11 | } | ||
12 | |||
13 | |||
14 | @@ -437,7 +437,7 @@ | ||
15 | TRACE ("%s\n", __PRETTY_FUNCTION__); | ||
16 | MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src"); | ||
17 | MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest"); | ||
18 | - bcopy (src, dest, n); | ||
19 | + memmove (dest, src, n); | ||
20 | } | ||
21 | |||
22 | |||
23 | @@ -447,7 +447,7 @@ | ||
24 | TRACE ("%s\n", __PRETTY_FUNCTION__); | ||
25 | MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg"); | ||
26 | MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg"); | ||
27 | - return bcmp (s1, s2, n); | ||
28 | + return n == 0 ? 0 : memcmp (s1, s2, n); | ||
29 | } | ||
30 | |||
31 | |||
32 | @@ -456,7 +456,7 @@ | ||
33 | size_t n = strlen (s); | ||
34 | TRACE ("%s\n", __PRETTY_FUNCTION__); | ||
35 | MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region"); | ||
36 | - return index (s, c); | ||
37 | + return strchr (s, c); | ||
38 | } | ||
39 | |||
40 | |||
41 | @@ -465,7 +465,7 @@ | ||
42 | size_t n = strlen (s); | ||
43 | TRACE ("%s\n", __PRETTY_FUNCTION__); | ||
44 | MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region"); | ||
45 | - return rindex (s, c); | ||
46 | + return strrchr (s, c); | ||
47 | } | ||
48 | |||
49 | /* XXX: stpcpy, memccpy */ | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/306-libstdc++-namespace.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/306-libstdc++-namespace.patch new file mode 100644 index 0000000000..69587ca63a --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/306-libstdc++-namespace.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h | ||
2 | --- gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2006-12-22 13:06:56.000000000 +0100 | ||
3 | +++ gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h 2006-12-22 15:23:41.000000000 +0100 | ||
4 | @@ -32,7 +32,8 @@ | ||
5 | // | ||
6 | |||
7 | // Written by Benjamin Kosnik <bkoz@redhat.com> | ||
8 | - | ||
9 | +namespace std | ||
10 | +{ | ||
11 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
12 | #warning fix prototypes for *textdomain funcs | ||
13 | #endif | ||
14 | @@ -115,3 +116,4 @@ | ||
15 | this->_S_create_c_locale(this->_M_c_locale_messages, __s); | ||
16 | } | ||
17 | } | ||
18 | +} | ||
19 | diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/time_members.h | ||
20 | --- gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2006-12-22 13:06:56.000000000 +0100 | ||
21 | +++ gcc-4.2/libstdc++-v3/config/locale/uclibc/time_members.h 2006-12-22 15:20:31.000000000 +0100 | ||
22 | @@ -33,7 +33,8 @@ | ||
23 | // | ||
24 | |||
25 | // Written by Benjamin Kosnik <bkoz@redhat.com> | ||
26 | - | ||
27 | +namespace std | ||
28 | +{ | ||
29 | template<typename _CharT> | ||
30 | __timepunct<_CharT>::__timepunct(size_t __refs) | ||
31 | : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), | ||
32 | @@ -74,3 +75,4 @@ | ||
33 | delete _M_data; | ||
34 | _S_destroy_c_locale(_M_c_locale_timepunct); | ||
35 | } | ||
36 | +} | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/307-locale_facets.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/307-locale_facets.patch new file mode 100644 index 0000000000..774fcfa2ca --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/307-locale_facets.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | This patch fixes a bug into ostream::operator<<(double) due to the wrong size | ||
2 | passed into the __convert_from_v method. The wrong size is then passed to | ||
3 | std::snprintf function, that, on uClibc, doens't handle sized 0 buffer. | ||
4 | |||
5 | Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com> | ||
6 | |||
7 | Index: gcc-4.3.1/libstdc++-v3/include/bits/locale_facets.tcc | ||
8 | =================================================================== | ||
9 | --- gcc-4.3.1.orig/libstdc++-v3/include/bits/locale_facets.tcc 2007-11-26 17:59:41.000000000 -0800 | ||
10 | +++ gcc-4.3.1/libstdc++-v3/include/bits/locale_facets.tcc 2008-08-16 02:14:48.000000000 -0700 | ||
11 | @@ -1004,7 +1004,7 @@ | ||
12 | const int __cs_size = __fixed ? __max_exp + __prec + 4 | ||
13 | : __max_digits * 2 + __prec; | ||
14 | char* __cs = static_cast<char*>(__builtin_alloca(__cs_size)); | ||
15 | - __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, __fbuf, | ||
16 | + __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size, __fbuf, | ||
17 | __prec, __v); | ||
18 | #endif | ||
19 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/402-libbackend_dep_gcov-iov.h.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/402-libbackend_dep_gcov-iov.h.patch new file mode 100644 index 0000000000..0bf115c45d --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/402-libbackend_dep_gcov-iov.h.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | Index: gcc-4.2/gcc/Makefile.in | ||
2 | =================================================================== | ||
3 | --- gcc-4.2/gcc/Makefile.in (revision 121758) | ||
4 | +++ gcc-4.2/gcc/Makefile.in (working copy) | ||
5 | @@ -2658,7 +2658,7 @@ mips-tdump.o : mips-tdump.c $(CONFIG_H) | ||
6 | # FIXME: writing proper dependencies for this is a *LOT* of work. | ||
7 | libbackend.o : $(OBJS-common:.o=.c) $(out_file) \ | ||
8 | insn-config.h insn-flags.h insn-codes.h insn-constants.h \ | ||
9 | - insn-attr.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) | ||
10 | + insn-attr.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h | ||
11 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ | ||
12 | -DTARGET_NAME=\"$(target_noncanonical)\" \ | ||
13 | -DLOCALEDIR=\"$(localedir)\" \ | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/602-sdk-libstdc++-includes.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/602-sdk-libstdc++-includes.patch new file mode 100644 index 0000000000..23fce7544d --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/602-sdk-libstdc++-includes.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | --- gcc-4.1.0/libstdc++-v3/fragment.am 2005-03-21 11:40:14.000000000 -0600 | ||
2 | +++ gcc-4.1.0-patched/libstdc++-v3/fragment.am 2005-04-25 20:14:39.856251785 -0500 | ||
3 | @@ -21,5 +21,5 @@ | ||
4 | $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once | ||
5 | |||
6 | # -I/-D flags to pass when compiling. | ||
7 | -AM_CPPFLAGS = $(GLIBCXX_INCLUDES) | ||
8 | +AM_CPPFLAGS = $(GLIBCXX_INCLUDES) -I$(toplevel_srcdir)/include | ||
9 | |||
10 | --- gcc-4.1.0/libstdc++-v3/libmath/Makefile.am 2005-03-21 11:40:18.000000000 -0600 | ||
11 | +++ gcc-4.1.0-patched/libstdc++-v3/libmath/Makefile.am 2005-04-25 20:14:39.682280735 -0500 | ||
12 | @@ -35,7 +35,7 @@ | ||
13 | |||
14 | libmath_la_SOURCES = stubs.c | ||
15 | |||
16 | -AM_CPPFLAGS = $(CANADIAN_INCLUDES) | ||
17 | +AM_CPPFLAGS = $(CANADIAN_INCLUDES) -I$(toplevel_srcdir)/include | ||
18 | |||
19 | # Only compiling "C" sources in this directory. | ||
20 | LIBTOOL = @LIBTOOL@ --tag CC | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/64bithack.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/64bithack.patch new file mode 100644 index 0000000000..f6931b85af --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/64bithack.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | By default gcc places 64 bit libs in a lib64 directory. This makes it use | ||
2 | "lib" instead. | ||
3 | |||
4 | RP 25/7/10 | ||
5 | |||
6 | Index: gcc-4.3.3/gcc/config/i386/t-linux64 | ||
7 | =================================================================== | ||
8 | --- gcc-4.3.3.orig/gcc/config/i386/t-linux64 2007-09-27 20:56:06.000000000 +0100 | ||
9 | +++ gcc-4.3.3/gcc/config/i386/t-linux64 2010-08-03 12:55:04.642189070 +0100 | ||
10 | @@ -12,8 +12,8 @@ | ||
11 | # MULTILIB_OSDIRNAMES according to what is found on the target. | ||
12 | |||
13 | MULTILIB_OPTIONS = m64/m32 | ||
14 | -MULTILIB_DIRNAMES = 64 32 | ||
15 | -MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) | ||
16 | +MULTILIB_DIRNAMES = . 32 | ||
17 | +MULTILIB_OSDIRNAMES = . $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) | ||
18 | |||
19 | LIBGCC = stmp-multilib | ||
20 | INSTALL_LIBGCC = install-multilib | ||
21 | Index: gcc-4.3.3/gcc/config/i386/linux64.h | ||
22 | =================================================================== | ||
23 | --- gcc-4.3.3.orig/gcc/config/i386/linux64.h 2007-08-02 11:49:31.000000000 +0100 | ||
24 | +++ gcc-4.3.3/gcc/config/i386/linux64.h 2010-08-03 13:01:51.621182117 +0100 | ||
25 | @@ -54,7 +54,7 @@ | ||
26 | done. */ | ||
27 | |||
28 | #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" | ||
29 | -#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" | ||
30 | +#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-linux-x86-64.so.2" | ||
31 | |||
32 | #if TARGET_64BIT_DEFAULT | ||
33 | #define SPEC_32 "m32" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/740-sh-pr24836.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/740-sh-pr24836.patch new file mode 100644 index 0000000000..7992282cff --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/740-sh-pr24836.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348 | ||
2 | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24836 | ||
3 | |||
4 | --- gcc/gcc/configure.ac (revision 106699) | ||
5 | +++ gcc/gcc/configure.ac (working copy) | ||
6 | @@ -2446,7 +2446,7 @@ | ||
7 | tls_first_minor=14 | ||
8 | tls_as_opt="-m64 -Aesame --fatal-warnings" | ||
9 | ;; | ||
10 | - sh-*-* | sh[34]-*-*) | ||
11 | + sh-*-* | sh[34]*-*-*) | ||
12 | conftest_s=' | ||
13 | .section ".tdata","awT",@progbits | ||
14 | foo: .long 25 | ||
15 | --- gcc/gcc/configure | ||
16 | +++ gcc/gcc/configure | ||
17 | @@ -14846,7 +14846,7 @@ | ||
18 | tls_first_minor=14 | ||
19 | tls_as_opt="-m64 -Aesame --fatal-warnings" | ||
20 | ;; | ||
21 | - sh-*-* | sh[34]-*-*) | ||
22 | + sh-*-* | sh[34]*-*-*) | ||
23 | conftest_s=' | ||
24 | .section ".tdata","awT",@progbits | ||
25 | foo: .long 25 | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/800-arm-bigendian.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/800-arm-bigendian.patch new file mode 100644 index 0000000000..f433942783 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/800-arm-bigendian.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | By Lennert Buytenhek <buytenh@wantstofly.org> | ||
2 | Adds support for arm*b-linux* big-endian ARM targets | ||
3 | |||
4 | See http://gcc.gnu.org/PR16350 | ||
5 | |||
6 | Index: gcc-4.3.2/gcc/config/arm/linux-elf.h | ||
7 | =================================================================== | ||
8 | --- gcc-4.3.2.orig/gcc/config/arm/linux-elf.h 2007-11-08 05:44:09.000000000 -0800 | ||
9 | +++ gcc-4.3.2/gcc/config/arm/linux-elf.h 2008-08-28 21:08:30.000000000 -0700 | ||
10 | @@ -51,7 +51,7 @@ | ||
11 | |||
12 | #undef MULTILIB_DEFAULTS | ||
13 | #define MULTILIB_DEFAULTS \ | ||
14 | - { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" } | ||
15 | + { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" } | ||
16 | |||
17 | /* Now we define the strings used to build the spec file. */ | ||
18 | #undef LIB_SPEC | ||
19 | Index: gcc-4.3.2/gcc/config.gcc | ||
20 | =================================================================== | ||
21 | --- gcc-4.3.2.orig/gcc/config.gcc 2008-08-28 20:57:39.000000000 -0700 | ||
22 | +++ gcc-4.3.2/gcc/config.gcc 2008-08-28 21:00:11.000000000 -0700 | ||
23 | @@ -742,6 +742,11 @@ | ||
24 | esac | ||
25 | tmake_file="${tmake_file} t-linux arm/t-arm" | ||
26 | case ${target} in | ||
27 | + arm*b-*) | ||
28 | + tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" | ||
29 | + ;; | ||
30 | + esac | ||
31 | + case ${target} in | ||
32 | arm*-*-linux-*eabi) | ||
33 | tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h" | ||
34 | tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/801-arm-bigendian-eabi.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/801-arm-bigendian-eabi.patch new file mode 100644 index 0000000000..54490fc24f --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/801-arm-bigendian-eabi.patch | |||
@@ -0,0 +1,14 @@ | |||
1 | Index: gcc-4.1.1/gcc/config/arm/linux-eabi.h | ||
2 | =================================================================== | ||
3 | --- gcc-4.1.1.orig/gcc/config/arm/linux-eabi.h 2007-02-20 14:51:33.416193250 +0100 | ||
4 | +++ gcc-4.1.1/gcc/config/arm/linux-eabi.h 2007-02-20 14:52:11.622581000 +0100 | ||
5 | @@ -48,7 +48,8 @@ | ||
6 | #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi | ||
7 | |||
8 | #undef SUBTARGET_EXTRA_LINK_SPEC | ||
9 | -#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi" | ||
10 | +#define SUBTARGET_EXTRA_LINK_SPEC \ | ||
11 | + " %{mbig-endian:-m armelfb_linux_eabi} %{mlittle-endian:-m armelf_linux_eabi} " | ||
12 | |||
13 | /* Use ld-linux.so.3 so that it will be possible to run "classic" | ||
14 | GNU/Linux binaries on an EABI system. */ | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/904-flatten-switch-stmt-00.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/904-flatten-switch-stmt-00.patch new file mode 100644 index 0000000000..8fac37c4df --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/904-flatten-switch-stmt-00.patch | |||
@@ -0,0 +1,153 @@ | |||
1 | Hi, | ||
2 | |||
3 | The attached patch makes sure that we create smaller object code for | ||
4 | simple switch statements. We just make sure to flatten the switch | ||
5 | statement into an if-else chain, basically. | ||
6 | |||
7 | This fixes a size-regression as compared to gcc-3.4, as can be seen | ||
8 | below. | ||
9 | |||
10 | 2007-04-15 Bernhard Fischer <..> | ||
11 | |||
12 | * stmt.c (expand_case): Do not create a complex binary tree when | ||
13 | optimizing for size but rather use the simple ordered list. | ||
14 | (emit_case_nodes): do not emit jumps to the default_label when | ||
15 | optimizing for size. | ||
16 | |||
17 | Not regtested so far. | ||
18 | Comments? | ||
19 | |||
20 | Attached is the test switch.c mentioned below. | ||
21 | |||
22 | $ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do | ||
23 | gcc-$i -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done | ||
24 | $ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do | ||
25 | gcc-$i -UCHAIN -Os -o switch-$i.o -c switch.c ;done | ||
26 | |||
27 | $ size switch-*.o | ||
28 | text data bss dec hex filename | ||
29 | 169 0 0 169 a9 switch-2.95.o | ||
30 | 115 0 0 115 73 switch-3.3.o | ||
31 | 103 0 0 103 67 switch-3.4.o | ||
32 | 124 0 0 124 7c switch-4.0.o | ||
33 | 124 0 0 124 7c switch-4.1.o | ||
34 | 124 0 0 124 7c switch-4.2.orig-HEAD.o | ||
35 | 95 0 0 95 5f switch-4.3-HEAD.o | ||
36 | 124 0 0 124 7c switch-4.3.orig-HEAD.o | ||
37 | 166 0 0 166 a6 switch-CHAIN-2.95.o | ||
38 | 111 0 0 111 6f switch-CHAIN-3.3.o | ||
39 | 95 0 0 95 5f switch-CHAIN-3.4.o | ||
40 | 95 0 0 95 5f switch-CHAIN-4.0.o | ||
41 | 95 0 0 95 5f switch-CHAIN-4.1.o | ||
42 | 95 0 0 95 5f switch-CHAIN-4.2.orig-HEAD.o | ||
43 | 95 0 0 95 5f switch-CHAIN-4.3-HEAD.o | ||
44 | 95 0 0 95 5f switch-CHAIN-4.3.orig-HEAD.o | ||
45 | |||
46 | |||
47 | Content-Type: text/x-diff; charset=us-ascii | ||
48 | Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff" | ||
49 | |||
50 | Index: gcc-4.2.0/gcc/stmt.c | ||
51 | =================================================================== | ||
52 | --- gcc-4.2.0.orig/gcc/stmt.c (revision 123843) | ||
53 | +++ gcc-4.2.0/gcc/stmt.c (working copy) | ||
54 | @@ -2517,7 +2517,11 @@ expand_case (tree exp) | ||
55 | use_cost_table | ||
56 | = (TREE_CODE (orig_type) != ENUMERAL_TYPE | ||
57 | && estimate_case_costs (case_list)); | ||
58 | - balance_case_nodes (&case_list, NULL); | ||
59 | + /* When optimizing for size, we want a straight list to avoid | ||
60 | + jumps as much as possible. This basically creates an if-else | ||
61 | + chain. */ | ||
62 | + if (!optimize_size) | ||
63 | + balance_case_nodes (&case_list, NULL); | ||
64 | emit_case_nodes (index, case_list, default_label, index_type); | ||
65 | emit_jump (default_label); | ||
66 | } | ||
67 | @@ -3075,6 +3079,7 @@ emit_case_nodes (rtx index, case_node_pt | ||
68 | { | ||
69 | if (!node_has_low_bound (node, index_type)) | ||
70 | { | ||
71 | + if (!optimize_size) /* don't jl to the .default_label. */ | ||
72 | emit_cmp_and_jump_insns (index, | ||
73 | convert_modes | ||
74 | (mode, imode, | ||
75 | |||
76 | |||
77 | Content-Type: text/x-csrc; charset=us-ascii | ||
78 | Content-Disposition: attachment; filename="switch.c" | ||
79 | |||
80 | int | ||
81 | commutative_tree_code (int code) | ||
82 | { | ||
83 | #define CASE(val, ret) case val:/* __asm__("# val="#val ",ret="#ret);*/ return ret; | ||
84 | #ifndef CHAIN | ||
85 | switch (code) | ||
86 | { | ||
87 | # if 1 | ||
88 | CASE(1,3) | ||
89 | CASE(3,2) | ||
90 | CASE(5,8) | ||
91 | CASE(7,1) | ||
92 | CASE(33,4) | ||
93 | CASE(44,9) | ||
94 | CASE(55,10) | ||
95 | CASE(66,-1) | ||
96 | CASE(77,99) | ||
97 | CASE(666,0) | ||
98 | # else | ||
99 | case 1: | ||
100 | return 3; | ||
101 | case 3: | ||
102 | return 2; | ||
103 | case 5: | ||
104 | return 8; | ||
105 | case 7: | ||
106 | return 1; | ||
107 | case 33: | ||
108 | return 4; | ||
109 | case 44: | ||
110 | return 9; | ||
111 | case 55: | ||
112 | return 10; | ||
113 | case 66: | ||
114 | return -1; | ||
115 | case 77: | ||
116 | return 99; | ||
117 | case 666: | ||
118 | return 0; | ||
119 | # endif | ||
120 | default: | ||
121 | break; | ||
122 | } | ||
123 | return 4711; | ||
124 | |||
125 | #else | ||
126 | if (code == 1) | ||
127 | return 3; | ||
128 | else if (code == 3) | ||
129 | return 2; | ||
130 | else if (code == 5) | ||
131 | return 8; | ||
132 | else if (code == 7) | ||
133 | return 1; | ||
134 | else if (code == 33) | ||
135 | return 4; | ||
136 | else if (code == 44) | ||
137 | return 9; | ||
138 | else if (code == 55) | ||
139 | return 10; | ||
140 | else if (code == 66) | ||
141 | return -1; | ||
142 | else if (code == 77) | ||
143 | return 99; | ||
144 | else if (code == 666) | ||
145 | return 0; | ||
146 | else | ||
147 | return 4711; | ||
148 | #endif | ||
149 | } | ||
150 | |||
151 | |||
152 | --AhhlLboLdkugWU4S-- | ||
153 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/arm-nolibfloat.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/arm-nolibfloat.patch new file mode 100644 index 0000000000..c4897c0330 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/arm-nolibfloat.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | # Dimitry Andric <dimitry@andric.com>, 2004-05-01 | ||
2 | # | ||
3 | # * Removed the extra -lfloat option from LIBGCC_SPEC, since it isn't needed | ||
4 | # anymore. (The required functions are now in libgcc.) | ||
5 | # | ||
6 | # Fixes errors like | ||
7 | # arm-softfloat-linux-gnu/3.4.0/../../../../arm-softfloat-linux-gnu/bin/ld: cannot find -lfloat | ||
8 | # collect2: ld returned 1 exit status | ||
9 | # make[2]: *** [arm-softfloat-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/iconvdata/ISO8859-1.so] Error 1 | ||
10 | # when building glibc-2.3.3 with gcc-3.4.0 for arm-softfloat | ||
11 | |||
12 | Index: gcc-4.0.2/gcc/config/arm/linux-elf.h | ||
13 | =================================================================== | ||
14 | --- gcc-4.0.2.orig/gcc/config/arm/linux-elf.h 2005-03-04 16:14:01.000000000 +0000 | ||
15 | +++ gcc-4.0.2/gcc/config/arm/linux-elf.h 2005-11-11 18:02:54.000000000 +0000 | ||
16 | @@ -56,7 +56,7 @@ | ||
17 | %{shared:-lc} \ | ||
18 | %{!shared:%{profile:-lc_p}%{!profile:-lc}}" | ||
19 | |||
20 | -#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc" | ||
21 | +#define LIBGCC_SPEC "-lgcc" | ||
22 | |||
23 | /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add | ||
24 | the GNU/Linux magical crtbegin.o file (see crtstuff.c) which | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/arm-softfloat.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/arm-softfloat.patch new file mode 100644 index 0000000000..5e1edd9208 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/arm-softfloat.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | Index: gcc-4.0.2/gcc/config/arm/t-linux | ||
2 | =================================================================== | ||
3 | --- gcc-4.0.2.orig/gcc/config/arm/t-linux 2004-05-15 12:41:35.000000000 +0000 | ||
4 | +++ gcc-4.0.2/gcc/config/arm/t-linux 2005-11-11 16:07:53.000000000 +0000 | ||
5 | @@ -4,7 +4,10 @@ | ||
6 | LIBGCC2_DEBUG_CFLAGS = -g0 | ||
7 | |||
8 | LIB1ASMSRC = arm/lib1funcs.asm | ||
9 | -LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx | ||
10 | +LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \ | ||
11 | + _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \ | ||
12 | + _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ | ||
13 | + _fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundisf _floatundidf | ||
14 | |||
15 | # MULTILIB_OPTIONS = mhard-float/msoft-float | ||
16 | # MULTILIB_DIRNAMES = hard-float soft-float | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/arm-thumb-cache.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/arm-thumb-cache.patch new file mode 100644 index 0000000000..fa63846c8c --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/arm-thumb-cache.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | --- gcc-4.1.1/gcc/config/arm/linux-gas.h- 2005-06-25 03:22:41.000000000 +0200 | ||
2 | +++ gcc-4.1.1/gcc/config/arm/linux-gas.h 2006-06-18 10:23:46.000000000 +0200 | ||
3 | @@ -44,6 +44,7 @@ | ||
4 | |||
5 | /* Clear the instruction cache from `beg' to `end'. This makes an | ||
6 | inline system call to SYS_cacheflush. */ | ||
7 | +#if !defined(__thumb__) | ||
8 | #define CLEAR_INSN_CACHE(BEG, END) \ | ||
9 | { \ | ||
10 | register unsigned long _beg __asm ("a1") = (unsigned long) (BEG); \ | ||
11 | @@ -53,3 +54,18 @@ | ||
12 | : "=r" (_beg) \ | ||
13 | : "0" (_beg), "r" (_end), "r" (_flg)); \ | ||
14 | } | ||
15 | +#else | ||
16 | +#define CLEAR_INSN_CACHE(BEG, END) \ | ||
17 | +{ \ | ||
18 | + register unsigned long _beg __asm ("a1") = (unsigned long) (BEG); \ | ||
19 | + register unsigned long _end __asm ("a2") = (unsigned long) (END); \ | ||
20 | + register unsigned long _flg __asm ("a3") = 0; \ | ||
21 | + register unsigned long _swi __asm ("a4") = 0xf0002; \ | ||
22 | + __asm __volatile ("push {r7}\n" \ | ||
23 | + " mov r7,a4\n" \ | ||
24 | + " swi 0 @ sys_cacheflush\n" \ | ||
25 | + " pop {r7}\n" \ | ||
26 | + : "=r" (_beg) \ | ||
27 | + : "0" (_beg), "r" (_end), "r" (_flg), "r" (_swi)); \ | ||
28 | +} | ||
29 | +#endif | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/arm-thumb.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/arm-thumb.patch new file mode 100644 index 0000000000..7b0b8b2ddc --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/arm-thumb.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | |||
2 | # | ||
3 | # Patch managed by http://www.holgerschurig.de/patcher.html | ||
4 | # | ||
5 | |||
6 | Index: gcc-4.3.1/gcc/config/arm/lib1funcs.asm | ||
7 | =================================================================== | ||
8 | --- gcc-4.3.1.orig/gcc/config/arm/lib1funcs.asm 2007-05-30 12:04:09.000000000 -0700 | ||
9 | +++ gcc-4.3.1/gcc/config/arm/lib1funcs.asm 2008-08-28 21:51:17.000000000 -0700 | ||
10 | @@ -1225,11 +1225,12 @@ | ||
11 | code here switches to the correct mode before executing the function. */ | ||
12 | |||
13 | .text | ||
14 | - .align 0 | ||
15 | + .align 1 | ||
16 | .force_thumb | ||
17 | |||
18 | .macro call_via register | ||
19 | THUMB_FUNC_START _call_via_\register | ||
20 | + .hidden SYM (_call_via_\register) | ||
21 | |||
22 | bx \register | ||
23 | nop | ||
24 | @@ -1330,6 +1331,7 @@ | ||
25 | .code 16 | ||
26 | |||
27 | THUMB_FUNC_START _interwork_call_via_\register | ||
28 | + .hidden SYM (_interwork_call_via_\register) | ||
29 | |||
30 | bx pc | ||
31 | nop | ||
32 | Index: gcc-4.3.1/gcc/config/arm/t-linux | ||
33 | =================================================================== | ||
34 | --- gcc-4.3.1.orig/gcc/config/arm/t-linux 2008-08-28 21:25:24.000000000 -0700 | ||
35 | +++ gcc-4.3.1/gcc/config/arm/t-linux 2008-08-28 21:51:17.000000000 -0700 | ||
36 | @@ -6,6 +6,7 @@ | ||
37 | LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \ | ||
38 | _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \ | ||
39 | _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ | ||
40 | + _call_via_rX \ | ||
41 | _fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundisf _floatundidf | ||
42 | |||
43 | # MULTILIB_OPTIONS = mhard-float/msoft-float | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/cache-amnesia.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/cache-amnesia.patch new file mode 100644 index 0000000000..fb4d1a26d8 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/cache-amnesia.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | --- | ||
2 | gcc/configure | 2 +- | ||
3 | gcc/configure.ac | 2 +- | ||
4 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
5 | |||
6 | Index: gcc-4.3.1/gcc/configure | ||
7 | =================================================================== | ||
8 | --- gcc-4.3.1.orig/gcc/configure 2008-08-20 00:27:57.000000000 -0700 | ||
9 | +++ gcc-4.3.1/gcc/configure 2008-08-20 00:45:11.000000000 -0700 | ||
10 | @@ -12813,7 +12813,7 @@ else | ||
11 | esac | ||
12 | saved_CFLAGS="${CFLAGS}" | ||
13 | CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ | ||
14 | - ${realsrcdir}/configure \ | ||
15 | + CONFIG_SITE= ${realsrcdir}/configure --cache-file=./other.cache \ | ||
16 | --enable-languages=${enable_languages-all} \ | ||
17 | --target=$target_alias --host=$build_alias --build=$build_alias | ||
18 | CFLAGS="${saved_CFLAGS}" | ||
19 | Index: gcc-4.3.1/gcc/configure.ac | ||
20 | =================================================================== | ||
21 | --- gcc-4.3.1.orig/gcc/configure.ac 2008-08-20 00:27:57.000000000 -0700 | ||
22 | +++ gcc-4.3.1/gcc/configure.ac 2008-08-20 00:44:52.000000000 -0700 | ||
23 | @@ -1480,7 +1480,7 @@ else | ||
24 | esac | ||
25 | saved_CFLAGS="${CFLAGS}" | ||
26 | CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ | ||
27 | - ${realsrcdir}/configure \ | ||
28 | + CONFIG_SITE= ${realsrcdir}/configure --cache-file=./other.cache \ | ||
29 | --enable-languages=${enable_languages-all} \ | ||
30 | --target=$target_alias --host=$build_alias --build=$build_alias | ||
31 | CFLAGS="${saved_CFLAGS}" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/debian/arm-unbreak-eabi-armv4t.dpatch b/meta/recipes-devtools/gcc/gcc-4.3.3/debian/arm-unbreak-eabi-armv4t.dpatch new file mode 100644 index 0000000000..7bb8887068 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/debian/arm-unbreak-eabi-armv4t.dpatch | |||
@@ -0,0 +1,36 @@ | |||
1 | #! /bin/sh -e | ||
2 | |||
3 | # DP: Fix armv4t build on ARM | ||
4 | |||
5 | dir= | ||
6 | if [ $# -eq 3 -a "$2" = '-d' ]; then | ||
7 | pdir="-d $3" | ||
8 | dir="$3/" | ||
9 | elif [ $# -ne 1 ]; then | ||
10 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
11 | exit 1 | ||
12 | fi | ||
13 | case "$1" in | ||
14 | -patch) | ||
15 | patch $pdir -f --no-backup-if-mismatch -p1 < $0 | ||
16 | ;; | ||
17 | -unpatch) | ||
18 | patch $pdir -f --no-backup-if-mismatch -R -p1 < $0 | ||
19 | ;; | ||
20 | *) | ||
21 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
22 | exit 1 | ||
23 | esac | ||
24 | exit 0 | ||
25 | |||
26 | --- src/gcc/config/arm/linux-eabi.h.orig 2007-11-24 12:37:38.000000000 +0000 | ||
27 | +++ src/gcc/config/arm/linux-eabi.h 2007-11-24 12:39:41.000000000 +0000 | ||
28 | @@ -44,7 +44,7 @@ | ||
29 | The ARM10TDMI core is the default for armv5t, so set | ||
30 | SUBTARGET_CPU_DEFAULT to achieve this. */ | ||
31 | #undef SUBTARGET_CPU_DEFAULT | ||
32 | -#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi | ||
33 | +#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi | ||
34 | |||
35 | /* TARGET_BIG_ENDIAN_DEFAULT is set in | ||
36 | config.gcc for big endian configurations. */ | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/debian/gcc-ice-hack.dpatch b/meta/recipes-devtools/gcc/gcc-4.3.3/debian/gcc-ice-hack.dpatch new file mode 100644 index 0000000000..84c5ef2ebd --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/debian/gcc-ice-hack.dpatch | |||
@@ -0,0 +1,331 @@ | |||
1 | #! /bin/sh -e | ||
2 | |||
3 | # DP: Retry the build on an ice, save the calling options and preprocessed | ||
4 | # DP: source when the ice is reproducible. | ||
5 | |||
6 | dir= | ||
7 | if [ $# -eq 3 -a "$2" = '-d' ]; then | ||
8 | pdir="-d $3" | ||
9 | dir="$3/" | ||
10 | elif [ $# -ne 1 ]; then | ||
11 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
12 | exit 1 | ||
13 | fi | ||
14 | case "$1" in | ||
15 | -patch) | ||
16 | patch $pdir -f --no-backup-if-mismatch -p0 < $0 | ||
17 | ;; | ||
18 | -unpatch) | ||
19 | patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 | ||
20 | ;; | ||
21 | *) | ||
22 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
23 | exit 1 | ||
24 | esac | ||
25 | exit 0 | ||
26 | |||
27 | 2004-01-23 Jakub Jelinek <jakub@redhat.com> | ||
28 | |||
29 | * system.h (ICE_EXIT_CODE): Define. | ||
30 | * gcc.c (execute): Don't free first string early, but at the end | ||
31 | of the function. Call retry_ice if compiler exited with | ||
32 | ICE_EXIT_CODE. | ||
33 | (retry_ice): New function. | ||
34 | * diagnostic.c (diagnostic_count_diagnostic, | ||
35 | diagnostic_action_after_output, error_recursion): Exit with | ||
36 | ICE_EXIT_CODE instead of FATAL_EXIT_CODE. | ||
37 | |||
38 | --- gcc/diagnostic.c.orig 2007-09-30 10:48:13.000000000 +0000 | ||
39 | +++ gcc/diagnostic.c 2007-09-30 10:49:57.000000000 +0000 | ||
40 | @@ -244,7 +244,7 @@ | ||
41 | fnotice (stderr, "Please submit a full bug report,\n" | ||
42 | "with preprocessed source if appropriate.\n" | ||
43 | "See %s for instructions.\n", bug_report_url); | ||
44 | - exit (ICE_EXIT_CODE); | ||
45 | + exit (FATAL_EXIT_CODE); | ||
46 | |||
47 | case DK_FATAL: | ||
48 | if (context->abort_on_error) | ||
49 | --- gcc/gcc.c.orig 2007-09-30 10:48:13.000000000 +0000 | ||
50 | +++ gcc/gcc.c 2007-09-30 10:48:39.000000000 +0000 | ||
51 | @@ -357,6 +357,9 @@ | ||
52 | #if defined(HAVE_TARGET_OBJECT_SUFFIX) || defined(HAVE_TARGET_EXECUTABLE_SUFFIX) | ||
53 | static const char *convert_filename (const char *, int, int); | ||
54 | #endif | ||
55 | +#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS)) | ||
56 | +static void retry_ice (const char *prog, const char **argv); | ||
57 | +#endif | ||
58 | |||
59 | static const char *getenv_spec_function (int, const char **); | ||
60 | static const char *if_exists_spec_function (int, const char **); | ||
61 | @@ -2999,7 +3002,7 @@ | ||
62 | } | ||
63 | } | ||
64 | |||
65 | - if (string != commands[i].prog) | ||
66 | + if (i && string != commands[i].prog) | ||
67 | free (CONST_CAST (char *, string)); | ||
68 | } | ||
69 | |||
70 | @@ -3056,6 +3059,16 @@ | ||
71 | else if (WIFEXITED (status) | ||
72 | && WEXITSTATUS (status) >= MIN_FATAL_STATUS) | ||
73 | { | ||
74 | +#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS)) | ||
75 | + /* For ICEs in cc1, cc1obj, cc1plus see if it is | ||
76 | + reproducible or not. */ | ||
77 | + char *p; | ||
78 | + if (WEXITSTATUS (status) == ICE_EXIT_CODE | ||
79 | + && i == 0 | ||
80 | + && (p = strrchr (commands[0].argv[0], DIR_SEPARATOR)) | ||
81 | + && ! strncmp (p + 1, "cc1", 3)) | ||
82 | + retry_ice (commands[0].prog, commands[0].argv); | ||
83 | +#endif | ||
84 | if (WEXITSTATUS (status) > greatest_status) | ||
85 | greatest_status = WEXITSTATUS (status); | ||
86 | ret_code = -1; | ||
87 | @@ -3076,6 +3089,9 @@ | ||
88 | } | ||
89 | } | ||
90 | |||
91 | + if (commands[0].argv[0] != commands[0].prog) | ||
92 | + free ((PTR) commands[0].argv[0]); | ||
93 | + | ||
94 | return ret_code; | ||
95 | } | ||
96 | } | ||
97 | @@ -6016,6 +6032,224 @@ | ||
98 | switches[switchnum].validated = 1; | ||
99 | } | ||
100 | |||
101 | +#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS)) | ||
102 | +#define RETRY_ICE_ATTEMPTS 2 | ||
103 | + | ||
104 | +static void | ||
105 | +retry_ice (const char *prog, const char **argv) | ||
106 | +{ | ||
107 | + int nargs, out_arg = -1, quiet = 0, attempt; | ||
108 | + int pid, retries, sleep_interval; | ||
109 | + const char **new_argv; | ||
110 | + char *temp_filenames[RETRY_ICE_ATTEMPTS * 2 + 2]; | ||
111 | + | ||
112 | + if (input_filename == NULL || ! strcmp (input_filename, "-")) | ||
113 | + return; | ||
114 | + | ||
115 | + for (nargs = 0; argv[nargs] != NULL; ++nargs) | ||
116 | + /* Only retry compiler ICEs, not preprocessor ones. */ | ||
117 | + if (! strcmp (argv[nargs], "-E")) | ||
118 | + return; | ||
119 | + else if (argv[nargs][0] == '-' && argv[nargs][1] == 'o') | ||
120 | + { | ||
121 | + if (out_arg == -1) | ||
122 | + out_arg = nargs; | ||
123 | + else | ||
124 | + return; | ||
125 | + } | ||
126 | + /* If the compiler is going to output any time information, | ||
127 | + it might vary between invocations. */ | ||
128 | + else if (! strcmp (argv[nargs], "-quiet")) | ||
129 | + quiet = 1; | ||
130 | + else if (! strcmp (argv[nargs], "-ftime-report")) | ||
131 | + return; | ||
132 | + | ||
133 | + if (out_arg == -1 || !quiet) | ||
134 | + return; | ||
135 | + | ||
136 | + memset (temp_filenames, '\0', sizeof (temp_filenames)); | ||
137 | + new_argv = alloca ((nargs + 3) * sizeof (const char *)); | ||
138 | + memcpy (new_argv, argv, (nargs + 1) * sizeof (const char *)); | ||
139 | + new_argv[nargs++] = "-frandom-seed=0"; | ||
140 | + new_argv[nargs] = NULL; | ||
141 | + if (new_argv[out_arg][2] == '\0') | ||
142 | + new_argv[out_arg + 1] = "-"; | ||
143 | + else | ||
144 | + new_argv[out_arg] = "-o-"; | ||
145 | + | ||
146 | + for (attempt = 0; attempt < RETRY_ICE_ATTEMPTS + 1; ++attempt) | ||
147 | + { | ||
148 | + int fd = -1; | ||
149 | + int status; | ||
150 | + | ||
151 | + temp_filenames[attempt * 2] = make_temp_file (".out"); | ||
152 | + temp_filenames[attempt * 2 + 1] = make_temp_file (".err"); | ||
153 | + | ||
154 | + if (attempt == RETRY_ICE_ATTEMPTS) | ||
155 | + { | ||
156 | + int i; | ||
157 | + int fd1, fd2; | ||
158 | + struct stat st1, st2; | ||
159 | + size_t n, len; | ||
160 | + char *buf; | ||
161 | + | ||
162 | + buf = xmalloc (8192); | ||
163 | + | ||
164 | + for (i = 0; i < 2; ++i) | ||
165 | + { | ||
166 | + fd1 = open (temp_filenames[i], O_RDONLY); | ||
167 | + fd2 = open (temp_filenames[2 + i], O_RDONLY); | ||
168 | + | ||
169 | + if (fd1 < 0 || fd2 < 0) | ||
170 | + { | ||
171 | + i = -1; | ||
172 | + close (fd1); | ||
173 | + close (fd2); | ||
174 | + break; | ||
175 | + } | ||
176 | + | ||
177 | + if (fstat (fd1, &st1) < 0 || fstat (fd2, &st2) < 0) | ||
178 | + { | ||
179 | + i = -1; | ||
180 | + close (fd1); | ||
181 | + close (fd2); | ||
182 | + break; | ||
183 | + } | ||
184 | + | ||
185 | + if (st1.st_size != st2.st_size) | ||
186 | + { | ||
187 | + close (fd1); | ||
188 | + close (fd2); | ||
189 | + break; | ||
190 | + } | ||
191 | + | ||
192 | + len = 0; | ||
193 | + for (n = st1.st_size; n; n -= len) | ||
194 | + { | ||
195 | + len = n; | ||
196 | + if (len > 4096) | ||
197 | + len = 4096; | ||
198 | + | ||
199 | + if (read (fd1, buf, len) != (int) len | ||
200 | + || read (fd2, buf + 4096, len) != (int) len) | ||
201 | + { | ||
202 | + i = -1; | ||
203 | + break; | ||
204 | + } | ||
205 | + | ||
206 | + if (memcmp (buf, buf + 4096, len) != 0) | ||
207 | + break; | ||
208 | + } | ||
209 | + | ||
210 | + close (fd1); | ||
211 | + close (fd2); | ||
212 | + | ||
213 | + if (n) | ||
214 | + break; | ||
215 | + } | ||
216 | + | ||
217 | + free (buf); | ||
218 | + if (i == -1) | ||
219 | + break; | ||
220 | + | ||
221 | + if (i != 2) | ||
222 | + { | ||
223 | + notice ("The bug is not reproducible, so it is likely a hardware or OS problem.\n"); | ||
224 | + break; | ||
225 | + } | ||
226 | + | ||
227 | + fd = open (temp_filenames[attempt * 2], O_RDWR); | ||
228 | + if (fd < 0) | ||
229 | + break; | ||
230 | + write (fd, "//", 2); | ||
231 | + for (i = 0; i < nargs; i++) | ||
232 | + { | ||
233 | + write (fd, " ", 1); | ||
234 | + write (fd, new_argv[i], strlen (new_argv[i])); | ||
235 | + } | ||
236 | + write (fd, "\n", 1); | ||
237 | + new_argv[nargs] = "-E"; | ||
238 | + new_argv[nargs + 1] = NULL; | ||
239 | + } | ||
240 | + | ||
241 | + /* Fork a subprocess; wait and retry if it fails. */ | ||
242 | + sleep_interval = 1; | ||
243 | + pid = -1; | ||
244 | + for (retries = 0; retries < 4; retries++) | ||
245 | + { | ||
246 | + pid = fork (); | ||
247 | + if (pid >= 0) | ||
248 | + break; | ||
249 | + sleep (sleep_interval); | ||
250 | + sleep_interval *= 2; | ||
251 | + } | ||
252 | + | ||
253 | + if (pid < 0) | ||
254 | + break; | ||
255 | + else if (pid == 0) | ||
256 | + { | ||
257 | + if (attempt != RETRY_ICE_ATTEMPTS) | ||
258 | + fd = open (temp_filenames[attempt * 2], O_RDWR); | ||
259 | + if (fd < 0) | ||
260 | + exit (-1); | ||
261 | + if (fd != 1) | ||
262 | + { | ||
263 | + close (1); | ||
264 | + dup (fd); | ||
265 | + close (fd); | ||
266 | + } | ||
267 | + | ||
268 | + fd = open (temp_filenames[attempt * 2 + 1], O_RDWR); | ||
269 | + if (fd < 0) | ||
270 | + exit (-1); | ||
271 | + if (fd != 2) | ||
272 | + { | ||
273 | + close (2); | ||
274 | + dup (fd); | ||
275 | + close (fd); | ||
276 | + } | ||
277 | + | ||
278 | + if (prog == new_argv[0]) | ||
279 | + execvp (prog, (char *const *) new_argv); | ||
280 | + else | ||
281 | + execv (new_argv[0], (char *const *) new_argv); | ||
282 | + exit (-1); | ||
283 | + } | ||
284 | + | ||
285 | + if (waitpid (pid, &status, 0) < 0) | ||
286 | + break; | ||
287 | + | ||
288 | + if (attempt < RETRY_ICE_ATTEMPTS | ||
289 | + && (! WIFEXITED (status) || WEXITSTATUS (status) != ICE_EXIT_CODE)) | ||
290 | + { | ||
291 | + notice ("The bug is not reproducible, so it is likely a hardware or OS problem.\n"); | ||
292 | + break; | ||
293 | + } | ||
294 | + else if (attempt == RETRY_ICE_ATTEMPTS) | ||
295 | + { | ||
296 | + close (fd); | ||
297 | + if (WIFEXITED (status) | ||
298 | + && WEXITSTATUS (status) == SUCCESS_EXIT_CODE) | ||
299 | + { | ||
300 | + notice ("Preprocessed source stored into %s file, please attach this to your bugreport.\n", | ||
301 | + temp_filenames[attempt * 2]); | ||
302 | + /* Make sure it is not deleted. */ | ||
303 | + free (temp_filenames[attempt * 2]); | ||
304 | + temp_filenames[attempt * 2] = NULL; | ||
305 | + break; | ||
306 | + } | ||
307 | + } | ||
308 | + } | ||
309 | + | ||
310 | + for (attempt = 0; attempt < RETRY_ICE_ATTEMPTS * 2 + 2; attempt++) | ||
311 | + if (temp_filenames[attempt]) | ||
312 | + { | ||
313 | + unlink (temp_filenames[attempt]); | ||
314 | + free (temp_filenames[attempt]); | ||
315 | + } | ||
316 | +} | ||
317 | +#endif | ||
318 | + | ||
319 | /* Search for a file named NAME trying various prefixes including the | ||
320 | user's -B prefix and some standard ones. | ||
321 | Return the absolute file name found. If nothing is found, return NAME. */ | ||
322 | --- gcc/Makefile.in.orig 2007-09-30 10:48:13.000000000 +0000 | ||
323 | +++ gcc/Makefile.in 2007-09-30 10:48:39.000000000 +0000 | ||
324 | @@ -192,6 +192,7 @@ | ||
325 | build/gengtype-lex.o-warn = -Wno-error | ||
326 | # SYSCALLS.c misses prototypes | ||
327 | SYSCALLS.c.X-warn = -Wno-strict-prototypes -Wno-error | ||
328 | +build/gcc.o-warn = -Wno-error | ||
329 | |||
330 | # All warnings have to be shut off in stage1 if the compiler used then | ||
331 | # isn't gcc; configure determines that. WARN_CFLAGS will be either | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/debian/libstdc++-pic.dpatch b/meta/recipes-devtools/gcc/gcc-4.3.3/debian/libstdc++-pic.dpatch new file mode 100644 index 0000000000..70c9e81542 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/debian/libstdc++-pic.dpatch | |||
@@ -0,0 +1,71 @@ | |||
1 | #! /bin/sh -e | ||
2 | |||
3 | # DP: Build and install libstdc++_pic.a library. | ||
4 | |||
5 | dir= | ||
6 | if [ $# -eq 3 -a "$2" = '-d' ]; then | ||
7 | pdir="-d $3" | ||
8 | dir="$3/" | ||
9 | elif [ $# -ne 1 ]; then | ||
10 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
11 | exit 1 | ||
12 | fi | ||
13 | case "$1" in | ||
14 | -patch) | ||
15 | patch $pdir -f --no-backup-if-mismatch -p0 < $0 | ||
16 | ;; | ||
17 | -unpatch) | ||
18 | patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 | ||
19 | ;; | ||
20 | *) | ||
21 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
22 | exit 1 | ||
23 | esac | ||
24 | exit 0 | ||
25 | |||
26 | diff -ur libstdc++-v3/src/Makefile.am libstdc++-v3/src/Makefile.am | ||
27 | --- libstdc++-v3/src/Makefile.am~ 2004-04-16 21:04:05.000000000 +0200 | ||
28 | +++ libstdc++-v3/src/Makefile.am 2004-07-03 20:22:43.000000000 +0200 | ||
29 | @@ -210,6 +210,10 @@ | ||
30 | $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@ | ||
31 | |||
32 | |||
33 | +install-exec-local: | ||
34 | + $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o || touch libstdc++_pic.a | ||
35 | + $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) | ||
36 | + | ||
37 | # Added bits to build debug library. | ||
38 | if GLIBCXX_BUILD_DEBUG | ||
39 | all-local: build_debug | ||
40 | diff -ur libstdc++-v3/src/Makefile.in libstdc++-v3/src/Makefile.in | ||
41 | --- libstdc++-v3/src/Makefile.in 2004-07-03 06:41:13.000000000 +0200 | ||
42 | +++ libstdc++-v3/src/Makefile.in 2004-07-03 20:25:05.000000000 +0200 | ||
43 | @@ -611,7 +611,7 @@ | ||
44 | |||
45 | install-data-am: install-data-local | ||
46 | |||
47 | -install-exec-am: install-toolexeclibLTLIBRARIES | ||
48 | +install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local | ||
49 | |||
50 | install-info: install-info-am | ||
51 | |||
52 | @@ -644,6 +644,7 @@ | ||
53 | distclean-libtool distclean-tags distdir dvi dvi-am html \ | ||
54 | html-am info info-am install install-am install-data \ | ||
55 | install-data-am install-data-local install-exec \ | ||
56 | + install-exec-local \ | ||
57 | install-exec-am install-info install-info-am install-man \ | ||
58 | install-strip install-toolexeclibLTLIBRARIES installcheck \ | ||
59 | installcheck-am installdirs maintainer-clean \ | ||
60 | @@ -729,6 +730,11 @@ | ||
61 | install_debug: | ||
62 | (cd ${debugdir} && $(MAKE) \ | ||
63 | toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install) | ||
64 | + | ||
65 | +install-exec-local: | ||
66 | + $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o || touch libstdc++_pic.a | ||
67 | + $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) | ||
68 | + | ||
69 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
70 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
71 | .NOEXPORT: | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/debian/pr30961.dpatch b/meta/recipes-devtools/gcc/gcc-4.3.3/debian/pr30961.dpatch new file mode 100644 index 0000000000..b20fdf5bf5 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/debian/pr30961.dpatch | |||
@@ -0,0 +1,179 @@ | |||
1 | #! /bin/sh -e | ||
2 | |||
3 | # DP: <your description> | ||
4 | |||
5 | dir= | ||
6 | if [ $# -eq 3 -a "$2" = '-d' ]; then | ||
7 | pdir="-d $3" | ||
8 | dir="$3/" | ||
9 | elif [ $# -ne 1 ]; then | ||
10 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
11 | exit 1 | ||
12 | fi | ||
13 | case "$1" in | ||
14 | -patch) | ||
15 | patch $pdir -f --no-backup-if-mismatch -p0 < $0 | ||
16 | ;; | ||
17 | -unpatch) | ||
18 | patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 | ||
19 | ;; | ||
20 | *) | ||
21 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
22 | exit 1 | ||
23 | esac | ||
24 | exit 0 | ||
25 | |||
26 | From: "H.J. Lu" <hjl@lucon.org> | ||
27 | Sender: gcc-patches-owner@gcc.gnu.org | ||
28 | To: gcc-patches@gcc.gnu.org | ||
29 | Subject: PATCH: PR target/30961: [4.1/4.2/4.3 regression] redundant reg/mem stores/moves | ||
30 | Date: Mon, 27 Aug 2007 11:34:12 -0700 | ||
31 | |||
32 | We start with | ||
33 | |||
34 | (note:HI 3 4 22 2 NOTE_INSN_FUNCTION_BEG) | ||
35 | |||
36 | (insn:HI 6 3 10 2 c.c:3 (set (reg:DF 58 [ <result> ]) | ||
37 | (subreg:DF (reg/v:DI 59 [ in ]) 0)) 102 {*movdf_integer_rex64} (expr_list:REG_DEAD (reg/v:DI 59 [ in ]) | ||
38 | (nil))) | ||
39 | |||
40 | (insn:HI 10 6 16 2 c.c:7 (set (reg/i:DF 21 xmm0 [ <result> ]) | ||
41 | (reg:DF 58 [ <result> ])) 102 {*movdf_integer_rex64} (expr_list:REG_DEAD (reg:DF 58 [ <result> ]) | ||
42 | (nil))) | ||
43 | |||
44 | (insn:HI 16 10 0 2 c.c:7 (use (reg/i:DF 21 xmm0 [ <result> ])) -1 (nil)) | ||
45 | |||
46 | we are trying to allocate registers for insn 6 and we allocate | ||
47 | xmm0 for the return value. Reload doesn't check if xmm0 can be used for | ||
48 | DF 59, it allocates xmm1 for DF 59 and generates: | ||
49 | |||
50 | Reloads for insn # 6 | ||
51 | Reload 0: reload_in (DF) = (reg:DF 5 di) | ||
52 | SSE_REGS, RELOAD_FOR_INPUT (opnum = 1), can't combine | ||
53 | reload_in_reg: (subreg:DF (reg/v:DI 5 di [orig:59 in ] [59]) 0) | ||
54 | reload_reg_rtx: (reg:DF 22 xmm1) | ||
55 | ... | ||
56 | |||
57 | (note:HI 4 1 3 2 [bb 2] NOTE_INSN_BASIC_BLOCK) | ||
58 | |||
59 | (note:HI 3 4 22 2 NOTE_INSN_FUNCTION_BEG) | ||
60 | |||
61 | (insn 22 3 23 2 c.c:3 (set (mem/c:DF (plus:DI (reg/f:DI 7 sp) | ||
62 | (const_int -8 [0xfffffffffffffff8])) [0 S8 A8]) | ||
63 | (reg:DF 5 di)) 102 {*movdf_integer_rex64} (nil)) | ||
64 | |||
65 | (insn 23 22 6 2 c.c:3 (set (reg:DF 22 xmm1) | ||
66 | (mem/c:DF (plus:DI (reg/f:DI 7 sp) | ||
67 | (const_int -8 [0xfffffffffffffff8])) [0 S8 A8])) 102 {*movdf_integer_rex64} (nil)) | ||
68 | |||
69 | (insn:HI 6 23 16 2 c.c:3 (set (reg:DF 21 xmm0 [orig:58 <result> ] [58]) | ||
70 | (reg:DF 22 xmm1)) 102 {*movdf_integer_rex64} (nil)) | ||
71 | |||
72 | (insn 16 6 21 2 c.c:7 (use (reg/i:DF 21 xmm0 [ <result> ])) -1 (nil)) | ||
73 | |||
74 | This patch tries to use the destination register when reloading for input. It | ||
75 | generates | ||
76 | |||
77 | Reloads for insn # 6 | ||
78 | Reload 0: reload_in (DF) = (reg:DF 5 di) | ||
79 | SSE_REGS, RELOAD_FOR_INPUT (opnum = 1), can't combine | ||
80 | reload_in_reg: (subreg:DF (reg/v:DI 5 di [orig:59 in ] [59]) 0) | ||
81 | reload_reg_rtx: (reg:DF 21 xmm0) | ||
82 | ... | ||
83 | (note:HI 4 1 3 2 [bb 2] NOTE_INSN_BASIC_BLOCK) | ||
84 | |||
85 | (note:HI 3 4 22 2 NOTE_INSN_FUNCTION_BEG) | ||
86 | |||
87 | (insn 22 3 23 2 c.c:3 (set (mem/c:DF (plus:DI (reg/f:DI 7 sp) | ||
88 | (const_int -8 [0xfffffffffffffff8])) [0 S8 A8]) | ||
89 | (reg:DF 5 di)) 102 {*movdf_integer_rex64} (nil)) | ||
90 | |||
91 | (insn 23 22 6 2 c.c:3 (set (reg:DF 21 xmm0) | ||
92 | (mem/c:DF (plus:DI (reg/f:DI 7 sp) | ||
93 | (const_int -8 [0xfffffffffffffff8])) [0 S8 A8])) 102 {*movdf_integer_rex64} (nil)) | ||
94 | |||
95 | (insn:HI 6 23 10 2 c.c:3 (set (reg:DF 22 xmm1 [orig:58 <result> ] [58]) | ||
96 | (reg:DF 21 xmm0)) 102 {*movdf_integer_rex64} (nil)) | ||
97 | |||
98 | (insn:HI 10 6 16 2 c.c:7 (set (reg/i:DF 21 xmm0 [ <result> ]) | ||
99 | (reg:DF 22 xmm1 [orig:58 <result> ] [58])) 102 {*movdf_integer_rex64} (nil)) | ||
100 | |||
101 | (insn 16 10 21 2 c.c:7 (use (reg/i:DF 21 xmm0 [ <result> ])) -1 (nil)) | ||
102 | |||
103 | |||
104 | H.J. | ||
105 | ---- | ||
106 | gcc/ | ||
107 | |||
108 | 2007-08-27 H.J. Lu <hongjiu.lu@intel.com> | ||
109 | |||
110 | PR target/30961 | ||
111 | * reload1.c (find_reg): Favor the hard register in destination | ||
112 | if it is usable and a memory location is needed for reload | ||
113 | input. | ||
114 | |||
115 | gcc/testsuite/ | ||
116 | |||
117 | 2007-08-27 H.J. Lu <hongjiu.lu@intel.com> | ||
118 | |||
119 | PR target/30961 | ||
120 | * gcc.target/i386/pr30961-1.c: New. | ||
121 | |||
122 | --- gcc/reload1.c.second 2007-08-27 09:35:08.000000000 -0700 | ||
123 | +++ gcc/reload1.c 2007-08-27 09:36:33.000000000 -0700 | ||
124 | @@ -1781,6 +1781,20 @@ find_reg (struct insn_chain *chain, int | ||
125 | HARD_REG_SET not_usable; | ||
126 | HARD_REG_SET used_by_other_reload; | ||
127 | reg_set_iterator rsi; | ||
128 | +#ifdef SECONDARY_MEMORY_NEEDED | ||
129 | + rtx body = PATTERN (chain->insn); | ||
130 | + unsigned int dest_reg = FIRST_PSEUDO_REGISTER; | ||
131 | + | ||
132 | + if (GET_CODE (body) == SET) | ||
133 | + { | ||
134 | + rtx dest = SET_DEST (body); | ||
135 | + | ||
136 | + if ((REG_P (dest) | ||
137 | + || (GET_CODE (dest) == SUBREG | ||
138 | + && REG_P (SUBREG_REG (dest))))) | ||
139 | + dest_reg = reg_or_subregno (dest); | ||
140 | + } | ||
141 | +#endif | ||
142 | |||
143 | COPY_HARD_REG_SET (not_usable, bad_spill_regs); | ||
144 | IOR_HARD_REG_SET (not_usable, bad_spill_regs_global); | ||
145 | @@ -1821,6 +1835,18 @@ find_reg (struct insn_chain *chain, int | ||
146 | this_cost--; | ||
147 | if (rl->out && REG_P (rl->out) && REGNO (rl->out) == regno) | ||
148 | this_cost--; | ||
149 | +#ifdef SECONDARY_MEMORY_NEEDED | ||
150 | + /* If a memory location is needed for rl->in and dest_reg | ||
151 | + is usable, we will favor it. */ | ||
152 | + else if (dest_reg == regno | ||
153 | + && rl->in | ||
154 | + && REG_P (rl->in) | ||
155 | + && REGNO (rl->in) < FIRST_PSEUDO_REGISTER | ||
156 | + && SECONDARY_MEMORY_NEEDED (REGNO_REG_CLASS (REGNO (rl->in)), | ||
157 | + rl->class, | ||
158 | + rl->mode)) | ||
159 | + this_cost = 0; | ||
160 | +#endif | ||
161 | if (this_cost < best_cost | ||
162 | /* Among registers with equal cost, prefer caller-saved ones, or | ||
163 | use REG_ALLOC_ORDER if it is defined. */ | ||
164 | --- gcc/testsuite/gcc.target/i386/pr30961-1.c.second 2007-08-27 11:01:59.000000000 -0700 | ||
165 | +++ gcc/testsuite/gcc.target/i386/pr30961-1.c 2007-08-27 11:02:51.000000000 -0700 | ||
166 | @@ -0,0 +1,13 @@ | ||
167 | +/* { dg-do compile } */ | ||
168 | +/* { dg-require-effective-target lp64 } */ | ||
169 | +/* { dg-options "-O2" } */ | ||
170 | + | ||
171 | +double | ||
172 | +convert (long long in) | ||
173 | +{ | ||
174 | + double f; | ||
175 | + __builtin_memcpy( &f, &in, sizeof( in ) ); | ||
176 | + return f; | ||
177 | +} | ||
178 | + | ||
179 | +/* { dg-final { scan-assembler-not "movapd" } } */ | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-c++-builtin-redecl.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-c++-builtin-redecl.patch new file mode 100644 index 0000000000..77655ad792 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-c++-builtin-redecl.patch | |||
@@ -0,0 +1,102 @@ | |||
1 | 2007-10-02 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | * decl.c (duplicate_decls): When redeclaring a builtin function, | ||
4 | keep the merged decl builtin whenever types match, even if new | ||
5 | decl defines a function. | ||
6 | |||
7 | * gcc.dg/builtins-65.c: New test. | ||
8 | * g++.dg/ext/builtin10.C: New test. | ||
9 | |||
10 | --- gcc/cp/decl.c.jj 2007-10-01 22:11:09.000000000 +0200 | ||
11 | +++ gcc/cp/decl.c 2007-10-02 11:39:46.000000000 +0200 | ||
12 | @@ -1988,23 +1988,21 @@ duplicate_decls (tree newdecl, tree oldd | ||
13 | DECL_ARGUMENTS (olddecl) = DECL_ARGUMENTS (newdecl); | ||
14 | DECL_RESULT (olddecl) = DECL_RESULT (newdecl); | ||
15 | } | ||
16 | + /* If redeclaring a builtin function, it stays built in. */ | ||
17 | + if (types_match && DECL_BUILT_IN (olddecl)) | ||
18 | + { | ||
19 | + DECL_BUILT_IN_CLASS (newdecl) = DECL_BUILT_IN_CLASS (olddecl); | ||
20 | + DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl); | ||
21 | + /* If we're keeping the built-in definition, keep the rtl, | ||
22 | + regardless of declaration matches. */ | ||
23 | + COPY_DECL_RTL (olddecl, newdecl); | ||
24 | + } | ||
25 | if (new_defines_function) | ||
26 | /* If defining a function declared with other language | ||
27 | linkage, use the previously declared language linkage. */ | ||
28 | SET_DECL_LANGUAGE (newdecl, DECL_LANGUAGE (olddecl)); | ||
29 | else if (types_match) | ||
30 | { | ||
31 | - /* If redeclaring a builtin function, and not a definition, | ||
32 | - it stays built in. */ | ||
33 | - if (DECL_BUILT_IN (olddecl)) | ||
34 | - { | ||
35 | - DECL_BUILT_IN_CLASS (newdecl) = DECL_BUILT_IN_CLASS (olddecl); | ||
36 | - DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl); | ||
37 | - /* If we're keeping the built-in definition, keep the rtl, | ||
38 | - regardless of declaration matches. */ | ||
39 | - COPY_DECL_RTL (olddecl, newdecl); | ||
40 | - } | ||
41 | - | ||
42 | DECL_RESULT (newdecl) = DECL_RESULT (olddecl); | ||
43 | /* Don't clear out the arguments if we're redefining a function. */ | ||
44 | if (DECL_ARGUMENTS (olddecl)) | ||
45 | --- gcc/testsuite/gcc.dg/builtins-65.c.jj 2007-10-02 11:23:51.000000000 +0200 | ||
46 | +++ gcc/testsuite/gcc.dg/builtins-65.c 2007-10-02 11:24:12.000000000 +0200 | ||
47 | @@ -0,0 +1,25 @@ | ||
48 | +/* { dg-do compile } */ | ||
49 | +/* { dg-options "-O2" } */ | ||
50 | + | ||
51 | +typedef __SIZE_TYPE__ size_t; | ||
52 | +extern void __chk_fail (void); | ||
53 | +extern int snprintf (char *, size_t, const char *, ...); | ||
54 | +extern inline __attribute__((gnu_inline, always_inline)) int snprintf (char *a, size_t b, const char *fmt, ...) | ||
55 | +{ | ||
56 | + if (__builtin_object_size (a, 0) != -1UL && __builtin_object_size (a, 0) < b) | ||
57 | + __chk_fail (); | ||
58 | + return __builtin_snprintf (a, b, fmt, __builtin_va_arg_pack ()); | ||
59 | +} | ||
60 | +extern int snprintf (char *, size_t, const char *, ...) __asm ("mysnprintf"); | ||
61 | + | ||
62 | +char buf[10]; | ||
63 | + | ||
64 | +int | ||
65 | +main (void) | ||
66 | +{ | ||
67 | + snprintf (buf, 10, "%d%d\n", 10, 10); | ||
68 | + return 0; | ||
69 | +} | ||
70 | + | ||
71 | +/* { dg-final { scan-assembler "mysnprintf" } } */ | ||
72 | +/* { dg-final { scan-assembler-not "__chk_fail" } } */ | ||
73 | --- gcc/testsuite/g++.dg/ext/builtin10.C.jj 2007-10-02 11:19:45.000000000 +0200 | ||
74 | +++ gcc/testsuite/g++.dg/ext/builtin10.C 2007-10-02 11:23:26.000000000 +0200 | ||
75 | @@ -0,0 +1,27 @@ | ||
76 | +// { dg-do compile } | ||
77 | +// { dg-options "-O2" } | ||
78 | + | ||
79 | +typedef __SIZE_TYPE__ size_t; | ||
80 | +extern "C" { | ||
81 | +extern void __chk_fail (void); | ||
82 | +extern int snprintf (char *, size_t, const char *, ...); | ||
83 | +extern inline __attribute__((gnu_inline, always_inline)) int snprintf (char *a, size_t b, const char *fmt, ...) | ||
84 | +{ | ||
85 | + if (__builtin_object_size (a, 0) != -1UL && __builtin_object_size (a, 0) < b) | ||
86 | + __chk_fail (); | ||
87 | + return __builtin_snprintf (a, b, fmt, __builtin_va_arg_pack ()); | ||
88 | +} | ||
89 | +extern int snprintf (char *, size_t, const char *, ...) __asm ("mysnprintf"); | ||
90 | +} | ||
91 | + | ||
92 | +char buf[10]; | ||
93 | + | ||
94 | +int | ||
95 | +main (void) | ||
96 | +{ | ||
97 | + snprintf (buf, 10, "%d%d\n", 10, 10); | ||
98 | + return 0; | ||
99 | +} | ||
100 | + | ||
101 | +// { dg-final { scan-assembler "mysnprintf" } } | ||
102 | +// { dg-final { scan-assembler-not "__chk_fail" } } | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-cpp-pragma.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-cpp-pragma.patch new file mode 100644 index 0000000000..00d37bd7ce --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-cpp-pragma.patch | |||
@@ -0,0 +1,284 @@ | |||
1 | 2008-02-26 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | * c-ppoutput.c (scan_translation_unit): Handle CPP_PRAGMA | ||
4 | and CPP_PRAGMA_EOL. | ||
5 | * c-pragma.c (pragma_ns_name): New typedef. | ||
6 | (registered_pp_pragmas): New variable. | ||
7 | (c_pp_lookup_pragma): New function. | ||
8 | (c_register_pragma_1): If flag_preprocess_only, do nothing | ||
9 | for non-expanded pragmas, for expanded ones push pragma's | ||
10 | namespace and name into registered_pp_pragmas vector. | ||
11 | (c_invoke_pragma_handler): Register OpenMP pragmas even when | ||
12 | flag_preprocess_only, don't register GCC pch_preprocess | ||
13 | pragma if flag_preprocess_only. | ||
14 | * c-opts.c (c_common_init): Call init_pragma even if | ||
15 | flag_preprocess_only. | ||
16 | * c-pragma.c (c_pp_lookup_pragma): New prototype. | ||
17 | * config/darwin.h (DARWIN_REGISTER_TARGET_PRAGMAS): Don't call | ||
18 | cpp_register_pragma if flag_preprocess_only. | ||
19 | |||
20 | * gcc.dg/gomp/preprocess-1.c: New test. | ||
21 | |||
22 | --- gcc/c-ppoutput.c.jj 2008-01-26 18:01:16.000000000 +0100 | ||
23 | +++ gcc/c-ppoutput.c 2008-02-26 22:54:57.000000000 +0100 | ||
24 | @@ -1,6 +1,6 @@ | ||
25 | /* Preprocess only, using cpplib. | ||
26 | - Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007 | ||
27 | - Free Software Foundation, Inc. | ||
28 | + Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007, | ||
29 | + 2008 Free Software Foundation, Inc. | ||
30 | Written by Per Bothner, 1994-95. | ||
31 | |||
32 | This program is free software; you can redistribute it and/or modify it | ||
33 | @@ -177,7 +177,24 @@ scan_translation_unit (cpp_reader *pfile | ||
34 | avoid_paste = false; | ||
35 | print.source = NULL; | ||
36 | print.prev = token; | ||
37 | - cpp_output_token (token, print.outf); | ||
38 | + if (token->type == CPP_PRAGMA) | ||
39 | + { | ||
40 | + const char *space; | ||
41 | + const char *name; | ||
42 | + | ||
43 | + maybe_print_line (token->src_loc); | ||
44 | + fputs ("#pragma ", print.outf); | ||
45 | + c_pp_lookup_pragma (token->val.pragma, &space, &name); | ||
46 | + if (space) | ||
47 | + fprintf (print.outf, "%s %s", space, name); | ||
48 | + else | ||
49 | + fprintf (print.outf, "%s", name); | ||
50 | + print.printed = 1; | ||
51 | + } | ||
52 | + else if (token->type == CPP_PRAGMA_EOL) | ||
53 | + maybe_print_line (token->src_loc); | ||
54 | + else | ||
55 | + cpp_output_token (token, print.outf); | ||
56 | |||
57 | if (token->type == CPP_COMMENT) | ||
58 | account_for_newlines (token->val.str.text, token->val.str.len); | ||
59 | --- gcc/c-pragma.c.jj 2008-02-15 18:43:03.000000000 +0100 | ||
60 | +++ gcc/c-pragma.c 2008-02-26 22:59:44.000000000 +0100 | ||
61 | @@ -1,6 +1,6 @@ | ||
62 | /* Handle #pragma, system V.4 style. Supports #pragma weak and #pragma pack. | ||
63 | Copyright (C) 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, | ||
64 | - 2006, 2007 Free Software Foundation, Inc. | ||
65 | + 2006, 2007, 2008 Free Software Foundation, Inc. | ||
66 | |||
67 | This file is part of GCC. | ||
68 | |||
69 | @@ -872,6 +872,61 @@ DEF_VEC_ALLOC_O (pragma_handler, heap); | ||
70 | |||
71 | static VEC(pragma_handler, heap) *registered_pragmas; | ||
72 | |||
73 | +typedef struct | ||
74 | +{ | ||
75 | + const char *space; | ||
76 | + const char *name; | ||
77 | +} pragma_ns_name; | ||
78 | + | ||
79 | +DEF_VEC_O (pragma_ns_name); | ||
80 | +DEF_VEC_ALLOC_O (pragma_ns_name, heap); | ||
81 | + | ||
82 | +static VEC(pragma_ns_name, heap) *registered_pp_pragmas; | ||
83 | + | ||
84 | +struct omp_pragma_def { const char *name; unsigned int id; }; | ||
85 | +static const struct omp_pragma_def omp_pragmas[] = { | ||
86 | + { "atomic", PRAGMA_OMP_ATOMIC }, | ||
87 | + { "barrier", PRAGMA_OMP_BARRIER }, | ||
88 | + { "critical", PRAGMA_OMP_CRITICAL }, | ||
89 | + { "flush", PRAGMA_OMP_FLUSH }, | ||
90 | + { "for", PRAGMA_OMP_FOR }, | ||
91 | + { "master", PRAGMA_OMP_MASTER }, | ||
92 | + { "ordered", PRAGMA_OMP_ORDERED }, | ||
93 | + { "parallel", PRAGMA_OMP_PARALLEL }, | ||
94 | + { "section", PRAGMA_OMP_SECTION }, | ||
95 | + { "sections", PRAGMA_OMP_SECTIONS }, | ||
96 | + { "single", PRAGMA_OMP_SINGLE }, | ||
97 | + { "threadprivate", PRAGMA_OMP_THREADPRIVATE } | ||
98 | +}; | ||
99 | + | ||
100 | +void | ||
101 | +c_pp_lookup_pragma (unsigned int id, const char **space, const char **name) | ||
102 | +{ | ||
103 | + const int n_omp_pragmas = sizeof (omp_pragmas) / sizeof (*omp_pragmas); | ||
104 | + int i; | ||
105 | + | ||
106 | + for (i = 0; i < n_omp_pragmas; ++i) | ||
107 | + if (omp_pragmas[i].id == id) | ||
108 | + { | ||
109 | + *space = "omp"; | ||
110 | + *name = omp_pragmas[i].name; | ||
111 | + return; | ||
112 | + } | ||
113 | + | ||
114 | + if (id >= PRAGMA_FIRST_EXTERNAL | ||
115 | + && (id < PRAGMA_FIRST_EXTERNAL | ||
116 | + + VEC_length (pragma_ns_name, registered_pp_pragmas))) | ||
117 | + { | ||
118 | + *space = VEC_index (pragma_ns_name, registered_pp_pragmas, | ||
119 | + id - PRAGMA_FIRST_EXTERNAL)->space; | ||
120 | + *name = VEC_index (pragma_ns_name, registered_pp_pragmas, | ||
121 | + id - PRAGMA_FIRST_EXTERNAL)->name; | ||
122 | + return; | ||
123 | + } | ||
124 | + | ||
125 | + gcc_unreachable (); | ||
126 | +} | ||
127 | + | ||
128 | /* Front-end wrappers for pragma registration to avoid dragging | ||
129 | cpplib.h in almost everywhere. */ | ||
130 | |||
131 | @@ -881,13 +936,29 @@ c_register_pragma_1 (const char *space, | ||
132 | { | ||
133 | unsigned id; | ||
134 | |||
135 | - VEC_safe_push (pragma_handler, heap, registered_pragmas, &handler); | ||
136 | - id = VEC_length (pragma_handler, registered_pragmas); | ||
137 | - id += PRAGMA_FIRST_EXTERNAL - 1; | ||
138 | - | ||
139 | - /* The C++ front end allocates 6 bits in cp_token; the C front end | ||
140 | - allocates 7 bits in c_token. At present this is sufficient. */ | ||
141 | - gcc_assert (id < 64); | ||
142 | + if (flag_preprocess_only) | ||
143 | + { | ||
144 | + pragma_ns_name ns_name; | ||
145 | + | ||
146 | + if (!allow_expansion) | ||
147 | + return; | ||
148 | + | ||
149 | + ns_name.space = space; | ||
150 | + ns_name.name = name; | ||
151 | + VEC_safe_push (pragma_ns_name, heap, registered_pp_pragmas, &ns_name); | ||
152 | + id = VEC_length (pragma_ns_name, registered_pp_pragmas); | ||
153 | + id += PRAGMA_FIRST_EXTERNAL - 1; | ||
154 | + } | ||
155 | + else | ||
156 | + { | ||
157 | + VEC_safe_push (pragma_handler, heap, registered_pragmas, &handler); | ||
158 | + id = VEC_length (pragma_handler, registered_pragmas); | ||
159 | + id += PRAGMA_FIRST_EXTERNAL - 1; | ||
160 | + | ||
161 | + /* The C++ front end allocates 6 bits in cp_token; the C front end | ||
162 | + allocates 7 bits in c_token. At present this is sufficient. */ | ||
163 | + gcc_assert (id < 64); | ||
164 | + } | ||
165 | |||
166 | cpp_register_deferred_pragma (parse_in, space, name, id, | ||
167 | allow_expansion, false); | ||
168 | @@ -921,24 +992,8 @@ c_invoke_pragma_handler (unsigned int id | ||
169 | void | ||
170 | init_pragma (void) | ||
171 | { | ||
172 | - if (flag_openmp && !flag_preprocess_only) | ||
173 | + if (flag_openmp) | ||
174 | { | ||
175 | - struct omp_pragma_def { const char *name; unsigned int id; }; | ||
176 | - static const struct omp_pragma_def omp_pragmas[] = { | ||
177 | - { "atomic", PRAGMA_OMP_ATOMIC }, | ||
178 | - { "barrier", PRAGMA_OMP_BARRIER }, | ||
179 | - { "critical", PRAGMA_OMP_CRITICAL }, | ||
180 | - { "flush", PRAGMA_OMP_FLUSH }, | ||
181 | - { "for", PRAGMA_OMP_FOR }, | ||
182 | - { "master", PRAGMA_OMP_MASTER }, | ||
183 | - { "ordered", PRAGMA_OMP_ORDERED }, | ||
184 | - { "parallel", PRAGMA_OMP_PARALLEL }, | ||
185 | - { "section", PRAGMA_OMP_SECTION }, | ||
186 | - { "sections", PRAGMA_OMP_SECTIONS }, | ||
187 | - { "single", PRAGMA_OMP_SINGLE }, | ||
188 | - { "threadprivate", PRAGMA_OMP_THREADPRIVATE } | ||
189 | - }; | ||
190 | - | ||
191 | const int n_omp_pragmas = sizeof (omp_pragmas) / sizeof (*omp_pragmas); | ||
192 | int i; | ||
193 | |||
194 | @@ -947,8 +1002,9 @@ init_pragma (void) | ||
195 | omp_pragmas[i].id, true, true); | ||
196 | } | ||
197 | |||
198 | - cpp_register_deferred_pragma (parse_in, "GCC", "pch_preprocess", | ||
199 | - PRAGMA_GCC_PCH_PREPROCESS, false, false); | ||
200 | + if (!flag_preprocess_only) | ||
201 | + cpp_register_deferred_pragma (parse_in, "GCC", "pch_preprocess", | ||
202 | + PRAGMA_GCC_PCH_PREPROCESS, false, false); | ||
203 | |||
204 | #ifdef HANDLE_PRAGMA_PACK | ||
205 | #ifdef HANDLE_PRAGMA_PACK_WITH_EXPANSION | ||
206 | --- gcc/c-opts.c.jj 2008-02-26 22:53:23.000000000 +0100 | ||
207 | +++ gcc/c-opts.c 2008-02-26 22:54:57.000000000 +0100 | ||
208 | @@ -1,5 +1,5 @@ | ||
209 | /* C/ObjC/C++ command line option handling. | ||
210 | - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 | ||
211 | + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 | ||
212 | Free Software Foundation, Inc. | ||
213 | Contributed by Neil Booth. | ||
214 | |||
215 | @@ -1239,6 +1239,9 @@ c_common_init (void) | ||
216 | if (version_flag) | ||
217 | c_common_print_pch_checksum (stderr); | ||
218 | |||
219 | + /* Has to wait until now so that cpplib has its hash table. */ | ||
220 | + init_pragma (); | ||
221 | + | ||
222 | if (flag_preprocess_only) | ||
223 | { | ||
224 | finish_options (); | ||
225 | @@ -1246,9 +1249,6 @@ c_common_init (void) | ||
226 | return false; | ||
227 | } | ||
228 | |||
229 | - /* Has to wait until now so that cpplib has its hash table. */ | ||
230 | - init_pragma (); | ||
231 | - | ||
232 | return true; | ||
233 | } | ||
234 | |||
235 | --- gcc/c-pragma.h.jj 2008-01-26 18:01:16.000000000 +0100 | ||
236 | +++ gcc/c-pragma.h 2008-02-26 22:54:57.000000000 +0100 | ||
237 | @@ -1,6 +1,6 @@ | ||
238 | /* Pragma related interfaces. | ||
239 | Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, | ||
240 | - 2007 Free Software Foundation, Inc. | ||
241 | + 2007, 2008 Free Software Foundation, Inc. | ||
242 | |||
243 | This file is part of GCC. | ||
244 | |||
245 | @@ -124,4 +124,6 @@ extern enum cpp_ttype pragma_lex (tree * | ||
246 | extern enum cpp_ttype c_lex_with_flags (tree *, location_t *, unsigned char *, | ||
247 | int); | ||
248 | |||
249 | +extern void c_pp_lookup_pragma (unsigned int, const char **, const char **); | ||
250 | + | ||
251 | #endif /* GCC_C_PRAGMA_H */ | ||
252 | --- gcc/config/darwin.h.jj 2008-02-11 14:48:12.000000000 +0100 | ||
253 | +++ gcc/config/darwin.h 2008-02-26 22:54:57.000000000 +0100 | ||
254 | @@ -892,8 +892,9 @@ enum machopic_addr_class { | ||
255 | |||
256 | #define DARWIN_REGISTER_TARGET_PRAGMAS() \ | ||
257 | do { \ | ||
258 | - cpp_register_pragma (parse_in, NULL, "mark", \ | ||
259 | - darwin_pragma_ignore, false); \ | ||
260 | + if (!flag_preprocess_only) \ | ||
261 | + cpp_register_pragma (parse_in, NULL, "mark", \ | ||
262 | + darwin_pragma_ignore, false); \ | ||
263 | c_register_pragma (0, "options", darwin_pragma_options); \ | ||
264 | c_register_pragma (0, "segment", darwin_pragma_ignore); \ | ||
265 | c_register_pragma (0, "unused", darwin_pragma_unused); \ | ||
266 | --- gcc/testsuite/gcc.dg/gomp/preprocess-1.c.jj 2008-02-26 22:54:57.000000000 +0100 | ||
267 | +++ gcc/testsuite/gcc.dg/gomp/preprocess-1.c 2008-02-26 22:54:57.000000000 +0100 | ||
268 | @@ -0,0 +1,16 @@ | ||
269 | +/* { dg-do preprocess } */ | ||
270 | + | ||
271 | +void foo (void) | ||
272 | +{ | ||
273 | + int i1, j1, k1; | ||
274 | +#define p parallel | ||
275 | +#define P(x) private (x##1) | ||
276 | +#define S(x) shared (x##1) | ||
277 | +#define F(x) firstprivate (x##1) | ||
278 | +#pragma omp p P(i) \ | ||
279 | + S(j) \ | ||
280 | + F(k) | ||
281 | + ; | ||
282 | +} | ||
283 | + | ||
284 | +/* { dg-final { scan-file preprocess-1.i "(^|\n)#pragma omp parallel private \\(i1\\) shared \\(j1\\) firstprivate \\(k1\\)($|\n)" } } */ | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-i386-libgomp.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-i386-libgomp.patch new file mode 100644 index 0000000000..2ad3b24d89 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-i386-libgomp.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | Build i386.rpm libgomp and libsupc++.a(guard.o) as i486+, pre-i486 | ||
2 | hardware isn't supported because NPTL doesn't support it anyway. | ||
3 | |||
4 | --- libgomp/configure.tgt.jj 2008-01-10 20:53:48.000000000 +0100 | ||
5 | +++ libgomp/configure.tgt 2008-03-27 12:44:51.000000000 +0100 | ||
6 | @@ -44,14 +44,14 @@ if test $enable_linux_futex = yes; then | ||
7 | ;; | ||
8 | |||
9 | # Note that bare i386 is not included here. We need cmpxchg. | ||
10 | - i[456]86-*-linux*) | ||
11 | + i[3456]86-*-linux*) | ||
12 | config_path="linux/x86 linux posix" | ||
13 | case " ${CC} ${CFLAGS} " in | ||
14 | *" -m64 "*) | ||
15 | ;; | ||
16 | *) | ||
17 | if test -z "$with_arch"; then | ||
18 | - XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}" | ||
19 | + XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" | ||
20 | fi | ||
21 | esac | ||
22 | ;; | ||
23 | @@ -63,7 +63,7 @@ if test $enable_linux_futex = yes; then | ||
24 | config_path="linux/x86 linux posix" | ||
25 | case " ${CC} ${CFLAGS} " in | ||
26 | *" -m32 "*) | ||
27 | - XCFLAGS="${XCFLAGS} -march=i486 -mtune=i686" | ||
28 | + XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" | ||
29 | ;; | ||
30 | esac | ||
31 | ;; | ||
32 | --- libstdc++-v3/libsupc++/guard.cc.jj 2008-03-01 00:58:24.000000000 +0100 | ||
33 | +++ libstdc++-v3/libsupc++/guard.cc 2008-03-27 14:08:44.000000000 +0100 | ||
34 | @@ -35,6 +35,27 @@ | ||
35 | #include <new> | ||
36 | #include <ext/atomicity.h> | ||
37 | #include <ext/concurrence.h> | ||
38 | +#if defined __i386__ && !defined _GLIBCXX_ATOMIC_BUILTINS | ||
39 | +# define _GLIBCXX_ATOMIC_BUILTINS 1 | ||
40 | +# define __sync_val_compare_and_swap(a, b, c) \ | ||
41 | + ({ \ | ||
42 | + typedef char sltast[sizeof (*a) == sizeof (int) ? 1 : -1]; \ | ||
43 | + int sltas; \ | ||
44 | + __asm __volatile ("lock; cmpxchgl %3, (%1)" \ | ||
45 | + : "=a" (sltas) \ | ||
46 | + : "r" (a), "0" (b), "r" (c) : "memory"); \ | ||
47 | + sltas; \ | ||
48 | + }) | ||
49 | +# define __sync_lock_test_and_set(a, b) \ | ||
50 | + ({ \ | ||
51 | + typedef char sltast[sizeof (*a) == sizeof (int) ? 1 : -1]; \ | ||
52 | + int sltas; \ | ||
53 | + __asm __volatile ("xchgl (%1), %0" \ | ||
54 | + : "=r" (sltas) \ | ||
55 | + : "r" (a), "0" (b) : "memory"); \ | ||
56 | + sltas; \ | ||
57 | + }) | ||
58 | +#endif | ||
59 | #if defined(__GTHREADS) && defined(__GTHREAD_HAS_COND) \ | ||
60 | && defined(_GLIBCXX_ATOMIC_BUILTINS) && defined(_GLIBCXX_HAVE_LINUX_FUTEX) | ||
61 | # include <climits> | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-ia64-libunwind.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-ia64-libunwind.patch new file mode 100644 index 0000000000..8e10979ce8 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-ia64-libunwind.patch | |||
@@ -0,0 +1,538 @@ | |||
1 | 2004-11-27 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | * config.gcc (ia64*-*-linux*): If native and libelf is installed, | ||
4 | use ia64/t-glibc-no-libunwind instead of the other t-*unwind* | ||
5 | fragments. | ||
6 | * config/ia64/t-glibc-no-libunwind: New file. | ||
7 | * config/ia64/change-symver.c: New file. | ||
8 | * config/ia64/unwind-ia64.c: If USE_SYMVER_GLOBAL and SHARED, | ||
9 | define _Unwind_* to __symverglobal_Unwind_*. | ||
10 | (alias): Undefine. | ||
11 | (symverglobal): Define. Use it on _Unwind_*. | ||
12 | * config/ia64/mkmap-symver-multi.awk: New file. | ||
13 | * config/ia64/libgcc-ia64-no-libunwind.ver: New file. | ||
14 | |||
15 | --- gcc/config.gcc.jj 2004-10-04 08:55:44.000000000 -0400 | ||
16 | +++ gcc/config.gcc 2004-11-13 05:23:50.000000000 -0500 | ||
17 | @@ -1185,9 +1185,16 @@ ia64*-*-freebsd*) | ||
18 | ;; | ||
19 | ia64*-*-linux*) | ||
20 | tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h ia64/sysv4.h ia64/linux.h" | ||
21 | - tmake_file="${tmake_file} ia64/t-ia64 t-libunwind ia64/t-glibc" | ||
22 | - if test x$with_system_libunwind != xyes ; then | ||
23 | - tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind" | ||
24 | + tmake_file="${tmake_file} ia64/t-ia64" | ||
25 | + if test x${target} = x${host} && test x${target} = x${build} \ | ||
26 | + && grep gelf_getverdef /usr/include/gelf.h > /dev/null 2>&1 \ | ||
27 | + && test -f /usr/lib/libelf.so; then | ||
28 | + tmake_file="${tmake_file} ia64/t-glibc-no-libunwind" | ||
29 | + else | ||
30 | + tmake_file="${tmake_file} t-libunwind ia64/t-glibc" | ||
31 | + if test x$with_system_libunwind != xyes ; then | ||
32 | + tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind" | ||
33 | + fi | ||
34 | fi | ||
35 | target_cpu_default="MASK_GNU_AS|MASK_GNU_LD" | ||
36 | extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o" | ||
37 | --- gcc/config/ia64/t-glibc-no-libunwind.jj 2004-02-18 10:27:36.000000000 -0500 | ||
38 | +++ gcc/config/ia64/t-glibc-no-libunwind 2004-11-15 09:56:33.000000000 -0500 | ||
39 | @@ -0,0 +1,30 @@ | ||
40 | +# Don't use system libunwind library on IA-64 GLIBC based system, | ||
41 | +# but make _Unwind_* symbols unversioned, so that created programs | ||
42 | +# are usable even when libgcc_s uses libunwind. | ||
43 | +LIB2ADDEH += $(srcdir)/config/ia64/fde-glibc.c | ||
44 | +SHLIB_MAPFILES += $(srcdir)/config/ia64/libgcc-ia64-no-libunwind.ver | ||
45 | +SHLIB_MKMAP = $(srcdir)/config/ia64/mkmap-symver-multi.awk | ||
46 | + | ||
47 | +SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \ | ||
48 | + -Wl,--soname=$(SHLIB_SONAME) \ | ||
49 | + -Wl,--version-script=$(SHLIB_MAP) \ | ||
50 | + -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ $(SHLIB_OBJS) -lc && \ | ||
51 | + rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \ | ||
52 | + if [ -f $(SHLIB_DIR)/$(SHLIB_SONAME) ]; then \ | ||
53 | + mv -f $(SHLIB_DIR)/$(SHLIB_SONAME) \ | ||
54 | + $(SHLIB_DIR)/$(SHLIB_SONAME).backup; \ | ||
55 | + else true; fi && \ | ||
56 | + gcc -O2 -o $(SHLIB_DIR)/$(SHLIB_SONAME).tweak \ | ||
57 | + $$(gcc_srcdir)/config/ia64/change-symver.c -lelf && \ | ||
58 | + $(SHLIB_DIR)/$(SHLIB_SONAME).tweak $(SHLIB_DIR)/$(SHLIB_SONAME).tmp \ | ||
59 | + GCC_3.4.2 _GLOBAL_ \ | ||
60 | + _Unwind_GetGR _Unwind_RaiseException _Unwind_GetRegionStart _Unwind_SetIP \ | ||
61 | + _Unwind_GetIP _Unwind_GetLanguageSpecificData _Unwind_Resume \ | ||
62 | + _Unwind_DeleteException _Unwind_SetGR _Unwind_ForcedUnwind \ | ||
63 | + _Unwind_Backtrace _Unwind_FindEnclosingFunction _Unwind_GetCFA \ | ||
64 | + _Unwind_Resume_or_Rethrow _Unwind_GetBSP && \ | ||
65 | + rm -f $(SHLIB_DIR)/$(SHLIB_SONAME).tweak && \ | ||
66 | + mv $(SHLIB_DIR)/$(SHLIB_SONAME).tmp $(SHLIB_DIR)/$(SHLIB_SONAME) && \ | ||
67 | + $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK) | ||
68 | + | ||
69 | +TARGET_LIBGCC2_CFLAGS += -DUSE_SYMVER_GLOBAL | ||
70 | --- gcc/config/ia64/change-symver.c.jj 2004-02-18 10:27:36.000000000 -0500 | ||
71 | +++ gcc/config/ia64/change-symver.c 2004-11-13 05:23:50.000000000 -0500 | ||
72 | @@ -0,0 +1,211 @@ | ||
73 | +#define _GNU_SOURCE 1 | ||
74 | +#define _FILE_OFFSET_BITS 64 | ||
75 | +#include <endian.h> | ||
76 | +#include <errno.h> | ||
77 | +#include <error.h> | ||
78 | +#include <fcntl.h> | ||
79 | +#include <fnmatch.h> | ||
80 | +#include <gelf.h> | ||
81 | +#include <stdlib.h> | ||
82 | +#include <string.h> | ||
83 | +#include <unistd.h> | ||
84 | + | ||
85 | +int | ||
86 | +compute_veridx (const char *name, Elf *elf, Elf_Data *verd, GElf_Shdr *verd_shdr) | ||
87 | +{ | ||
88 | + if (strcmp (name, "_GLOBAL_") == 0) | ||
89 | + return 1; | ||
90 | + | ||
91 | + int cnt; | ||
92 | + size_t offset = 0; | ||
93 | + for (cnt = verd_shdr->sh_info; --cnt >= 0; ) | ||
94 | + { | ||
95 | + GElf_Verdef defmem; | ||
96 | + GElf_Verdef *def; | ||
97 | + GElf_Verdaux auxmem; | ||
98 | + GElf_Verdaux *aux; | ||
99 | + unsigned int auxoffset; | ||
100 | + | ||
101 | + /* Get the data at the next offset. */ | ||
102 | + def = gelf_getverdef (verd, offset, &defmem); | ||
103 | + if (def == NULL) | ||
104 | + break; | ||
105 | + | ||
106 | + auxoffset = offset + def->vd_aux; | ||
107 | + aux = gelf_getverdaux (verd, auxoffset, &auxmem); | ||
108 | + if (aux == NULL) | ||
109 | + break; | ||
110 | + | ||
111 | + if (strcmp (name, elf_strptr (elf, verd_shdr->sh_link, | ||
112 | + aux->vda_name)) == 0) | ||
113 | + return def->vd_ndx; | ||
114 | + | ||
115 | + /* Find the next offset. */ | ||
116 | + offset += def->vd_next; | ||
117 | + } | ||
118 | + | ||
119 | + return -1; | ||
120 | +} | ||
121 | + | ||
122 | +int | ||
123 | +main (int argc, char **argv) | ||
124 | +{ | ||
125 | + if (argc < 4) | ||
126 | + error (1, 0, "Usage: change_symver library from_symver to_symver symbol...\nExample: change_symver libfoo.so FOO_1.0 *global* bar baz"); | ||
127 | + | ||
128 | + const char *fname = argv[1]; | ||
129 | + | ||
130 | + /* Open the file. */ | ||
131 | + int fd; | ||
132 | + fd = open (fname, O_RDWR); | ||
133 | + if (fd == -1) | ||
134 | + error (1, errno, fname); | ||
135 | + | ||
136 | + elf_version (EV_CURRENT); | ||
137 | + | ||
138 | + /* Now get the ELF descriptor. */ | ||
139 | + Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL); | ||
140 | + if (elf == NULL || elf_kind (elf) != ELF_K_ELF) | ||
141 | + error (1, 0, "Couldn't open %s: %s", fname, elf_errmsg (-1)); | ||
142 | + | ||
143 | + size_t shstrndx; | ||
144 | + /* Get the section header string table index. */ | ||
145 | + if (elf_getshstrndx (elf, &shstrndx) < 0) | ||
146 | + error (1, 0, "cannot get shstrndx from %s", fname); | ||
147 | + | ||
148 | + GElf_Ehdr ehdr_mem; | ||
149 | + GElf_Ehdr *ehdr; | ||
150 | + | ||
151 | + /* We need the ELF header in a few places. */ | ||
152 | + ehdr = gelf_getehdr (elf, &ehdr_mem); | ||
153 | + if (ehdr == NULL) | ||
154 | + error (1, 0, "couldn't get ELF headers %s: %s", fname, elf_errmsg (-1)); | ||
155 | + | ||
156 | + Elf_Scn *scn = NULL; | ||
157 | + GElf_Shdr shdr_mem, verd_shdr, ver_shdr, dynsym_shdr; | ||
158 | + Elf_Data *ver = NULL, *verd = NULL, *dynsym = NULL; | ||
159 | + | ||
160 | + while ((scn = elf_nextscn (elf, scn)) != NULL) | ||
161 | + { | ||
162 | + GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); | ||
163 | + | ||
164 | + if (shdr == NULL) | ||
165 | + error (1, 0, "couldn't get shdr from %s", fname); | ||
166 | + | ||
167 | + if ((shdr->sh_flags & SHF_ALLOC) != 0) | ||
168 | + { | ||
169 | + const char *name = elf_strptr (elf, shstrndx, shdr->sh_name); | ||
170 | + Elf_Data **p; | ||
171 | + | ||
172 | + if (strcmp (name, ".gnu.version") == 0) | ||
173 | + { | ||
174 | + p = &ver; | ||
175 | + ver_shdr = *shdr; | ||
176 | + } | ||
177 | + else if (strcmp (name, ".gnu.version_d") == 0) | ||
178 | + { | ||
179 | + p = &verd; | ||
180 | + verd_shdr = *shdr; | ||
181 | + } | ||
182 | + else if (strcmp (name, ".dynsym") == 0) | ||
183 | + { | ||
184 | + p = &dynsym; | ||
185 | + dynsym_shdr = *shdr; | ||
186 | + } | ||
187 | + else | ||
188 | + continue; | ||
189 | + | ||
190 | + if (*p != NULL) | ||
191 | + error (1, 0, "Two %s sections in %s", name, fname); | ||
192 | + *p = elf_getdata (scn, NULL); | ||
193 | + if (*p == NULL || elf_getdata (scn, *p) != NULL) | ||
194 | + error (1, 0, "No data or non-contiguous data in %s section in %s", | ||
195 | + name, fname); | ||
196 | + } | ||
197 | + } | ||
198 | + | ||
199 | + if (ver == NULL || verd == NULL || dynsym == NULL) | ||
200 | + error (1, 0, "Couldn't find one of the needed sections in %s", fname); | ||
201 | + | ||
202 | + int from_idx = compute_veridx (argv[2], elf, verd, &verd_shdr); | ||
203 | + if (from_idx == -1) | ||
204 | + error (1, 0, "Could not find symbol version %s in %s", argv[2], fname); | ||
205 | + | ||
206 | + int to_idx = compute_veridx (argv[3], elf, verd, &verd_shdr); | ||
207 | + if (to_idx == -1) | ||
208 | + error (1, 0, "Could not find symbol version %s in %s", argv[3], fname); | ||
209 | + | ||
210 | + if (dynsym_shdr.sh_entsize != gelf_fsize (elf, ELF_T_SYM, 1, ehdr->e_version) | ||
211 | + || dynsym_shdr.sh_size % dynsym_shdr.sh_entsize | ||
212 | + || ver_shdr.sh_entsize != 2 | ||
213 | + || (ver_shdr.sh_size & 1) | ||
214 | + || dynsym_shdr.sh_size / dynsym_shdr.sh_entsize != ver_shdr.sh_size / 2) | ||
215 | + error (1, 0, "Unexpected sh_size or sh_entsize in %s", fname); | ||
216 | + | ||
217 | + size_t nentries = ver_shdr.sh_size / 2; | ||
218 | + size_t cnt; | ||
219 | + GElf_Versym array[nentries]; | ||
220 | + for (cnt = 0; cnt < nentries; ++cnt) | ||
221 | + { | ||
222 | + GElf_Versym vsymmem; | ||
223 | + GElf_Versym *vsym; | ||
224 | + | ||
225 | + vsym = gelf_getversym (ver, cnt, &vsymmem); | ||
226 | + if (vsym == NULL) | ||
227 | + error (1, 0, "gelt_getversym failed in %s: %s", fname, elf_errmsg (-1)); | ||
228 | + | ||
229 | + array[cnt] = *vsym; | ||
230 | + if (*vsym != from_idx) | ||
231 | + continue; | ||
232 | + | ||
233 | + GElf_Sym sym_mem; | ||
234 | + GElf_Sym *sym; | ||
235 | + sym = gelf_getsym (dynsym, cnt, &sym_mem); | ||
236 | + if (sym == NULL) | ||
237 | + error (1, 0, "gelt_getsym failed in %s: %s", fname, elf_errmsg (-1)); | ||
238 | + | ||
239 | + const char *name = elf_strptr (elf, dynsym_shdr.sh_link, sym->st_name); | ||
240 | + | ||
241 | + int argn; | ||
242 | + for (argn = 4; argn < argc; ++argn) | ||
243 | + if (fnmatch (argv[argn], name, 0) == 0) | ||
244 | + { | ||
245 | + array[cnt] = to_idx; | ||
246 | + break; | ||
247 | + } | ||
248 | + } | ||
249 | + | ||
250 | + if (sizeof (array[0]) != 2) | ||
251 | + abort (); | ||
252 | + | ||
253 | +#if __BYTE_ORDER == __LITTLE_ENDIAN | ||
254 | + if (ehdr->e_ident[EI_DATA] == ELFDATA2LSB) | ||
255 | + ; | ||
256 | + else if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) | ||
257 | +#elif __BYTE_ORDER == __BIG_ENDIAN | ||
258 | + if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) | ||
259 | + ; | ||
260 | + else if (ehdr->e_ident[EI_DATA] == ELFDATA2LSB) | ||
261 | +#else | ||
262 | +# error Unsupported endianity | ||
263 | +#endif | ||
264 | + { | ||
265 | + for (cnt = 0; cnt < nentries; ++cnt) | ||
266 | + array[cnt] = ((array[cnt] & 0xff) << 8) | ((array[cnt] & 0xff00) >> 8); | ||
267 | + } | ||
268 | + else | ||
269 | + error (1, 0, "Unknown EI_DATA %d in %s", ehdr->e_ident[EI_DATA], fname); | ||
270 | + | ||
271 | + if (elf_end (elf) != 0) | ||
272 | + error (1, 0, "couldn't close %s: %s", fname, elf_errmsg (-1)); | ||
273 | + | ||
274 | + if (lseek (fd, ver_shdr.sh_offset, SEEK_SET) != (off_t) ver_shdr.sh_offset) | ||
275 | + error (1, 0, "failed to seek to %zd in %s", (size_t) ver_shdr.sh_offset, | ||
276 | + fname); | ||
277 | + | ||
278 | + if (write (fd, array, 2 * nentries) != (ssize_t) (2 * nentries)) | ||
279 | + error (1, 0, "failed to write .gnu.version section into %s", fname); | ||
280 | + | ||
281 | + close (fd); | ||
282 | + return 0; | ||
283 | +} | ||
284 | --- gcc/config/ia64/unwind-ia64.c.jj 2004-10-04 08:55:57.000000000 -0400 | ||
285 | +++ gcc/config/ia64/unwind-ia64.c 2004-11-15 09:07:45.000000000 -0500 | ||
286 | @@ -51,6 +51,51 @@ | ||
287 | #define UNW_FLAG_UHANDLER(x) ((x) & 0x0000000200000000L) | ||
288 | #define UNW_LENGTH(x) ((x) & 0x00000000ffffffffL) | ||
289 | |||
290 | +#if defined (USE_SYMVER_GLOBAL) && defined (SHARED) | ||
291 | +extern _Unwind_Reason_Code __symverglobal_Unwind_Backtrace | ||
292 | + (_Unwind_Trace_Fn, void *); | ||
293 | +extern void __symverglobal_Unwind_DeleteException | ||
294 | + (struct _Unwind_Exception *); | ||
295 | +extern void * __symverglobal_Unwind_FindEnclosingFunction (void *); | ||
296 | +extern _Unwind_Reason_Code __symverglobal_Unwind_ForcedUnwind | ||
297 | + (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); | ||
298 | +extern _Unwind_Word __symverglobal_Unwind_GetCFA | ||
299 | + (struct _Unwind_Context *); | ||
300 | +extern _Unwind_Word __symverglobal_Unwind_GetBSP | ||
301 | + (struct _Unwind_Context *); | ||
302 | +extern _Unwind_Word __symverglobal_Unwind_GetGR | ||
303 | + (struct _Unwind_Context *, int ); | ||
304 | +extern _Unwind_Ptr __symverglobal_Unwind_GetIP (struct _Unwind_Context *); | ||
305 | +extern void *__symverglobal_Unwind_GetLanguageSpecificData | ||
306 | + (struct _Unwind_Context *); | ||
307 | +extern _Unwind_Ptr __symverglobal_Unwind_GetRegionStart | ||
308 | + (struct _Unwind_Context *); | ||
309 | +extern _Unwind_Reason_Code __symverglobal_Unwind_RaiseException | ||
310 | + (struct _Unwind_Exception *); | ||
311 | +extern void __symverglobal_Unwind_Resume (struct _Unwind_Exception *); | ||
312 | +extern _Unwind_Reason_Code __symverglobal_Unwind_Resume_or_Rethrow | ||
313 | + (struct _Unwind_Exception *); | ||
314 | +extern void __symverglobal_Unwind_SetGR | ||
315 | + (struct _Unwind_Context *, int, _Unwind_Word); | ||
316 | +extern void __symverglobal_Unwind_SetIP | ||
317 | + (struct _Unwind_Context *, _Unwind_Ptr); | ||
318 | +#define _Unwind_Backtrace __symverglobal_Unwind_Backtrace | ||
319 | +#define _Unwind_DeleteException __symverglobal_Unwind_DeleteException | ||
320 | +#define _Unwind_FindEnclosingFunction __symverglobal_Unwind_FindEnclosingFunction | ||
321 | +#define _Unwind_ForcedUnwind __symverglobal_Unwind_ForcedUnwind | ||
322 | +#define _Unwind_GetBSP __symverglobal_Unwind_GetBSP | ||
323 | +#define _Unwind_GetCFA __symverglobal_Unwind_GetCFA | ||
324 | +#define _Unwind_GetGR __symverglobal_Unwind_GetGR | ||
325 | +#define _Unwind_GetIP __symverglobal_Unwind_GetIP | ||
326 | +#define _Unwind_GetLanguageSpecificData __symverglobal_Unwind_GetLanguageSpecificData | ||
327 | +#define _Unwind_GetRegionStart __symverglobal_Unwind_GetRegionStart | ||
328 | +#define _Unwind_RaiseException __symverglobal_Unwind_RaiseException | ||
329 | +#define _Unwind_Resume __symverglobal_Unwind_Resume | ||
330 | +#define _Unwind_Resume_or_Rethrow __symverglobal_Unwind_Resume_or_Rethrow | ||
331 | +#define _Unwind_SetGR __symverglobal_Unwind_SetGR | ||
332 | +#define _Unwind_SetIP __symverglobal_Unwind_SetIP | ||
333 | +#endif | ||
334 | + | ||
335 | enum unw_application_register | ||
336 | { | ||
337 | UNW_AR_BSP, | ||
338 | @@ -2402,4 +2447,44 @@ alias (_Unwind_SetGR); | ||
339 | alias (_Unwind_SetIP); | ||
340 | #endif | ||
341 | |||
342 | +#if defined (USE_SYMVER_GLOBAL) && defined (SHARED) | ||
343 | +#undef alias | ||
344 | +#define symverglobal(name, version) \ | ||
345 | +__typeof (__symverglobal##name) __symverlocal##name \ | ||
346 | + __attribute__ ((alias ("__symverglobal" #name))); \ | ||
347 | +__asm__ (".symver __symverglobal" #name"," #name "@@GCC_3.4.2");\ | ||
348 | +__asm__ (".symver __symverlocal" #name"," #name "@" #version) | ||
349 | + | ||
350 | +#undef _Unwind_Backtrace | ||
351 | +#undef _Unwind_DeleteException | ||
352 | +#undef _Unwind_FindEnclosingFunction | ||
353 | +#undef _Unwind_ForcedUnwind | ||
354 | +#undef _Unwind_GetBSP | ||
355 | +#undef _Unwind_GetCFA | ||
356 | +#undef _Unwind_GetGR | ||
357 | +#undef _Unwind_GetIP | ||
358 | +#undef _Unwind_GetLanguageSpecificData | ||
359 | +#undef _Unwind_GetRegionStart | ||
360 | +#undef _Unwind_RaiseException | ||
361 | +#undef _Unwind_Resume | ||
362 | +#undef _Unwind_Resume_or_Rethrow | ||
363 | +#undef _Unwind_SetGR | ||
364 | +#undef _Unwind_SetIP | ||
365 | +symverglobal (_Unwind_Backtrace, GCC_3.3); | ||
366 | +symverglobal (_Unwind_DeleteException, GCC_3.0); | ||
367 | +symverglobal (_Unwind_FindEnclosingFunction, GCC_3.3); | ||
368 | +symverglobal (_Unwind_ForcedUnwind, GCC_3.0); | ||
369 | +symverglobal (_Unwind_GetBSP, GCC_3.3.2); | ||
370 | +symverglobal (_Unwind_GetCFA, GCC_3.3); | ||
371 | +symverglobal (_Unwind_GetGR, GCC_3.0); | ||
372 | +symverglobal (_Unwind_GetIP, GCC_3.0); | ||
373 | +symverglobal (_Unwind_GetLanguageSpecificData, GCC_3.0); | ||
374 | +symverglobal (_Unwind_GetRegionStart, GCC_3.0); | ||
375 | +symverglobal (_Unwind_RaiseException, GCC_3.0); | ||
376 | +symverglobal (_Unwind_Resume, GCC_3.0); | ||
377 | +symverglobal (_Unwind_Resume_or_Rethrow, GCC_3.3); | ||
378 | +symverglobal (_Unwind_SetGR, GCC_3.0); | ||
379 | +symverglobal (_Unwind_SetIP, GCC_3.0); | ||
380 | +#endif | ||
381 | + | ||
382 | #endif | ||
383 | --- gcc/config/ia64/mkmap-symver-multi.awk.jj 2004-02-18 10:27:36.000000000 -0500 | ||
384 | +++ gcc/config/ia64/mkmap-symver-multi.awk 2004-11-15 09:46:50.000000000 -0500 | ||
385 | @@ -0,0 +1,133 @@ | ||
386 | +# Generate an ELF symbol version map a-la Solaris and GNU ld. | ||
387 | +# Contributed by Richard Henderson <rth@cygnus.com> | ||
388 | +# | ||
389 | +# This file is part of GCC. | ||
390 | +# | ||
391 | +# GCC is free software; you can redistribute it and/or modify it under | ||
392 | +# the terms of the GNU General Public License as published by the Free | ||
393 | +# Software Foundation; either version 2, or (at your option) any later | ||
394 | +# version. | ||
395 | +# | ||
396 | +# GCC is distributed in the hope that it will be useful, but WITHOUT | ||
397 | +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
398 | +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public | ||
399 | +# License for more details. | ||
400 | +# | ||
401 | +# You should have received a copy of the GNU General Public License | ||
402 | +# along with GCC; see the file COPYING. If not, write to the Free | ||
403 | +# Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA | ||
404 | +# 02110-1301, USA. | ||
405 | + | ||
406 | +BEGIN { | ||
407 | + state = "nm"; | ||
408 | + sawsymbol = 0; | ||
409 | +} | ||
410 | + | ||
411 | +# Remove comment and blank lines. | ||
412 | +/^ *#/ || /^ *$/ { | ||
413 | + next; | ||
414 | +} | ||
415 | + | ||
416 | +# We begin with nm input. Collect the set of symbols that are present | ||
417 | +# so that we can not emit them into the final version script -- Solaris | ||
418 | +# complains at us if we do. | ||
419 | + | ||
420 | +state == "nm" && /^%%/ { | ||
421 | + state = "ver"; | ||
422 | + next; | ||
423 | +} | ||
424 | + | ||
425 | +state == "nm" && ($1 == "U" || $2 == "U") { | ||
426 | + next; | ||
427 | +} | ||
428 | + | ||
429 | +state == "nm" && NF == 3 { | ||
430 | + if ($3 ~ /^[^@]*@GCC_[0-9.]*$/) { | ||
431 | + def[$3] = 1 | ||
432 | + tl=$3 | ||
433 | + sub(/^.*@/,"",tl) | ||
434 | + ver[$3] = tl | ||
435 | + } else { | ||
436 | + sub(/@@?GCC_[0-9.]*$/,"",$3) | ||
437 | + def[$3] = 1; | ||
438 | + } | ||
439 | + sawsymbol = 1; | ||
440 | + next; | ||
441 | +} | ||
442 | + | ||
443 | +state == "nm" { | ||
444 | + next; | ||
445 | +} | ||
446 | + | ||
447 | +# Now we process a simplified variant of the Solaris symbol version | ||
448 | +# script. We have one symbol per line, no semicolons, simple markers | ||
449 | +# for beginning and ending each section, and %inherit markers for | ||
450 | +# describing version inheritence. A symbol may appear in more than | ||
451 | +# one symbol version, and the last seen takes effect. | ||
452 | + | ||
453 | +NF == 3 && $1 == "%inherit" { | ||
454 | + inherit[$2] = $3; | ||
455 | + next; | ||
456 | +} | ||
457 | + | ||
458 | +NF == 2 && $2 == "{" { | ||
459 | + libs[$1] = 1; | ||
460 | + thislib = $1; | ||
461 | + next; | ||
462 | +} | ||
463 | + | ||
464 | +$1 == "}" { | ||
465 | + thislib = ""; | ||
466 | + next; | ||
467 | +} | ||
468 | + | ||
469 | +{ | ||
470 | + ver[$1] = thislib; | ||
471 | + next; | ||
472 | +} | ||
473 | + | ||
474 | +END { | ||
475 | + if (!sawsymbol) | ||
476 | + { | ||
477 | + print "No symbols seen -- broken or mis-installed nm?" | "cat 1>&2"; | ||
478 | + exit 1; | ||
479 | + } | ||
480 | + for (l in libs) | ||
481 | + output(l); | ||
482 | +} | ||
483 | + | ||
484 | +function output(lib) { | ||
485 | + if (done[lib]) | ||
486 | + return; | ||
487 | + done[lib] = 1; | ||
488 | + if (inherit[lib]) | ||
489 | + output(inherit[lib]); | ||
490 | + | ||
491 | + empty=1 | ||
492 | + for (sym in ver) | ||
493 | + if ((ver[sym] == lib) && (sym in def)) | ||
494 | + { | ||
495 | + if (empty) | ||
496 | + { | ||
497 | + printf("%s {\n", lib); | ||
498 | + printf(" global:\n"); | ||
499 | + empty = 0; | ||
500 | + } | ||
501 | + symp = sym; | ||
502 | + sub(/@GCC_[0-9.]*$/,"",symp); | ||
503 | + printf("\t%s;\n", symp); | ||
504 | + if (dotsyms) | ||
505 | + printf("\t.%s;\n", symp); | ||
506 | + } | ||
507 | + | ||
508 | + if (empty) | ||
509 | + { | ||
510 | + for (l in libs) | ||
511 | + if (inherit[l] == lib) | ||
512 | + inherit[l] = inherit[lib]; | ||
513 | + } | ||
514 | + else if (inherit[lib]) | ||
515 | + printf("} %s;\n", inherit[lib]); | ||
516 | + else | ||
517 | + printf ("\n local:\n\t*;\n};\n"); | ||
518 | +} | ||
519 | --- gcc/config/ia64/libgcc-ia64-no-libunwind.ver.jj 2004-02-18 10:27:36.000000000 -0500 | ||
520 | +++ gcc/config/ia64/libgcc-ia64-no-libunwind.ver 2004-11-15 09:19:56.000000000 -0500 | ||
521 | @@ -0,0 +1,17 @@ | ||
522 | +GCC_3.4.2 { | ||
523 | + _Unwind_GetGR | ||
524 | + _Unwind_RaiseException | ||
525 | + _Unwind_GetRegionStart | ||
526 | + _Unwind_SetIP | ||
527 | + _Unwind_GetIP | ||
528 | + _Unwind_GetLanguageSpecificData | ||
529 | + _Unwind_Resume | ||
530 | + _Unwind_DeleteException | ||
531 | + _Unwind_SetGR | ||
532 | + _Unwind_ForcedUnwind | ||
533 | + _Unwind_Backtrace | ||
534 | + _Unwind_FindEnclosingFunction | ||
535 | + _Unwind_GetCFA | ||
536 | + _Unwind_Resume_or_Rethrow | ||
537 | + _Unwind_GetBSP | ||
538 | +} | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-java-debug-iface-type.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-java-debug-iface-type.patch new file mode 100644 index 0000000000..63a1b50a76 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-java-debug-iface-type.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | 2008-01-25 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | * lang.c (java_classify_record): Revert 2007-12-20 change. | ||
4 | |||
5 | --- gcc/java/lang.c 2007-12-27 09:09:49.000000000 +0100 | ||
6 | +++ gcc/java/lang.c 2008-01-25 17:43:57.000000000 +0100 | ||
7 | @@ -965,9 +965,7 @@ java_classify_record (tree type) | ||
8 | if (! CLASS_P (type)) | ||
9 | return RECORD_IS_STRUCT; | ||
10 | |||
11 | - /* ??? GDB does not support DW_TAG_interface_type as of December, | ||
12 | - 2007. Re-enable this at a later time. */ | ||
13 | - if (0 && CLASS_INTERFACE (TYPE_NAME (type))) | ||
14 | + if (CLASS_INTERFACE (TYPE_NAME (type))) | ||
15 | return RECORD_IS_INTERFACE; | ||
16 | |||
17 | return RECORD_IS_CLASS; | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-java-nomulti.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-java-nomulti.patch new file mode 100644 index 0000000000..f07ead8f2b --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-java-nomulti.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | --- libjava/configure.ac.jj 2007-12-07 17:55:50.000000000 +0100 | ||
2 | +++ libjava/configure.ac 2007-12-07 18:36:56.000000000 +0100 | ||
3 | @@ -82,6 +82,13 @@ AC_ARG_ENABLE(java-maintainer-mode, | ||
4 | [allow rebuilding of .class and .h files])) | ||
5 | AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes) | ||
6 | |||
7 | +AC_ARG_ENABLE(libjava-multilib, | ||
8 | + AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib])) | ||
9 | +if test "$enable_libjava_multilib" = no; then | ||
10 | + multilib=no | ||
11 | + ac_configure_args="$ac_configure_args --disable-multilib" | ||
12 | +fi | ||
13 | + | ||
14 | # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX. | ||
15 | GCC_NO_EXECUTABLES | ||
16 | |||
17 | --- libjava/configure.jj 2007-12-07 17:55:50.000000000 +0100 | ||
18 | +++ libjava/configure 2007-12-07 18:39:58.000000000 +0100 | ||
19 | @@ -1018,6 +1018,8 @@ Optional Features: | ||
20 | --enable-gconf-peer compile GConf native peers for util.preferences | ||
21 | --enable-java-maintainer-mode | ||
22 | allow rebuilding of .class and .h files | ||
23 | + --enable-libjava-multilib | ||
24 | + build libjava as multilib | ||
25 | --disable-dependency-tracking speeds up one-time build | ||
26 | --enable-dependency-tracking do not reject slow dependency extractors | ||
27 | --enable-maintainer-mode enable make rules and dependencies not useful | ||
28 | @@ -1848,6 +1850,16 @@ else | ||
29 | fi | ||
30 | |||
31 | |||
32 | +# Check whether --enable-libjava-multilib was given. | ||
33 | +if test "${enable_libjava_multilib+set}" = set; then | ||
34 | + enableval=$enable_libjava_multilib; | ||
35 | +fi | ||
36 | + | ||
37 | +if test "$enable_libjava_multilib" = no; then | ||
38 | + multilib=no | ||
39 | + ac_configure_args="$ac_configure_args --disable-multilib" | ||
40 | +fi | ||
41 | + | ||
42 | # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX. | ||
43 | |||
44 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-libgomp-speedup.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-libgomp-speedup.patch new file mode 100644 index 0000000000..da85e556ec --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-libgomp-speedup.patch | |||
@@ -0,0 +1,2797 @@ | |||
1 | 2008-03-28 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | * config/linux/sparc/futex.h (atomic_write_barrier): Fix membar | ||
4 | argument. | ||
5 | |||
6 | 2008-03-27 Jakub Jelinek <jakub@redhat.com> | ||
7 | |||
8 | * libgomp.h (struct gomp_team_state): Remove single_count field | ||
9 | ifndef HAVE_SYNC_BUILTINS. | ||
10 | (struct gomp_team): Likewise. Add work_share_list_free_lock | ||
11 | ifndef HAVE_SYNC_BUILTINS. | ||
12 | * team.c (gomp_new_team): If HAVE_SYNC_BUILTINS is not defined, | ||
13 | don't initialize single_count, but instead initialize | ||
14 | work_share_list_free_lock. | ||
15 | (free_team): Destroy work_share_list_free_lock ifndef | ||
16 | HAVE_SYNC_BUILTINS. | ||
17 | (gomp_team_start): Don't initialize ts.single_count ifndef | ||
18 | HAVE_SYNC_BUILTINS. | ||
19 | * work.c (alloc_work_share, free_work_share): Use | ||
20 | work_share_list_free_lock instead of atomic chaining ifndef | ||
21 | HAVE_SYNC_BUILTINS. | ||
22 | |||
23 | 2008-03-26 Jakub Jelinek <jakub@redhat.com> | ||
24 | |||
25 | * loop.c (gomp_loop_init): Fix GFS_DYNAMIC ws->mode setting. | ||
26 | * testsuite/libgomp.c/loop-4.c: New test. | ||
27 | |||
28 | * libgomp.h (struct gomp_team_state): Add single_count field. | ||
29 | (struct gomp_team): Likewise. | ||
30 | * team.c (gomp_new_team): Clear single_count. | ||
31 | (gomp_team_start): Likewise. | ||
32 | * single.c (GOMP_single_start): Rewritten if HAVE_SYNC_BUILTINS. | ||
33 | |||
34 | 2008-03-25 Jakub Jelinek <jakub@redhat.com> | ||
35 | |||
36 | * team.c (gomp_thread_start): Don't clear ts.static_trip here. | ||
37 | * loop.c (gomp_loop_static_start, gomp_loop_dynamic_start): Clear | ||
38 | ts.static_trip here. | ||
39 | * work.c (gomp_work_share_start): Don't clear ts.static_trip here. | ||
40 | |||
41 | 2008-03-21 Jakub Jelinek <jakub@redhat.com> | ||
42 | |||
43 | * libgomp.h: Include ptrlock.h. | ||
44 | (struct gomp_work_share): Reshuffle fields. Add next_alloc, | ||
45 | next_ws, next_free and inline_ordered_team_ids fields, change | ||
46 | ordered_team_ids into pointer from flexible array member. | ||
47 | (struct gomp_team_state): Add last_work_share field, remove | ||
48 | work_share_generation. | ||
49 | (struct gomp_team): Remove work_share_lock, generation_mask, | ||
50 | oldest_live_gen, num_live_gen and init_work_shares fields, add | ||
51 | work work_share_list_alloc, work_share_list_free and work_share_chunk | ||
52 | fields. Change work_shares from pointer to pointers into an array. | ||
53 | (gomp_new_team): New prototype. | ||
54 | (gomp_team_start): Change type of last argument. | ||
55 | (gomp_new_work_share): Removed. | ||
56 | (gomp_init_work_share, gomp_fini_work_share): New prototypes. | ||
57 | (gomp_work_share_init_done): New static inline. | ||
58 | * team.c (gomp_thread_start): Clear ts.last_work_share, don't clear | ||
59 | ts.work_share_generation. | ||
60 | (new_team): Removed. | ||
61 | (gomp_new_team): New function. | ||
62 | (free_team): Free gomp_work_share blocks chained through next_alloc, | ||
63 | instead of freeing work_shares and destroying work_share_lock. | ||
64 | (gomp_team_start): Change last argument from ws to team, don't create | ||
65 | new team, set ts.work_share to &team->work_shares[0] and clear | ||
66 | ts.last_work_share. Don't clear ts.work_share_generation. | ||
67 | (gomp_team_end): Call gomp_fini_work_share. | ||
68 | * work.c (gomp_new_work_share): Removed. | ||
69 | (alloc_work_share, gomp_init_work_share, gomp_fini_work_share): New | ||
70 | functions. | ||
71 | (free_work_share): Add team argument. Call gomp_fini_work_share | ||
72 | and then either free ws if orphaned, or put it into | ||
73 | work_share_list_free list of the current team. | ||
74 | (gomp_work_share_start, gomp_work_share_end, | ||
75 | gomp_work_share_end_nowait): Rewritten. | ||
76 | * sections.c (GOMP_sections_start): Call gomp_work_share_init_done | ||
77 | after gomp_sections_init. If HAVE_SYNC_BUILTINS, call | ||
78 | gomp_iter_dynamic_next instead of the _locked variant and don't take | ||
79 | lock around it, otherwise acquire it before calling | ||
80 | gomp_iter_dynamic_next_locked. | ||
81 | (GOMP_sections_next): If HAVE_SYNC_BUILTINS, call | ||
82 | gomp_iter_dynamic_next instead of the _locked variant and don't take | ||
83 | lock around it. | ||
84 | (GOMP_parallel_sections_start): Call gomp_new_team instead of | ||
85 | gomp_new_work_share. Call gomp_sections_init on &team->work_shares[0]. | ||
86 | Adjust gomp_team_start caller. | ||
87 | * loop.c (gomp_loop_static_start, gomp_loop_ordered_static_start): Call | ||
88 | gomp_work_share_init_done after gomp_loop_init. Don't unlock ws->lock. | ||
89 | (gomp_loop_dynamic_start, gomp_loop_guided_start): Call | ||
90 | gomp_work_share_init_done after gomp_loop_init. If HAVE_SYNC_BUILTINS, | ||
91 | don't unlock ws->lock, otherwise lock it. | ||
92 | (gomp_loop_ordered_dynamic_start, gomp_loop_ordered_guided_start): Call | ||
93 | gomp_work_share_init_done after gomp_loop_init. Lock ws->lock. | ||
94 | (gomp_parallel_loop_start): Call gomp_new_team instead of | ||
95 | gomp_new_work_share. Call gomp_loop_init on &team->work_shares[0]. | ||
96 | Adjust gomp_team_start caller. | ||
97 | * single.c (GOMP_single_start, GOMP_single_copy_start): Call | ||
98 | gomp_work_share_init_done if gomp_work_share_start returned true. | ||
99 | Don't unlock ws->lock. | ||
100 | * parallel.c (GOMP_parallel_start): Call gomp_new_team and pass that | ||
101 | as last argument to gomp_team_start. | ||
102 | * config/linux/ptrlock.c: New file. | ||
103 | * config/linux/ptrlock.h: New file. | ||
104 | * config/posix/ptrlock.c: New file. | ||
105 | * config/posix/ptrlock.h: New file. | ||
106 | * Makefile.am (libgomp_la_SOURCES): Add ptrlock.c. | ||
107 | * Makefile.in: Regenerated. | ||
108 | * testsuite/Makefile.in: Regenerated. | ||
109 | |||
110 | 2008-03-19 Jakub Jelinek <jakub@redhat.com> | ||
111 | |||
112 | * libgomp.h (gomp_active_wait_policy): Remove decl. | ||
113 | (gomp_throttled_spin_count_var, gomp_available_cpus, | ||
114 | gomp_managed_threads): New extern decls. | ||
115 | * team.c (gomp_team_start, gomp_team_end): If number of threads | ||
116 | changed, adjust atomically gomp_managed_threads. | ||
117 | * env.c (gomp_active_wait_policy, gomp_block_time_var): Remove. | ||
118 | (gomp_throttled_spin_count_var, gomp_available_cpus, | ||
119 | gomp_managed_threads): New variables. | ||
120 | (parse_millis): Removed. | ||
121 | (parse_spincount): New function. | ||
122 | (parse_wait_policy): Return -1/0/1 instead of setting | ||
123 | gomp_active_wait_policy. | ||
124 | (initialize_env): Call gomp_init_num_threads unconditionally. | ||
125 | Initialize gomp_available_cpus. Call parse_spincount instead | ||
126 | of parse_millis, initialize gomp_{,throttled_}spin_count_var | ||
127 | depending on presence and value of OMP_WAIT_POLICY and | ||
128 | GOMP_SPINCOUNT env vars. | ||
129 | * config/linux/wait.h (do_wait): Use gomp_throttled_spin_count_var | ||
130 | instead of gomp_spin_count_var if gomp_managed_threads > | ||
131 | gomp_available_cpus. | ||
132 | |||
133 | * config/linux/wait.h: Include errno.h. | ||
134 | (FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Define. | ||
135 | (gomp_futex_wake, gomp_futex_wait): New extern decls. | ||
136 | * config/linux/mutex.c (gomp_futex_wake, gomp_futex_wait): New | ||
137 | variables. | ||
138 | * config/linux/powerpc/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove. | ||
139 | (sys_futex0): Return error code. | ||
140 | (futex_wake, futex_wait): If ENOSYS was returned, clear | ||
141 | FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry. | ||
142 | * config/linux/alpha/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove. | ||
143 | (futex_wake, futex_wait): If ENOSYS was returned, clear | ||
144 | FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry. | ||
145 | * config/linux/x86/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove. | ||
146 | (sys_futex0): Return error code. | ||
147 | (futex_wake, futex_wait): If ENOSYS was returned, clear | ||
148 | FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry. | ||
149 | * config/linux/s390/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove. | ||
150 | (sys_futex0): Return error code. | ||
151 | (futex_wake, futex_wait): If ENOSYS was returned, clear | ||
152 | FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry. | ||
153 | * config/linux/ia64/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove. | ||
154 | (sys_futex0): Return error code. | ||
155 | (futex_wake, futex_wait): If ENOSYS was returned, clear | ||
156 | FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry. | ||
157 | * config/linux/sparc/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove. | ||
158 | (sys_futex0): Return error code. | ||
159 | (futex_wake, futex_wait): If ENOSYS was returned, clear | ||
160 | FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry. | ||
161 | |||
162 | 2008-03-18 Jakub Jelinek <jakub@redhat.com> | ||
163 | |||
164 | * libgomp.h (struct gomp_work_share): Add mode field. Put lock and | ||
165 | next into a different cache line from most of the write-once fields. | ||
166 | * loop.c: Include limits.h. | ||
167 | (gomp_loop_init): For GFS_DYNAMIC, multiply ws->chunk_size by incr. | ||
168 | If adding ws->chunk_size nthreads + 1 times after end won't | ||
169 | overflow, set ws->mode to 1. | ||
170 | * iter.c (gomp_iter_dynamic_next_locked): Don't multiply | ||
171 | ws->chunk_size by incr. | ||
172 | (gomp_iter_dynamic_next): Likewise. If ws->mode, use more efficient | ||
173 | code. | ||
174 | * work.c: Include stddef.h. | ||
175 | (gomp_new_work_share): Use offsetof rather than sizeof. | ||
176 | |||
177 | 2008-03-17 Jakub Jelinek <jakub@redhat.com> | ||
178 | |||
179 | * libgomp.h (struct gomp_team): Change ordered_release field | ||
180 | into gomp_sem_t ** from flexible array member. Add implicit_task | ||
181 | and initial_work_shares fields. | ||
182 | (gomp_new_task): Removed. | ||
183 | (gomp_init_task): New prototype. | ||
184 | * team.c (new_team): Allocate implicit_task for each thread | ||
185 | and initial work_shares together with gomp_team allocation. | ||
186 | (free_team): Only free work_shares if it is not init_work_shares. | ||
187 | (gomp_team_start): Use gomp_init_task instead of gomp_new_task, | ||
188 | set thr->task to the corresponding implicit_task array entry. | ||
189 | * task.c (gomp_new_task): Removed. | ||
190 | (gomp_init_task): New function. | ||
191 | (gomp_end_task): Don't free the task. | ||
192 | (GOMP_task): Allocate struct gomp_task on the stack, call | ||
193 | gomp_init_task rather than gomp_new_task. | ||
194 | * work.c (gomp_work_share_start): If work_shares == | ||
195 | init_work_shares, gomp_malloc + memcpy rather than gomp_realloc. | ||
196 | |||
197 | 2008-03-15 Jakub Jelinek <jakub@redhat.com> | ||
198 | Ulrich Drepper <drepper@redhat.com> | ||
199 | |||
200 | * config/linux/bar.h (gomp_barrier_state_t): Rewritten. | ||
201 | (gomp_barrier_state_t): Change to unsigned int. | ||
202 | (gomp_barrier_init, gomp_barrier_reinit, gomp_barrier_destroy, | ||
203 | gomp_barrier_wait_start, gomp_barrier_last_thread): Rewritten. | ||
204 | (gomp_barrier_wait_last): Prototype rather than inline. | ||
205 | * config/linux/bar.c (gomp_barrier_wait_end): Rewritten. | ||
206 | (gomp_barrier_wait_last): New function. | ||
207 | |||
208 | 2008-03-15 Jakub Jelinek <jakub@redhat.com> | ||
209 | |||
210 | * team.c (gomp_thread_start): Use gomp_barrier_wait_last instead | ||
211 | of gomp_barrier_wait. | ||
212 | * env.c (gomp_block_time_var, gomp_spin_count_var): New variables. | ||
213 | (parse_millis): New function. | ||
214 | (initialize_env): Handle GOMP_BLOCKTIME env var. | ||
215 | * libgomp.h (struct gomp_team): Move close to the end of the struct. | ||
216 | (gomp_spin_count_var): New extern var decl. | ||
217 | * work.c (gomp_work_share_end): Use gomp_barrier_state_t bstate | ||
218 | var instead of bool last, call gomp_barrier_last_thread to check | ||
219 | for last thread, pass bstate to gomp_barrier_wait_end. | ||
220 | * config/linux/wait.h: New file. | ||
221 | * config/linux/mutex.c: Include wait.h instead of libgomp.h and | ||
222 | futex.h. | ||
223 | (gomp_mutex_lock_slow): Call do_wait instead of futex_wait. | ||
224 | * config/linux/bar.c: Include wait.h instead of libgomp.h and | ||
225 | futex.h. | ||
226 | (gomp_barrier_wait_end): Change second argument to | ||
227 | gomp_barrier_state_t. Call do_wait instead of futex_wait. | ||
228 | * config/linux/sem.c: Include wait.h instead of libgomp.h and | ||
229 | futex.h. | ||
230 | (gomp_sem_wait_slow): Call do_wait instead of futex_wait. | ||
231 | * config/linux/lock.c: Include wait.h instead of libgomp.h and | ||
232 | futex.h. | ||
233 | (gomp_set_nest_lock_25): Call do_wait instead of futex_wait. | ||
234 | * config/linux/affinity.c: Assume HAVE_SYNC_BUILTINS. | ||
235 | * config/linux/bar.h (gomp_barrier_state_t): New typedef. | ||
236 | (gomp_barrier_wait_end): Change second argument to | ||
237 | gomp_barrier_state_t. | ||
238 | (gomp_barrier_wait_start): Return gomp_barrier_state_t. | ||
239 | (gomp_barrier_last_thread, gomp_barrier_wait_last): New static | ||
240 | inlines. | ||
241 | * config/linux/powerpc/futex.h (cpu_relax, atomic_write_barrier): New | ||
242 | static inlines. | ||
243 | * config/linux/alpha/futex.h (cpu_relax, atomic_write_barrier): | ||
244 | Likewise. | ||
245 | * config/linux/x86/futex.h (cpu_relax, atomic_write_barrier): | ||
246 | Likewise. | ||
247 | * config/linux/s390/futex.h (cpu_relax, atomic_write_barrier): | ||
248 | Likewise. | ||
249 | * config/linux/ia64/futex.h (cpu_relax, atomic_write_barrier): | ||
250 | Likewise. | ||
251 | * config/linux/sparc/futex.h (cpu_relax, atomic_write_barrier): | ||
252 | Likewise. | ||
253 | * config/posix/bar.c (gomp_barrier_wait_end): Change second argument | ||
254 | to gomp_barrier_state_t. | ||
255 | * config/posix/bar.h (gomp_barrier_state_t): New typedef. | ||
256 | (gomp_barrier_wait_end): Change second argument to | ||
257 | gomp_barrier_state_t. | ||
258 | (gomp_barrier_wait_start): Return gomp_barrier_state_t. | ||
259 | (gomp_barrier_last_thread, gomp_barrier_wait_last): New static | ||
260 | inlines. | ||
261 | |||
262 | --- libgomp/parallel.c.jj 2007-12-07 14:41:01.000000000 +0100 | ||
263 | +++ libgomp/parallel.c 2008-03-26 15:32:06.000000000 +0100 | ||
264 | @@ -68,7 +68,7 @@ void | ||
265 | GOMP_parallel_start (void (*fn) (void *), void *data, unsigned num_threads) | ||
266 | { | ||
267 | num_threads = gomp_resolve_num_threads (num_threads); | ||
268 | - gomp_team_start (fn, data, num_threads, NULL); | ||
269 | + gomp_team_start (fn, data, num_threads, gomp_new_team (num_threads)); | ||
270 | } | ||
271 | |||
272 | void | ||
273 | --- libgomp/sections.c.jj 2007-12-07 14:41:01.000000000 +0100 | ||
274 | +++ libgomp/sections.c 2008-03-26 15:33:06.000000000 +0100 | ||
275 | @@ -59,14 +59,24 @@ GOMP_sections_start (unsigned count) | ||
276 | long s, e, ret; | ||
277 | |||
278 | if (gomp_work_share_start (false)) | ||
279 | - gomp_sections_init (thr->ts.work_share, count); | ||
280 | + { | ||
281 | + gomp_sections_init (thr->ts.work_share, count); | ||
282 | + gomp_work_share_init_done (); | ||
283 | + } | ||
284 | |||
285 | +#ifdef HAVE_SYNC_BUILTINS | ||
286 | + if (gomp_iter_dynamic_next (&s, &e)) | ||
287 | + ret = s; | ||
288 | + else | ||
289 | + ret = 0; | ||
290 | +#else | ||
291 | + gomp_mutex_lock (&thr->ts.work_share->lock); | ||
292 | if (gomp_iter_dynamic_next_locked (&s, &e)) | ||
293 | ret = s; | ||
294 | else | ||
295 | ret = 0; | ||
296 | - | ||
297 | gomp_mutex_unlock (&thr->ts.work_share->lock); | ||
298 | +#endif | ||
299 | |||
300 | return ret; | ||
301 | } | ||
302 | @@ -83,15 +93,23 @@ GOMP_sections_start (unsigned count) | ||
303 | unsigned | ||
304 | GOMP_sections_next (void) | ||
305 | { | ||
306 | - struct gomp_thread *thr = gomp_thread (); | ||
307 | long s, e, ret; | ||
308 | |||
309 | +#ifdef HAVE_SYNC_BUILTINS | ||
310 | + if (gomp_iter_dynamic_next (&s, &e)) | ||
311 | + ret = s; | ||
312 | + else | ||
313 | + ret = 0; | ||
314 | +#else | ||
315 | + struct gomp_thread *thr = gomp_thread (); | ||
316 | + | ||
317 | gomp_mutex_lock (&thr->ts.work_share->lock); | ||
318 | if (gomp_iter_dynamic_next_locked (&s, &e)) | ||
319 | ret = s; | ||
320 | else | ||
321 | ret = 0; | ||
322 | gomp_mutex_unlock (&thr->ts.work_share->lock); | ||
323 | +#endif | ||
324 | |||
325 | return ret; | ||
326 | } | ||
327 | @@ -103,15 +121,15 @@ void | ||
328 | GOMP_parallel_sections_start (void (*fn) (void *), void *data, | ||
329 | unsigned num_threads, unsigned count) | ||
330 | { | ||
331 | - struct gomp_work_share *ws; | ||
332 | + struct gomp_team *team; | ||
333 | |||
334 | num_threads = gomp_resolve_num_threads (num_threads); | ||
335 | if (gomp_dyn_var && num_threads > count) | ||
336 | num_threads = count; | ||
337 | |||
338 | - ws = gomp_new_work_share (false, num_threads); | ||
339 | - gomp_sections_init (ws, count); | ||
340 | - gomp_team_start (fn, data, num_threads, ws); | ||
341 | + team = gomp_new_team (num_threads); | ||
342 | + gomp_sections_init (&team->work_shares[0], count); | ||
343 | + gomp_team_start (fn, data, num_threads, team); | ||
344 | } | ||
345 | |||
346 | /* The GOMP_section_end* routines are called after the thread is told | ||
347 | --- libgomp/env.c.jj 2007-12-07 14:41:01.000000000 +0100 | ||
348 | +++ libgomp/env.c 2008-03-26 16:40:26.000000000 +0100 | ||
349 | @@ -44,6 +44,11 @@ enum gomp_schedule_type gomp_run_sched_v | ||
350 | unsigned long gomp_run_sched_chunk = 1; | ||
351 | unsigned short *gomp_cpu_affinity; | ||
352 | size_t gomp_cpu_affinity_len; | ||
353 | +#ifndef HAVE_SYNC_BUILTINS | ||
354 | +gomp_mutex_t gomp_remaining_threads_lock; | ||
355 | +#endif | ||
356 | +unsigned long gomp_available_cpus = 1, gomp_managed_threads = 1; | ||
357 | +unsigned long long gomp_spin_count_var, gomp_throttled_spin_count_var; | ||
358 | |||
359 | /* Parse the OMP_SCHEDULE environment variable. */ | ||
360 | |||
361 | @@ -147,6 +152,79 @@ parse_unsigned_long (const char *name, u | ||
362 | return false; | ||
363 | } | ||
364 | |||
365 | +/* Parse the GOMP_SPINCOUNT environment varible. Return true if one was | ||
366 | + present and it was successfully parsed. */ | ||
367 | + | ||
368 | +static bool | ||
369 | +parse_spincount (const char *name, unsigned long long *pvalue) | ||
370 | +{ | ||
371 | + char *env, *end; | ||
372 | + unsigned long long value, mult = 1; | ||
373 | + | ||
374 | + env = getenv (name); | ||
375 | + if (env == NULL) | ||
376 | + return false; | ||
377 | + | ||
378 | + while (isspace ((unsigned char) *env)) | ||
379 | + ++env; | ||
380 | + if (*env == '\0') | ||
381 | + goto invalid; | ||
382 | + | ||
383 | + if (strncasecmp (env, "infinite", 8) == 0 | ||
384 | + || strncasecmp (env, "infinity", 8) == 0) | ||
385 | + { | ||
386 | + value = ~0ULL; | ||
387 | + end = env + 8; | ||
388 | + goto check_tail; | ||
389 | + } | ||
390 | + | ||
391 | + errno = 0; | ||
392 | + value = strtoull (env, &end, 10); | ||
393 | + if (errno) | ||
394 | + goto invalid; | ||
395 | + | ||
396 | + while (isspace ((unsigned char) *end)) | ||
397 | + ++end; | ||
398 | + if (*end != '\0') | ||
399 | + { | ||
400 | + switch (tolower (*end)) | ||
401 | + { | ||
402 | + case 'k': | ||
403 | + mult = 1000LL; | ||
404 | + break; | ||
405 | + case 'm': | ||
406 | + mult = 1000LL * 1000LL; | ||
407 | + break; | ||
408 | + case 'g': | ||
409 | + mult = 1000LL * 1000LL * 1000LL; | ||
410 | + break; | ||
411 | + case 't': | ||
412 | + mult = 1000LL * 1000LL * 1000LL * 1000LL; | ||
413 | + break; | ||
414 | + default: | ||
415 | + goto invalid; | ||
416 | + } | ||
417 | + ++end; | ||
418 | + check_tail: | ||
419 | + while (isspace ((unsigned char) *end)) | ||
420 | + ++end; | ||
421 | + if (*end != '\0') | ||
422 | + goto invalid; | ||
423 | + } | ||
424 | + | ||
425 | + if (value > ~0ULL / mult) | ||
426 | + value = ~0ULL; | ||
427 | + else | ||
428 | + value *= mult; | ||
429 | + | ||
430 | + *pvalue = value; | ||
431 | + return true; | ||
432 | + | ||
433 | + invalid: | ||
434 | + gomp_error ("Invalid value for environment variable %s", name); | ||
435 | + return false; | ||
436 | +} | ||
437 | + | ||
438 | /* Parse a boolean value for environment variable NAME and store the | ||
439 | result in VALUE. */ | ||
440 | |||
441 | @@ -281,10 +359,25 @@ initialize_env (void) | ||
442 | parse_schedule (); | ||
443 | parse_boolean ("OMP_DYNAMIC", &gomp_dyn_var); | ||
444 | parse_boolean ("OMP_NESTED", &gomp_nest_var); | ||
445 | + gomp_init_num_threads (); | ||
446 | + gomp_available_cpus = gomp_nthreads_var; | ||
447 | if (!parse_unsigned_long ("OMP_NUM_THREADS", &gomp_nthreads_var)) | ||
448 | - gomp_init_num_threads (); | ||
449 | + gomp_nthreads_var = gomp_available_cpus; | ||
450 | if (parse_affinity ()) | ||
451 | gomp_init_affinity (); | ||
452 | + if (!parse_spincount ("GOMP_SPINCOUNT", &gomp_spin_count_var)) | ||
453 | + { | ||
454 | + /* Using a rough estimation of 100000 spins per msec, | ||
455 | + use 200 msec blocking. | ||
456 | + Depending on the CPU speed, this can be e.g. 5 times longer | ||
457 | + or 5 times shorter. */ | ||
458 | + gomp_spin_count_var = 20000000LL; | ||
459 | + } | ||
460 | + /* gomp_throttled_spin_count_var is used when there are more libgomp | ||
461 | + managed threads than available CPUs. Use very short spinning. */ | ||
462 | + gomp_throttled_spin_count_var = 100LL; | ||
463 | + if (gomp_throttled_spin_count_var > gomp_spin_count_var) | ||
464 | + gomp_throttled_spin_count_var = gomp_spin_count_var; | ||
465 | |||
466 | /* Not strictly environment related, but ordering constructors is tricky. */ | ||
467 | pthread_attr_init (&gomp_thread_attr); | ||
468 | --- libgomp/libgomp.h.jj 2007-12-07 14:41:01.000000000 +0100 | ||
469 | +++ libgomp/libgomp.h 2008-03-27 12:21:51.000000000 +0100 | ||
470 | @@ -50,6 +50,7 @@ | ||
471 | #include "sem.h" | ||
472 | #include "mutex.h" | ||
473 | #include "bar.h" | ||
474 | +#include "ptrlock.h" | ||
475 | |||
476 | |||
477 | /* This structure contains the data to control one work-sharing construct, | ||
478 | @@ -70,6 +71,8 @@ struct gomp_work_share | ||
479 | If this is a SECTIONS construct, this value will always be DYNAMIC. */ | ||
480 | enum gomp_schedule_type sched; | ||
481 | |||
482 | + int mode; | ||
483 | + | ||
484 | /* This is the chunk_size argument to the SCHEDULE clause. */ | ||
485 | long chunk_size; | ||
486 | |||
487 | @@ -81,17 +84,38 @@ struct gomp_work_share | ||
488 | is always 1. */ | ||
489 | long incr; | ||
490 | |||
491 | - /* This lock protects the update of the following members. */ | ||
492 | - gomp_mutex_t lock; | ||
493 | + /* This is a circular queue that details which threads will be allowed | ||
494 | + into the ordered region and in which order. When a thread allocates | ||
495 | + iterations on which it is going to work, it also registers itself at | ||
496 | + the end of the array. When a thread reaches the ordered region, it | ||
497 | + checks to see if it is the one at the head of the queue. If not, it | ||
498 | + blocks on its RELEASE semaphore. */ | ||
499 | + unsigned *ordered_team_ids; | ||
500 | |||
501 | - union { | ||
502 | - /* This is the next iteration value to be allocated. In the case of | ||
503 | - GFS_STATIC loops, this the iteration start point and never changes. */ | ||
504 | - long next; | ||
505 | + /* This is the number of threads that have registered themselves in | ||
506 | + the circular queue ordered_team_ids. */ | ||
507 | + unsigned ordered_num_used; | ||
508 | |||
509 | - /* This is the returned data structure for SINGLE COPYPRIVATE. */ | ||
510 | - void *copyprivate; | ||
511 | - }; | ||
512 | + /* This is the team_id of the currently acknowledged owner of the ordered | ||
513 | + section, or -1u if the ordered section has not been acknowledged by | ||
514 | + any thread. This is distinguished from the thread that is *allowed* | ||
515 | + to take the section next. */ | ||
516 | + unsigned ordered_owner; | ||
517 | + | ||
518 | + /* This is the index into the circular queue ordered_team_ids of the | ||
519 | + current thread that's allowed into the ordered reason. */ | ||
520 | + unsigned ordered_cur; | ||
521 | + | ||
522 | + /* This is a chain of allocated gomp_work_share blocks, valid only | ||
523 | + in the first gomp_work_share struct in the block. */ | ||
524 | + struct gomp_work_share *next_alloc; | ||
525 | + | ||
526 | + /* The above fields are written once during workshare initialization, | ||
527 | + or related to ordered worksharing. Make sure the following fields | ||
528 | + are in a different cache line. */ | ||
529 | + | ||
530 | + /* This lock protects the update of the following members. */ | ||
531 | + gomp_mutex_t lock __attribute__((aligned (64))); | ||
532 | |||
533 | /* This is the count of the number of threads that have exited the work | ||
534 | share construct. If the construct was marked nowait, they have moved on | ||
535 | @@ -99,27 +123,28 @@ struct gomp_work_share | ||
536 | of the team to exit the work share construct must deallocate it. */ | ||
537 | unsigned threads_completed; | ||
538 | |||
539 | - /* This is the index into the circular queue ordered_team_ids of the | ||
540 | - current thread that's allowed into the ordered reason. */ | ||
541 | - unsigned ordered_cur; | ||
542 | + union { | ||
543 | + /* This is the next iteration value to be allocated. In the case of | ||
544 | + GFS_STATIC loops, this the iteration start point and never changes. */ | ||
545 | + long next; | ||
546 | |||
547 | - /* This is the number of threads that have registered themselves in | ||
548 | - the circular queue ordered_team_ids. */ | ||
549 | - unsigned ordered_num_used; | ||
550 | + /* This is the returned data structure for SINGLE COPYPRIVATE. */ | ||
551 | + void *copyprivate; | ||
552 | + }; | ||
553 | |||
554 | - /* This is the team_id of the currently acknoledged owner of the ordered | ||
555 | - section, or -1u if the ordered section has not been acknowledged by | ||
556 | - any thread. This is distinguished from the thread that is *allowed* | ||
557 | - to take the section next. */ | ||
558 | - unsigned ordered_owner; | ||
559 | + union { | ||
560 | + /* Link to gomp_work_share struct for next work sharing construct | ||
561 | + encountered after this one. */ | ||
562 | + gomp_ptrlock_t next_ws; | ||
563 | + | ||
564 | + /* gomp_work_share structs are chained in the free work share cache | ||
565 | + through this. */ | ||
566 | + struct gomp_work_share *next_free; | ||
567 | + }; | ||
568 | |||
569 | - /* This is a circular queue that details which threads will be allowed | ||
570 | - into the ordered region and in which order. When a thread allocates | ||
571 | - iterations on which it is going to work, it also registers itself at | ||
572 | - the end of the array. When a thread reaches the ordered region, it | ||
573 | - checks to see if it is the one at the head of the queue. If not, it | ||
574 | - blocks on its RELEASE semaphore. */ | ||
575 | - unsigned ordered_team_ids[]; | ||
576 | + /* If only few threads are in the team, ordered_team_ids can point | ||
577 | + to this array which fills the padding at the end of this struct. */ | ||
578 | + unsigned inline_ordered_team_ids[0]; | ||
579 | }; | ||
580 | |||
581 | /* This structure contains all of the thread-local data associated with | ||
582 | @@ -133,21 +158,24 @@ struct gomp_team_state | ||
583 | |||
584 | /* This is the work share construct which this thread is currently | ||
585 | processing. Recall that with NOWAIT, not all threads may be | ||
586 | - processing the same construct. This value is NULL when there | ||
587 | - is no construct being processed. */ | ||
588 | + processing the same construct. */ | ||
589 | struct gomp_work_share *work_share; | ||
590 | |||
591 | + /* This is the previous work share construct or NULL if there wasn't any. | ||
592 | + When all threads are done with the current work sharing construct, | ||
593 | + the previous one can be freed. The current one can't, as its | ||
594 | + next_ws field is used. */ | ||
595 | + struct gomp_work_share *last_work_share; | ||
596 | + | ||
597 | /* This is the ID of this thread within the team. This value is | ||
598 | guaranteed to be between 0 and N-1, where N is the number of | ||
599 | threads in the team. */ | ||
600 | unsigned team_id; | ||
601 | |||
602 | - /* The work share "generation" is a number that increases by one for | ||
603 | - each work share construct encountered in the dynamic flow of the | ||
604 | - program. It is used to find the control data for the work share | ||
605 | - when encountering it for the first time. This particular number | ||
606 | - reflects the generation of the work_share member of this struct. */ | ||
607 | - unsigned work_share_generation; | ||
608 | +#ifdef HAVE_SYNC_BUILTINS | ||
609 | + /* Number of single stmts encountered. */ | ||
610 | + unsigned long single_count; | ||
611 | +#endif | ||
612 | |||
613 | /* For GFS_RUNTIME loops that resolved to GFS_STATIC, this is the | ||
614 | trip number through the loop. So first time a particular loop | ||
615 | @@ -163,41 +191,53 @@ struct gomp_team_state | ||
616 | |||
617 | struct gomp_team | ||
618 | { | ||
619 | - /* This lock protects access to the following work shares data structures. */ | ||
620 | - gomp_mutex_t work_share_lock; | ||
621 | - | ||
622 | - /* This is a dynamically sized array containing pointers to the control | ||
623 | - structs for all "live" work share constructs. Here "live" means that | ||
624 | - the construct has been encountered by at least one thread, and not | ||
625 | - completed by all threads. */ | ||
626 | - struct gomp_work_share **work_shares; | ||
627 | - | ||
628 | - /* The work_shares array is indexed by "generation & generation_mask". | ||
629 | - The mask will be 2**N - 1, where 2**N is the size of the array. */ | ||
630 | - unsigned generation_mask; | ||
631 | - | ||
632 | - /* These two values define the bounds of the elements of the work_shares | ||
633 | - array that are currently in use. */ | ||
634 | - unsigned oldest_live_gen; | ||
635 | - unsigned num_live_gen; | ||
636 | - | ||
637 | /* This is the number of threads in the current team. */ | ||
638 | unsigned nthreads; | ||
639 | |||
640 | + /* This is number of gomp_work_share structs that have been allocated | ||
641 | + as a block last time. */ | ||
642 | + unsigned work_share_chunk; | ||
643 | + | ||
644 | /* This is the saved team state that applied to a master thread before | ||
645 | the current thread was created. */ | ||
646 | struct gomp_team_state prev_ts; | ||
647 | |||
648 | - /* This barrier is used for most synchronization of the team. */ | ||
649 | - gomp_barrier_t barrier; | ||
650 | - | ||
651 | /* This semaphore should be used by the master thread instead of its | ||
652 | "native" semaphore in the thread structure. Required for nested | ||
653 | parallels, as the master is a member of two teams. */ | ||
654 | gomp_sem_t master_release; | ||
655 | |||
656 | - /* This array contains pointers to the release semaphore of the threads | ||
657 | - in the team. */ | ||
658 | + /* List of gomp_work_share structs chained through next_free fields. | ||
659 | + This is populated and taken off only by the first thread in the | ||
660 | + team encountering a new work sharing construct, in a critical | ||
661 | + section. */ | ||
662 | + struct gomp_work_share *work_share_list_alloc; | ||
663 | + | ||
664 | + /* List of gomp_work_share structs freed by free_work_share. New | ||
665 | + entries are atomically added to the start of the list, and | ||
666 | + alloc_work_share can safely only move all but the first entry | ||
667 | + to work_share_list alloc, as free_work_share can happen concurrently | ||
668 | + with alloc_work_share. */ | ||
669 | + struct gomp_work_share *work_share_list_free; | ||
670 | + | ||
671 | +#ifdef HAVE_SYNC_BUILTINS | ||
672 | + /* Number of simple single regions encountered by threads in this | ||
673 | + team. */ | ||
674 | + unsigned long single_count; | ||
675 | +#else | ||
676 | + /* Mutex protecting addition of workshares to work_share_list_free. */ | ||
677 | + gomp_mutex_t work_share_list_free_lock; | ||
678 | +#endif | ||
679 | + | ||
680 | + /* This barrier is used for most synchronization of the team. */ | ||
681 | + gomp_barrier_t barrier; | ||
682 | + | ||
683 | + /* Initial work shares, to avoid allocating any gomp_work_share | ||
684 | + structs in the common case. */ | ||
685 | + struct gomp_work_share work_shares[8]; | ||
686 | + | ||
687 | + /* This is an array with pointers to the release semaphore | ||
688 | + of the threads in the team. */ | ||
689 | gomp_sem_t *ordered_release[]; | ||
690 | }; | ||
691 | |||
692 | @@ -242,6 +282,11 @@ extern bool gomp_dyn_var; | ||
693 | extern bool gomp_nest_var; | ||
694 | extern enum gomp_schedule_type gomp_run_sched_var; | ||
695 | extern unsigned long gomp_run_sched_chunk; | ||
696 | +#ifndef HAVE_SYNC_BUILTINS | ||
697 | +extern gomp_mutex_t gomp_remaining_threads_lock; | ||
698 | +#endif | ||
699 | +extern unsigned long long gomp_spin_count_var, gomp_throttled_spin_count_var; | ||
700 | +extern unsigned long gomp_available_cpus, gomp_managed_threads; | ||
701 | |||
702 | /* The attributes to be used during thread creation. */ | ||
703 | extern pthread_attr_t gomp_thread_attr; | ||
704 | @@ -306,17 +351,27 @@ extern unsigned gomp_dynamic_max_threads | ||
705 | |||
706 | /* team.c */ | ||
707 | |||
708 | +extern struct gomp_team *gomp_new_team (unsigned); | ||
709 | extern void gomp_team_start (void (*) (void *), void *, unsigned, | ||
710 | - struct gomp_work_share *); | ||
711 | + struct gomp_team *); | ||
712 | extern void gomp_team_end (void); | ||
713 | |||
714 | /* work.c */ | ||
715 | |||
716 | -extern struct gomp_work_share * gomp_new_work_share (bool, unsigned); | ||
717 | +extern void gomp_init_work_share (struct gomp_work_share *, bool, unsigned); | ||
718 | +extern void gomp_fini_work_share (struct gomp_work_share *); | ||
719 | extern bool gomp_work_share_start (bool); | ||
720 | extern void gomp_work_share_end (void); | ||
721 | extern void gomp_work_share_end_nowait (void); | ||
722 | |||
723 | +static inline void | ||
724 | +gomp_work_share_init_done (void) | ||
725 | +{ | ||
726 | + struct gomp_thread *thr = gomp_thread (); | ||
727 | + if (__builtin_expect (thr->ts.last_work_share != NULL, 1)) | ||
728 | + gomp_ptrlock_set (&thr->ts.last_work_share->next_ws, thr->ts.work_share); | ||
729 | +} | ||
730 | + | ||
731 | #ifdef HAVE_ATTRIBUTE_VISIBILITY | ||
732 | # pragma GCC visibility pop | ||
733 | #endif | ||
734 | --- libgomp/iter.c.jj 2008-03-26 14:48:34.000000000 +0100 | ||
735 | +++ libgomp/iter.c 2008-03-26 15:11:23.000000000 +0100 | ||
736 | @@ -1,4 +1,4 @@ | ||
737 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
738 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
739 | Contributed by Richard Henderson <rth@redhat.com>. | ||
740 | |||
741 | This file is part of the GNU OpenMP Library (libgomp). | ||
742 | @@ -154,7 +154,7 @@ gomp_iter_dynamic_next_locked (long *pst | ||
743 | if (start == ws->end) | ||
744 | return false; | ||
745 | |||
746 | - chunk = ws->chunk_size * ws->incr; | ||
747 | + chunk = ws->chunk_size; | ||
748 | left = ws->end - start; | ||
749 | if (ws->incr < 0) | ||
750 | { | ||
751 | @@ -186,11 +186,38 @@ gomp_iter_dynamic_next (long *pstart, lo | ||
752 | struct gomp_work_share *ws = thr->ts.work_share; | ||
753 | long start, end, nend, chunk, incr; | ||
754 | |||
755 | - start = ws->next; | ||
756 | end = ws->end; | ||
757 | incr = ws->incr; | ||
758 | - chunk = ws->chunk_size * incr; | ||
759 | + chunk = ws->chunk_size; | ||
760 | + | ||
761 | + if (__builtin_expect (ws->mode, 1)) | ||
762 | + { | ||
763 | + long tmp = __sync_fetch_and_add (&ws->next, chunk); | ||
764 | + if (incr > 0) | ||
765 | + { | ||
766 | + if (tmp >= end) | ||
767 | + return false; | ||
768 | + nend = tmp + chunk; | ||
769 | + if (nend > end) | ||
770 | + nend = end; | ||
771 | + *pstart = tmp; | ||
772 | + *pend = nend; | ||
773 | + return true; | ||
774 | + } | ||
775 | + else | ||
776 | + { | ||
777 | + if (tmp <= end) | ||
778 | + return false; | ||
779 | + nend = tmp + chunk; | ||
780 | + if (nend < end) | ||
781 | + nend = end; | ||
782 | + *pstart = tmp; | ||
783 | + *pend = nend; | ||
784 | + return true; | ||
785 | + } | ||
786 | + } | ||
787 | |||
788 | + start = ws->next; | ||
789 | while (1) | ||
790 | { | ||
791 | long left = end - start; | ||
792 | --- libgomp/work.c.jj 2007-12-07 14:41:01.000000000 +0100 | ||
793 | +++ libgomp/work.c 2008-03-27 12:21:51.000000000 +0100 | ||
794 | @@ -1,4 +1,4 @@ | ||
795 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
796 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
797 | Contributed by Richard Henderson <rth@redhat.com>. | ||
798 | |||
799 | This file is part of the GNU OpenMP Library (libgomp). | ||
800 | @@ -29,39 +29,138 @@ | ||
801 | of threads. */ | ||
802 | |||
803 | #include "libgomp.h" | ||
804 | +#include <stddef.h> | ||
805 | #include <stdlib.h> | ||
806 | #include <string.h> | ||
807 | |||
808 | |||
809 | -/* Create a new work share structure. */ | ||
810 | +/* Allocate a new work share structure, preferably from current team's | ||
811 | + free gomp_work_share cache. */ | ||
812 | |||
813 | -struct gomp_work_share * | ||
814 | -gomp_new_work_share (bool ordered, unsigned nthreads) | ||
815 | +static struct gomp_work_share * | ||
816 | +alloc_work_share (struct gomp_team *team) | ||
817 | { | ||
818 | struct gomp_work_share *ws; | ||
819 | - size_t size; | ||
820 | + unsigned int i; | ||
821 | |||
822 | - size = sizeof (*ws); | ||
823 | - if (ordered) | ||
824 | - size += nthreads * sizeof (ws->ordered_team_ids[0]); | ||
825 | + /* This is called in a critical section. */ | ||
826 | + if (team->work_share_list_alloc != NULL) | ||
827 | + { | ||
828 | + ws = team->work_share_list_alloc; | ||
829 | + team->work_share_list_alloc = ws->next_free; | ||
830 | + return ws; | ||
831 | + } | ||
832 | |||
833 | - ws = gomp_malloc_cleared (size); | ||
834 | - gomp_mutex_init (&ws->lock); | ||
835 | - ws->ordered_owner = -1; | ||
836 | +#ifdef HAVE_SYNC_BUILTINS | ||
837 | + ws = team->work_share_list_free; | ||
838 | + /* We need atomic read from work_share_list_free, | ||
839 | + as free_work_share can be called concurrently. */ | ||
840 | + __asm ("" : "+r" (ws)); | ||
841 | + | ||
842 | + if (ws && ws->next_free) | ||
843 | + { | ||
844 | + struct gomp_work_share *next = ws->next_free; | ||
845 | + ws->next_free = NULL; | ||
846 | + team->work_share_list_alloc = next->next_free; | ||
847 | + return next; | ||
848 | + } | ||
849 | +#else | ||
850 | + gomp_mutex_lock (&team->work_share_list_free_lock); | ||
851 | + ws = team->work_share_list_free; | ||
852 | + if (ws) | ||
853 | + { | ||
854 | + team->work_share_list_alloc = ws->next_free; | ||
855 | + team->work_share_list_free = NULL; | ||
856 | + gomp_mutex_unlock (&team->work_share_list_free_lock); | ||
857 | + return ws; | ||
858 | + } | ||
859 | + gomp_mutex_unlock (&team->work_share_list_free_lock); | ||
860 | +#endif | ||
861 | |||
862 | + team->work_share_chunk *= 2; | ||
863 | + ws = gomp_malloc (team->work_share_chunk * sizeof (struct gomp_work_share)); | ||
864 | + ws->next_alloc = team->work_shares[0].next_alloc; | ||
865 | + team->work_shares[0].next_alloc = ws; | ||
866 | + team->work_share_list_alloc = &ws[1]; | ||
867 | + for (i = 1; i < team->work_share_chunk - 1; i++) | ||
868 | + ws[i].next_free = &ws[i + 1]; | ||
869 | + ws[i].next_free = NULL; | ||
870 | return ws; | ||
871 | } | ||
872 | |||
873 | +/* Initialize an already allocated struct gomp_work_share. | ||
874 | + This shouldn't touch the next_alloc field. */ | ||
875 | + | ||
876 | +void | ||
877 | +gomp_init_work_share (struct gomp_work_share *ws, bool ordered, | ||
878 | + unsigned nthreads) | ||
879 | +{ | ||
880 | + gomp_mutex_init (&ws->lock); | ||
881 | + if (__builtin_expect (ordered, 0)) | ||
882 | + { | ||
883 | +#define INLINE_ORDERED_TEAM_IDS_CNT \ | ||
884 | + ((sizeof (struct gomp_work_share) \ | ||
885 | + - offsetof (struct gomp_work_share, inline_ordered_team_ids)) \ | ||
886 | + / sizeof (((struct gomp_work_share *) 0)->inline_ordered_team_ids[0])) | ||
887 | + | ||
888 | + if (nthreads > INLINE_ORDERED_TEAM_IDS_CNT) | ||
889 | + ws->ordered_team_ids | ||
890 | + = gomp_malloc (nthreads * sizeof (*ws->ordered_team_ids)); | ||
891 | + else | ||
892 | + ws->ordered_team_ids = ws->inline_ordered_team_ids; | ||
893 | + memset (ws->ordered_team_ids, '\0', | ||
894 | + nthreads * sizeof (*ws->ordered_team_ids)); | ||
895 | + ws->ordered_num_used = 0; | ||
896 | + ws->ordered_owner = -1; | ||
897 | + ws->ordered_cur = 0; | ||
898 | + } | ||
899 | + else | ||
900 | + ws->ordered_team_ids = NULL; | ||
901 | + gomp_ptrlock_init (&ws->next_ws, NULL); | ||
902 | + ws->threads_completed = 0; | ||
903 | +} | ||
904 | |||
905 | -/* Free a work share structure. */ | ||
906 | +/* Do any needed destruction of gomp_work_share fields before it | ||
907 | + is put back into free gomp_work_share cache or freed. */ | ||
908 | |||
909 | -static void | ||
910 | -free_work_share (struct gomp_work_share *ws) | ||
911 | +void | ||
912 | +gomp_fini_work_share (struct gomp_work_share *ws) | ||
913 | { | ||
914 | gomp_mutex_destroy (&ws->lock); | ||
915 | - free (ws); | ||
916 | + if (ws->ordered_team_ids != ws->inline_ordered_team_ids) | ||
917 | + free (ws->ordered_team_ids); | ||
918 | + gomp_ptrlock_destroy (&ws->next_ws); | ||
919 | } | ||
920 | |||
921 | +/* Free a work share struct, if not orphaned, put it into current | ||
922 | + team's free gomp_work_share cache. */ | ||
923 | + | ||
924 | +static inline void | ||
925 | +free_work_share (struct gomp_team *team, struct gomp_work_share *ws) | ||
926 | +{ | ||
927 | + gomp_fini_work_share (ws); | ||
928 | + if (__builtin_expect (team == NULL, 0)) | ||
929 | + free (ws); | ||
930 | + else | ||
931 | + { | ||
932 | + struct gomp_work_share *next_ws; | ||
933 | +#ifdef HAVE_SYNC_BUILTINS | ||
934 | + do | ||
935 | + { | ||
936 | + next_ws = team->work_share_list_free; | ||
937 | + ws->next_free = next_ws; | ||
938 | + } | ||
939 | + while (!__sync_bool_compare_and_swap (&team->work_share_list_free, | ||
940 | + next_ws, ws)); | ||
941 | +#else | ||
942 | + gomp_mutex_lock (&team->work_share_list_free_lock); | ||
943 | + next_ws = team->work_share_list_free; | ||
944 | + ws->next_free = next_ws; | ||
945 | + team->work_share_list_free = ws; | ||
946 | + gomp_mutex_unlock (&team->work_share_list_free_lock); | ||
947 | +#endif | ||
948 | + } | ||
949 | +} | ||
950 | |||
951 | /* The current thread is ready to begin the next work sharing construct. | ||
952 | In all cases, thr->ts.work_share is updated to point to the new | ||
953 | @@ -74,71 +173,34 @@ gomp_work_share_start (bool ordered) | ||
954 | struct gomp_thread *thr = gomp_thread (); | ||
955 | struct gomp_team *team = thr->ts.team; | ||
956 | struct gomp_work_share *ws; | ||
957 | - unsigned ws_index, ws_gen; | ||
958 | |||
959 | /* Work sharing constructs can be orphaned. */ | ||
960 | if (team == NULL) | ||
961 | { | ||
962 | - ws = gomp_new_work_share (ordered, 1); | ||
963 | + ws = gomp_malloc (sizeof (*ws)); | ||
964 | + gomp_init_work_share (ws, ordered, 1); | ||
965 | thr->ts.work_share = ws; | ||
966 | - thr->ts.static_trip = 0; | ||
967 | - gomp_mutex_lock (&ws->lock); | ||
968 | - return true; | ||
969 | + return ws; | ||
970 | } | ||
971 | |||
972 | - gomp_mutex_lock (&team->work_share_lock); | ||
973 | - | ||
974 | - /* This thread is beginning its next generation. */ | ||
975 | - ws_gen = ++thr->ts.work_share_generation; | ||
976 | - | ||
977 | - /* If this next generation is not newer than any other generation in | ||
978 | - the team, then simply reference the existing construct. */ | ||
979 | - if (ws_gen - team->oldest_live_gen < team->num_live_gen) | ||
980 | + ws = thr->ts.work_share; | ||
981 | + thr->ts.last_work_share = ws; | ||
982 | + ws = gomp_ptrlock_get (&ws->next_ws); | ||
983 | + if (ws == NULL) | ||
984 | { | ||
985 | - ws_index = ws_gen & team->generation_mask; | ||
986 | - ws = team->work_shares[ws_index]; | ||
987 | + /* This thread encountered a new ws first. */ | ||
988 | + struct gomp_work_share *ws = alloc_work_share (team); | ||
989 | + gomp_init_work_share (ws, ordered, team->nthreads); | ||
990 | thr->ts.work_share = ws; | ||
991 | - thr->ts.static_trip = 0; | ||
992 | - | ||
993 | - gomp_mutex_lock (&ws->lock); | ||
994 | - gomp_mutex_unlock (&team->work_share_lock); | ||
995 | - | ||
996 | - return false; | ||
997 | + return true; | ||
998 | } | ||
999 | - | ||
1000 | - /* Resize the work shares queue if we've run out of space. */ | ||
1001 | - if (team->num_live_gen++ == team->generation_mask) | ||
1002 | + else | ||
1003 | { | ||
1004 | - team->work_shares = gomp_realloc (team->work_shares, | ||
1005 | - 2 * team->num_live_gen | ||
1006 | - * sizeof (*team->work_shares)); | ||
1007 | - | ||
1008 | - /* Unless oldest_live_gen is zero, the sequence of live elements | ||
1009 | - wraps around the end of the array. If we do nothing, we break | ||
1010 | - lookup of the existing elements. Fix that by unwrapping the | ||
1011 | - data from the front to the end. */ | ||
1012 | - if (team->oldest_live_gen > 0) | ||
1013 | - memcpy (team->work_shares + team->num_live_gen, | ||
1014 | - team->work_shares, | ||
1015 | - (team->oldest_live_gen & team->generation_mask) | ||
1016 | - * sizeof (*team->work_shares)); | ||
1017 | - | ||
1018 | - team->generation_mask = team->generation_mask * 2 + 1; | ||
1019 | - } | ||
1020 | - | ||
1021 | - ws_index = ws_gen & team->generation_mask; | ||
1022 | - ws = gomp_new_work_share (ordered, team->nthreads); | ||
1023 | - thr->ts.work_share = ws; | ||
1024 | - thr->ts.static_trip = 0; | ||
1025 | - team->work_shares[ws_index] = ws; | ||
1026 | - | ||
1027 | - gomp_mutex_lock (&ws->lock); | ||
1028 | - gomp_mutex_unlock (&team->work_share_lock); | ||
1029 | - | ||
1030 | - return true; | ||
1031 | + thr->ts.work_share = ws; | ||
1032 | + return false; | ||
1033 | + } | ||
1034 | } | ||
1035 | |||
1036 | - | ||
1037 | /* The current thread is done with its current work sharing construct. | ||
1038 | This version does imply a barrier at the end of the work-share. */ | ||
1039 | |||
1040 | @@ -147,36 +209,28 @@ gomp_work_share_end (void) | ||
1041 | { | ||
1042 | struct gomp_thread *thr = gomp_thread (); | ||
1043 | struct gomp_team *team = thr->ts.team; | ||
1044 | - struct gomp_work_share *ws = thr->ts.work_share; | ||
1045 | - bool last; | ||
1046 | - | ||
1047 | - thr->ts.work_share = NULL; | ||
1048 | + gomp_barrier_state_t bstate; | ||
1049 | |||
1050 | /* Work sharing constructs can be orphaned. */ | ||
1051 | if (team == NULL) | ||
1052 | { | ||
1053 | - free_work_share (ws); | ||
1054 | + free_work_share (NULL, thr->ts.work_share); | ||
1055 | + thr->ts.work_share = NULL; | ||
1056 | return; | ||
1057 | } | ||
1058 | |||
1059 | - last = gomp_barrier_wait_start (&team->barrier); | ||
1060 | + bstate = gomp_barrier_wait_start (&team->barrier); | ||
1061 | |||
1062 | - if (last) | ||
1063 | + if (gomp_barrier_last_thread (bstate)) | ||
1064 | { | ||
1065 | - unsigned ws_index; | ||
1066 | - | ||
1067 | - ws_index = thr->ts.work_share_generation & team->generation_mask; | ||
1068 | - team->work_shares[ws_index] = NULL; | ||
1069 | - team->oldest_live_gen++; | ||
1070 | - team->num_live_gen = 0; | ||
1071 | - | ||
1072 | - free_work_share (ws); | ||
1073 | + if (__builtin_expect (thr->ts.last_work_share != NULL, 1)) | ||
1074 | + free_work_share (team, thr->ts.last_work_share); | ||
1075 | } | ||
1076 | |||
1077 | - gomp_barrier_wait_end (&team->barrier, last); | ||
1078 | + gomp_barrier_wait_end (&team->barrier, bstate); | ||
1079 | + thr->ts.last_work_share = NULL; | ||
1080 | } | ||
1081 | |||
1082 | - | ||
1083 | /* The current thread is done with its current work sharing construct. | ||
1084 | This version does NOT imply a barrier at the end of the work-share. */ | ||
1085 | |||
1086 | @@ -188,15 +242,17 @@ gomp_work_share_end_nowait (void) | ||
1087 | struct gomp_work_share *ws = thr->ts.work_share; | ||
1088 | unsigned completed; | ||
1089 | |||
1090 | - thr->ts.work_share = NULL; | ||
1091 | - | ||
1092 | /* Work sharing constructs can be orphaned. */ | ||
1093 | if (team == NULL) | ||
1094 | { | ||
1095 | - free_work_share (ws); | ||
1096 | + free_work_share (NULL, ws); | ||
1097 | + thr->ts.work_share = NULL; | ||
1098 | return; | ||
1099 | } | ||
1100 | |||
1101 | + if (__builtin_expect (thr->ts.last_work_share == NULL, 0)) | ||
1102 | + return; | ||
1103 | + | ||
1104 | #ifdef HAVE_SYNC_BUILTINS | ||
1105 | completed = __sync_add_and_fetch (&ws->threads_completed, 1); | ||
1106 | #else | ||
1107 | @@ -206,18 +262,6 @@ gomp_work_share_end_nowait (void) | ||
1108 | #endif | ||
1109 | |||
1110 | if (completed == team->nthreads) | ||
1111 | - { | ||
1112 | - unsigned ws_index; | ||
1113 | - | ||
1114 | - gomp_mutex_lock (&team->work_share_lock); | ||
1115 | - | ||
1116 | - ws_index = thr->ts.work_share_generation & team->generation_mask; | ||
1117 | - team->work_shares[ws_index] = NULL; | ||
1118 | - team->oldest_live_gen++; | ||
1119 | - team->num_live_gen--; | ||
1120 | - | ||
1121 | - gomp_mutex_unlock (&team->work_share_lock); | ||
1122 | - | ||
1123 | - free_work_share (ws); | ||
1124 | - } | ||
1125 | + free_work_share (team, thr->ts.last_work_share); | ||
1126 | + thr->ts.last_work_share = NULL; | ||
1127 | } | ||
1128 | --- libgomp/single.c.jj 2007-12-07 14:41:01.000000000 +0100 | ||
1129 | +++ libgomp/single.c 2008-03-26 15:11:32.000000000 +0100 | ||
1130 | @@ -1,4 +1,4 @@ | ||
1131 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
1132 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
1133 | Contributed by Richard Henderson <rth@redhat.com>. | ||
1134 | |||
1135 | This file is part of the GNU OpenMP Library (libgomp). | ||
1136 | @@ -37,10 +37,24 @@ | ||
1137 | bool | ||
1138 | GOMP_single_start (void) | ||
1139 | { | ||
1140 | +#ifdef HAVE_SYNC_BUILTINS | ||
1141 | + struct gomp_thread *thr = gomp_thread (); | ||
1142 | + struct gomp_team *team = thr->ts.team; | ||
1143 | + unsigned long single_count; | ||
1144 | + | ||
1145 | + if (__builtin_expect (team == NULL, 0)) | ||
1146 | + return true; | ||
1147 | + | ||
1148 | + single_count = thr->ts.single_count++; | ||
1149 | + return __sync_bool_compare_and_swap (&team->single_count, single_count, | ||
1150 | + single_count + 1L); | ||
1151 | +#else | ||
1152 | bool ret = gomp_work_share_start (false); | ||
1153 | - gomp_mutex_unlock (&gomp_thread ()->ts.work_share->lock); | ||
1154 | + if (ret) | ||
1155 | + gomp_work_share_init_done (); | ||
1156 | gomp_work_share_end_nowait (); | ||
1157 | return ret; | ||
1158 | +#endif | ||
1159 | } | ||
1160 | |||
1161 | /* This routine is called when first encountering a SINGLE construct that | ||
1162 | @@ -57,10 +71,12 @@ GOMP_single_copy_start (void) | ||
1163 | void *ret; | ||
1164 | |||
1165 | first = gomp_work_share_start (false); | ||
1166 | - gomp_mutex_unlock (&thr->ts.work_share->lock); | ||
1167 | |||
1168 | if (first) | ||
1169 | - ret = NULL; | ||
1170 | + { | ||
1171 | + gomp_work_share_init_done (); | ||
1172 | + ret = NULL; | ||
1173 | + } | ||
1174 | else | ||
1175 | { | ||
1176 | gomp_barrier_wait (&thr->ts.team->barrier); | ||
1177 | --- libgomp/loop.c.jj 2007-12-07 14:41:01.000000000 +0100 | ||
1178 | +++ libgomp/loop.c 2008-03-26 18:47:04.000000000 +0100 | ||
1179 | @@ -27,8 +27,9 @@ | ||
1180 | |||
1181 | /* This file handles the LOOP (FOR/DO) construct. */ | ||
1182 | |||
1183 | -#include "libgomp.h" | ||
1184 | +#include <limits.h> | ||
1185 | #include <stdlib.h> | ||
1186 | +#include "libgomp.h" | ||
1187 | |||
1188 | |||
1189 | /* Initialize the given work share construct from the given arguments. */ | ||
1190 | @@ -44,6 +45,39 @@ gomp_loop_init (struct gomp_work_share * | ||
1191 | ? start : end; | ||
1192 | ws->incr = incr; | ||
1193 | ws->next = start; | ||
1194 | + if (sched == GFS_DYNAMIC) | ||
1195 | + { | ||
1196 | + ws->chunk_size *= incr; | ||
1197 | + | ||
1198 | +#ifdef HAVE_SYNC_BUILTINS | ||
1199 | + { | ||
1200 | + /* For dynamic scheduling prepare things to make each iteration | ||
1201 | + faster. */ | ||
1202 | + struct gomp_thread *thr = gomp_thread (); | ||
1203 | + struct gomp_team *team = thr->ts.team; | ||
1204 | + long nthreads = team ? team->nthreads : 1; | ||
1205 | + | ||
1206 | + if (__builtin_expect (incr > 0, 1)) | ||
1207 | + { | ||
1208 | + /* Cheap overflow protection. */ | ||
1209 | + if (__builtin_expect ((nthreads | ws->chunk_size) | ||
1210 | + >= 1UL << (sizeof (long) | ||
1211 | + * __CHAR_BIT__ / 2 - 1), 0)) | ||
1212 | + ws->mode = 0; | ||
1213 | + else | ||
1214 | + ws->mode = ws->end < (LONG_MAX | ||
1215 | + - (nthreads + 1) * ws->chunk_size); | ||
1216 | + } | ||
1217 | + /* Cheap overflow protection. */ | ||
1218 | + else if (__builtin_expect ((nthreads | -ws->chunk_size) | ||
1219 | + >= 1UL << (sizeof (long) | ||
1220 | + * __CHAR_BIT__ / 2 - 1), 0)) | ||
1221 | + ws->mode = 0; | ||
1222 | + else | ||
1223 | + ws->mode = ws->end > (nthreads + 1) * -ws->chunk_size - LONG_MAX; | ||
1224 | + } | ||
1225 | +#endif | ||
1226 | + } | ||
1227 | } | ||
1228 | |||
1229 | /* The *_start routines are called when first encountering a loop construct | ||
1230 | @@ -68,10 +102,13 @@ gomp_loop_static_start (long start, long | ||
1231 | { | ||
1232 | struct gomp_thread *thr = gomp_thread (); | ||
1233 | |||
1234 | + thr->ts.static_trip = 0; | ||
1235 | if (gomp_work_share_start (false)) | ||
1236 | - gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1237 | - GFS_STATIC, chunk_size); | ||
1238 | - gomp_mutex_unlock (&thr->ts.work_share->lock); | ||
1239 | + { | ||
1240 | + gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1241 | + GFS_STATIC, chunk_size); | ||
1242 | + gomp_work_share_init_done (); | ||
1243 | + } | ||
1244 | |||
1245 | return !gomp_iter_static_next (istart, iend); | ||
1246 | } | ||
1247 | @@ -84,13 +121,16 @@ gomp_loop_dynamic_start (long start, lon | ||
1248 | bool ret; | ||
1249 | |||
1250 | if (gomp_work_share_start (false)) | ||
1251 | - gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1252 | - GFS_DYNAMIC, chunk_size); | ||
1253 | + { | ||
1254 | + gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1255 | + GFS_DYNAMIC, chunk_size); | ||
1256 | + gomp_work_share_init_done (); | ||
1257 | + } | ||
1258 | |||
1259 | #ifdef HAVE_SYNC_BUILTINS | ||
1260 | - gomp_mutex_unlock (&thr->ts.work_share->lock); | ||
1261 | ret = gomp_iter_dynamic_next (istart, iend); | ||
1262 | #else | ||
1263 | + gomp_mutex_lock (&thr->ts.work_share->lock); | ||
1264 | ret = gomp_iter_dynamic_next_locked (istart, iend); | ||
1265 | gomp_mutex_unlock (&thr->ts.work_share->lock); | ||
1266 | #endif | ||
1267 | @@ -106,13 +146,16 @@ gomp_loop_guided_start (long start, long | ||
1268 | bool ret; | ||
1269 | |||
1270 | if (gomp_work_share_start (false)) | ||
1271 | - gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1272 | - GFS_GUIDED, chunk_size); | ||
1273 | + { | ||
1274 | + gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1275 | + GFS_GUIDED, chunk_size); | ||
1276 | + gomp_work_share_init_done (); | ||
1277 | + } | ||
1278 | |||
1279 | #ifdef HAVE_SYNC_BUILTINS | ||
1280 | - gomp_mutex_unlock (&thr->ts.work_share->lock); | ||
1281 | ret = gomp_iter_guided_next (istart, iend); | ||
1282 | #else | ||
1283 | + gomp_mutex_lock (&thr->ts.work_share->lock); | ||
1284 | ret = gomp_iter_guided_next_locked (istart, iend); | ||
1285 | gomp_mutex_unlock (&thr->ts.work_share->lock); | ||
1286 | #endif | ||
1287 | @@ -149,13 +192,14 @@ gomp_loop_ordered_static_start (long sta | ||
1288 | { | ||
1289 | struct gomp_thread *thr = gomp_thread (); | ||
1290 | |||
1291 | + thr->ts.static_trip = 0; | ||
1292 | if (gomp_work_share_start (true)) | ||
1293 | { | ||
1294 | gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1295 | GFS_STATIC, chunk_size); | ||
1296 | gomp_ordered_static_init (); | ||
1297 | + gomp_work_share_init_done (); | ||
1298 | } | ||
1299 | - gomp_mutex_unlock (&thr->ts.work_share->lock); | ||
1300 | |||
1301 | return !gomp_iter_static_next (istart, iend); | ||
1302 | } | ||
1303 | @@ -168,8 +212,14 @@ gomp_loop_ordered_dynamic_start (long st | ||
1304 | bool ret; | ||
1305 | |||
1306 | if (gomp_work_share_start (true)) | ||
1307 | - gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1308 | - GFS_DYNAMIC, chunk_size); | ||
1309 | + { | ||
1310 | + gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1311 | + GFS_DYNAMIC, chunk_size); | ||
1312 | + gomp_mutex_lock (&thr->ts.work_share->lock); | ||
1313 | + gomp_work_share_init_done (); | ||
1314 | + } | ||
1315 | + else | ||
1316 | + gomp_mutex_lock (&thr->ts.work_share->lock); | ||
1317 | |||
1318 | ret = gomp_iter_dynamic_next_locked (istart, iend); | ||
1319 | if (ret) | ||
1320 | @@ -187,8 +237,14 @@ gomp_loop_ordered_guided_start (long sta | ||
1321 | bool ret; | ||
1322 | |||
1323 | if (gomp_work_share_start (true)) | ||
1324 | - gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1325 | - GFS_GUIDED, chunk_size); | ||
1326 | + { | ||
1327 | + gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1328 | + GFS_GUIDED, chunk_size); | ||
1329 | + gomp_mutex_lock (&thr->ts.work_share->lock); | ||
1330 | + gomp_work_share_init_done (); | ||
1331 | + } | ||
1332 | + else | ||
1333 | + gomp_mutex_lock (&thr->ts.work_share->lock); | ||
1334 | |||
1335 | ret = gomp_iter_guided_next_locked (istart, iend); | ||
1336 | if (ret) | ||
1337 | @@ -375,12 +431,12 @@ gomp_parallel_loop_start (void (*fn) (vo | ||
1338 | long incr, enum gomp_schedule_type sched, | ||
1339 | long chunk_size) | ||
1340 | { | ||
1341 | - struct gomp_work_share *ws; | ||
1342 | + struct gomp_team *team; | ||
1343 | |||
1344 | num_threads = gomp_resolve_num_threads (num_threads); | ||
1345 | - ws = gomp_new_work_share (false, num_threads); | ||
1346 | - gomp_loop_init (ws, start, end, incr, sched, chunk_size); | ||
1347 | - gomp_team_start (fn, data, num_threads, ws); | ||
1348 | + team = gomp_new_team (num_threads); | ||
1349 | + gomp_loop_init (&team->work_shares[0], start, end, incr, sched, chunk_size); | ||
1350 | + gomp_team_start (fn, data, num_threads, team); | ||
1351 | } | ||
1352 | |||
1353 | void | ||
1354 | --- libgomp/Makefile.in.jj 2008-01-10 20:53:47.000000000 +0100 | ||
1355 | +++ libgomp/Makefile.in 2008-03-26 18:51:01.000000000 +0100 | ||
1356 | @@ -83,7 +83,7 @@ libgomp_la_LIBADD = | ||
1357 | am_libgomp_la_OBJECTS = alloc.lo barrier.lo critical.lo env.lo \ | ||
1358 | error.lo iter.lo loop.lo ordered.lo parallel.lo sections.lo \ | ||
1359 | single.lo team.lo work.lo lock.lo mutex.lo proc.lo sem.lo \ | ||
1360 | - bar.lo time.lo fortran.lo affinity.lo | ||
1361 | + bar.lo ptrlock.lo time.lo fortran.lo affinity.lo | ||
1362 | libgomp_la_OBJECTS = $(am_libgomp_la_OBJECTS) | ||
1363 | DEFAULT_INCLUDES = -I. -I$(srcdir) -I. | ||
1364 | depcomp = $(SHELL) $(top_srcdir)/../depcomp | ||
1365 | @@ -292,7 +292,7 @@ libgomp_version_info = -version-info $(l | ||
1366 | libgomp_la_LDFLAGS = $(libgomp_version_info) $(libgomp_version_script) | ||
1367 | libgomp_la_SOURCES = alloc.c barrier.c critical.c env.c error.c iter.c \ | ||
1368 | loop.c ordered.c parallel.c sections.c single.c team.c work.c \ | ||
1369 | - lock.c mutex.c proc.c sem.c bar.c time.c fortran.c affinity.c | ||
1370 | + lock.c mutex.c proc.c sem.c bar.c ptrlock.c time.c fortran.c affinity.c | ||
1371 | |||
1372 | nodist_noinst_HEADERS = libgomp_f.h | ||
1373 | nodist_libsubinclude_HEADERS = omp.h | ||
1374 | @@ -434,6 +434,7 @@ distclean-compile: | ||
1375 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ordered.Plo@am__quote@ | ||
1376 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parallel.Plo@am__quote@ | ||
1377 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proc.Plo@am__quote@ | ||
1378 | +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptrlock.Plo@am__quote@ | ||
1379 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sections.Plo@am__quote@ | ||
1380 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sem.Plo@am__quote@ | ||
1381 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/single.Plo@am__quote@ | ||
1382 | --- libgomp/testsuite/libgomp.c/loop-4.c.jj 2008-03-26 18:47:04.000000000 +0100 | ||
1383 | +++ libgomp/testsuite/libgomp.c/loop-4.c 2008-03-26 18:47:04.000000000 +0100 | ||
1384 | @@ -0,0 +1,28 @@ | ||
1385 | +/* { dg-do run } */ | ||
1386 | + | ||
1387 | +extern void abort (void); | ||
1388 | + | ||
1389 | +int | ||
1390 | +main (void) | ||
1391 | +{ | ||
1392 | + int e = 0; | ||
1393 | +#pragma omp parallel num_threads (4) reduction(+:e) | ||
1394 | + { | ||
1395 | + long i; | ||
1396 | + #pragma omp for schedule(dynamic,1) | ||
1397 | + for (i = __LONG_MAX__ - 30001; i <= __LONG_MAX__ - 10001; i += 10000) | ||
1398 | + if (i != __LONG_MAX__ - 30001 | ||
1399 | + && i != __LONG_MAX__ - 20001 | ||
1400 | + && i != __LONG_MAX__ - 10001) | ||
1401 | + e = 1; | ||
1402 | + #pragma omp for schedule(dynamic,1) | ||
1403 | + for (i = -__LONG_MAX__ + 30000; i >= -__LONG_MAX__ + 10000; i -= 10000) | ||
1404 | + if (i != -__LONG_MAX__ + 30000 | ||
1405 | + && i != -__LONG_MAX__ + 20000 | ||
1406 | + && i != -__LONG_MAX__ + 10000) | ||
1407 | + e = 1; | ||
1408 | + } | ||
1409 | + if (e) | ||
1410 | + abort (); | ||
1411 | + return 0; | ||
1412 | +} | ||
1413 | --- libgomp/Makefile.am.jj 2007-12-07 14:41:01.000000000 +0100 | ||
1414 | +++ libgomp/Makefile.am 2008-03-26 15:15:19.000000000 +0100 | ||
1415 | @@ -31,7 +31,7 @@ libgomp_la_LDFLAGS = $(libgomp_version_i | ||
1416 | |||
1417 | libgomp_la_SOURCES = alloc.c barrier.c critical.c env.c error.c iter.c \ | ||
1418 | loop.c ordered.c parallel.c sections.c single.c team.c work.c \ | ||
1419 | - lock.c mutex.c proc.c sem.c bar.c time.c fortran.c affinity.c | ||
1420 | + lock.c mutex.c proc.c sem.c bar.c ptrlock.c time.c fortran.c affinity.c | ||
1421 | |||
1422 | nodist_noinst_HEADERS = libgomp_f.h | ||
1423 | nodist_libsubinclude_HEADERS = omp.h | ||
1424 | --- libgomp/team.c.jj 2007-12-07 14:41:01.000000000 +0100 | ||
1425 | +++ libgomp/team.c 2008-03-27 12:22:26.000000000 +0100 | ||
1426 | @@ -94,7 +94,7 @@ gomp_thread_start (void *xdata) | ||
1427 | { | ||
1428 | gomp_barrier_wait (&thr->ts.team->barrier); | ||
1429 | local_fn (local_data); | ||
1430 | - gomp_barrier_wait (&thr->ts.team->barrier); | ||
1431 | + gomp_barrier_wait_last (&thr->ts.team->barrier); | ||
1432 | } | ||
1433 | else | ||
1434 | { | ||
1435 | @@ -114,11 +114,10 @@ gomp_thread_start (void *xdata) | ||
1436 | thr->data = NULL; | ||
1437 | thr->ts.team = NULL; | ||
1438 | thr->ts.work_share = NULL; | ||
1439 | + thr->ts.last_work_share = NULL; | ||
1440 | thr->ts.team_id = 0; | ||
1441 | - thr->ts.work_share_generation = 0; | ||
1442 | - thr->ts.static_trip = 0; | ||
1443 | |||
1444 | - gomp_barrier_wait (&team->barrier); | ||
1445 | + gomp_barrier_wait_last (&team->barrier); | ||
1446 | gomp_barrier_wait (&gomp_threads_dock); | ||
1447 | |||
1448 | local_fn = thr->fn; | ||
1449 | @@ -133,21 +132,29 @@ gomp_thread_start (void *xdata) | ||
1450 | |||
1451 | /* Create a new team data structure. */ | ||
1452 | |||
1453 | -static struct gomp_team * | ||
1454 | -new_team (unsigned nthreads, struct gomp_work_share *work_share) | ||
1455 | +struct gomp_team * | ||
1456 | +gomp_new_team (unsigned nthreads) | ||
1457 | { | ||
1458 | struct gomp_team *team; | ||
1459 | size_t size; | ||
1460 | + int i; | ||
1461 | |||
1462 | size = sizeof (*team) + nthreads * sizeof (team->ordered_release[0]); | ||
1463 | team = gomp_malloc (size); | ||
1464 | - gomp_mutex_init (&team->work_share_lock); | ||
1465 | |||
1466 | - team->work_shares = gomp_malloc (4 * sizeof (struct gomp_work_share *)); | ||
1467 | - team->generation_mask = 3; | ||
1468 | - team->oldest_live_gen = work_share == NULL; | ||
1469 | - team->num_live_gen = work_share != NULL; | ||
1470 | - team->work_shares[0] = work_share; | ||
1471 | + team->work_share_chunk = 8; | ||
1472 | +#ifdef HAVE_SYNC_BUILTINS | ||
1473 | + team->single_count = 0; | ||
1474 | +#else | ||
1475 | + gomp_mutex_init (&team->work_share_list_free_lock); | ||
1476 | +#endif | ||
1477 | + gomp_init_work_share (&team->work_shares[0], false, nthreads); | ||
1478 | + team->work_shares[0].next_alloc = NULL; | ||
1479 | + team->work_share_list_free = NULL; | ||
1480 | + team->work_share_list_alloc = &team->work_shares[1]; | ||
1481 | + for (i = 1; i < 7; i++) | ||
1482 | + team->work_shares[i].next_free = &team->work_shares[i + 1]; | ||
1483 | + team->work_shares[i].next_free = NULL; | ||
1484 | |||
1485 | team->nthreads = nthreads; | ||
1486 | gomp_barrier_init (&team->barrier, nthreads); | ||
1487 | @@ -164,10 +171,22 @@ new_team (unsigned nthreads, struct gomp | ||
1488 | static void | ||
1489 | free_team (struct gomp_team *team) | ||
1490 | { | ||
1491 | - free (team->work_shares); | ||
1492 | - gomp_mutex_destroy (&team->work_share_lock); | ||
1493 | + if (__builtin_expect (team->work_shares[0].next_alloc != NULL, 0)) | ||
1494 | + { | ||
1495 | + struct gomp_work_share *ws = team->work_shares[0].next_alloc; | ||
1496 | + do | ||
1497 | + { | ||
1498 | + struct gomp_work_share *next_ws = ws->next_alloc; | ||
1499 | + free (ws); | ||
1500 | + ws = next_ws; | ||
1501 | + } | ||
1502 | + while (ws != NULL); | ||
1503 | + } | ||
1504 | gomp_barrier_destroy (&team->barrier); | ||
1505 | gomp_sem_destroy (&team->master_release); | ||
1506 | +#ifndef HAVE_SYNC_BUILTINS | ||
1507 | + gomp_mutex_destroy (&team->work_share_list_free_lock); | ||
1508 | +#endif | ||
1509 | free (team); | ||
1510 | } | ||
1511 | |||
1512 | @@ -176,11 +195,10 @@ free_team (struct gomp_team *team) | ||
1513 | |||
1514 | void | ||
1515 | gomp_team_start (void (*fn) (void *), void *data, unsigned nthreads, | ||
1516 | - struct gomp_work_share *work_share) | ||
1517 | + struct gomp_team *team) | ||
1518 | { | ||
1519 | struct gomp_thread_start_data *start_data; | ||
1520 | struct gomp_thread *thr, *nthr; | ||
1521 | - struct gomp_team *team; | ||
1522 | bool nested; | ||
1523 | unsigned i, n, old_threads_used = 0; | ||
1524 | pthread_attr_t thread_attr, *attr; | ||
1525 | @@ -188,17 +206,18 @@ gomp_team_start (void (*fn) (void *), vo | ||
1526 | thr = gomp_thread (); | ||
1527 | nested = thr->ts.team != NULL; | ||
1528 | |||
1529 | - team = new_team (nthreads, work_share); | ||
1530 | - | ||
1531 | /* Always save the previous state, even if this isn't a nested team. | ||
1532 | In particular, we should save any work share state from an outer | ||
1533 | orphaned work share construct. */ | ||
1534 | team->prev_ts = thr->ts; | ||
1535 | |||
1536 | thr->ts.team = team; | ||
1537 | - thr->ts.work_share = work_share; | ||
1538 | thr->ts.team_id = 0; | ||
1539 | - thr->ts.work_share_generation = 0; | ||
1540 | + thr->ts.work_share = &team->work_shares[0]; | ||
1541 | + thr->ts.last_work_share = NULL; | ||
1542 | +#ifdef HAVE_SYNC_BUILTINS | ||
1543 | + thr->ts.single_count = 0; | ||
1544 | +#endif | ||
1545 | thr->ts.static_trip = 0; | ||
1546 | |||
1547 | if (nthreads == 1) | ||
1548 | @@ -241,9 +260,12 @@ gomp_team_start (void (*fn) (void *), vo | ||
1549 | { | ||
1550 | nthr = gomp_threads[i]; | ||
1551 | nthr->ts.team = team; | ||
1552 | - nthr->ts.work_share = work_share; | ||
1553 | + nthr->ts.work_share = &team->work_shares[0]; | ||
1554 | + nthr->ts.last_work_share = NULL; | ||
1555 | nthr->ts.team_id = i; | ||
1556 | - nthr->ts.work_share_generation = 0; | ||
1557 | +#ifdef HAVE_SYNC_BUILTINS | ||
1558 | + nthr->ts.single_count = 0; | ||
1559 | +#endif | ||
1560 | nthr->ts.static_trip = 0; | ||
1561 | nthr->fn = fn; | ||
1562 | nthr->data = data; | ||
1563 | @@ -266,8 +288,24 @@ gomp_team_start (void (*fn) (void *), vo | ||
1564 | } | ||
1565 | } | ||
1566 | |||
1567 | + if (__builtin_expect (nthreads > old_threads_used, 0)) | ||
1568 | + { | ||
1569 | + long diff = (long) nthreads - (long) old_threads_used; | ||
1570 | + | ||
1571 | + if (old_threads_used == 0) | ||
1572 | + --diff; | ||
1573 | + | ||
1574 | +#ifdef HAVE_SYNC_BUILTINS | ||
1575 | + __sync_fetch_and_add (&gomp_managed_threads, diff); | ||
1576 | +#else | ||
1577 | + gomp_mutex_lock (&gomp_remaining_threads_lock); | ||
1578 | + gomp_managed_threads += diff; | ||
1579 | + gomp_mutex_unlock (&gomp_remaining_threads_lock); | ||
1580 | +#endif | ||
1581 | + } | ||
1582 | + | ||
1583 | attr = &gomp_thread_attr; | ||
1584 | - if (gomp_cpu_affinity != NULL) | ||
1585 | + if (__builtin_expect (gomp_cpu_affinity != NULL, 0)) | ||
1586 | { | ||
1587 | size_t stacksize; | ||
1588 | pthread_attr_init (&thread_attr); | ||
1589 | @@ -287,9 +325,12 @@ gomp_team_start (void (*fn) (void *), vo | ||
1590 | int err; | ||
1591 | |||
1592 | start_data->ts.team = team; | ||
1593 | - start_data->ts.work_share = work_share; | ||
1594 | + start_data->ts.work_share = &team->work_shares[0]; | ||
1595 | + start_data->ts.last_work_share = NULL; | ||
1596 | start_data->ts.team_id = i; | ||
1597 | - start_data->ts.work_share_generation = 0; | ||
1598 | +#ifdef HAVE_SYNC_BUILTINS | ||
1599 | + start_data->ts.single_count = 0; | ||
1600 | +#endif | ||
1601 | start_data->ts.static_trip = 0; | ||
1602 | start_data->fn = fn; | ||
1603 | start_data->fn_data = data; | ||
1604 | @@ -303,7 +344,7 @@ gomp_team_start (void (*fn) (void *), vo | ||
1605 | gomp_fatal ("Thread creation failed: %s", strerror (err)); | ||
1606 | } | ||
1607 | |||
1608 | - if (gomp_cpu_affinity != NULL) | ||
1609 | + if (__builtin_expect (gomp_cpu_affinity != NULL, 0)) | ||
1610 | pthread_attr_destroy (&thread_attr); | ||
1611 | |||
1612 | do_release: | ||
1613 | @@ -313,8 +354,20 @@ gomp_team_start (void (*fn) (void *), vo | ||
1614 | that should arrive back at the end of this team. The extra | ||
1615 | threads should be exiting. Note that we arrange for this test | ||
1616 | to never be true for nested teams. */ | ||
1617 | - if (nthreads < old_threads_used) | ||
1618 | - gomp_barrier_reinit (&gomp_threads_dock, nthreads); | ||
1619 | + if (__builtin_expect (nthreads < old_threads_used, 0)) | ||
1620 | + { | ||
1621 | + long diff = (long) nthreads - (long) old_threads_used; | ||
1622 | + | ||
1623 | + gomp_barrier_reinit (&gomp_threads_dock, nthreads); | ||
1624 | + | ||
1625 | +#ifdef HAVE_SYNC_BUILTINS | ||
1626 | + __sync_fetch_and_add (&gomp_managed_threads, diff); | ||
1627 | +#else | ||
1628 | + gomp_mutex_lock (&gomp_remaining_threads_lock); | ||
1629 | + gomp_managed_threads += diff; | ||
1630 | + gomp_mutex_unlock (&gomp_remaining_threads_lock); | ||
1631 | +#endif | ||
1632 | + } | ||
1633 | } | ||
1634 | |||
1635 | |||
1636 | @@ -329,8 +382,21 @@ gomp_team_end (void) | ||
1637 | |||
1638 | gomp_barrier_wait (&team->barrier); | ||
1639 | |||
1640 | + gomp_fini_work_share (thr->ts.work_share); | ||
1641 | + | ||
1642 | thr->ts = team->prev_ts; | ||
1643 | |||
1644 | + if (__builtin_expect (thr->ts.team != NULL, 0)) | ||
1645 | + { | ||
1646 | +#ifdef HAVE_SYNC_BUILTINS | ||
1647 | + __sync_fetch_and_add (&gomp_managed_threads, 1L - team->nthreads); | ||
1648 | +#else | ||
1649 | + gomp_mutex_lock (&gomp_remaining_threads_lock); | ||
1650 | + gomp_managed_threads -= team->nthreads - 1L; | ||
1651 | + gomp_mutex_unlock (&gomp_remaining_threads_lock); | ||
1652 | +#endif | ||
1653 | + } | ||
1654 | + | ||
1655 | free_team (team); | ||
1656 | } | ||
1657 | |||
1658 | --- libgomp/config/posix/bar.h.jj 2007-12-07 14:41:01.000000000 +0100 | ||
1659 | +++ libgomp/config/posix/bar.h 2008-03-26 15:11:32.000000000 +0100 | ||
1660 | @@ -1,4 +1,4 @@ | ||
1661 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
1662 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
1663 | Contributed by Richard Henderson <rth@redhat.com>. | ||
1664 | |||
1665 | This file is part of the GNU OpenMP Library (libgomp). | ||
1666 | @@ -46,18 +46,32 @@ typedef struct | ||
1667 | unsigned total; | ||
1668 | unsigned arrived; | ||
1669 | } gomp_barrier_t; | ||
1670 | +typedef bool gomp_barrier_state_t; | ||
1671 | |||
1672 | extern void gomp_barrier_init (gomp_barrier_t *, unsigned); | ||
1673 | extern void gomp_barrier_reinit (gomp_barrier_t *, unsigned); | ||
1674 | extern void gomp_barrier_destroy (gomp_barrier_t *); | ||
1675 | |||
1676 | extern void gomp_barrier_wait (gomp_barrier_t *); | ||
1677 | -extern void gomp_barrier_wait_end (gomp_barrier_t *, bool); | ||
1678 | +extern void gomp_barrier_wait_end (gomp_barrier_t *, gomp_barrier_state_t); | ||
1679 | |||
1680 | -static inline bool gomp_barrier_wait_start (gomp_barrier_t *bar) | ||
1681 | +static inline gomp_barrier_state_t | ||
1682 | +gomp_barrier_wait_start (gomp_barrier_t *bar) | ||
1683 | { | ||
1684 | gomp_mutex_lock (&bar->mutex1); | ||
1685 | return ++bar->arrived == bar->total; | ||
1686 | } | ||
1687 | |||
1688 | +static inline bool | ||
1689 | +gomp_barrier_last_thread (gomp_barrier_state_t state) | ||
1690 | +{ | ||
1691 | + return state; | ||
1692 | +} | ||
1693 | + | ||
1694 | +static inline void | ||
1695 | +gomp_barrier_wait_last (gomp_barrier_t *bar) | ||
1696 | +{ | ||
1697 | + gomp_barrier_wait (bar); | ||
1698 | +} | ||
1699 | + | ||
1700 | #endif /* GOMP_BARRIER_H */ | ||
1701 | --- libgomp/config/posix/ptrlock.h.jj 2008-03-26 15:11:32.000000000 +0100 | ||
1702 | +++ libgomp/config/posix/ptrlock.h 2008-03-26 15:11:32.000000000 +0100 | ||
1703 | @@ -0,0 +1,69 @@ | ||
1704 | +/* Copyright (C) 2008 Free Software Foundation, Inc. | ||
1705 | + Contributed by Jakub Jelinek <jakub@redhat.com>. | ||
1706 | + | ||
1707 | + This file is part of the GNU OpenMP Library (libgomp). | ||
1708 | + | ||
1709 | + Libgomp is free software; you can redistribute it and/or modify it | ||
1710 | + under the terms of the GNU Lesser General Public License as published by | ||
1711 | + the Free Software Foundation; either version 2.1 of the License, or | ||
1712 | + (at your option) any later version. | ||
1713 | + | ||
1714 | + Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY | ||
1715 | + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
1716 | + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for | ||
1717 | + more details. | ||
1718 | + | ||
1719 | + You should have received a copy of the GNU Lesser General Public License | ||
1720 | + along with libgomp; see the file COPYING.LIB. If not, write to the | ||
1721 | + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
1722 | + MA 02110-1301, USA. */ | ||
1723 | + | ||
1724 | +/* As a special exception, if you link this library with other files, some | ||
1725 | + of which are compiled with GCC, to produce an executable, this library | ||
1726 | + does not by itself cause the resulting executable to be covered by the | ||
1727 | + GNU General Public License. This exception does not however invalidate | ||
1728 | + any other reasons why the executable file might be covered by the GNU | ||
1729 | + General Public License. */ | ||
1730 | + | ||
1731 | +/* This is a Linux specific implementation of a mutex synchronization | ||
1732 | + mechanism for libgomp. This type is private to the library. This | ||
1733 | + implementation uses atomic instructions and the futex syscall. */ | ||
1734 | + | ||
1735 | +#ifndef GOMP_PTRLOCK_H | ||
1736 | +#define GOMP_PTRLOCK_H 1 | ||
1737 | + | ||
1738 | +typedef struct { void *ptr; gomp_mutex_t lock; } gomp_ptrlock_t; | ||
1739 | + | ||
1740 | +static inline void gomp_ptrlock_init (gomp_ptrlock_t *ptrlock, void *ptr) | ||
1741 | +{ | ||
1742 | + ptrlock->ptr = ptr; | ||
1743 | + gomp_mutex_init (&ptrlock->lock); | ||
1744 | +} | ||
1745 | + | ||
1746 | +static inline void *gomp_ptrlock_get (gomp_ptrlock_t *ptrlock) | ||
1747 | +{ | ||
1748 | + if (ptrlock->ptr != NULL) | ||
1749 | + return ptrlock->ptr; | ||
1750 | + | ||
1751 | + gomp_mutex_lock (&ptrlock->lock); | ||
1752 | + if (ptrlock->ptr != NULL) | ||
1753 | + { | ||
1754 | + gomp_mutex_unlock (&ptrlock->lock); | ||
1755 | + return ptrlock->ptr; | ||
1756 | + } | ||
1757 | + | ||
1758 | + return NULL; | ||
1759 | +} | ||
1760 | + | ||
1761 | +static inline void gomp_ptrlock_set (gomp_ptrlock_t *ptrlock, void *ptr) | ||
1762 | +{ | ||
1763 | + ptrlock->ptr = ptr; | ||
1764 | + gomp_mutex_unlock (&ptrlock->lock); | ||
1765 | +} | ||
1766 | + | ||
1767 | +static inline void gomp_ptrlock_destroy (gomp_ptrlock_t *ptrlock) | ||
1768 | +{ | ||
1769 | + gomp_mutex_destroy (&ptrlock->lock); | ||
1770 | +} | ||
1771 | + | ||
1772 | +#endif /* GOMP_PTRLOCK_H */ | ||
1773 | --- libgomp/config/posix/ptrlock.c.jj 2008-03-26 15:11:32.000000000 +0100 | ||
1774 | +++ libgomp/config/posix/ptrlock.c 2008-03-26 15:11:32.000000000 +0100 | ||
1775 | @@ -0,0 +1 @@ | ||
1776 | +/* Everything is in the header. */ | ||
1777 | --- libgomp/config/posix/bar.c.jj 2007-12-07 14:41:01.000000000 +0100 | ||
1778 | +++ libgomp/config/posix/bar.c 2008-03-26 15:11:32.000000000 +0100 | ||
1779 | @@ -1,4 +1,4 @@ | ||
1780 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
1781 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
1782 | Contributed by Richard Henderson <rth@redhat.com>. | ||
1783 | |||
1784 | This file is part of the GNU OpenMP Library (libgomp). | ||
1785 | @@ -70,7 +70,7 @@ gomp_barrier_reinit (gomp_barrier_t *bar | ||
1786 | } | ||
1787 | |||
1788 | void | ||
1789 | -gomp_barrier_wait_end (gomp_barrier_t *bar, bool last) | ||
1790 | +gomp_barrier_wait_end (gomp_barrier_t *bar, gomp_barrier_state_t last) | ||
1791 | { | ||
1792 | unsigned int n; | ||
1793 | |||
1794 | --- libgomp/config/linux/alpha/futex.h.jj 2007-12-07 14:41:00.000000000 +0100 | ||
1795 | +++ libgomp/config/linux/alpha/futex.h 2008-03-26 15:11:32.000000000 +0100 | ||
1796 | @@ -1,4 +1,4 @@ | ||
1797 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
1798 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
1799 | Contributed by Richard Henderson <rth@redhat.com>. | ||
1800 | |||
1801 | This file is part of the GNU OpenMP Library (libgomp). | ||
1802 | @@ -30,8 +30,6 @@ | ||
1803 | #ifndef SYS_futex | ||
1804 | #define SYS_futex 394 | ||
1805 | #endif | ||
1806 | -#define FUTEX_WAIT 0 | ||
1807 | -#define FUTEX_WAKE 1 | ||
1808 | |||
1809 | |||
1810 | static inline void | ||
1811 | @@ -45,7 +43,7 @@ futex_wait (int *addr, int val) | ||
1812 | |||
1813 | sc_0 = SYS_futex; | ||
1814 | sc_16 = (long) addr; | ||
1815 | - sc_17 = FUTEX_WAIT; | ||
1816 | + sc_17 = gomp_futex_wait; | ||
1817 | sc_18 = val; | ||
1818 | sc_19 = 0; | ||
1819 | __asm volatile ("callsys" | ||
1820 | @@ -53,6 +51,20 @@ futex_wait (int *addr, int val) | ||
1821 | : "0"(sc_0), "r" (sc_16), "r"(sc_17), "r"(sc_18), "1"(sc_19) | ||
1822 | : "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", | ||
1823 | "$22", "$23", "$24", "$25", "$27", "$28", "memory"); | ||
1824 | + if (__builtin_expect (sc_19, 0) && sc_0 == ENOSYS) | ||
1825 | + { | ||
1826 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
1827 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
1828 | + sc_0 = SYS_futex; | ||
1829 | + sc_17 &= ~FUTEX_PRIVATE_FLAG; | ||
1830 | + sc_19 = 0; | ||
1831 | + __asm volatile ("callsys" | ||
1832 | + : "=r" (sc_0), "=r"(sc_19) | ||
1833 | + : "0"(sc_0), "r" (sc_16), "r"(sc_17), "r"(sc_18), | ||
1834 | + "1"(sc_19) | ||
1835 | + : "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", | ||
1836 | + "$22", "$23", "$24", "$25", "$27", "$28", "memory"); | ||
1837 | + } | ||
1838 | } | ||
1839 | |||
1840 | static inline void | ||
1841 | @@ -66,11 +78,35 @@ futex_wake (int *addr, int count) | ||
1842 | |||
1843 | sc_0 = SYS_futex; | ||
1844 | sc_16 = (long) addr; | ||
1845 | - sc_17 = FUTEX_WAKE; | ||
1846 | + sc_17 = gomp_futex_wake; | ||
1847 | sc_18 = count; | ||
1848 | __asm volatile ("callsys" | ||
1849 | : "=r" (sc_0), "=r"(sc_19) | ||
1850 | : "0"(sc_0), "r" (sc_16), "r"(sc_17), "r"(sc_18) | ||
1851 | : "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", | ||
1852 | "$22", "$23", "$24", "$25", "$27", "$28", "memory"); | ||
1853 | + if (__builtin_expect (sc_19, 0) && sc_0 == ENOSYS) | ||
1854 | + { | ||
1855 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
1856 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
1857 | + sc_0 = SYS_futex; | ||
1858 | + sc_17 &= ~FUTEX_PRIVATE_FLAG; | ||
1859 | + __asm volatile ("callsys" | ||
1860 | + : "=r" (sc_0), "=r"(sc_19) | ||
1861 | + : "0"(sc_0), "r" (sc_16), "r"(sc_17), "r"(sc_18) | ||
1862 | + : "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", | ||
1863 | + "$22", "$23", "$24", "$25", "$27", "$28", "memory"); | ||
1864 | + } | ||
1865 | +} | ||
1866 | + | ||
1867 | +static inline void | ||
1868 | +cpu_relax (void) | ||
1869 | +{ | ||
1870 | + __asm volatile ("" : : : "memory"); | ||
1871 | +} | ||
1872 | + | ||
1873 | +static inline void | ||
1874 | +atomic_write_barrier (void) | ||
1875 | +{ | ||
1876 | + __asm volatile ("wmb" : : : "memory"); | ||
1877 | } | ||
1878 | --- libgomp/config/linux/affinity.c.jj 2007-12-07 14:41:00.000000000 +0100 | ||
1879 | +++ libgomp/config/linux/affinity.c 2008-03-26 15:11:32.000000000 +0100 | ||
1880 | @@ -1,4 +1,4 @@ | ||
1881 | -/* Copyright (C) 2006, 2007 Free Software Foundation, Inc. | ||
1882 | +/* Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. | ||
1883 | Contributed by Jakub Jelinek <jakub@redhat.com>. | ||
1884 | |||
1885 | This file is part of the GNU OpenMP Library (libgomp). | ||
1886 | @@ -38,9 +38,6 @@ | ||
1887 | #ifdef HAVE_PTHREAD_AFFINITY_NP | ||
1888 | |||
1889 | static unsigned int affinity_counter; | ||
1890 | -#ifndef HAVE_SYNC_BUILTINS | ||
1891 | -static gomp_mutex_t affinity_lock; | ||
1892 | -#endif | ||
1893 | |||
1894 | void | ||
1895 | gomp_init_affinity (void) | ||
1896 | @@ -76,9 +73,6 @@ gomp_init_affinity (void) | ||
1897 | CPU_SET (gomp_cpu_affinity[0], &cpuset); | ||
1898 | pthread_setaffinity_np (pthread_self (), sizeof (cpuset), &cpuset); | ||
1899 | affinity_counter = 1; | ||
1900 | -#ifndef HAVE_SYNC_BUILTINS | ||
1901 | - gomp_mutex_init (&affinity_lock); | ||
1902 | -#endif | ||
1903 | } | ||
1904 | |||
1905 | void | ||
1906 | @@ -87,13 +81,7 @@ gomp_init_thread_affinity (pthread_attr_ | ||
1907 | unsigned int cpu; | ||
1908 | cpu_set_t cpuset; | ||
1909 | |||
1910 | -#ifdef HAVE_SYNC_BUILTINS | ||
1911 | cpu = __sync_fetch_and_add (&affinity_counter, 1); | ||
1912 | -#else | ||
1913 | - gomp_mutex_lock (&affinity_lock); | ||
1914 | - cpu = affinity_counter++; | ||
1915 | - gomp_mutex_unlock (&affinity_lock); | ||
1916 | -#endif | ||
1917 | cpu %= gomp_cpu_affinity_len; | ||
1918 | CPU_ZERO (&cpuset); | ||
1919 | CPU_SET (gomp_cpu_affinity[cpu], &cpuset); | ||
1920 | --- libgomp/config/linux/bar.h.jj 2007-12-07 14:41:00.000000000 +0100 | ||
1921 | +++ libgomp/config/linux/bar.h 2008-03-26 15:11:32.000000000 +0100 | ||
1922 | @@ -1,4 +1,4 @@ | ||
1923 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
1924 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
1925 | Contributed by Richard Henderson <rth@redhat.com>. | ||
1926 | |||
1927 | This file is part of the GNU OpenMP Library (libgomp). | ||
1928 | @@ -36,40 +36,49 @@ | ||
1929 | |||
1930 | typedef struct | ||
1931 | { | ||
1932 | - gomp_mutex_t mutex; | ||
1933 | - unsigned total; | ||
1934 | - unsigned arrived; | ||
1935 | - int generation; | ||
1936 | + /* Make sure total/generation is in a mostly read cacheline, while | ||
1937 | + awaited in a separate cacheline. */ | ||
1938 | + unsigned total __attribute__((aligned (64))); | ||
1939 | + unsigned generation; | ||
1940 | + unsigned awaited __attribute__((aligned (64))); | ||
1941 | } gomp_barrier_t; | ||
1942 | +typedef unsigned int gomp_barrier_state_t; | ||
1943 | |||
1944 | static inline void gomp_barrier_init (gomp_barrier_t *bar, unsigned count) | ||
1945 | { | ||
1946 | - gomp_mutex_init (&bar->mutex); | ||
1947 | bar->total = count; | ||
1948 | - bar->arrived = 0; | ||
1949 | + bar->awaited = count; | ||
1950 | bar->generation = 0; | ||
1951 | } | ||
1952 | |||
1953 | static inline void gomp_barrier_reinit (gomp_barrier_t *bar, unsigned count) | ||
1954 | { | ||
1955 | - gomp_mutex_lock (&bar->mutex); | ||
1956 | + __sync_fetch_and_add (&bar->awaited, count - bar->total); | ||
1957 | bar->total = count; | ||
1958 | - gomp_mutex_unlock (&bar->mutex); | ||
1959 | } | ||
1960 | |||
1961 | static inline void gomp_barrier_destroy (gomp_barrier_t *bar) | ||
1962 | { | ||
1963 | - /* Before destroying, make sure all threads have left the barrier. */ | ||
1964 | - gomp_mutex_lock (&bar->mutex); | ||
1965 | } | ||
1966 | |||
1967 | extern void gomp_barrier_wait (gomp_barrier_t *); | ||
1968 | -extern void gomp_barrier_wait_end (gomp_barrier_t *, bool); | ||
1969 | +extern void gomp_barrier_wait_last (gomp_barrier_t *); | ||
1970 | +extern void gomp_barrier_wait_end (gomp_barrier_t *, gomp_barrier_state_t); | ||
1971 | |||
1972 | -static inline bool gomp_barrier_wait_start (gomp_barrier_t *bar) | ||
1973 | +static inline gomp_barrier_state_t | ||
1974 | +gomp_barrier_wait_start (gomp_barrier_t *bar) | ||
1975 | { | ||
1976 | - gomp_mutex_lock (&bar->mutex); | ||
1977 | - return ++bar->arrived == bar->total; | ||
1978 | + unsigned int ret = bar->generation; | ||
1979 | + /* Do we need any barrier here or is __sync_add_and_fetch acting | ||
1980 | + as the needed LoadLoad barrier already? */ | ||
1981 | + ret += __sync_add_and_fetch (&bar->awaited, -1) == 0; | ||
1982 | + return ret; | ||
1983 | +} | ||
1984 | + | ||
1985 | +static inline bool | ||
1986 | +gomp_barrier_last_thread (gomp_barrier_state_t state) | ||
1987 | +{ | ||
1988 | + return state & 1; | ||
1989 | } | ||
1990 | |||
1991 | #endif /* GOMP_BARRIER_H */ | ||
1992 | --- libgomp/config/linux/ptrlock.h.jj 2008-03-26 15:11:32.000000000 +0100 | ||
1993 | +++ libgomp/config/linux/ptrlock.h 2008-03-26 15:11:32.000000000 +0100 | ||
1994 | @@ -0,0 +1,65 @@ | ||
1995 | +/* Copyright (C) 2008 Free Software Foundation, Inc. | ||
1996 | + Contributed by Jakub Jelinek <jakub@redhat.com>. | ||
1997 | + | ||
1998 | + This file is part of the GNU OpenMP Library (libgomp). | ||
1999 | + | ||
2000 | + Libgomp is free software; you can redistribute it and/or modify it | ||
2001 | + under the terms of the GNU Lesser General Public License as published by | ||
2002 | + the Free Software Foundation; either version 2.1 of the License, or | ||
2003 | + (at your option) any later version. | ||
2004 | + | ||
2005 | + Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY | ||
2006 | + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
2007 | + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for | ||
2008 | + more details. | ||
2009 | + | ||
2010 | + You should have received a copy of the GNU Lesser General Public License | ||
2011 | + along with libgomp; see the file COPYING.LIB. If not, write to the | ||
2012 | + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
2013 | + MA 02110-1301, USA. */ | ||
2014 | + | ||
2015 | +/* As a special exception, if you link this library with other files, some | ||
2016 | + of which are compiled with GCC, to produce an executable, this library | ||
2017 | + does not by itself cause the resulting executable to be covered by the | ||
2018 | + GNU General Public License. This exception does not however invalidate | ||
2019 | + any other reasons why the executable file might be covered by the GNU | ||
2020 | + General Public License. */ | ||
2021 | + | ||
2022 | +/* This is a Linux specific implementation of a mutex synchronization | ||
2023 | + mechanism for libgomp. This type is private to the library. This | ||
2024 | + implementation uses atomic instructions and the futex syscall. */ | ||
2025 | + | ||
2026 | +#ifndef GOMP_PTRLOCK_H | ||
2027 | +#define GOMP_PTRLOCK_H 1 | ||
2028 | + | ||
2029 | +typedef void *gomp_ptrlock_t; | ||
2030 | + | ||
2031 | +static inline void gomp_ptrlock_init (gomp_ptrlock_t *ptrlock, void *ptr) | ||
2032 | +{ | ||
2033 | + *ptrlock = ptr; | ||
2034 | +} | ||
2035 | + | ||
2036 | +extern void *gomp_ptrlock_get_slow (gomp_ptrlock_t *ptrlock); | ||
2037 | +static inline void *gomp_ptrlock_get (gomp_ptrlock_t *ptrlock) | ||
2038 | +{ | ||
2039 | + if ((uintptr_t) *ptrlock > 2) | ||
2040 | + return *ptrlock; | ||
2041 | + | ||
2042 | + if (__sync_bool_compare_and_swap (ptrlock, NULL, (uintptr_t) 1)) | ||
2043 | + return NULL; | ||
2044 | + | ||
2045 | + return gomp_ptrlock_get_slow (ptrlock); | ||
2046 | +} | ||
2047 | + | ||
2048 | +extern void gomp_ptrlock_set_slow (gomp_ptrlock_t *ptrlock, void *ptr); | ||
2049 | +static inline void gomp_ptrlock_set (gomp_ptrlock_t *ptrlock, void *ptr) | ||
2050 | +{ | ||
2051 | + if (!__sync_bool_compare_and_swap (ptrlock, (uintptr_t) 1, ptr)) | ||
2052 | + gomp_ptrlock_set_slow (ptrlock, ptr); | ||
2053 | +} | ||
2054 | + | ||
2055 | +static inline void gomp_ptrlock_destroy (gomp_ptrlock_t *ptrlock) | ||
2056 | +{ | ||
2057 | +} | ||
2058 | + | ||
2059 | +#endif /* GOMP_PTRLOCK_H */ | ||
2060 | --- libgomp/config/linux/lock.c.jj 2007-12-07 14:41:00.000000000 +0100 | ||
2061 | +++ libgomp/config/linux/lock.c 2008-03-26 15:11:32.000000000 +0100 | ||
2062 | @@ -29,11 +29,10 @@ | ||
2063 | primitives. This implementation uses atomic instructions and the futex | ||
2064 | syscall. */ | ||
2065 | |||
2066 | -#include "libgomp.h" | ||
2067 | #include <string.h> | ||
2068 | #include <unistd.h> | ||
2069 | #include <sys/syscall.h> | ||
2070 | -#include "futex.h" | ||
2071 | +#include "wait.h" | ||
2072 | |||
2073 | |||
2074 | /* The internal gomp_mutex_t and the external non-recursive omp_lock_t | ||
2075 | @@ -137,7 +136,7 @@ omp_set_nest_lock (omp_nest_lock_t *lock | ||
2076 | return; | ||
2077 | } | ||
2078 | |||
2079 | - futex_wait (&lock->owner, otid); | ||
2080 | + do_wait (&lock->owner, otid); | ||
2081 | } | ||
2082 | } | ||
2083 | |||
2084 | --- libgomp/config/linux/ptrlock.c.jj 2008-03-26 15:11:32.000000000 +0100 | ||
2085 | +++ libgomp/config/linux/ptrlock.c 2008-03-26 15:11:32.000000000 +0100 | ||
2086 | @@ -0,0 +1,70 @@ | ||
2087 | +/* Copyright (C) 2008 Free Software Foundation, Inc. | ||
2088 | + Contributed by Jakub Jelinek <jakub@redhat.com>. | ||
2089 | + | ||
2090 | + This file is part of the GNU OpenMP Library (libgomp). | ||
2091 | + | ||
2092 | + Libgomp is free software; you can redistribute it and/or modify it | ||
2093 | + under the terms of the GNU Lesser General Public License as published by | ||
2094 | + the Free Software Foundation; either version 2.1 of the License, or | ||
2095 | + (at your option) any later version. | ||
2096 | + | ||
2097 | + Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY | ||
2098 | + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
2099 | + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for | ||
2100 | + more details. | ||
2101 | + | ||
2102 | + You should have received a copy of the GNU Lesser General Public License | ||
2103 | + along with libgomp; see the file COPYING.LIB. If not, write to the | ||
2104 | + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
2105 | + MA 02110-1301, USA. */ | ||
2106 | + | ||
2107 | +/* As a special exception, if you link this library with other files, some | ||
2108 | + of which are compiled with GCC, to produce an executable, this library | ||
2109 | + does not by itself cause the resulting executable to be covered by the | ||
2110 | + GNU General Public License. This exception does not however invalidate | ||
2111 | + any other reasons why the executable file might be covered by the GNU | ||
2112 | + General Public License. */ | ||
2113 | + | ||
2114 | +/* This is a Linux specific implementation of a mutex synchronization | ||
2115 | + mechanism for libgomp. This type is private to the library. This | ||
2116 | + implementation uses atomic instructions and the futex syscall. */ | ||
2117 | + | ||
2118 | +#include <endian.h> | ||
2119 | +#include <limits.h> | ||
2120 | +#include "wait.h" | ||
2121 | + | ||
2122 | +void * | ||
2123 | +gomp_ptrlock_get_slow (gomp_ptrlock_t *ptrlock) | ||
2124 | +{ | ||
2125 | + int *intptr; | ||
2126 | + __sync_bool_compare_and_swap (ptrlock, 1, 2); | ||
2127 | + | ||
2128 | + /* futex works on ints, not pointers. | ||
2129 | + But a valid work share pointer will be at least | ||
2130 | + 8 byte aligned, so it is safe to assume the low | ||
2131 | + 32-bits of the pointer won't contain values 1 or 2. */ | ||
2132 | + __asm volatile ("" : "=r" (intptr) : "0" (ptrlock)); | ||
2133 | +#if __BYTE_ORDER == __BIG_ENDIAN | ||
2134 | + if (sizeof (*ptrlock) > sizeof (int)) | ||
2135 | + intptr += (sizeof (*ptrlock) / sizeof (int)) - 1; | ||
2136 | +#endif | ||
2137 | + do | ||
2138 | + do_wait (intptr, 2); | ||
2139 | + while (*intptr == 2); | ||
2140 | + __asm volatile ("" : : : "memory"); | ||
2141 | + return *ptrlock; | ||
2142 | +} | ||
2143 | + | ||
2144 | +void | ||
2145 | +gomp_ptrlock_set_slow (gomp_ptrlock_t *ptrlock, void *ptr) | ||
2146 | +{ | ||
2147 | + int *intptr; | ||
2148 | + | ||
2149 | + *ptrlock = ptr; | ||
2150 | + __asm volatile ("" : "=r" (intptr) : "0" (ptrlock)); | ||
2151 | +#if __BYTE_ORDER == __BIG_ENDIAN | ||
2152 | + if (sizeof (*ptrlock) > sizeof (int)) | ||
2153 | + intptr += (sizeof (*ptrlock) / sizeof (int)) - 1; | ||
2154 | +#endif | ||
2155 | + futex_wake (intptr, INT_MAX); | ||
2156 | +} | ||
2157 | --- libgomp/config/linux/x86/futex.h.jj 2007-12-07 14:41:00.000000000 +0100 | ||
2158 | +++ libgomp/config/linux/x86/futex.h 2008-03-26 15:11:32.000000000 +0100 | ||
2159 | @@ -1,4 +1,4 @@ | ||
2160 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
2161 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
2162 | Contributed by Richard Henderson <rth@redhat.com>. | ||
2163 | |||
2164 | This file is part of the GNU OpenMP Library (libgomp). | ||
2165 | @@ -27,9 +27,6 @@ | ||
2166 | |||
2167 | /* Provide target-specific access to the futex system call. */ | ||
2168 | |||
2169 | -#define FUTEX_WAIT 0 | ||
2170 | -#define FUTEX_WAKE 1 | ||
2171 | - | ||
2172 | #ifdef __LP64__ | ||
2173 | # ifndef SYS_futex | ||
2174 | # define SYS_futex 202 | ||
2175 | @@ -38,14 +35,26 @@ | ||
2176 | static inline void | ||
2177 | futex_wait (int *addr, int val) | ||
2178 | { | ||
2179 | - register long r10 __asm__("%r10") = 0; | ||
2180 | + register long r10 __asm__("%r10"); | ||
2181 | long res; | ||
2182 | |||
2183 | + r10 = 0; | ||
2184 | __asm volatile ("syscall" | ||
2185 | : "=a" (res) | ||
2186 | - : "0"(SYS_futex), "D" (addr), "S"(FUTEX_WAIT), | ||
2187 | - "d"(val), "r"(r10) | ||
2188 | + : "0" (SYS_futex), "D" (addr), "S" (gomp_futex_wait), | ||
2189 | + "d" (val), "r" (r10) | ||
2190 | : "r11", "rcx", "memory"); | ||
2191 | + if (__builtin_expect (res == -ENOSYS, 0)) | ||
2192 | + { | ||
2193 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2194 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2195 | + r10 = 0; | ||
2196 | + __asm volatile ("syscall" | ||
2197 | + : "=a" (res) | ||
2198 | + : "0" (SYS_futex), "D" (addr), "S" (gomp_futex_wait), | ||
2199 | + "d" (val), "r" (r10) | ||
2200 | + : "r11", "rcx", "memory"); | ||
2201 | + } | ||
2202 | } | ||
2203 | |||
2204 | static inline void | ||
2205 | @@ -55,8 +64,19 @@ futex_wake (int *addr, int count) | ||
2206 | |||
2207 | __asm volatile ("syscall" | ||
2208 | : "=a" (res) | ||
2209 | - : "0"(SYS_futex), "D" (addr), "S"(FUTEX_WAKE), "d"(count) | ||
2210 | + : "0" (SYS_futex), "D" (addr), "S" (gomp_futex_wake), | ||
2211 | + "d" (count) | ||
2212 | : "r11", "rcx", "memory"); | ||
2213 | + if (__builtin_expect (res == -ENOSYS, 0)) | ||
2214 | + { | ||
2215 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2216 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2217 | + __asm volatile ("syscall" | ||
2218 | + : "=a" (res) | ||
2219 | + : "0" (SYS_futex), "D" (addr), "S" (gomp_futex_wake), | ||
2220 | + "d" (count) | ||
2221 | + : "r11", "rcx", "memory"); | ||
2222 | + } | ||
2223 | } | ||
2224 | #else | ||
2225 | # ifndef SYS_futex | ||
2226 | @@ -65,7 +85,7 @@ futex_wake (int *addr, int count) | ||
2227 | |||
2228 | # ifdef __PIC__ | ||
2229 | |||
2230 | -static inline void | ||
2231 | +static inline long | ||
2232 | sys_futex0 (int *addr, int op, int val) | ||
2233 | { | ||
2234 | long res; | ||
2235 | @@ -77,11 +97,12 @@ sys_futex0 (int *addr, int op, int val) | ||
2236 | : "0"(SYS_futex), "r" (addr), "c"(op), | ||
2237 | "d"(val), "S"(0) | ||
2238 | : "memory"); | ||
2239 | + return res; | ||
2240 | } | ||
2241 | |||
2242 | # else | ||
2243 | |||
2244 | -static inline void | ||
2245 | +static inline long | ||
2246 | sys_futex0 (int *addr, int op, int val) | ||
2247 | { | ||
2248 | long res; | ||
2249 | @@ -91,6 +112,7 @@ sys_futex0 (int *addr, int op, int val) | ||
2250 | : "0"(SYS_futex), "b" (addr), "c"(op), | ||
2251 | "d"(val), "S"(0) | ||
2252 | : "memory"); | ||
2253 | + return res; | ||
2254 | } | ||
2255 | |||
2256 | # endif /* __PIC__ */ | ||
2257 | @@ -98,13 +120,37 @@ sys_futex0 (int *addr, int op, int val) | ||
2258 | static inline void | ||
2259 | futex_wait (int *addr, int val) | ||
2260 | { | ||
2261 | - sys_futex0 (addr, FUTEX_WAIT, val); | ||
2262 | + long res = sys_futex0 (addr, gomp_futex_wait, val); | ||
2263 | + if (__builtin_expect (res == -ENOSYS, 0)) | ||
2264 | + { | ||
2265 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2266 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2267 | + sys_futex0 (addr, gomp_futex_wait, val); | ||
2268 | + } | ||
2269 | } | ||
2270 | |||
2271 | static inline void | ||
2272 | futex_wake (int *addr, int count) | ||
2273 | { | ||
2274 | - sys_futex0 (addr, FUTEX_WAKE, count); | ||
2275 | + long res = sys_futex0 (addr, gomp_futex_wake, count); | ||
2276 | + if (__builtin_expect (res == -ENOSYS, 0)) | ||
2277 | + { | ||
2278 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2279 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2280 | + sys_futex0 (addr, gomp_futex_wake, count); | ||
2281 | + } | ||
2282 | } | ||
2283 | |||
2284 | #endif /* __LP64__ */ | ||
2285 | + | ||
2286 | +static inline void | ||
2287 | +cpu_relax (void) | ||
2288 | +{ | ||
2289 | + __asm volatile ("rep; nop" : : : "memory"); | ||
2290 | +} | ||
2291 | + | ||
2292 | +static inline void | ||
2293 | +atomic_write_barrier (void) | ||
2294 | +{ | ||
2295 | + __sync_synchronize (); | ||
2296 | +} | ||
2297 | --- libgomp/config/linux/wait.h.jj 2008-03-26 15:11:32.000000000 +0100 | ||
2298 | +++ libgomp/config/linux/wait.h 2008-03-26 15:11:32.000000000 +0100 | ||
2299 | @@ -0,0 +1,68 @@ | ||
2300 | +/* Copyright (C) 2008 Free Software Foundation, Inc. | ||
2301 | + Contributed by Jakub Jelinek <jakub@redhat.com>. | ||
2302 | + | ||
2303 | + This file is part of the GNU OpenMP Library (libgomp). | ||
2304 | + | ||
2305 | + Libgomp is free software; you can redistribute it and/or modify it | ||
2306 | + under the terms of the GNU Lesser General Public License as published by | ||
2307 | + the Free Software Foundation; either version 2.1 of the License, or | ||
2308 | + (at your option) any later version. | ||
2309 | + | ||
2310 | + Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY | ||
2311 | + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
2312 | + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for | ||
2313 | + more details. | ||
2314 | + | ||
2315 | + You should have received a copy of the GNU Lesser General Public License | ||
2316 | + along with libgomp; see the file COPYING.LIB. If not, write to the | ||
2317 | + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
2318 | + MA 02110-1301, USA. */ | ||
2319 | + | ||
2320 | +/* As a special exception, if you link this library with other files, some | ||
2321 | + of which are compiled with GCC, to produce an executable, this library | ||
2322 | + does not by itself cause the resulting executable to be covered by the | ||
2323 | + GNU General Public License. This exception does not however invalidate | ||
2324 | + any other reasons why the executable file might be covered by the GNU | ||
2325 | + General Public License. */ | ||
2326 | + | ||
2327 | +/* This is a Linux specific implementation of a mutex synchronization | ||
2328 | + mechanism for libgomp. This type is private to the library. This | ||
2329 | + implementation uses atomic instructions and the futex syscall. */ | ||
2330 | + | ||
2331 | +#ifndef GOMP_WAIT_H | ||
2332 | +#define GOMP_WAIT_H 1 | ||
2333 | + | ||
2334 | +#include "libgomp.h" | ||
2335 | +#include <errno.h> | ||
2336 | + | ||
2337 | +#define FUTEX_WAIT 0 | ||
2338 | +#define FUTEX_WAKE 1 | ||
2339 | +#define FUTEX_PRIVATE_FLAG 128L | ||
2340 | + | ||
2341 | +#ifdef HAVE_ATTRIBUTE_VISIBILITY | ||
2342 | +# pragma GCC visibility push(hidden) | ||
2343 | +#endif | ||
2344 | + | ||
2345 | +extern long int gomp_futex_wait, gomp_futex_wake; | ||
2346 | + | ||
2347 | +#include "futex.h" | ||
2348 | + | ||
2349 | +static inline void do_wait (int *addr, int val) | ||
2350 | +{ | ||
2351 | + unsigned long long i, count = gomp_spin_count_var; | ||
2352 | + | ||
2353 | + if (__builtin_expect (gomp_managed_threads > gomp_available_cpus, 0)) | ||
2354 | + count = gomp_throttled_spin_count_var; | ||
2355 | + for (i = 0; i < count; i++) | ||
2356 | + if (__builtin_expect (*addr != val, 0)) | ||
2357 | + return; | ||
2358 | + else | ||
2359 | + cpu_relax (); | ||
2360 | + futex_wait (addr, val); | ||
2361 | +} | ||
2362 | + | ||
2363 | +#ifdef HAVE_ATTRIBUTE_VISIBILITY | ||
2364 | +# pragma GCC visibility pop | ||
2365 | +#endif | ||
2366 | + | ||
2367 | +#endif /* GOMP_WAIT_H */ | ||
2368 | --- libgomp/config/linux/sparc/futex.h.jj 2007-12-07 14:41:00.000000000 +0100 | ||
2369 | +++ libgomp/config/linux/sparc/futex.h 2008-03-26 15:11:32.000000000 +0100 | ||
2370 | @@ -1,4 +1,4 @@ | ||
2371 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
2372 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
2373 | Contributed by Jakub Jelinek <jakub@redhat.com>. | ||
2374 | |||
2375 | This file is part of the GNU OpenMP Library (libgomp). | ||
2376 | @@ -28,10 +28,8 @@ | ||
2377 | /* Provide target-specific access to the futex system call. */ | ||
2378 | |||
2379 | #include <sys/syscall.h> | ||
2380 | -#define FUTEX_WAIT 0 | ||
2381 | -#define FUTEX_WAKE 1 | ||
2382 | |||
2383 | -static inline void | ||
2384 | +static inline long | ||
2385 | sys_futex0 (int *addr, int op, int val) | ||
2386 | { | ||
2387 | register long int g1 __asm__ ("g1"); | ||
2388 | @@ -47,9 +45,9 @@ sys_futex0 (int *addr, int op, int val) | ||
2389 | o3 = 0; | ||
2390 | |||
2391 | #ifdef __arch64__ | ||
2392 | -# define SYSCALL_STRING "ta\t0x6d" | ||
2393 | +# define SYSCALL_STRING "ta\t0x6d; bcs,a,pt %%xcc, 1f; sub %%g0, %%o0, %%o0; 1:" | ||
2394 | #else | ||
2395 | -# define SYSCALL_STRING "ta\t0x10" | ||
2396 | +# define SYSCALL_STRING "ta\t0x10; bcs,a 1f; sub %%g0, %%o0, %%o0; 1:" | ||
2397 | #endif | ||
2398 | |||
2399 | __asm volatile (SYSCALL_STRING | ||
2400 | @@ -65,16 +63,49 @@ sys_futex0 (int *addr, int op, int val) | ||
2401 | "f48", "f50", "f52", "f54", "f56", "f58", "f60", "f62", | ||
2402 | #endif | ||
2403 | "cc", "memory"); | ||
2404 | + return o0; | ||
2405 | } | ||
2406 | |||
2407 | static inline void | ||
2408 | futex_wait (int *addr, int val) | ||
2409 | { | ||
2410 | - sys_futex0 (addr, FUTEX_WAIT, val); | ||
2411 | + long err = sys_futex0 (addr, gomp_futex_wait, val); | ||
2412 | + if (__builtin_expect (err == ENOSYS, 0)) | ||
2413 | + { | ||
2414 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2415 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2416 | + sys_futex0 (addr, gomp_futex_wait, val); | ||
2417 | + } | ||
2418 | } | ||
2419 | |||
2420 | static inline void | ||
2421 | futex_wake (int *addr, int count) | ||
2422 | { | ||
2423 | - sys_futex0 (addr, FUTEX_WAKE, count); | ||
2424 | + long err = sys_futex0 (addr, gomp_futex_wake, count); | ||
2425 | + if (__builtin_expect (err == ENOSYS, 0)) | ||
2426 | + { | ||
2427 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2428 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2429 | + sys_futex0 (addr, gomp_futex_wake, count); | ||
2430 | + } | ||
2431 | +} | ||
2432 | + | ||
2433 | +static inline void | ||
2434 | +cpu_relax (void) | ||
2435 | +{ | ||
2436 | +#if defined __arch64__ || defined __sparc_v9__ | ||
2437 | + __asm volatile ("membar #LoadLoad" : : : "memory"); | ||
2438 | +#else | ||
2439 | + __asm volatile ("" : : : "memory"); | ||
2440 | +#endif | ||
2441 | +} | ||
2442 | + | ||
2443 | +static inline void | ||
2444 | +atomic_write_barrier (void) | ||
2445 | +{ | ||
2446 | +#if defined __arch64__ || defined __sparc_v9__ | ||
2447 | + __asm volatile ("membar #StoreStore" : : : "memory"); | ||
2448 | +#else | ||
2449 | + __sync_synchronize (); | ||
2450 | +#endif | ||
2451 | } | ||
2452 | --- libgomp/config/linux/ia64/futex.h.jj 2007-12-07 14:41:00.000000000 +0100 | ||
2453 | +++ libgomp/config/linux/ia64/futex.h 2008-03-26 15:11:32.000000000 +0100 | ||
2454 | @@ -1,4 +1,4 @@ | ||
2455 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
2456 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
2457 | Contributed by Richard Henderson <rth@redhat.com>. | ||
2458 | |||
2459 | This file is part of the GNU OpenMP Library (libgomp). | ||
2460 | @@ -29,23 +29,24 @@ | ||
2461 | |||
2462 | #include <sys/syscall.h> | ||
2463 | |||
2464 | -#define FUTEX_WAIT 0 | ||
2465 | -#define FUTEX_WAKE 1 | ||
2466 | |||
2467 | |||
2468 | -static inline void | ||
2469 | -sys_futex0(int *addr, int op, int val) | ||
2470 | +static inline long | ||
2471 | +sys_futex0(int *addr, long op, int val) | ||
2472 | { | ||
2473 | register long out0 asm ("out0") = (long) addr; | ||
2474 | register long out1 asm ("out1") = op; | ||
2475 | register long out2 asm ("out2") = val; | ||
2476 | register long out3 asm ("out3") = 0; | ||
2477 | + register long r8 asm ("r8"); | ||
2478 | + register long r10 asm ("r10"); | ||
2479 | register long r15 asm ("r15") = SYS_futex; | ||
2480 | |||
2481 | __asm __volatile ("break 0x100000" | ||
2482 | - : "=r"(r15), "=r"(out0), "=r"(out1), "=r"(out2), "=r"(out3) | ||
2483 | + : "=r"(r15), "=r"(out0), "=r"(out1), "=r"(out2), "=r"(out3), | ||
2484 | + "=r"(r8), "=r"(r10) | ||
2485 | : "r"(r15), "r"(out0), "r"(out1), "r"(out2), "r"(out3) | ||
2486 | - : "memory", "r8", "r10", "out4", "out5", "out6", "out7", | ||
2487 | + : "memory", "out4", "out5", "out6", "out7", | ||
2488 | /* Non-stacked integer registers, minus r8, r10, r15. */ | ||
2489 | "r2", "r3", "r9", "r11", "r12", "r13", "r14", "r16", "r17", "r18", | ||
2490 | "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", | ||
2491 | @@ -56,16 +57,41 @@ sys_futex0(int *addr, int op, int val) | ||
2492 | "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", | ||
2493 | /* Branch registers. */ | ||
2494 | "b6"); | ||
2495 | + return r8 & r10; | ||
2496 | } | ||
2497 | |||
2498 | static inline void | ||
2499 | futex_wait (int *addr, int val) | ||
2500 | { | ||
2501 | - sys_futex0 (addr, FUTEX_WAIT, val); | ||
2502 | + long err = sys_futex0 (addr, gomp_futex_wait, val); | ||
2503 | + if (__builtin_expect (err == ENOSYS, 0)) | ||
2504 | + { | ||
2505 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2506 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2507 | + sys_futex0 (addr, gomp_futex_wait, val); | ||
2508 | + } | ||
2509 | } | ||
2510 | |||
2511 | static inline void | ||
2512 | futex_wake (int *addr, int count) | ||
2513 | { | ||
2514 | - sys_futex0 (addr, FUTEX_WAKE, count); | ||
2515 | + long err = sys_futex0 (addr, gomp_futex_wake, count); | ||
2516 | + if (__builtin_expect (err == ENOSYS, 0)) | ||
2517 | + { | ||
2518 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2519 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2520 | + sys_futex0 (addr, gomp_futex_wake, count); | ||
2521 | + } | ||
2522 | +} | ||
2523 | + | ||
2524 | +static inline void | ||
2525 | +cpu_relax (void) | ||
2526 | +{ | ||
2527 | + __asm volatile ("hint @pause" : : : "memory"); | ||
2528 | +} | ||
2529 | + | ||
2530 | +static inline void | ||
2531 | +atomic_write_barrier (void) | ||
2532 | +{ | ||
2533 | + __sync_synchronize (); | ||
2534 | } | ||
2535 | --- libgomp/config/linux/s390/futex.h.jj 2007-12-07 14:41:00.000000000 +0100 | ||
2536 | +++ libgomp/config/linux/s390/futex.h 2008-03-26 15:11:32.000000000 +0100 | ||
2537 | @@ -1,4 +1,4 @@ | ||
2538 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
2539 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
2540 | Contributed by Jakub Jelinek <jakub@redhat.com>. | ||
2541 | |||
2542 | This file is part of the GNU OpenMP Library (libgomp). | ||
2543 | @@ -28,10 +28,8 @@ | ||
2544 | /* Provide target-specific access to the futex system call. */ | ||
2545 | |||
2546 | #include <sys/syscall.h> | ||
2547 | -#define FUTEX_WAIT 0 | ||
2548 | -#define FUTEX_WAKE 1 | ||
2549 | |||
2550 | -static inline void | ||
2551 | +static inline long | ||
2552 | sys_futex0 (int *addr, int op, int val) | ||
2553 | { | ||
2554 | register long int gpr2 __asm__ ("2"); | ||
2555 | @@ -49,16 +47,41 @@ sys_futex0 (int *addr, int op, int val) | ||
2556 | : "i" (SYS_futex), | ||
2557 | "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5) | ||
2558 | : "memory"); | ||
2559 | + return gpr2; | ||
2560 | } | ||
2561 | |||
2562 | static inline void | ||
2563 | futex_wait (int *addr, int val) | ||
2564 | { | ||
2565 | - sys_futex0 (addr, FUTEX_WAIT, val); | ||
2566 | + long err = sys_futex0 (addr, gomp_futex_wait, val); | ||
2567 | + if (__builtin_expect (err == -ENOSYS, 0)) | ||
2568 | + { | ||
2569 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2570 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2571 | + sys_futex0 (addr, gomp_futex_wait, val); | ||
2572 | + } | ||
2573 | } | ||
2574 | |||
2575 | static inline void | ||
2576 | futex_wake (int *addr, int count) | ||
2577 | { | ||
2578 | - sys_futex0 (addr, FUTEX_WAKE, count); | ||
2579 | + long err = sys_futex0 (addr, gomp_futex_wake, count); | ||
2580 | + if (__builtin_expect (err == -ENOSYS, 0)) | ||
2581 | + { | ||
2582 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2583 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2584 | + sys_futex0 (addr, gomp_futex_wake, count); | ||
2585 | + } | ||
2586 | +} | ||
2587 | + | ||
2588 | +static inline void | ||
2589 | +cpu_relax (void) | ||
2590 | +{ | ||
2591 | + __asm volatile ("" : : : "memory"); | ||
2592 | +} | ||
2593 | + | ||
2594 | +static inline void | ||
2595 | +atomic_write_barrier (void) | ||
2596 | +{ | ||
2597 | + __sync_synchronize (); | ||
2598 | } | ||
2599 | --- libgomp/config/linux/mutex.c.jj 2007-12-07 14:41:00.000000000 +0100 | ||
2600 | +++ libgomp/config/linux/mutex.c 2008-03-26 15:11:32.000000000 +0100 | ||
2601 | @@ -1,4 +1,4 @@ | ||
2602 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
2603 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
2604 | Contributed by Richard Henderson <rth@redhat.com>. | ||
2605 | |||
2606 | This file is part of the GNU OpenMP Library (libgomp). | ||
2607 | @@ -29,9 +29,10 @@ | ||
2608 | mechanism for libgomp. This type is private to the library. This | ||
2609 | implementation uses atomic instructions and the futex syscall. */ | ||
2610 | |||
2611 | -#include "libgomp.h" | ||
2612 | -#include "futex.h" | ||
2613 | +#include "wait.h" | ||
2614 | |||
2615 | +long int gomp_futex_wake = FUTEX_WAKE | FUTEX_PRIVATE_FLAG; | ||
2616 | +long int gomp_futex_wait = FUTEX_WAIT | FUTEX_PRIVATE_FLAG; | ||
2617 | |||
2618 | void | ||
2619 | gomp_mutex_lock_slow (gomp_mutex_t *mutex) | ||
2620 | @@ -40,7 +41,7 @@ gomp_mutex_lock_slow (gomp_mutex_t *mute | ||
2621 | { | ||
2622 | int oldval = __sync_val_compare_and_swap (mutex, 1, 2); | ||
2623 | if (oldval != 0) | ||
2624 | - futex_wait (mutex, 2); | ||
2625 | + do_wait (mutex, 2); | ||
2626 | } | ||
2627 | while (!__sync_bool_compare_and_swap (mutex, 0, 2)); | ||
2628 | } | ||
2629 | --- libgomp/config/linux/sem.c.jj 2007-12-07 14:41:00.000000000 +0100 | ||
2630 | +++ libgomp/config/linux/sem.c 2008-03-26 15:11:32.000000000 +0100 | ||
2631 | @@ -1,4 +1,4 @@ | ||
2632 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
2633 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
2634 | Contributed by Richard Henderson <rth@redhat.com>. | ||
2635 | |||
2636 | This file is part of the GNU OpenMP Library (libgomp). | ||
2637 | @@ -29,8 +29,7 @@ | ||
2638 | mechanism for libgomp. This type is private to the library. This | ||
2639 | implementation uses atomic instructions and the futex syscall. */ | ||
2640 | |||
2641 | -#include "libgomp.h" | ||
2642 | -#include "futex.h" | ||
2643 | +#include "wait.h" | ||
2644 | |||
2645 | |||
2646 | void | ||
2647 | @@ -44,7 +43,7 @@ gomp_sem_wait_slow (gomp_sem_t *sem) | ||
2648 | if (__sync_bool_compare_and_swap (sem, val, val - 1)) | ||
2649 | return; | ||
2650 | } | ||
2651 | - futex_wait (sem, -1); | ||
2652 | + do_wait (sem, -1); | ||
2653 | } | ||
2654 | } | ||
2655 | |||
2656 | --- libgomp/config/linux/powerpc/futex.h.jj 2007-12-07 14:41:00.000000000 +0100 | ||
2657 | +++ libgomp/config/linux/powerpc/futex.h 2008-03-26 15:11:32.000000000 +0100 | ||
2658 | @@ -1,4 +1,4 @@ | ||
2659 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
2660 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
2661 | Contributed by Richard Henderson <rth@redhat.com>. | ||
2662 | |||
2663 | This file is part of the GNU OpenMP Library (libgomp). | ||
2664 | @@ -28,10 +28,8 @@ | ||
2665 | /* Provide target-specific access to the futex system call. */ | ||
2666 | |||
2667 | #include <sys/syscall.h> | ||
2668 | -#define FUTEX_WAIT 0 | ||
2669 | -#define FUTEX_WAKE 1 | ||
2670 | |||
2671 | -static inline void | ||
2672 | +static inline long | ||
2673 | sys_futex0 (int *addr, int op, int val) | ||
2674 | { | ||
2675 | register long int r0 __asm__ ("r0"); | ||
2676 | @@ -50,21 +48,48 @@ sys_futex0 (int *addr, int op, int val) | ||
2677 | doesn't. It doesn't much matter for us. In the interest of unity, | ||
2678 | go ahead and clobber it always. */ | ||
2679 | |||
2680 | - __asm volatile ("sc" | ||
2681 | + __asm volatile ("sc; mfcr %0" | ||
2682 | : "=r"(r0), "=r"(r3), "=r"(r4), "=r"(r5), "=r"(r6) | ||
2683 | : "r"(r0), "r"(r3), "r"(r4), "r"(r5), "r"(r6) | ||
2684 | : "r7", "r8", "r9", "r10", "r11", "r12", | ||
2685 | "cr0", "ctr", "memory"); | ||
2686 | + if (__builtin_expect (r0 & (1 << 28), 0)) | ||
2687 | + return r3; | ||
2688 | + return 0; | ||
2689 | } | ||
2690 | |||
2691 | static inline void | ||
2692 | futex_wait (int *addr, int val) | ||
2693 | { | ||
2694 | - sys_futex0 (addr, FUTEX_WAIT, val); | ||
2695 | + long err = sys_futex0 (addr, gomp_futex_wait, val); | ||
2696 | + if (__builtin_expect (err == ENOSYS, 0)) | ||
2697 | + { | ||
2698 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2699 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2700 | + sys_futex0 (addr, gomp_futex_wait, val); | ||
2701 | + } | ||
2702 | } | ||
2703 | |||
2704 | static inline void | ||
2705 | futex_wake (int *addr, int count) | ||
2706 | { | ||
2707 | - sys_futex0 (addr, FUTEX_WAKE, count); | ||
2708 | + long err = sys_futex0 (addr, gomp_futex_wake, count); | ||
2709 | + if (__builtin_expect (err == ENOSYS, 0)) | ||
2710 | + { | ||
2711 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2712 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2713 | + sys_futex0 (addr, gomp_futex_wake, count); | ||
2714 | + } | ||
2715 | +} | ||
2716 | + | ||
2717 | +static inline void | ||
2718 | +cpu_relax (void) | ||
2719 | +{ | ||
2720 | + __asm volatile ("" : : : "memory"); | ||
2721 | +} | ||
2722 | + | ||
2723 | +static inline void | ||
2724 | +atomic_write_barrier (void) | ||
2725 | +{ | ||
2726 | + __asm volatile ("eieio" : : : "memory"); | ||
2727 | } | ||
2728 | --- libgomp/config/linux/bar.c.jj 2007-12-07 14:41:00.000000000 +0100 | ||
2729 | +++ libgomp/config/linux/bar.c 2008-03-26 15:11:32.000000000 +0100 | ||
2730 | @@ -1,4 +1,4 @@ | ||
2731 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
2732 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
2733 | Contributed by Richard Henderson <rth@redhat.com>. | ||
2734 | |||
2735 | This file is part of the GNU OpenMP Library (libgomp). | ||
2736 | @@ -29,32 +29,29 @@ | ||
2737 | mechanism for libgomp. This type is private to the library. This | ||
2738 | implementation uses atomic instructions and the futex syscall. */ | ||
2739 | |||
2740 | -#include "libgomp.h" | ||
2741 | -#include "futex.h" | ||
2742 | #include <limits.h> | ||
2743 | +#include "wait.h" | ||
2744 | |||
2745 | |||
2746 | void | ||
2747 | -gomp_barrier_wait_end (gomp_barrier_t *bar, bool last) | ||
2748 | +gomp_barrier_wait_end (gomp_barrier_t *bar, gomp_barrier_state_t state) | ||
2749 | { | ||
2750 | - if (last) | ||
2751 | + if (__builtin_expect ((state & 1) != 0, 0)) | ||
2752 | { | ||
2753 | - bar->generation++; | ||
2754 | - futex_wake (&bar->generation, INT_MAX); | ||
2755 | + /* Next time we'll be awaiting TOTAL threads again. */ | ||
2756 | + bar->awaited = bar->total; | ||
2757 | + atomic_write_barrier (); | ||
2758 | + bar->generation += 2; | ||
2759 | + futex_wake ((int *) &bar->generation, INT_MAX); | ||
2760 | } | ||
2761 | else | ||
2762 | { | ||
2763 | - unsigned int generation = bar->generation; | ||
2764 | - | ||
2765 | - gomp_mutex_unlock (&bar->mutex); | ||
2766 | + unsigned int generation = state; | ||
2767 | |||
2768 | do | ||
2769 | - futex_wait (&bar->generation, generation); | ||
2770 | + do_wait ((int *) &bar->generation, generation); | ||
2771 | while (bar->generation == generation); | ||
2772 | } | ||
2773 | - | ||
2774 | - if (__sync_add_and_fetch (&bar->arrived, -1) == 0) | ||
2775 | - gomp_mutex_unlock (&bar->mutex); | ||
2776 | } | ||
2777 | |||
2778 | void | ||
2779 | @@ -62,3 +59,18 @@ gomp_barrier_wait (gomp_barrier_t *barri | ||
2780 | { | ||
2781 | gomp_barrier_wait_end (barrier, gomp_barrier_wait_start (barrier)); | ||
2782 | } | ||
2783 | + | ||
2784 | +/* Like gomp_barrier_wait, except that if the encountering thread | ||
2785 | + is not the last one to hit the barrier, it returns immediately. | ||
2786 | + The intended usage is that a thread which intends to gomp_barrier_destroy | ||
2787 | + this barrier calls gomp_barrier_wait, while all other threads | ||
2788 | + call gomp_barrier_wait_last. When gomp_barrier_wait returns, | ||
2789 | + the barrier can be safely destroyed. */ | ||
2790 | + | ||
2791 | +void | ||
2792 | +gomp_barrier_wait_last (gomp_barrier_t *barrier) | ||
2793 | +{ | ||
2794 | + gomp_barrier_state_t state = gomp_barrier_wait_start (barrier); | ||
2795 | + if (state & 1) | ||
2796 | + gomp_barrier_wait_end (barrier, state); | ||
2797 | +} | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-ppc32-retaddr.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-ppc32-retaddr.patch new file mode 100644 index 0000000000..e9ae1bc303 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-ppc32-retaddr.patch | |||
@@ -0,0 +1,86 @@ | |||
1 | 2005-11-28 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | * config/rs6000/rs6000.c (rs6000_return_addr): If COUNT == 0, | ||
4 | read word RETURN_ADDRESS_OFFSET bytes above arg_pointer_rtx | ||
5 | instead of doing an extran indirection from frame_pointer_rtx. | ||
6 | |||
7 | * gcc.dg/20051128-1.c: New test. | ||
8 | |||
9 | --- gcc/config/rs6000/rs6000.c.jj 2005-11-26 14:38:01.000000000 +0100 | ||
10 | +++ gcc/config/rs6000/rs6000.c 2005-11-28 20:32:18.000000000 +0100 | ||
11 | @@ -13166,17 +13166,22 @@ rs6000_return_addr (int count, rtx frame | ||
12 | don't try to be too clever here. */ | ||
13 | if (count != 0 || (DEFAULT_ABI != ABI_AIX && flag_pic)) | ||
14 | { | ||
15 | + rtx x; | ||
16 | cfun->machine->ra_needs_full_frame = 1; | ||
17 | |||
18 | - return | ||
19 | - gen_rtx_MEM | ||
20 | - (Pmode, | ||
21 | - memory_address | ||
22 | - (Pmode, | ||
23 | - plus_constant (copy_to_reg | ||
24 | - (gen_rtx_MEM (Pmode, | ||
25 | - memory_address (Pmode, frame))), | ||
26 | - RETURN_ADDRESS_OFFSET))); | ||
27 | + if (count == 0) | ||
28 | + { | ||
29 | + gcc_assert (frame == frame_pointer_rtx); | ||
30 | + x = arg_pointer_rtx; | ||
31 | + } | ||
32 | + else | ||
33 | + { | ||
34 | + x = memory_address (Pmode, frame); | ||
35 | + x = copy_to_reg (gen_rtx_MEM (Pmode, x)); | ||
36 | + } | ||
37 | + | ||
38 | + x = plus_constant (x, RETURN_ADDRESS_OFFSET); | ||
39 | + return gen_rtx_MEM (Pmode, memory_address (Pmode, x)); | ||
40 | } | ||
41 | |||
42 | cfun->machine->ra_need_lr = 1; | ||
43 | --- gcc/testsuite/gcc.dg/20051128-1.c.jj 2005-10-10 11:21:41.096999000 +0200 | ||
44 | +++ gcc/testsuite/gcc.dg/20051128-1.c 2005-11-28 12:30:57.000000000 +0100 | ||
45 | @@ -0,0 +1,41 @@ | ||
46 | +/* { dg-do run } */ | ||
47 | +/* { dg-options "-O2 -fpic" } */ | ||
48 | + | ||
49 | +extern void exit (int); | ||
50 | +extern void abort (void); | ||
51 | + | ||
52 | +int b; | ||
53 | + | ||
54 | +struct A | ||
55 | +{ | ||
56 | + void *pad[147]; | ||
57 | + void *ra, *h; | ||
58 | + long o; | ||
59 | +}; | ||
60 | + | ||
61 | +void | ||
62 | +__attribute__((noinline)) | ||
63 | +foo (struct A *a, void *x) | ||
64 | +{ | ||
65 | + __builtin_memset (a, 0, sizeof (a)); | ||
66 | + if (!b) | ||
67 | + exit (0); | ||
68 | +} | ||
69 | + | ||
70 | +void | ||
71 | +__attribute__((noinline)) | ||
72 | +bar (void) | ||
73 | +{ | ||
74 | + struct A a; | ||
75 | + | ||
76 | + __builtin_unwind_init (); | ||
77 | + foo (&a, __builtin_return_address (0)); | ||
78 | +} | ||
79 | + | ||
80 | +int | ||
81 | +main (void) | ||
82 | +{ | ||
83 | + bar (); | ||
84 | + abort (); | ||
85 | + return 0; | ||
86 | +} | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-pr27898.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-pr27898.patch new file mode 100644 index 0000000000..172bb81171 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-pr27898.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | 2006-08-18 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | PR c/27898 | ||
4 | * gcc.dg/pr27898.c: New test. | ||
5 | |||
6 | --- gcc/testsuite/gcc.dg/pr27898.c.jj 2006-08-18 09:19:33.000000000 +0200 | ||
7 | +++ gcc/testsuite/gcc.dg/pr27898.c 2006-08-18 09:19:27.000000000 +0200 | ||
8 | @@ -0,0 +1,8 @@ | ||
9 | +/* PR c/27898 */ | ||
10 | +/* { dg-do compile } */ | ||
11 | +/* { dg-options "--combine" } */ | ||
12 | +/* { dg-additional-sources "pr27898.c" } */ | ||
13 | + | ||
14 | +union u { struct { int i; }; }; | ||
15 | + | ||
16 | +extern int foo (union u *); | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-pr32139.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-pr32139.patch new file mode 100644 index 0000000000..f35696703d --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-pr32139.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | 2007-06-01 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | PR tree-optimization/32139 | ||
4 | * gcc.c-torture/compile/20070531-1.c: New test. | ||
5 | |||
6 | --- gcc/testsuite/gcc.c-torture/compile/20070531-1.c.jj 2007-05-31 13:47:22.000000000 +0200 | ||
7 | +++ gcc/testsuite/gcc.c-torture/compile/20070531-1.c 2007-06-01 10:57:15.000000000 +0200 | ||
8 | @@ -0,0 +1,11 @@ | ||
9 | +/* PR tree-optimization/32139 */ | ||
10 | +int foo (void); | ||
11 | +int bar (void) __attribute__ ((const)); | ||
12 | + | ||
13 | +int | ||
14 | +test (int x) | ||
15 | +{ | ||
16 | + int a = (x == 10000 ? foo : bar) (); | ||
17 | + int b = (x == 10000 ? foo : bar) (); | ||
18 | + return a + b; | ||
19 | +} | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-pr33763.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-pr33763.patch new file mode 100644 index 0000000000..9e9c90d271 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-pr33763.patch | |||
@@ -0,0 +1,153 @@ | |||
1 | 2007-11-06 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | PR tree-optimization/33763 | ||
4 | * gcc.dg/pr33763.c: New test. | ||
5 | * g++.dg/opt/inline13.C: New test. | ||
6 | |||
7 | 2007-11-06 Jan Hubicka <jh@suse.cz> | ||
8 | |||
9 | PR tree-optimization/33763 | ||
10 | * tree-inline.c (expand_call_inline): Silently ignore always_inline | ||
11 | attribute for redefined extern inline functions. | ||
12 | |||
13 | --- gcc/tree-inline.c.jj 2007-11-06 09:29:04.000000000 +0100 | ||
14 | +++ gcc/tree-inline.c 2007-11-06 16:19:12.000000000 +0100 | ||
15 | @@ -2582,6 +2582,12 @@ expand_call_inline (basic_block bb, tree | ||
16 | if (!cgraph_inline_p (cg_edge, &reason)) | ||
17 | { | ||
18 | if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) | ||
19 | + /* For extern inline functions that get redefined we always | ||
20 | + silently ignored alway_inline flag. Better behaviour would | ||
21 | + be to be able to keep both bodies and use extern inline body | ||
22 | + for inlining, but we can't do that because frontends overwrite | ||
23 | + the body. */ | ||
24 | + && !cg_edge->callee->local.redefined_extern_inline | ||
25 | /* Avoid warnings during early inline pass. */ | ||
26 | && (!flag_unit_at_a_time || cgraph_global_info_ready)) | ||
27 | { | ||
28 | --- gcc/testsuite/gcc.dg/pr33763.c.jj 2007-11-06 16:19:12.000000000 +0100 | ||
29 | +++ gcc/testsuite/gcc.dg/pr33763.c 2007-11-06 16:19:12.000000000 +0100 | ||
30 | @@ -0,0 +1,60 @@ | ||
31 | +/* PR tree-optimization/33763 */ | ||
32 | +/* { dg-do compile } */ | ||
33 | +/* { dg-options "-O2" } */ | ||
34 | + | ||
35 | +typedef struct | ||
36 | +{ | ||
37 | + void *a; | ||
38 | + void *b; | ||
39 | +} T; | ||
40 | +extern void *foo (const char *, const char *); | ||
41 | +extern void *bar (void *, const char *, T); | ||
42 | +extern int baz (const char *, int); | ||
43 | + | ||
44 | +extern inline __attribute__ ((always_inline, gnu_inline)) int | ||
45 | +baz (const char *x, int y) | ||
46 | +{ | ||
47 | + return 2; | ||
48 | +} | ||
49 | + | ||
50 | +int | ||
51 | +baz (const char *x, int y) | ||
52 | +{ | ||
53 | + return 1; | ||
54 | +} | ||
55 | + | ||
56 | +int xa, xb; | ||
57 | + | ||
58 | +static void * | ||
59 | +inl (const char *x, const char *y) | ||
60 | +{ | ||
61 | + T t = { &xa, &xb }; | ||
62 | + int *f = (int *) __builtin_malloc (sizeof (int)); | ||
63 | + const char *z; | ||
64 | + int o = 0; | ||
65 | + void *r = 0; | ||
66 | + | ||
67 | + for (z = y; *z; z++) | ||
68 | + { | ||
69 | + if (*z == 'r') | ||
70 | + o |= 1; | ||
71 | + if (*z == 'w') | ||
72 | + o |= 2; | ||
73 | + } | ||
74 | + if (o == 1) | ||
75 | + *f = baz (x, 0); | ||
76 | + if (o == 2) | ||
77 | + *f = baz (x, 1); | ||
78 | + if (o == 3) | ||
79 | + *f = baz (x, 2); | ||
80 | + | ||
81 | + if (o && *f > 0) | ||
82 | + r = bar (f, "w", t); | ||
83 | + return r; | ||
84 | +} | ||
85 | + | ||
86 | +void * | ||
87 | +foo (const char *x, const char *y) | ||
88 | +{ | ||
89 | + return inl (x, y); | ||
90 | +} | ||
91 | --- gcc/testsuite/g++.dg/opt/inline13.C.jj 2007-11-06 16:20:20.000000000 +0100 | ||
92 | +++ gcc/testsuite/g++.dg/opt/inline13.C 2007-11-06 16:21:30.000000000 +0100 | ||
93 | @@ -0,0 +1,60 @@ | ||
94 | +// PR tree-optimization/33763 | ||
95 | +// { dg-do compile } | ||
96 | +// { dg-options "-O2" } | ||
97 | + | ||
98 | +typedef struct | ||
99 | +{ | ||
100 | + void *a; | ||
101 | + void *b; | ||
102 | +} T; | ||
103 | +extern void *foo (const char *, const char *); | ||
104 | +extern void *bar (void *, const char *, T); | ||
105 | +extern int baz (const char *, int); | ||
106 | + | ||
107 | +extern inline __attribute__ ((always_inline, gnu_inline)) int | ||
108 | +baz (const char *x, int y) | ||
109 | +{ | ||
110 | + return 2; | ||
111 | +} | ||
112 | + | ||
113 | +int | ||
114 | +baz (const char *x, int y) | ||
115 | +{ | ||
116 | + return 1; | ||
117 | +} | ||
118 | + | ||
119 | +int xa, xb; | ||
120 | + | ||
121 | +static void * | ||
122 | +inl (const char *x, const char *y) | ||
123 | +{ | ||
124 | + T t = { &xa, &xb }; | ||
125 | + int *f = (int *) __builtin_malloc (sizeof (int)); | ||
126 | + const char *z; | ||
127 | + int o = 0; | ||
128 | + void *r = 0; | ||
129 | + | ||
130 | + for (z = y; *z; z++) | ||
131 | + { | ||
132 | + if (*z == 'r') | ||
133 | + o |= 1; | ||
134 | + if (*z == 'w') | ||
135 | + o |= 2; | ||
136 | + } | ||
137 | + if (o == 1) | ||
138 | + *f = baz (x, 0); | ||
139 | + if (o == 2) | ||
140 | + *f = baz (x, 1); | ||
141 | + if (o == 3) | ||
142 | + *f = baz (x, 2); | ||
143 | + | ||
144 | + if (o && *f > 0) | ||
145 | + r = bar (f, "w", t); | ||
146 | + return r; | ||
147 | +} | ||
148 | + | ||
149 | +void * | ||
150 | +foo (const char *x, const char *y) | ||
151 | +{ | ||
152 | + return inl (x, y); | ||
153 | +} | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-pr35440.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-pr35440.patch new file mode 100644 index 0000000000..6bf3f0d9d8 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-pr35440.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | 2008-03-19 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | PR c/35440 | ||
4 | * c-pretty-print.c (pp_c_initializer_list): Handle CONSTRUCTOR | ||
5 | for all types. | ||
6 | |||
7 | * gcc.dg/pr35440.c: New test. | ||
8 | |||
9 | --- gcc/c-pretty-print.c.jj 2008-02-11 14:48:12.000000000 +0100 | ||
10 | +++ gcc/c-pretty-print.c 2008-03-19 14:50:09.000000000 +0100 | ||
11 | @@ -1173,6 +1173,12 @@ pp_c_initializer_list (c_pretty_printer | ||
12 | tree type = TREE_TYPE (e); | ||
13 | const enum tree_code code = TREE_CODE (type); | ||
14 | |||
15 | + if (TREE_CODE (e) == CONSTRUCTOR) | ||
16 | + { | ||
17 | + pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e)); | ||
18 | + return; | ||
19 | + } | ||
20 | + | ||
21 | switch (code) | ||
22 | { | ||
23 | case RECORD_TYPE: | ||
24 | @@ -1207,16 +1213,12 @@ pp_c_initializer_list (c_pretty_printer | ||
25 | case VECTOR_TYPE: | ||
26 | if (TREE_CODE (e) == VECTOR_CST) | ||
27 | pp_c_expression_list (pp, TREE_VECTOR_CST_ELTS (e)); | ||
28 | - else if (TREE_CODE (e) == CONSTRUCTOR) | ||
29 | - pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e)); | ||
30 | else | ||
31 | break; | ||
32 | return; | ||
33 | |||
34 | case COMPLEX_TYPE: | ||
35 | - if (TREE_CODE (e) == CONSTRUCTOR) | ||
36 | - pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e)); | ||
37 | - else if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR) | ||
38 | + if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR) | ||
39 | { | ||
40 | const bool cst = TREE_CODE (e) == COMPLEX_CST; | ||
41 | pp_expression (pp, cst ? TREE_REALPART (e) : TREE_OPERAND (e, 0)); | ||
42 | --- gcc/testsuite/gcc.dg/pr35440.c.jj 2008-03-19 15:57:13.000000000 +0100 | ||
43 | +++ gcc/testsuite/gcc.dg/pr35440.c 2008-03-19 15:47:35.000000000 +0100 | ||
44 | @@ -0,0 +1,12 @@ | ||
45 | +/* PR c/35440 */ | ||
46 | +/* { dg-do compile } */ | ||
47 | +/* { dg-options "-std=gnu99" } */ | ||
48 | + | ||
49 | +struct A {}; | ||
50 | +struct B { int i; char j[2]; }; | ||
51 | + | ||
52 | +void foo (void) | ||
53 | +{ | ||
54 | + (struct A){}(); /* { dg-error "called object" } */ | ||
55 | + (struct B){ .i = 2, .j[1] = 1 }(); /* { dg-error "called object" } */ | ||
56 | +} | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-pr35751.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-pr35751.patch new file mode 100644 index 0000000000..37b84275e2 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-pr35751.patch | |||
@@ -0,0 +1,114 @@ | |||
1 | 2008-04-03 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | PR c/35751 | ||
4 | * c-decl.c (finish_decl): If extern or static var has variable | ||
5 | size, set TREE_TYPE (decl) to error_mark_node. | ||
6 | |||
7 | * decl.c (layout_var_decl): If extern or static var has variable | ||
8 | size, set TREE_TYPE (decl) to error_mark_node. | ||
9 | |||
10 | * gcc.dg/gomp/pr35751.c: New test. | ||
11 | * g++.dg/gomp/pr35751.C: New test. | ||
12 | |||
13 | --- gcc/c-decl.c.jj 2008-04-03 09:41:42.000000000 +0200 | ||
14 | +++ gcc/c-decl.c 2008-04-03 18:20:52.000000000 +0200 | ||
15 | @@ -3481,7 +3481,10 @@ finish_decl (tree decl, tree init, tree | ||
16 | if (TREE_CODE (DECL_SIZE (decl)) == INTEGER_CST) | ||
17 | constant_expression_warning (DECL_SIZE (decl)); | ||
18 | else | ||
19 | - error ("storage size of %q+D isn%'t constant", decl); | ||
20 | + { | ||
21 | + error ("storage size of %q+D isn%'t constant", decl); | ||
22 | + TREE_TYPE (decl) = error_mark_node; | ||
23 | + } | ||
24 | } | ||
25 | |||
26 | if (TREE_USED (type)) | ||
27 | --- gcc/cp/decl.c.jj 2008-03-31 23:54:40.000000000 +0200 | ||
28 | +++ gcc/cp/decl.c 2008-04-03 18:30:19.000000000 +0200 | ||
29 | @@ -4442,7 +4442,10 @@ layout_var_decl (tree decl) | ||
30 | if (TREE_CODE (DECL_SIZE (decl)) == INTEGER_CST) | ||
31 | constant_expression_warning (DECL_SIZE (decl)); | ||
32 | else | ||
33 | - error ("storage size of %qD isn't constant", decl); | ||
34 | + { | ||
35 | + error ("storage size of %qD isn't constant", decl); | ||
36 | + TREE_TYPE (decl) = error_mark_node; | ||
37 | + } | ||
38 | } | ||
39 | } | ||
40 | |||
41 | --- gcc/testsuite/gcc.dg/gomp/pr35751.c.jj 2008-04-03 18:26:12.000000000 +0200 | ||
42 | +++ gcc/testsuite/gcc.dg/gomp/pr35751.c 2008-04-03 18:25:51.000000000 +0200 | ||
43 | @@ -0,0 +1,34 @@ | ||
44 | +/* PR c/35751 */ | ||
45 | +/* { dg-do compile } */ | ||
46 | +/* { dg-options "-fopenmp" } */ | ||
47 | + | ||
48 | +void | ||
49 | +foo (int i) | ||
50 | +{ | ||
51 | + extern int a[i]; /* { dg-error "must have no linkage|storage size of" } */ | ||
52 | + static int b[i]; /* { dg-error "storage size of" } */ | ||
53 | + | ||
54 | +#pragma omp parallel | ||
55 | + { | ||
56 | + a[0] = 0; | ||
57 | + b[0] = 0; | ||
58 | + } | ||
59 | + | ||
60 | +#pragma omp parallel shared (a, b) | ||
61 | + { | ||
62 | + a[0] = 0; | ||
63 | + b[0] = 0; | ||
64 | + } | ||
65 | + | ||
66 | +#pragma omp parallel private (a, b) | ||
67 | + { | ||
68 | + a[0] = 0; | ||
69 | + b[0] = 0; | ||
70 | + } | ||
71 | + | ||
72 | +#pragma omp parallel firstprivate (a, b) | ||
73 | + { | ||
74 | + a[0] = 0; | ||
75 | + b[0] = 0; | ||
76 | + } | ||
77 | +} | ||
78 | --- gcc/testsuite/g++.dg/gomp/pr35751.C.jj 2008-04-03 18:32:13.000000000 +0200 | ||
79 | +++ gcc/testsuite/g++.dg/gomp/pr35751.C 2008-04-03 18:32:32.000000000 +0200 | ||
80 | @@ -0,0 +1,34 @@ | ||
81 | +// PR c/35751 | ||
82 | +// { dg-do compile } | ||
83 | +// { dg-options "-fopenmp" } | ||
84 | + | ||
85 | +void | ||
86 | +foo (int i) | ||
87 | +{ | ||
88 | + extern int a[i]; // { dg-error "storage size of" } | ||
89 | + static int b[i]; // { dg-error "storage size of" } | ||
90 | + | ||
91 | +#pragma omp parallel | ||
92 | + { | ||
93 | + a[0] = 0; | ||
94 | + b[0] = 0; | ||
95 | + } | ||
96 | + | ||
97 | +#pragma omp parallel shared (a, b) | ||
98 | + { | ||
99 | + a[0] = 0; | ||
100 | + b[0] = 0; | ||
101 | + } | ||
102 | + | ||
103 | +#pragma omp parallel private (a, b) | ||
104 | + { | ||
105 | + a[0] = 0; | ||
106 | + b[0] = 0; | ||
107 | + } | ||
108 | + | ||
109 | +#pragma omp parallel firstprivate (a, b) | ||
110 | + { | ||
111 | + a[0] = 0; | ||
112 | + b[0] = 0; | ||
113 | + } | ||
114 | +} | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-rh251682.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-rh251682.patch new file mode 100644 index 0000000000..e96ae6f134 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-rh251682.patch | |||
@@ -0,0 +1,89 @@ | |||
1 | 2008-04-01 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | PR pch/13675 | ||
4 | * files.c (struct _cpp_file): Remove pch field. | ||
5 | (pch_open_file): Don't set file->pch, just file->pchname. | ||
6 | (should_stack_file): After pfile->cb.read_pch call | ||
7 | free pchname and clear pchname, don't close file->fd. | ||
8 | Test file->pchname instead of file->pch. Don't close fd after cb. | ||
9 | (_cpp_stack_include): Test file->pchname instead of file->pch. | ||
10 | |||
11 | * c-pch.c (c_common_read_pch): On error close (fd) resp. fclose (f). | ||
12 | |||
13 | --- libcpp/files.c.jj 2008-02-18 23:50:17.000000000 +0100 | ||
14 | +++ libcpp/files.c 2008-03-31 15:59:01.000000000 +0200 | ||
15 | @@ -106,9 +106,6 @@ struct _cpp_file | ||
16 | |||
17 | /* If BUFFER above contains the true contents of the file. */ | ||
18 | bool buffer_valid; | ||
19 | - | ||
20 | - /* File is a PCH (on return from find_include_file). */ | ||
21 | - bool pch; | ||
22 | }; | ||
23 | |||
24 | /* A singly-linked list for all searches for a given file name, with | ||
25 | @@ -322,9 +319,7 @@ pch_open_file (cpp_reader *pfile, _cpp_f | ||
26 | } | ||
27 | closedir (pchdir); | ||
28 | } | ||
29 | - if (valid) | ||
30 | - file->pch = true; | ||
31 | - else | ||
32 | + if (!valid) | ||
33 | *invalid_pch = true; | ||
34 | } | ||
35 | |||
36 | @@ -703,11 +698,12 @@ should_stack_file (cpp_reader *pfile, _c | ||
37 | return false; | ||
38 | |||
39 | /* Handle PCH files immediately; don't stack them. */ | ||
40 | - if (file->pch) | ||
41 | + if (file->pchname) | ||
42 | { | ||
43 | pfile->cb.read_pch (pfile, file->pchname, file->fd, file->path); | ||
44 | - close (file->fd); | ||
45 | file->fd = -1; | ||
46 | + free ((void *) file->pchname); | ||
47 | + file->pchname = NULL; | ||
48 | return false; | ||
49 | } | ||
50 | |||
51 | @@ -916,7 +912,7 @@ _cpp_stack_include (cpp_reader *pfile, c | ||
52 | complicates LAST_SOURCE_LINE_LOCATION. This does not apply if we | ||
53 | found a PCH file (in which case linemap_add is not called) or we | ||
54 | were included from the command-line. */ | ||
55 | - if (! file->pch && file->err_no == 0 && type != IT_CMDLINE) | ||
56 | + if (file->pchname == NULL && file->err_no == 0 && type != IT_CMDLINE) | ||
57 | pfile->line_table->highest_location--; | ||
58 | |||
59 | return _cpp_stack_file (pfile, file, type == IT_IMPORT); | ||
60 | --- gcc/c-pch.c.jj 2008-02-18 23:46:08.000000000 +0100 | ||
61 | +++ gcc/c-pch.c 2008-03-31 15:56:00.000000000 +0200 | ||
62 | @@ -372,6 +372,7 @@ c_common_read_pch (cpp_reader *pfile, co | ||
63 | if (f == NULL) | ||
64 | { | ||
65 | cpp_errno (pfile, CPP_DL_ERROR, "calling fdopen"); | ||
66 | + close (fd); | ||
67 | return; | ||
68 | } | ||
69 | |||
70 | @@ -380,6 +381,7 @@ c_common_read_pch (cpp_reader *pfile, co | ||
71 | if (fread (&h, sizeof (h), 1, f) != 1) | ||
72 | { | ||
73 | cpp_errno (pfile, CPP_DL_ERROR, "reading"); | ||
74 | + fclose (f); | ||
75 | return; | ||
76 | } | ||
77 | |||
78 | @@ -425,7 +427,10 @@ c_common_read_pch (cpp_reader *pfile, co | ||
79 | gt_pch_restore (f); | ||
80 | |||
81 | if (cpp_read_state (pfile, name, f, smd) != 0) | ||
82 | - return; | ||
83 | + { | ||
84 | + fclose (f); | ||
85 | + return; | ||
86 | + } | ||
87 | |||
88 | fclose (f); | ||
89 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-rh330771.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-rh330771.patch new file mode 100644 index 0000000000..c894f83b43 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-rh330771.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | 2007-10-16 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | * Makefile.am (libgcj_tools_la_LIBADD): Add. | ||
4 | * Makefile.in: Regenerated. | ||
5 | |||
6 | --- libjava/Makefile.am.jj 2007-03-17 09:20:30.000000000 +0100 | ||
7 | +++ libjava/Makefile.am 2007-10-16 15:45:14.000000000 +0200 | ||
8 | @@ -262,6 +262,8 @@ EXTRA_libgcj_la_SOURCES = java/lang/Obje | ||
9 | |||
10 | libgcj_tools_la_SOURCES = classpath/tools/tools.zip | ||
11 | libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findirect-dispatch -fno-indirect-classes -fsource-filename=$(here)/classpath/tools/all-classes.lst | ||
12 | +## See jv_convert_LDADD. | ||
13 | +libgcj_tools_la_LIBADD = -L$(here)/.libs libgcj.la | ||
14 | libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \ | ||
15 | -version-info `grep -v '^\#' $(srcdir)/libtool-version` | ||
16 | libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec | ||
17 | --- libjava/Makefile.in.jj 2007-07-04 21:11:11.000000000 +0200 | ||
18 | +++ libjava/Makefile.in 2007-10-16 15:56:07.000000000 +0200 | ||
19 | @@ -146,7 +146,6 @@ am__objects_1 = gnu/gcj/xlib/lib_gnu_awt | ||
20 | am_lib_gnu_awt_xlib_la_OBJECTS = $(am__objects_1) | ||
21 | lib_gnu_awt_xlib_la_OBJECTS = $(am_lib_gnu_awt_xlib_la_OBJECTS) | ||
22 | @XLIB_AWT_TRUE@am_lib_gnu_awt_xlib_la_rpath = -rpath $(toolexeclibdir) | ||
23 | -libgcj_tools_la_LIBADD = | ||
24 | am_libgcj_tools_la_OBJECTS = classpath/tools/libgcj_tools_la-tools.lo | ||
25 | libgcj_tools_la_OBJECTS = $(am_libgcj_tools_la_OBJECTS) | ||
26 | am__DEPENDENCIES_1 = gnu/awt.lo gnu/awt/j2d.lo gnu/classpath.lo \ | ||
27 | @@ -894,6 +893,7 @@ libgcj_la_LINK = $(LIBLINK) | ||
28 | EXTRA_libgcj_la_SOURCES = java/lang/Object.java | ||
29 | libgcj_tools_la_SOURCES = classpath/tools/tools.zip | ||
30 | libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findirect-dispatch -fno-indirect-classes -fsource-filename=$(here)/classpath/tools/all-classes.lst | ||
31 | +libgcj_tools_la_LIBADD = -L$(here)/.libs libgcj.la | ||
32 | libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \ | ||
33 | -version-info `grep -v '^\#' $(srcdir)/libtool-version` | ||
34 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-rh341221.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-rh341221.patch new file mode 100644 index 0000000000..28e73b07c3 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/fedora/gcc43-rh341221.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | 2007-10-21 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | * doc/Makefile.am (POD2MAN): Set date from cp-tools.texinfo | ||
4 | timestamp rather than from current date. | ||
5 | * doc/Makefile.in: Regenerated. | ||
6 | |||
7 | --- libjava/classpath/doc/Makefile.am.jj 2007-12-07 17:55:00.000000000 +0100 | ||
8 | +++ libjava/classpath/doc/Makefile.am 2007-12-07 18:55:28.000000000 +0100 | ||
9 | @@ -30,7 +30,7 @@ TOOLS_MANFILES = \ | ||
10 | gserialver.1 \ | ||
11 | gtnameserv.1 | ||
12 | |||
13 | -POD2MAN = pod2man --center="GNU" --release="$(VERSION)" | ||
14 | +POD2MAN = pod2man --center="GNU" --release="$(VERSION)" --date="$(shell ls --time-style=+%F -l $(srcdir)/cp-tools.texinfo | awk '{print $$6}')" | ||
15 | TEXI2POD = perl $(srcdir)/texi2pod.pl | ||
16 | STAMP = echo timestamp > | ||
17 | |||
18 | --- libjava/classpath/doc/Makefile.in.jj 2007-12-07 17:55:00.000000000 +0100 | ||
19 | +++ libjava/classpath/doc/Makefile.in 2007-12-07 18:55:43.000000000 +0100 | ||
20 | @@ -357,7 +357,7 @@ TOOLS_MANFILES = \ | ||
21 | gserialver.1 \ | ||
22 | gtnameserv.1 | ||
23 | |||
24 | -POD2MAN = pod2man --center="GNU" --release="$(VERSION)" | ||
25 | +POD2MAN = pod2man --center="GNU" --release="$(VERSION)" --date="$(shell ls --time-style=+%F -l $(srcdir)/cp-tools.texinfo | awk '{print $$6}')" | ||
26 | TEXI2POD = perl $(srcdir)/texi2pod.pl | ||
27 | STAMP = echo timestamp > | ||
28 | @GENINSRC_FALSE@STAMP_GENINSRC = | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/fortran-cross-compile-hack.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/fortran-cross-compile-hack.patch new file mode 100644 index 0000000000..b3d38ad983 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/fortran-cross-compile-hack.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | * Fortran would have searched for arm-angstrom-gnueabi-gfortran but would have used | ||
2 | used gfortan. For gcc_4.2.2.bb we want to use the gfortran compiler from our cross | ||
3 | directory. | ||
4 | |||
5 | diff --git a/libgfortran/configure b/libgfortran/configure | ||
6 | index f7d86fb..d0966ec 100755 | ||
7 | --- a/libgfortran/configure | ||
8 | +++ b/libgfortran/configure | ||
9 | @@ -4475,6 +4475,6 @@ exec 5>>./config.log | ||
10 | |||
11 | # We need gfortran to compile parts of the library | ||
12 | #AC_PROG_FC(gfortran) | ||
13 | -FC="$GFORTRAN" | ||
14 | +#FC="$GFORTRAN" | ||
15 | ac_ext=${FC_SRCEXT-f} | ||
16 | ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5' | ||
17 | \ No newline at end of file | ||
18 | diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac | ||
19 | index 4661306..9f83e55 100644 | ||
20 | --- a/libgfortran/configure.ac | ||
21 | +++ b/libgfortran/configure.ac | ||
22 | @@ -140,7 +140,7 @@ AC_SUBST(enable_static) | ||
23 | |||
24 | # We need gfortran to compile parts of the library | ||
25 | #AC_PROG_FC(gfortran) | ||
26 | -FC="$GFORTRAN" | ||
27 | +#FC="$GFORTRAN" | ||
28 | AC_PROG_FC(gfortran) | ||
29 | |||
30 | # extra LD Flags which are required for targets | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/fortran-static-linking.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/fortran-static-linking.patch new file mode 100644 index 0000000000..3dd6321dc3 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/fortran-static-linking.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | f951 (fortran) links to MPFR and GMP of our staging area but when executing | ||
2 | the command the libs can not be found. Use rpath like all the other apps in | ||
3 | our staging bin/ directory. | ||
4 | |||
5 | Patch the configure to avoid the regeneration... | ||
6 | |||
7 | Index: gcc-4.2.2/configure | ||
8 | =================================================================== | ||
9 | --- gcc-4.2.2.orig/configure 2008-01-15 23:23:41.000000000 +0100 | ||
10 | +++ gcc-4.2.2/configure 2008-01-15 23:25:20.000000000 +0100 | ||
11 | @@ -2278,14 +2278,14 @@ | ||
12 | |||
13 | |||
14 | if test "x$with_mpfr" != x; then | ||
15 | - gmplibs="-L$with_mpfr/lib $gmplibs" | ||
16 | + gmplibs="-static -L$with_mpfr/lib $gmplibs" | ||
17 | gmpinc="-I$with_mpfr/include" | ||
18 | fi | ||
19 | if test "x$with_mpfr_include" != x; then | ||
20 | gmpinc="-I$with_mpfr_include" | ||
21 | fi | ||
22 | if test "x$with_mpfr_lib" != x; then | ||
23 | - gmplibs="-L$with_mpfr_lib $gmplibs" | ||
24 | + gmplibs="-static -L$with_mpfr_lib $gmplibs" | ||
25 | fi | ||
26 | |||
27 | # Specify a location for gmp | ||
28 | Index: gcc-4.2.2/configure.in | ||
29 | =================================================================== | ||
30 | --- gcc-4.2.2.orig/configure.in 2008-01-15 23:23:41.000000000 +0100 | ||
31 | +++ gcc-4.2.2/configure.in 2008-01-15 23:24:36.000000000 +0100 | ||
32 | @@ -1066,14 +1066,14 @@ | ||
33 | AC_ARG_WITH(mpfr_lib, [ --with-mpfr-lib=PATH Specify the directory for the installed MPFR library]) | ||
34 | |||
35 | if test "x$with_mpfr" != x; then | ||
36 | - gmplibs="-L$with_mpfr/lib $gmplibs" | ||
37 | + gmplibs="-static -L$with_mpfr/lib $gmplibs" | ||
38 | gmpinc="-I$with_mpfr/include" | ||
39 | fi | ||
40 | if test "x$with_mpfr_include" != x; then | ||
41 | gmpinc="-I$with_mpfr_include" | ||
42 | fi | ||
43 | if test "x$with_mpfr_lib" != x; then | ||
44 | - gmplibs="-L$with_mpfr_lib $gmplibs" | ||
45 | + gmplibs="-static -L$with_mpfr_lib $gmplibs" | ||
46 | fi | ||
47 | |||
48 | # Specify a location for gmp | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-4.0.2-e300c2c3.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-4.0.2-e300c2c3.patch new file mode 100644 index 0000000000..d1df8b2716 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-4.0.2-e300c2c3.patch | |||
@@ -0,0 +1,319 @@ | |||
1 | Adds support for Freescale Power architecture e300c2 and e300c3 cores. | ||
2 | http://www.bitshrine.org/gpp/tc-fsl-x86lnx-e300c3-nptl-4.0.2-2.src.rpm | ||
3 | |||
4 | Leon Woestenberg <leonw@mailcan.com> | ||
5 | |||
6 | --- | ||
7 | gcc/config.gcc | 2 | ||
8 | gcc/config/rs6000/e300c2c3.md | 189 ++++++++++++++++++++++++++++++++++++++++++ | ||
9 | gcc/config/rs6000/rs6000.c | 24 +++++ | ||
10 | gcc/config/rs6000/rs6000.h | 4 | ||
11 | gcc/config/rs6000/rs6000.md | 3 | ||
12 | 5 files changed, 220 insertions(+), 2 deletions(-) | ||
13 | |||
14 | Index: gcc-4.3.1/gcc/config/rs6000/e300c2c3.md | ||
15 | =================================================================== | ||
16 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
17 | +++ gcc-4.3.1/gcc/config/rs6000/e300c2c3.md 2008-08-23 16:51:33.000000000 -0700 | ||
18 | @@ -0,0 +1,189 @@ | ||
19 | +;; Pipeline description for Motorola PowerPC e300c3 core. | ||
20 | +;; Copyright (C) 2003 Free Software Foundation, Inc. | ||
21 | +;; | ||
22 | +;; This file is part of GCC. | ||
23 | + | ||
24 | +;; GCC is free software; you can redistribute it and/or modify it | ||
25 | +;; under the terms of the GNU General Public License as published | ||
26 | +;; by the Free Software Foundation; either version 2, or (at your | ||
27 | +;; option) any later version. | ||
28 | + | ||
29 | +;; GCC is distributed in the hope that it will be useful, but WITHOUT | ||
30 | +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
31 | +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public | ||
32 | +;; License for more details. | ||
33 | + | ||
34 | +;; You should have received a copy of the GNU General Public License | ||
35 | +;; along with GCC; see the file COPYING. If not, write to the | ||
36 | +;; Free Software Foundation, 59 Temple Place - Suite 330, Boston, | ||
37 | +;; MA 02111-1307, USA. | ||
38 | + | ||
39 | +(define_automaton "ppce300c3_most,ppce300c3_long,ppce300c3_retire") | ||
40 | +(define_cpu_unit "ppce300c3_decode_0,ppce300c3_decode_1" "ppce300c3_most") | ||
41 | + | ||
42 | +;; We don't simulate general issue queue (GIC). If we have SU insn | ||
43 | +;; and then SU1 insn, they can not be issued on the same cycle | ||
44 | +;; (although SU1 insn and then SU insn can be issued) because the SU | ||
45 | +;; insn will go to SU1 from GIC0 entry. Fortunately, the first cycle | ||
46 | +;; multipass insn scheduling will find the situation and issue the SU1 | ||
47 | +;; insn and then the SU insn. | ||
48 | +(define_cpu_unit "ppce300c3_issue_0,ppce300c3_issue_1" "ppce300c3_most") | ||
49 | + | ||
50 | +;; We could describe completion buffers slots in combination with the | ||
51 | +;; retirement units and the order of completion but the result | ||
52 | +;; automaton would behave in the same way because we can not describe | ||
53 | +;; real latency time with taking in order completion into account. | ||
54 | +;; Actually we could define the real latency time by querying reserved | ||
55 | +;; automaton units but the current scheduler uses latency time before | ||
56 | +;; issuing insns and making any reservations. | ||
57 | +;; | ||
58 | +;; So our description is aimed to achieve a insn schedule in which the | ||
59 | +;; insns would not wait in the completion buffer. | ||
60 | +(define_cpu_unit "ppce300c3_retire_0,ppce300c3_retire_1" "ppce300c3_retire") | ||
61 | + | ||
62 | +;; Branch unit: | ||
63 | +(define_cpu_unit "ppce300c3_bu" "ppce300c3_most") | ||
64 | + | ||
65 | +;; IU: | ||
66 | +(define_cpu_unit "ppce300c3_iu0_stage0,ppce300c3_iu1_stage0" "ppce300c3_most") | ||
67 | + | ||
68 | +;; IU: This used to describe non-pipelined division. | ||
69 | +(define_cpu_unit "ppce300c3_mu_div" "ppce300c3_long") | ||
70 | + | ||
71 | +;; SRU: | ||
72 | +(define_cpu_unit "ppce300c3_sru_stage0" "ppce300c3_most") | ||
73 | + | ||
74 | +;; Here we simplified LSU unit description not describing the stages. | ||
75 | +(define_cpu_unit "ppce300c3_lsu" "ppce300c3_most") | ||
76 | + | ||
77 | +;; FPU: | ||
78 | +(define_cpu_unit "ppce300c3_fpu" "ppce300c3_most") | ||
79 | + | ||
80 | +;; The following units are used to make automata deterministic | ||
81 | +(define_cpu_unit "present_ppce300c3_decode_0" "ppce300c3_most") | ||
82 | +(define_cpu_unit "present_ppce300c3_issue_0" "ppce300c3_most") | ||
83 | +(define_cpu_unit "present_ppce300c3_retire_0" "ppce300c3_retire") | ||
84 | +(define_cpu_unit "present_ppce300c3_iu0_stage0" "ppce300c3_most") | ||
85 | + | ||
86 | +;; The following sets to make automata deterministic when option ndfa is used. | ||
87 | +(presence_set "present_ppce300c3_decode_0" "ppce300c3_decode_0") | ||
88 | +(presence_set "present_ppce300c3_issue_0" "ppce300c3_issue_0") | ||
89 | +(presence_set "present_ppce300c3_retire_0" "ppce300c3_retire_0") | ||
90 | +(presence_set "present_ppce300c3_iu0_stage0" "ppce300c3_iu0_stage0") | ||
91 | + | ||
92 | +;; Some useful abbreviations. | ||
93 | +(define_reservation "ppce300c3_decode" | ||
94 | + "ppce300c3_decode_0|ppce300c3_decode_1+present_ppce300c3_decode_0") | ||
95 | +(define_reservation "ppce300c3_issue" | ||
96 | + "ppce300c3_issue_0|ppce300c3_issue_1+present_ppce300c3_issue_0") | ||
97 | +(define_reservation "ppce300c3_retire" | ||
98 | + "ppce300c3_retire_0|ppce300c3_retire_1+present_ppce300c3_retire_0") | ||
99 | +(define_reservation "ppce300c3_iu_stage0" | ||
100 | + "ppce300c3_iu0_stage0|ppce300c3_iu1_stage0+present_ppce300c3_iu0_stage0") | ||
101 | + | ||
102 | +;; Compares can be executed either one of the IU or SRU | ||
103 | +(define_insn_reservation "ppce300c3_cmp" 1 | ||
104 | + (and (eq_attr "type" "cmp,compare,delayed_compare,fast_compare") | ||
105 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
106 | + "ppce300c3_decode,ppce300c3_issue+(ppce300c3_iu_stage0|ppce300c3_sru_stage0) \ | ||
107 | + +ppce300c3_retire") | ||
108 | + | ||
109 | +;; Other one cycle IU insns | ||
110 | +(define_insn_reservation "ppce300c3_iu" 1 | ||
111 | + (and (eq_attr "type" "integer,insert_word") | ||
112 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
113 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_iu_stage0+ppce300c3_retire") | ||
114 | + | ||
115 | +;; Branch. Actually this latency time is not used by the scheduler. | ||
116 | +(define_insn_reservation "ppce300c3_branch" 1 | ||
117 | + (and (eq_attr "type" "jmpreg,branch") | ||
118 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
119 | + "ppce300c3_decode,ppce300c3_bu,ppce300c3_retire") | ||
120 | + | ||
121 | +;; Multiply is non-pipelined but can be executed in any IU | ||
122 | +(define_insn_reservation "ppce300c3_multiply" 2 | ||
123 | + (and (eq_attr "type" "imul,imul2,imul3,imul_compare") | ||
124 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
125 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_iu_stage0, \ | ||
126 | + ppce300c3_iu_stage0+ppce300c3_retire") | ||
127 | + | ||
128 | +;; Divide. We use the average latency time here. We omit reserving a | ||
129 | +;; retire unit because of the result automata will be huge. | ||
130 | +(define_insn_reservation "ppce300c3_divide" 20 | ||
131 | + (and (eq_attr "type" "idiv") | ||
132 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
133 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_iu_stage0+ppce300c3_mu_div,\ | ||
134 | + ppce300c3_mu_div*19") | ||
135 | + | ||
136 | +;; CR logical | ||
137 | +(define_insn_reservation "ppce300c3_cr_logical" 1 | ||
138 | + (and (eq_attr "type" "cr_logical,delayed_cr") | ||
139 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
140 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_sru_stage0+ppce300c3_retire") | ||
141 | + | ||
142 | +;; Mfcr | ||
143 | +(define_insn_reservation "ppce300c3_mfcr" 1 | ||
144 | + (and (eq_attr "type" "mfcr") | ||
145 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
146 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_sru_stage0+ppce300c3_retire") | ||
147 | + | ||
148 | +;; Mtcrf | ||
149 | +(define_insn_reservation "ppce300c3_mtcrf" 1 | ||
150 | + (and (eq_attr "type" "mtcr") | ||
151 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
152 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_sru_stage0+ppce300c3_retire") | ||
153 | + | ||
154 | +;; Mtjmpr | ||
155 | +(define_insn_reservation "ppce300c3_mtjmpr" 1 | ||
156 | + (and (eq_attr "type" "mtjmpr,mfjmpr") | ||
157 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
158 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_sru_stage0+ppce300c3_retire") | ||
159 | + | ||
160 | +;; Float point instructions | ||
161 | +(define_insn_reservation "ppce300c3_fpcompare" 3 | ||
162 | + (and (eq_attr "type" "fpcompare") | ||
163 | + (eq_attr "cpu" "ppce300c3")) | ||
164 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,nothing,ppce300c3_retire") | ||
165 | + | ||
166 | +(define_insn_reservation "ppce300c3_fp" 3 | ||
167 | + (and (eq_attr "type" "fp") | ||
168 | + (eq_attr "cpu" "ppce300c3")) | ||
169 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,nothing,ppce300c3_retire") | ||
170 | + | ||
171 | +(define_insn_reservation "ppce300c3_dmul" 4 | ||
172 | + (and (eq_attr "type" "dmul") | ||
173 | + (eq_attr "cpu" "ppce300c3")) | ||
174 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,ppce300c3_fpu,nothing,ppce300c3_retire") | ||
175 | + | ||
176 | +; Divides are not pipelined | ||
177 | +(define_insn_reservation "ppce300c3_sdiv" 18 | ||
178 | + (and (eq_attr "type" "sdiv") | ||
179 | + (eq_attr "cpu" "ppce300c3")) | ||
180 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,ppce300c3_fpu*17") | ||
181 | + | ||
182 | +(define_insn_reservation "ppce300c3_ddiv" 33 | ||
183 | + (and (eq_attr "type" "ddiv") | ||
184 | + (eq_attr "cpu" "ppce300c3")) | ||
185 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,ppce300c3_fpu*32") | ||
186 | + | ||
187 | +;; Loads | ||
188 | +(define_insn_reservation "ppce300c3_load" 2 | ||
189 | + (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u") | ||
190 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
191 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_lsu,ppce300c3_retire") | ||
192 | + | ||
193 | +(define_insn_reservation "ppce300c3_fpload" 2 | ||
194 | + (and (eq_attr "type" "fpload,fpload_ux,fpload_u") | ||
195 | + (eq_attr "cpu" "ppce300c3")) | ||
196 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_lsu,ppce300c3_retire") | ||
197 | + | ||
198 | +;; Stores. | ||
199 | +(define_insn_reservation "ppce300c3_store" 2 | ||
200 | + (and (eq_attr "type" "store,store_ux,store_u") | ||
201 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
202 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_lsu,ppce300c3_retire") | ||
203 | + | ||
204 | +(define_insn_reservation "ppce300c3_fpstore" 2 | ||
205 | + (and (eq_attr "type" "fpstore,fpstore_ux,fpstore_u") | ||
206 | + (eq_attr "cpu" "ppce300c3")) | ||
207 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_lsu,ppce300c3_retire") | ||
208 | Index: gcc-4.3.1/gcc/config/rs6000/rs6000.c | ||
209 | =================================================================== | ||
210 | --- gcc-4.3.1.orig/gcc/config/rs6000/rs6000.c 2008-08-23 16:49:39.000000000 -0700 | ||
211 | +++ gcc-4.3.1/gcc/config/rs6000/rs6000.c 2008-08-23 16:54:25.000000000 -0700 | ||
212 | @@ -669,6 +669,21 @@ struct processor_costs ppc8540_cost = { | ||
213 | 1, /* prefetch streams /*/ | ||
214 | }; | ||
215 | |||
216 | +/* Instruction costs on E300C2 and E300C3 cores. */ | ||
217 | +static const | ||
218 | +struct processor_costs ppce300c2c3_cost = { | ||
219 | + COSTS_N_INSNS (4), /* mulsi */ | ||
220 | + COSTS_N_INSNS (4), /* mulsi_const */ | ||
221 | + COSTS_N_INSNS (4), /* mulsi_const9 */ | ||
222 | + COSTS_N_INSNS (4), /* muldi */ | ||
223 | + COSTS_N_INSNS (19), /* divsi */ | ||
224 | + COSTS_N_INSNS (19), /* divdi */ | ||
225 | + COSTS_N_INSNS (3), /* fp */ | ||
226 | + COSTS_N_INSNS (4), /* dmul */ | ||
227 | + COSTS_N_INSNS (18), /* sdiv */ | ||
228 | + COSTS_N_INSNS (33), /* ddiv */ | ||
229 | +}; | ||
230 | + | ||
231 | /* Instruction costs on POWER4 and POWER5 processors. */ | ||
232 | static const | ||
233 | struct processor_costs power4_cost = { | ||
234 | @@ -1420,6 +1435,8 @@ rs6000_override_options (const char *def | ||
235 | {"8540", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_STRICT_ALIGN}, | ||
236 | /* 8548 has a dummy entry for now. */ | ||
237 | {"8548", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_STRICT_ALIGN}, | ||
238 | + {"e300c2", PROCESSOR_PPCE300C2, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, | ||
239 | + {"e300c3", PROCESSOR_PPCE300C3, POWERPC_BASE_MASK}, | ||
240 | {"860", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, | ||
241 | {"970", PROCESSOR_POWER4, | ||
242 | POWERPC_7400_MASK | MASK_PPC_GPOPT | MASK_MFCRF | MASK_POWERPC64}, | ||
243 | @@ -1845,6 +1862,11 @@ rs6000_override_options (const char *def | ||
244 | rs6000_cost = &ppc8540_cost; | ||
245 | break; | ||
246 | |||
247 | + case PROCESSOR_PPCE300C2: | ||
248 | + case PROCESSOR_PPCE300C3: | ||
249 | + rs6000_cost = &ppce300c2c3_cost; | ||
250 | + break; | ||
251 | + | ||
252 | case PROCESSOR_POWER4: | ||
253 | case PROCESSOR_POWER5: | ||
254 | rs6000_cost = &power4_cost; | ||
255 | @@ -18606,6 +18628,8 @@ rs6000_issue_rate (void) | ||
256 | case CPU_PPC7400: | ||
257 | case CPU_PPC8540: | ||
258 | case CPU_CELL: | ||
259 | + case CPU_PPCE300C2: | ||
260 | + case CPU_PPCE300C3: | ||
261 | return 2; | ||
262 | case CPU_RIOS2: | ||
263 | case CPU_PPC604: | ||
264 | Index: gcc-4.3.1/gcc/config/rs6000/rs6000.h | ||
265 | =================================================================== | ||
266 | --- gcc-4.3.1.orig/gcc/config/rs6000/rs6000.h 2008-01-26 09:18:35.000000000 -0800 | ||
267 | +++ gcc-4.3.1/gcc/config/rs6000/rs6000.h 2008-08-23 16:55:30.000000000 -0700 | ||
268 | @@ -117,6 +117,8 @@ | ||
269 | %{mcpu=G5: -mpower4 -maltivec} \ | ||
270 | %{mcpu=8540: -me500} \ | ||
271 | %{mcpu=8548: -me500} \ | ||
272 | +%{mcpu=e300c2: -mppc} \ | ||
273 | +%{mcpu=e300c3: -mppc -mpmr} \ | ||
274 | %{maltivec: -maltivec} \ | ||
275 | -many" | ||
276 | |||
277 | @@ -262,6 +264,8 @@ enum processor_type | ||
278 | PROCESSOR_PPC7400, | ||
279 | PROCESSOR_PPC7450, | ||
280 | PROCESSOR_PPC8540, | ||
281 | + PROCESSOR_PPCE300C2, | ||
282 | + PROCESSOR_PPCE300C3, | ||
283 | PROCESSOR_POWER4, | ||
284 | PROCESSOR_POWER5, | ||
285 | PROCESSOR_POWER6, | ||
286 | Index: gcc-4.3.1/gcc/config/rs6000/rs6000.md | ||
287 | =================================================================== | ||
288 | --- gcc-4.3.1.orig/gcc/config/rs6000/rs6000.md 2008-02-13 16:14:45.000000000 -0800 | ||
289 | +++ gcc-4.3.1/gcc/config/rs6000/rs6000.md 2008-08-23 16:57:29.000000000 -0700 | ||
290 | @@ -133,7 +133,7 @@ | ||
291 | ;; Processor type -- this attribute must exactly match the processor_type | ||
292 | ;; enumeration in rs6000.h. | ||
293 | |||
294 | -(define_attr "cpu" "rios1,rios2,rs64a,mpccore,ppc403,ppc405,ppc440,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450,ppc8540,power4,power5,power6,cell" | ||
295 | +(define_attr "cpu" "rios1,rios2,rs64a,mpccore,ppc403,ppc405,ppc440,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450,ppc8540,power4,power5,power6,cell,ppce300c2,ppce300c3" | ||
296 | (const (symbol_ref "rs6000_cpu_attr"))) | ||
297 | |||
298 | |||
299 | @@ -166,6 +166,7 @@ | ||
300 | (include "7xx.md") | ||
301 | (include "7450.md") | ||
302 | (include "8540.md") | ||
303 | +(include "e300c2c3.md") | ||
304 | (include "power4.md") | ||
305 | (include "power5.md") | ||
306 | (include "power6.md") | ||
307 | Index: gcc-4.3.1/gcc/config.gcc | ||
308 | =================================================================== | ||
309 | --- gcc-4.3.1.orig/gcc/config.gcc 2008-08-23 16:49:43.000000000 -0700 | ||
310 | +++ gcc-4.3.1/gcc/config.gcc 2008-08-23 17:03:55.000000000 -0700 | ||
311 | @@ -3144,7 +3144,7 @@ case "${target}" in | ||
312 | | rios | rios1 | rios2 | rsc | rsc1 | rs64a \ | ||
313 | | 401 | 403 | 405 | 405fp | 440 | 440fp | 505 \ | ||
314 | | 601 | 602 | 603 | 603e | ec603e | 604 \ | ||
315 | - | 604e | 620 | 630 | 740 | 750 | 7400 | 7450 \ | ||
316 | + | 604e | 620 | 630 | 740 | 750 | 7400 | 7450 | e300c[23] \ | ||
317 | | 854[08] | 801 | 821 | 823 | 860 | 970 | G3 | G4 | G5 | cell) | ||
318 | # OK | ||
319 | ;; | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-4.2.3-linux-multilib-fix.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-4.2.3-linux-multilib-fix.patch new file mode 100644 index 0000000000..81522a8f57 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-4.2.3-linux-multilib-fix.patch | |||
@@ -0,0 +1,23 @@ | |||
1 | Change gcc build : Enable m4 and m4-nofpu (needed for kernel) for sh4-gnu-linux | ||
2 | |||
3 | Signed-off-by: Carl Shaw <carl.shaw@st.com> | ||
4 | |||
5 | Index: gcc/gcc/config.gcc | ||
6 | =================================================================== | ||
7 | --- gcc.orig/gcc/config.gcc 2008-07-18 10:37:54.000000000 +0100 | ||
8 | +++ gcc/gcc/config.gcc 2008-07-18 11:00:42.000000000 +0100 | ||
9 | @@ -2097,11 +2097,12 @@ | ||
10 | if test x${sh_multilibs} = x ; then | ||
11 | case ${target} in | ||
12 | sh64-superh-linux* | \ | ||
13 | - sh[1234]*) sh_multilibs=${sh_cpu_target} ;; | ||
14 | sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;; | ||
15 | - sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;; | ||
16 | + sh-superh-* | \ | ||
17 | + sh4-*-linux*) sh_multilibs=m4,m4-nofpu ;; | ||
18 | sh*-*-linux*) sh_multilibs=m1,m3e,m4 ;; | ||
19 | sh*-*-netbsd*) sh_multilibs=m3,m3e,m4 ;; | ||
20 | + sh[1234]*) sh_multilibs=${sh_cpu_target} ;; | ||
21 | *) sh_multilibs=m1,m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single ;; | ||
22 | esac | ||
23 | if test x$with_fp = xno; then | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch new file mode 100644 index 0000000000..f33e6c1ea6 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | --- | ||
2 | configure | 2 +- | ||
3 | configure.ac | 2 +- | ||
4 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
5 | |||
6 | Index: gcc-4.3.1/configure.ac | ||
7 | =================================================================== | ||
8 | --- gcc-4.3.1.orig/configure.ac 2008-07-21 12:29:18.000000000 -0700 | ||
9 | +++ gcc-4.3.1/configure.ac 2008-07-21 12:29:35.000000000 -0700 | ||
10 | @@ -2352,7 +2352,7 @@ fi | ||
11 | # for target_alias and gcc doesn't manage it consistently. | ||
12 | target_configargs="--cache-file=./config.cache ${target_configargs}" | ||
13 | |||
14 | -FLAGS_FOR_TARGET= | ||
15 | +FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET" | ||
16 | case " $target_configdirs " in | ||
17 | *" newlib "*) | ||
18 | case " $target_configargs " in | ||
19 | Index: gcc-4.3.1/configure | ||
20 | =================================================================== | ||
21 | --- gcc-4.3.1.orig/configure 2008-07-21 12:29:48.000000000 -0700 | ||
22 | +++ gcc-4.3.1/configure 2008-07-21 12:29:59.000000000 -0700 | ||
23 | @@ -5841,7 +5841,7 @@ fi | ||
24 | # for target_alias and gcc doesn't manage it consistently. | ||
25 | target_configargs="--cache-file=./config.cache ${target_configargs}" | ||
26 | |||
27 | -FLAGS_FOR_TARGET= | ||
28 | +FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET" | ||
29 | case " $target_configdirs " in | ||
30 | *" newlib "*) | ||
31 | case " $target_configargs " in | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch new file mode 100644 index 0000000000..1d3936bc39 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch | |||
@@ -0,0 +1,6691 @@ | |||
1 | Before committing, I noticed that PR/32161 was marked as a dup of PR/32009, but my previous patch did not fix it. | ||
2 | |||
3 | This alternative patch is better because it lets you just use CFLAGS_FOR_TARGET to set the compilation flags for libgcc. Since bootstrapped target libraries are never compiled with the native compiler, it makes little sense to use different flags for stage1 and later stages. And it also makes little sense to use a different variable than CFLAGS_FOR_TARGET. | ||
4 | |||
5 | Other changes I had to do include: | ||
6 | |||
7 | - moving the creation of default CFLAGS_FOR_TARGET from Makefile.am to configure.ac, because otherwise the BOOT_CFLAGS are substituted into CFLAGS_FOR_TARGET (which is "-O2 -g $(CFLAGS)") via $(CFLAGS). It is also cleaner this way though. | ||
8 | |||
9 | - passing the right CFLAGS to configure scripts as exported environment variables | ||
10 | |||
11 | I also stopped passing LIBCFLAGS to configure scripts since they are unused in the whole src tree. And I updated the documentation as H-P reminded me to do. | ||
12 | |||
13 | Bootstrapped/regtested i686-pc-linux-gnu, will commit to 4.4 shortly. Ok for 4.3? | ||
14 | |||
15 | Paolo | ||
16 | |||
17 | 2008-02-19 Paolo Bonzini <bonzini@gnu.org> | ||
18 | |||
19 | PR bootstrap/32009 | ||
20 | PR bootstrap/32161 | ||
21 | |||
22 | * configure.ac (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Compute here. | ||
23 | * configure: Regenerate. | ||
24 | |||
25 | * Makefile.def: Define stage_libcflags for all bootstrap stages. | ||
26 | * Makefile.tpl (BOOT_LIBCFLAGS, STAGE2_LIBCFLAGS, STAGE3_LIBCFLAGS, | ||
27 | STAGE4_LIBCFLAGS): New. | ||
28 | (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Subst from autoconf, without | ||
29 | $(SYSROOT_CFLAGS_FOR_TARGET) and $(DEBUG_PREFIX_CFLAGS_FOR_TARGET). | ||
30 | (BASE_TARGET_EXPORTS): Append them here to C{,XX}FLAGS. | ||
31 | (EXTRA_TARGET_FLAGS): Append them here to {LIB,}C{,XX}FLAGS. | ||
32 | (configure-stage[+id+]-[+prefix+][+module+]): Pass stage_libcflags | ||
33 | for target modules. Don't export LIBCFLAGS. | ||
34 | (all-stage[+id+]-[+prefix+][+module+]): Pass stage_libcflags; pass | ||
35 | $(BASE_FLAGS_TO_PASS) where [+args+] was passed, and [+args+] after | ||
36 | the overridden CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET. | ||
37 | (invocations of `all'): Replace $(TARGET_FLAGS_TO_PASS) with | ||
38 | $(EXTRA_TARGET_FLAGS), $(FLAGS_TO_PASS) with $(EXTRA_HOST_FLAGS). | ||
39 | * Makefile.in: Regenerate. | ||
40 | |||
41 | config: | ||
42 | 2008-02-19 Paolo Bonzini <bonzini@gnu.org> | ||
43 | |||
44 | PR bootstrap/32009 | ||
45 | * mh-ppc-darwin (BOOT_CFLAGS): Reenable. | ||
46 | |||
47 | gcc: | ||
48 | 2008-02-19 Paolo Bonzini <bonzini@gnu.org> | ||
49 | |||
50 | PR bootstrap/32009 | ||
51 | * doc/install.texi: Correct references to CFLAGS, replacing them | ||
52 | with BOOT_CFLAGS. Document flags used during bootstrap for | ||
53 | target libraries. | ||
54 | |||
55 | |||
56 | --- | ||
57 | Makefile.def | 25 | ||
58 | Makefile.in | 1845 ++++++++++++++++++++++++++++++------------------- | ||
59 | Makefile.tpl | 91 +- | ||
60 | config/mh-ppc-darwin | 3 | ||
61 | configure | 36 | ||
62 | configure.ac | 32 | ||
63 | gcc/Makefile.in | 2 | ||
64 | gcc/configure | 6 | ||
65 | gcc/configure.ac | 3 | ||
66 | gcc/doc/install.texi | 56 - | ||
67 | libiberty/Makefile.in | 162 ++-- | ||
68 | libiberty/configure | 46 - | ||
69 | libiberty/configure.ac | 43 - | ||
70 | 13 files changed, 1454 insertions(+), 896 deletions(-) | ||
71 | |||
72 | Index: gcc-4.3.3/configure.ac | ||
73 | =================================================================== | ||
74 | --- gcc-4.3.3.orig/configure.ac 2008-02-01 20:29:30.000000000 -0700 | ||
75 | +++ gcc-4.3.3/configure.ac 2009-04-29 18:03:50.025603468 -0700 | ||
76 | @@ -1667,6 +1667,38 @@ | ||
77 | [DEBUG_PREFIX_CFLAGS_FOR_TARGET=]) | ||
78 | AC_SUBST(DEBUG_PREFIX_CFLAGS_FOR_TARGET) | ||
79 | |||
80 | +# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS | ||
81 | +# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS | ||
82 | +# might also be empty (or "-g", if a non-GCC C++ compiler is in the path). | ||
83 | +# We want to ensure that TARGET libraries (which we know are built with | ||
84 | +# gcc) are built with "-O2 -g", so include those options when setting | ||
85 | +# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET. | ||
86 | +if test "x$CFLAGS_FOR_TARGET" = x; then | ||
87 | + CFLAGS_FOR_TARGET=$CFLAGS | ||
88 | + case " $CFLAGS " in | ||
89 | + *" -O2 "*) ;; | ||
90 | + *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;; | ||
91 | + esac | ||
92 | + case " $CFLAGS " in | ||
93 | + *" -g "* | *" -g3 "*) ;; | ||
94 | + *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;; | ||
95 | + esac | ||
96 | +fi | ||
97 | +AC_SUBST(CFLAGS_FOR_TARGET) | ||
98 | + | ||
99 | +if test "x$CXXFLAGS_FOR_TARGET" = x; then | ||
100 | + CXXFLAGS_FOR_TARGET=$CXXFLAGS | ||
101 | + case " $CXXFLAGS " in | ||
102 | + *" -O2 "*) ;; | ||
103 | + *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS" ;; | ||
104 | + esac | ||
105 | + case " $CXXFLAGS " in | ||
106 | + *" -g "* | *" -g3 "*) ;; | ||
107 | + *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;; | ||
108 | + esac | ||
109 | +fi | ||
110 | +AC_SUBST(CXXFLAGS_FOR_TARGET) | ||
111 | + | ||
112 | # Handle --with-headers=XXX. If the value is not "yes", the contents of | ||
113 | # the named directory are copied to $(tooldir)/sys-include. | ||
114 | if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then | ||
115 | Index: gcc-4.3.3/Makefile.def | ||
116 | =================================================================== | ||
117 | --- gcc-4.3.3.orig/Makefile.def 2007-10-23 08:53:18.000000000 -0700 | ||
118 | +++ gcc-4.3.3/Makefile.def 2009-04-29 18:03:50.029603058 -0700 | ||
119 | @@ -214,6 +214,7 @@ | ||
120 | flags_to_pass = { flag= INSTALL_DATA ; }; | ||
121 | flags_to_pass = { flag= INSTALL_PROGRAM ; }; | ||
122 | flags_to_pass = { flag= INSTALL_SCRIPT ; }; | ||
123 | +flags_to_pass = { flag= LDFLAGS_FOR_BUILD ; }; | ||
124 | flags_to_pass = { flag= LEX ; }; | ||
125 | flags_to_pass = { flag= M4 ; }; | ||
126 | flags_to_pass = { flag= MAKE ; }; | ||
127 | @@ -511,43 +512,51 @@ | ||
128 | // compiler probably has never heard of them. | ||
129 | stage_configure_flags='--disable-intermodule $(STAGE1_CHECKING) \ | ||
130 | --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"' ; | ||
131 | - stage_cflags='$(STAGE1_CFLAGS)' ; }; | ||
132 | + stage_cflags='$(STAGE1_CFLAGS)' ; | ||
133 | + stage_libcflags='$(STAGE1_LIBCFLAGS)' ; }; | ||
134 | bootstrap_stage = { | ||
135 | id=2 ; prev=1 ; | ||
136 | bootstrap_target=bootstrap2 ; | ||
137 | stage_configure_flags="@stage2_werror_flag@" ; | ||
138 | - stage_cflags="$(STAGE2_CFLAGS)" ; }; | ||
139 | + stage_cflags="$(STAGE2_CFLAGS)" ; | ||
140 | + stage_libcflags="$(STAGE2_LIBCFLAGS)" ; }; | ||
141 | bootstrap_stage = { | ||
142 | id=b2g0 ; prev=1 ; | ||
143 | bootstrap_target=bootstrap2-debug ; | ||
144 | stage_configure_flags="@stage2_werror_flag@" ; | ||
145 | - stage_cflags="$(STAGE2_CFLAGS) -g0" ; }; | ||
146 | + stage_cflags="$(STAGE2_CFLAGS) -g0" ; | ||
147 | + stage_libcflags="$(STAGE2_LIBCFLAGS) -g0" ; }; | ||
148 | bootstrap_stage = { | ||
149 | id=3 ; prev=2 ; lean=1 ; | ||
150 | compare_target=compare ; | ||
151 | bootstrap_target=bootstrap ; | ||
152 | cleanstrap_target=cleanstrap ; | ||
153 | stage_configure_flags="@stage2_werror_flag@" ; | ||
154 | - stage_cflags="$(STAGE3_CFLAGS)" ; }; | ||
155 | + stage_cflags="$(STAGE3_CFLAGS)" ; | ||
156 | + stage_libcflags="$(STAGE3_LIBCFLAGS)" ; }; | ||
157 | bootstrap_stage = { | ||
158 | id=b3g2 ; prev=b2g0 ; lean=1 ; | ||
159 | compare_target=compare-debug ; | ||
160 | bootstrap_target=bootstrap-debug ; | ||
161 | cleanstrap_target=cleanstrap-debug ; | ||
162 | stage_configure_flags="@stage2_werror_flag@" ; | ||
163 | - stage_cflags="$(STAGE3_CFLAGS) -g2" ; }; | ||
164 | + stage_cflags="$(STAGE3_CFLAGS) -g2" ; | ||
165 | + stage_libcflags="$(STAGE3_LIBCFLAGS) -g2" ; }; | ||
166 | bootstrap_stage = { | ||
167 | id=4 ; prev=3 ; lean=2 ; | ||
168 | compare_target=compare3 ; | ||
169 | bootstrap_target=bootstrap4 ; | ||
170 | stage_configure_flags="@stage2_werror_flag@" ; | ||
171 | - stage_cflags="$(STAGE4_CFLAGS)" ; }; | ||
172 | + stage_cflags="$(STAGE4_CFLAGS)" ; | ||
173 | + stage_libcflags="$(STAGE4_CFLAGS)" ; }; | ||
174 | bootstrap_stage = { | ||
175 | id=profile ; prev=1 ; | ||
176 | stage_configure_flags="@stage2_werror_flag@" ; | ||
177 | - stage_cflags='$(STAGE2_CFLAGS) -fprofile-generate' ; }; | ||
178 | + stage_cflags='$(STAGE2_CFLAGS) -fprofile-generate' ; | ||
179 | + stage_libcflags='$(STAGE2_LIBCFLAGS) -fprofile-generate' ; }; | ||
180 | bootstrap_stage = { | ||
181 | id=feedback ; prev=profile ; | ||
182 | bootstrap_target=profiledbootstrap ; | ||
183 | stage_configure_flags="@stage2_werror_flag@" ; | ||
184 | - stage_cflags='$(STAGE3_CFLAGS) -fprofile-use' ; }; | ||
185 | + stage_cflags='$(STAGE3_CFLAGS) -fprofile-use' ; | ||
186 | + stage_libcflags='$(STAGE3_LIBCFLAGS) -fprofile-use' ; }; | ||
187 | Index: gcc-4.3.3/Makefile.tpl | ||
188 | =================================================================== | ||
189 | --- gcc-4.3.3.orig/Makefile.tpl 2008-08-16 00:28:01.000000000 -0700 | ||
190 | +++ gcc-4.3.3/Makefile.tpl 2009-04-29 18:04:16.836611837 -0700 | ||
191 | @@ -23,6 +23,14 @@ | ||
192 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
193 | # | ||
194 | |||
195 | +# First, test for a proper version of make, but only where one is required. | ||
196 | + | ||
197 | +@if gcc | ||
198 | +ifeq (,$(.VARIABLES)) # The variable .VARIABLES, new with 3.80, is never empty. | ||
199 | +$(error GNU make version 3.80 or newer is required.) | ||
200 | +endif | ||
201 | +@endif gcc | ||
202 | + | ||
203 | # ------------------------------- | ||
204 | # Standard Autoconf-set variables | ||
205 | # ------------------------------- | ||
206 | @@ -139,6 +147,13 @@ | ||
207 | WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \ | ||
208 | WINDMC="$(WINDMC_FOR_BUILD)"; export WINDMC; | ||
209 | |||
210 | +# These variables must be set on the make command line for directories | ||
211 | +# built for the build system to override those in BASE_FLAGS_TO_PASSS. | ||
212 | +EXTRA_BUILD_FLAGS = \ | ||
213 | + CFLAGS="$(CFLAGS_FOR_BUILD)" \ | ||
214 | + LDFLAGS="$(LDFLAGS_FOR_BUILD)" \ | ||
215 | + LIBCFLAGS="" | ||
216 | + | ||
217 | # This is the list of directories to built for the host system. | ||
218 | SUBDIRS = @configdirs@ | ||
219 | # This is set by the configure script to the arguments to use when configuring | ||
220 | @@ -153,6 +168,7 @@ | ||
221 | HOST_EXPORTS = \ | ||
222 | $(BASE_EXPORTS) \ | ||
223 | CC="$(CC)"; export CC; \ | ||
224 | + ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \ | ||
225 | CFLAGS="$(CFLAGS)"; export CFLAGS; \ | ||
226 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
227 | CXX="$(CXX)"; export CXX; \ | ||
228 | @@ -207,10 +223,10 @@ | ||
229 | AR="$(AR_FOR_TARGET)"; export AR; \ | ||
230 | AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \ | ||
231 | CC="$(CC_FOR_TARGET)"; export CC; \ | ||
232 | - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ | ||
233 | + CFLAGS="$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ | ||
234 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
235 | CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ | ||
236 | - CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ | ||
237 | + CXXFLAGS="$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ | ||
238 | GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ | ||
239 | GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \ | ||
240 | DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ | ||
241 | @@ -323,7 +339,6 @@ | ||
242 | LIBCFLAGS = $(CFLAGS) | ||
243 | CXXFLAGS = @CXXFLAGS@ | ||
244 | LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates | ||
245 | -PICFLAG = | ||
246 | |||
247 | # Only build the C compiler for stage1, because that is the only one that | ||
248 | # we can guarantee will build with the native compiler, and also it is the | ||
249 | @@ -331,14 +346,19 @@ | ||
250 | # MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them | ||
251 | # overrideable (for a bootstrap build stage1 also builds gcc.info). | ||
252 | |||
253 | -STAGE1_CFLAGS=@stage1_cflags@ | ||
254 | STAGE1_CHECKING=@stage1_checking@ | ||
255 | STAGE1_LANGUAGES=@stage1_languages@ | ||
256 | |||
257 | +STAGE1_CFLAGS=@stage1_cflags@ | ||
258 | STAGE2_CFLAGS=$(BOOT_CFLAGS) | ||
259 | STAGE3_CFLAGS=$(BOOT_CFLAGS) | ||
260 | STAGE4_CFLAGS=$(BOOT_CFLAGS) | ||
261 | |||
262 | +STAGE1_LIBCFLAGS=$(CFLAGS_FOR_TARGET) | ||
263 | +STAGE2_LIBCFLAGS=$(CFLAGS_FOR_TARGET) | ||
264 | +STAGE3_LIBCFLAGS=$(CFLAGS_FOR_TARGET) | ||
265 | +STAGE4_LIBCFLAGS=$(CFLAGS_FOR_TARGET) | ||
266 | + | ||
267 | do-compare = @do_compare@ | ||
268 | do-compare3 = $(do-compare) | ||
269 | do-compare-debug = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2 | ||
270 | @@ -377,22 +397,14 @@ | ||
271 | COMPILER_LD_FOR_TARGET=@COMPILER_LD_FOR_TARGET@ | ||
272 | COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_TARGET@ | ||
273 | |||
274 | -# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS | ||
275 | -# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS | ||
276 | -# might also be empty (or "-g", if a non-GCC C++ compiler is in the path). | ||
277 | -# We want to ensure that TARGET libraries (which we know are built with | ||
278 | -# gcc) are built with "-O2 -g", so prepend those options when setting | ||
279 | -# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET. | ||
280 | -CFLAGS_FOR_TARGET = -O2 -g $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) \ | ||
281 | - $(DEBUG_PREFIX_CFLAGS_FOR_TARGET) | ||
282 | +CFLAGS_FOR_TARGET = @CFLAGS_FOR_TARGET@ | ||
283 | +CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@ | ||
284 | SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ | ||
285 | DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@ | ||
286 | -CXXFLAGS_FOR_TARGET = -O2 -g $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) \ | ||
287 | - $(DEBUG_PREFIX_CFLAGS_FOR_TARGET) | ||
288 | + | ||
289 | LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) | ||
290 | LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates | ||
291 | -LDFLAGS_FOR_TARGET = | ||
292 | -PICFLAG_FOR_TARGET = | ||
293 | +LDFLAGS_FOR_TARGET = @LDFLAGS@ | ||
294 | |||
295 | # ------------------------------------ | ||
296 | # Miscellaneous targets and flag lists | ||
297 | @@ -492,19 +504,20 @@ | ||
298 | # Flags to pass down to makes which are built with the target environment. | ||
299 | # The double $ decreases the length of the command line; those variables | ||
300 | # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. The | ||
301 | -# COMPILER_ prefixed variables are not passed down so we expand them here. | ||
302 | +# *_CFLAGS_FOR_TARGET variables are not passed down and most often empty, | ||
303 | +# so we expand them here. | ||
304 | EXTRA_TARGET_FLAGS = \ | ||
305 | 'AR=$$(AR_FOR_TARGET)' \ | ||
306 | 'AS=$(COMPILER_AS_FOR_TARGET)' \ | ||
307 | 'CC=$$(CC_FOR_TARGET)' \ | ||
308 | - 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \ | ||
309 | + 'CFLAGS=$$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \ | ||
310 | 'CXX=$$(CXX_FOR_TARGET)' \ | ||
311 | - 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \ | ||
312 | + 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \ | ||
313 | 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ | ||
314 | 'LD=$(COMPILER_LD_FOR_TARGET)' \ | ||
315 | 'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \ | ||
316 | - 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \ | ||
317 | - 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \ | ||
318 | + 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \ | ||
319 | + 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \ | ||
320 | 'NM=$(COMPILER_NM_FOR_TARGET)' \ | ||
321 | 'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \ | ||
322 | 'RANLIB=$$(RANLIB_FOR_TARGET)' \ | ||
323 | @@ -852,9 +865,11 @@ | ||
324 | fi; \ | ||
325 | [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \ | ||
326 | [+exports+][+ IF prev +] \ | ||
327 | - [+poststage1_exports+][+ ENDIF prev +] \ | ||
328 | + [+poststage1_exports+][+ ENDIF prev +] [+ IF prefix +] \ | ||
329 | + CFLAGS="[+stage_libcflags+] $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ | ||
330 | + CXXFLAGS="[+stage_libcflags+] $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; [+ ELSE +] \ | ||
331 | CFLAGS="[+stage_cflags+]"; export CFLAGS; \ | ||
332 | - LIBCFLAGS="[+stage_cflags+]"; export LIBCFLAGS; \ | ||
333 | + CXXFLAGS="[+stage_cflags+]"; export CXXFLAGS; [+ ENDIF +] \ | ||
334 | echo Configuring stage [+id+] in [+subdir+]/[+module+] ; \ | ||
335 | $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \ | ||
336 | cd [+subdir+]/[+module+] || exit 1; \ | ||
337 | @@ -891,7 +906,8 @@ | ||
338 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
339 | [+exports+] \ | ||
340 | (cd [+subdir+]/[+module+] && \ | ||
341 | - $(MAKE) [+args+] [+extra_make_flags+] $(TARGET-[+prefix+][+module+])) | ||
342 | + $(MAKE) $(BASE_FLAGS_TO_PASS) [+args+] [+extra_make_flags+] \ | ||
343 | + $(TARGET-[+prefix+][+module+])) | ||
344 | @endif [+prefix+][+module+] | ||
345 | |||
346 | [+ IF bootstrap +] | ||
347 | @@ -911,8 +927,11 @@ | ||
348 | [+exports+][+ IF prev +] \ | ||
349 | [+poststage1_exports+][+ ENDIF prev +] \ | ||
350 | cd [+subdir+]/[+module+] && \ | ||
351 | - $(MAKE) [+args+] \ | ||
352 | - CFLAGS="[+stage_cflags+]" LIBCFLAGS="[+stage_cflags+]" [+ | ||
353 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
354 | + CFLAGS="[+stage_cflags+]" CXXFLAGS="[+stage_cflags+]" \ | ||
355 | + LIBCFLAGS="[+stage_libcflags+]" \ | ||
356 | + CFLAGS_FOR_TARGET="[+stage_libcflags+]" \ | ||
357 | + CXXFLAGS_FOR_TARGET="[+stage_libcflags+]" [+args+] [+ | ||
358 | IF prev +][+poststage1_args+][+ ENDIF prev | ||
359 | +] [+extra_make_flags+] \ | ||
360 | $(TARGET-stage[+id+]-[+prefix+][+module+]) | ||
361 | @@ -945,7 +964,8 @@ | ||
362 | target_alias=(get "target" "${target_alias}") | ||
363 | args="$(BUILD_CONFIGARGS)" no-config-site=true +] | ||
364 | |||
365 | -[+ all prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)" +] | ||
366 | +[+ all prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)" | ||
367 | + args="$(EXTRA_BUILD_FLAGS)" +] | ||
368 | [+ ENDFOR build_module +] | ||
369 | |||
370 | # -------------------------------------- | ||
371 | @@ -962,7 +982,7 @@ | ||
372 | [+ all prefix="" subdir="$(HOST_SUBDIR)" | ||
373 | exports="$(HOST_EXPORTS)" | ||
374 | poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)" | ||
375 | - args="$(FLAGS_TO_PASS)" | ||
376 | + args="$(EXTRA_HOST_FLAGS)" | ||
377 | poststage1_args="$(POSTSTAGE1_FLAGS_TO_PASS)" +] | ||
378 | |||
379 | .PHONY: check-[+module+] maybe-check-[+module+] | ||
380 | @@ -1060,7 +1080,7 @@ | ||
381 | |||
382 | [+ all prefix="target-" subdir="$(TARGET_SUBDIR)" | ||
383 | exports="$(RAW_CXX_TARGET_EXPORTS)" | ||
384 | - args="$(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'" +] | ||
385 | + args="$(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'" +] | ||
386 | [+ ELSE +] | ||
387 | [+ configure prefix="target-" subdir="$(TARGET_SUBDIR)" | ||
388 | check_multilibs=true | ||
389 | @@ -1071,7 +1091,7 @@ | ||
390 | |||
391 | [+ all prefix="target-" subdir="$(TARGET_SUBDIR)" | ||
392 | exports="$(NORMAL_TARGET_EXPORTS)" | ||
393 | - args="$(TARGET_FLAGS_TO_PASS)" +] | ||
394 | + args="$(EXTRA_TARGET_FLAGS)" +] | ||
395 | [+ ENDIF +] | ||
396 | |||
397 | .PHONY: check-target-[+module+] maybe-check-target-[+module+] | ||
398 | @@ -1301,7 +1321,7 @@ | ||
399 | |||
400 | # Bubble a bug fix through all the stages up to stage [+id+]. They are | ||
401 | # remade, but not reconfigured. The next stage (if any) will not be | ||
402 | -# reconfigured as well. | ||
403 | +# reconfigured either. | ||
404 | .PHONY: stage[+id+]-bubble | ||
405 | stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +] | ||
406 | @r=`${PWD_COMMAND}`; export r; \ | ||
407 | @@ -1440,11 +1460,11 @@ | ||
408 | @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi | ||
409 | |||
410 | .PHONY: restrap | ||
411 | -restrap: | ||
412 | +restrap:: | ||
413 | @: $(MAKE); $(stage) | ||
414 | rm -rf stage1-$(TARGET_SUBDIR) [+ FOR bootstrap-stage +][+ IF prev | ||
415 | +]stage[+id+]-* [+ ENDIF prev +][+ ENDFOR bootstrap-stage +] | ||
416 | - $(MAKE) $(RECURSE_FLAGS_TO_PASS) all | ||
417 | +restrap:: all | ||
418 | @endif gcc-bootstrap | ||
419 | |||
420 | # -------------------------------------- | ||
421 | @@ -1475,7 +1495,7 @@ | ||
422 | |||
423 | [+ ;; These Scheme functions build the bulk of the dependencies. | ||
424 | ;; dep-target builds a string like "maybe-all-MODULE_KIND-gcc", | ||
425 | - ;; where "maybe-" is only included if HARD is true, and all-gcc | ||
426 | + ;; where "maybe-" is only included if HARD is not true, and all-gcc | ||
427 | ;; is taken from VAR-NAME. | ||
428 | (define dep-target (lambda (module-kind var-name hard) | ||
429 | (string-append | ||
430 | @@ -1633,7 +1653,8 @@ | ||
431 | |||
432 | # Rebuilding configure. | ||
433 | AUTOCONF = autoconf | ||
434 | -$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 | ||
435 | +$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 \ | ||
436 | + $(srcdir)/config/override.m4 $(srcdir)/config/proginstall.m4 | ||
437 | cd $(srcdir) && $(AUTOCONF) | ||
438 | |||
439 | # ------------------------------ | ||
440 | Index: gcc-4.3.3/config/mh-ppc-darwin | ||
441 | =================================================================== | ||
442 | --- gcc-4.3.3.orig/config/mh-ppc-darwin 2007-05-23 07:26:31.000000000 -0700 | ||
443 | +++ gcc-4.3.3/config/mh-ppc-darwin 2009-04-29 18:03:50.057603252 -0700 | ||
444 | @@ -2,5 +2,4 @@ | ||
445 | # position-independent-code -- the usual default on Darwin. This fix speeds | ||
446 | # compiles by 3-5%. | ||
447 | |||
448 | -# Broken because of PR32009. | ||
449 | -# BOOT_CFLAGS=-g -O2 -mdynamic-no-pic | ||
450 | +BOOT_CFLAGS=-g -O2 -mdynamic-no-pic | ||
451 | Index: gcc-4.3.3/gcc/doc/install.texi | ||
452 | =================================================================== | ||
453 | --- gcc-4.3.3.orig/gcc/doc/install.texi 2009-01-06 17:52:26.000000000 -0700 | ||
454 | +++ gcc-4.3.3/gcc/doc/install.texi 2009-04-29 18:03:50.065603803 -0700 | ||
455 | @@ -1778,33 +1778,35 @@ | ||
456 | stage2 of the 3-stage bootstrap of the compiler are deleted as | ||
457 | soon as they are no longer needed. | ||
458 | |||
459 | -If you want to save additional space during the bootstrap and in | ||
460 | -the final installation as well, you can build the compiler binaries | ||
461 | -without debugging information as in the following example. This will save | ||
462 | -roughly 40% of disk space both for the bootstrap and the final installation. | ||
463 | -(Libraries will still contain debugging information.) | ||
464 | - | ||
465 | -@smallexample | ||
466 | - make CFLAGS='-O' LIBCFLAGS='-g -O2' \ | ||
467 | - LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap | ||
468 | -@end smallexample | ||
469 | - | ||
470 | -If you wish to use non-default GCC flags when compiling the stage2 and | ||
471 | -stage3 compilers, set @code{BOOT_CFLAGS} on the command line when doing | ||
472 | -@samp{make}. Non-default optimization flags are less well | ||
473 | -tested here than the default of @samp{-g -O2}, but should still work. | ||
474 | -In a few cases, you may find that you need to specify special flags such | ||
475 | -as @option{-msoft-float} here to complete the bootstrap; or, if the | ||
476 | -native compiler miscompiles the stage1 compiler, you may need to work | ||
477 | -around this, by choosing @code{BOOT_CFLAGS} to avoid the parts of the | ||
478 | -stage1 compiler that were miscompiled, or by using @samp{make | ||
479 | +If you wish to use non-default GCC flags when compiling the stage2 | ||
480 | +and stage3 compilers, set @code{BOOT_CFLAGS} on the command line when | ||
481 | +doing @samp{make}. For example, if you want to save additional space | ||
482 | +during the bootstrap and in the final installation as well, you can | ||
483 | +build the compiler binaries without debugging information as in the | ||
484 | +following example. This will save roughly 40% of disk space both for | ||
485 | +the bootstrap and the final installation. (Libraries will still contain | ||
486 | +debugging information.) | ||
487 | + | ||
488 | +@smallexample | ||
489 | + make BOOT_CFLAGS='-O' bootstrap | ||
490 | +@end smallexample | ||
491 | + | ||
492 | +You can place non-default optimization flags into @code{BOOT_CFLAGS}; they | ||
493 | +are less well tested here than the default of @samp{-g -O2}, but should | ||
494 | +still work. In a few cases, you may find that you need to specify special | ||
495 | +flags such as @option{-msoft-float} here to complete the bootstrap; or, | ||
496 | +if the native compiler miscompiles the stage1 compiler, you may need | ||
497 | +to work around this, by choosing @code{BOOT_CFLAGS} to avoid the parts | ||
498 | +of the stage1 compiler that were miscompiled, or by using @samp{make | ||
499 | bootstrap4} to increase the number of stages of bootstrap. | ||
500 | |||
501 | -Note that using non-standard @code{CFLAGS} can cause bootstrap to fail | ||
502 | -if these trigger a warning with the new compiler. For example using | ||
503 | -@samp{-O2 -g -mcpu=i686} on @code{i686-pc-linux-gnu} will cause bootstrap | ||
504 | -failure as @option{-mcpu=} is deprecated in 3.4.0 and above. | ||
505 | - | ||
506 | +@code{BOOT_CFLAGS} does not apply to bootstrapped target libraries. | ||
507 | +Since these are always compiled with the compiler currently being | ||
508 | +bootstrapped, you can use @code{CFLAGS_FOR_TARGET} to modify their | ||
509 | +compilation flags, as for non-bootstrapped target libraries. | ||
510 | +Again, if the native compiler miscompiles the stage1 compiler, you may | ||
511 | +need to work around this by avoiding non-working parts of the stage1 | ||
512 | +compiler. Use @code{STAGE1_LIBCFLAGS} to this end. | ||
513 | |||
514 | If you used the flag @option{--enable-languages=@dots{}} to restrict | ||
515 | the compilers to be built, only those you've actually enabled will be | ||
516 | @@ -2687,8 +2689,8 @@ | ||
517 | stamp. | ||
518 | |||
519 | @samp{make compare} may fail on old versions of DEC Unix unless you add | ||
520 | -@option{-save-temps} to @code{CFLAGS}. On these systems, the name of the | ||
521 | -assembler input file is stored in the object file, and that makes | ||
522 | +@option{-save-temps} to @code{BOOT_CFLAGS}. On these systems, the name | ||
523 | +of the assembler input file is stored in the object file, and that makes | ||
524 | comparison fail if it differs between the @code{stage1} and | ||
525 | @code{stage2} compilations. The option @option{-save-temps} forces a | ||
526 | fixed name to be used for the assembler input file, instead of a | ||
527 | Index: gcc-4.3.3/Makefile.in | ||
528 | =================================================================== | ||
529 | --- gcc-4.3.3.orig/Makefile.in 2008-08-16 00:28:01.000000000 -0700 | ||
530 | +++ gcc-4.3.3/Makefile.in 2009-04-29 18:04:32.133111439 -0700 | ||
531 | @@ -20,6 +20,14 @@ | ||
532 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
533 | # | ||
534 | |||
535 | +# First, test for a proper version of make, but only where one is required. | ||
536 | + | ||
537 | +@if gcc | ||
538 | +ifeq (,$(.VARIABLES)) # The variable .VARIABLES, new with 3.80, is never empty. | ||
539 | +$(error GNU make version 3.80 or newer is required.) | ||
540 | +endif | ||
541 | +@endif gcc | ||
542 | + | ||
543 | # ------------------------------- | ||
544 | # Standard Autoconf-set variables | ||
545 | # ------------------------------- | ||
546 | @@ -136,6 +144,13 @@ | ||
547 | WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \ | ||
548 | WINDMC="$(WINDMC_FOR_BUILD)"; export WINDMC; | ||
549 | |||
550 | +# These variables must be set on the make command line for directories | ||
551 | +# built for the build system to override those in BASE_FLAGS_TO_PASSS. | ||
552 | +EXTRA_BUILD_FLAGS = \ | ||
553 | + CFLAGS="$(CFLAGS_FOR_BUILD)" \ | ||
554 | + LDFLAGS="$(LDFLAGS_FOR_BUILD)" \ | ||
555 | + LIBCFLAGS="" | ||
556 | + | ||
557 | # This is the list of directories to built for the host system. | ||
558 | SUBDIRS = @configdirs@ | ||
559 | # This is set by the configure script to the arguments to use when configuring | ||
560 | @@ -150,6 +165,7 @@ | ||
561 | HOST_EXPORTS = \ | ||
562 | $(BASE_EXPORTS) \ | ||
563 | CC="$(CC)"; export CC; \ | ||
564 | + ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \ | ||
565 | CFLAGS="$(CFLAGS)"; export CFLAGS; \ | ||
566 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
567 | CXX="$(CXX)"; export CXX; \ | ||
568 | @@ -204,10 +220,10 @@ | ||
569 | AR="$(AR_FOR_TARGET)"; export AR; \ | ||
570 | AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \ | ||
571 | CC="$(CC_FOR_TARGET)"; export CC; \ | ||
572 | - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ | ||
573 | + CFLAGS="$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ | ||
574 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
575 | CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ | ||
576 | - CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ | ||
577 | + CXXFLAGS="$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ | ||
578 | GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ | ||
579 | GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \ | ||
580 | DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ | ||
581 | @@ -320,7 +336,6 @@ | ||
582 | LIBCFLAGS = $(CFLAGS) | ||
583 | CXXFLAGS = @CXXFLAGS@ | ||
584 | LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates | ||
585 | -PICFLAG = | ||
586 | |||
587 | # Only build the C compiler for stage1, because that is the only one that | ||
588 | # we can guarantee will build with the native compiler, and also it is the | ||
589 | @@ -328,14 +343,19 @@ | ||
590 | # MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them | ||
591 | # overrideable (for a bootstrap build stage1 also builds gcc.info). | ||
592 | |||
593 | -STAGE1_CFLAGS=@stage1_cflags@ | ||
594 | STAGE1_CHECKING=@stage1_checking@ | ||
595 | STAGE1_LANGUAGES=@stage1_languages@ | ||
596 | |||
597 | +STAGE1_CFLAGS=@stage1_cflags@ | ||
598 | STAGE2_CFLAGS=$(BOOT_CFLAGS) | ||
599 | STAGE3_CFLAGS=$(BOOT_CFLAGS) | ||
600 | STAGE4_CFLAGS=$(BOOT_CFLAGS) | ||
601 | |||
602 | +STAGE1_LIBCFLAGS=$(CFLAGS_FOR_TARGET) | ||
603 | +STAGE2_LIBCFLAGS=$(CFLAGS_FOR_TARGET) | ||
604 | +STAGE3_LIBCFLAGS=$(CFLAGS_FOR_TARGET) | ||
605 | +STAGE4_LIBCFLAGS=$(CFLAGS_FOR_TARGET) | ||
606 | + | ||
607 | do-compare = @do_compare@ | ||
608 | do-compare3 = $(do-compare) | ||
609 | do-compare-debug = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2 | ||
610 | @@ -374,22 +394,14 @@ | ||
611 | COMPILER_LD_FOR_TARGET=@COMPILER_LD_FOR_TARGET@ | ||
612 | COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_TARGET@ | ||
613 | |||
614 | -# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS | ||
615 | -# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS | ||
616 | -# might also be empty (or "-g", if a non-GCC C++ compiler is in the path). | ||
617 | -# We want to ensure that TARGET libraries (which we know are built with | ||
618 | -# gcc) are built with "-O2 -g", so prepend those options when setting | ||
619 | -# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET. | ||
620 | -CFLAGS_FOR_TARGET = -O2 -g $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) \ | ||
621 | - $(DEBUG_PREFIX_CFLAGS_FOR_TARGET) | ||
622 | +CFLAGS_FOR_TARGET = @CFLAGS_FOR_TARGET@ | ||
623 | +CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@ | ||
624 | SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ | ||
625 | DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@ | ||
626 | -CXXFLAGS_FOR_TARGET = -O2 -g $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) \ | ||
627 | - $(DEBUG_PREFIX_CFLAGS_FOR_TARGET) | ||
628 | + | ||
629 | LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) | ||
630 | LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates | ||
631 | -LDFLAGS_FOR_TARGET = | ||
632 | -PICFLAG_FOR_TARGET = | ||
633 | +LDFLAGS_FOR_TARGET = @LDFLAGS@ | ||
634 | |||
635 | # ------------------------------------ | ||
636 | # Miscellaneous targets and flag lists | ||
637 | @@ -496,6 +508,7 @@ | ||
638 | "INSTALL_DATA=$(INSTALL_DATA)" \ | ||
639 | "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ | ||
640 | "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ | ||
641 | + "LDFLAGS_FOR_BUILD=$(LDFLAGS_FOR_BUILD)" \ | ||
642 | "LEX=$(LEX)" \ | ||
643 | "M4=$(M4)" \ | ||
644 | "MAKE=$(MAKE)" \ | ||
645 | @@ -592,19 +605,20 @@ | ||
646 | # Flags to pass down to makes which are built with the target environment. | ||
647 | # The double $ decreases the length of the command line; those variables | ||
648 | # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. The | ||
649 | -# COMPILER_ prefixed variables are not passed down so we expand them here. | ||
650 | +# *_CFLAGS_FOR_TARGET variables are not passed down and most often empty, | ||
651 | +# so we expand them here. | ||
652 | EXTRA_TARGET_FLAGS = \ | ||
653 | 'AR=$$(AR_FOR_TARGET)' \ | ||
654 | 'AS=$(COMPILER_AS_FOR_TARGET)' \ | ||
655 | 'CC=$$(CC_FOR_TARGET)' \ | ||
656 | - 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \ | ||
657 | + 'CFLAGS=$$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \ | ||
658 | 'CXX=$$(CXX_FOR_TARGET)' \ | ||
659 | - 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \ | ||
660 | + 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \ | ||
661 | 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ | ||
662 | 'LD=$(COMPILER_LD_FOR_TARGET)' \ | ||
663 | 'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \ | ||
664 | - 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \ | ||
665 | - 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \ | ||
666 | + 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \ | ||
667 | + 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \ | ||
668 | 'NM=$(COMPILER_NM_FOR_TARGET)' \ | ||
669 | 'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \ | ||
670 | 'RANLIB=$$(RANLIB_FOR_TARGET)' \ | ||
671 | @@ -2738,7 +2752,8 @@ | ||
672 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
673 | $(BUILD_EXPORTS) \ | ||
674 | (cd $(BUILD_SUBDIR)/libiberty && \ | ||
675 | - $(MAKE) $(TARGET-build-libiberty)) | ||
676 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \ | ||
677 | + $(TARGET-build-libiberty)) | ||
678 | @endif build-libiberty | ||
679 | |||
680 | |||
681 | @@ -2793,7 +2808,8 @@ | ||
682 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
683 | $(BUILD_EXPORTS) \ | ||
684 | (cd $(BUILD_SUBDIR)/bison && \ | ||
685 | - $(MAKE) $(TARGET-build-bison)) | ||
686 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \ | ||
687 | + $(TARGET-build-bison)) | ||
688 | @endif build-bison | ||
689 | |||
690 | |||
691 | @@ -2848,7 +2864,8 @@ | ||
692 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
693 | $(BUILD_EXPORTS) \ | ||
694 | (cd $(BUILD_SUBDIR)/byacc && \ | ||
695 | - $(MAKE) $(TARGET-build-byacc)) | ||
696 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \ | ||
697 | + $(TARGET-build-byacc)) | ||
698 | @endif build-byacc | ||
699 | |||
700 | |||
701 | @@ -2903,7 +2920,8 @@ | ||
702 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
703 | $(BUILD_EXPORTS) \ | ||
704 | (cd $(BUILD_SUBDIR)/flex && \ | ||
705 | - $(MAKE) $(TARGET-build-flex)) | ||
706 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \ | ||
707 | + $(TARGET-build-flex)) | ||
708 | @endif build-flex | ||
709 | |||
710 | |||
711 | @@ -2958,7 +2976,8 @@ | ||
712 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
713 | $(BUILD_EXPORTS) \ | ||
714 | (cd $(BUILD_SUBDIR)/m4 && \ | ||
715 | - $(MAKE) $(TARGET-build-m4)) | ||
716 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \ | ||
717 | + $(TARGET-build-m4)) | ||
718 | @endif build-m4 | ||
719 | |||
720 | |||
721 | @@ -3013,7 +3032,8 @@ | ||
722 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
723 | $(BUILD_EXPORTS) \ | ||
724 | (cd $(BUILD_SUBDIR)/texinfo && \ | ||
725 | - $(MAKE) $(TARGET-build-texinfo)) | ||
726 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \ | ||
727 | + $(TARGET-build-texinfo)) | ||
728 | @endif build-texinfo | ||
729 | |||
730 | |||
731 | @@ -3068,7 +3088,8 @@ | ||
732 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
733 | $(BUILD_EXPORTS) \ | ||
734 | (cd $(BUILD_SUBDIR)/fixincludes && \ | ||
735 | - $(MAKE) $(TARGET-build-fixincludes)) | ||
736 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \ | ||
737 | + $(TARGET-build-fixincludes)) | ||
738 | @endif build-fixincludes | ||
739 | |||
740 | |||
741 | @@ -3127,7 +3148,8 @@ | ||
742 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
743 | $(HOST_EXPORTS) \ | ||
744 | (cd $(HOST_SUBDIR)/ash && \ | ||
745 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-ash)) | ||
746 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
747 | + $(TARGET-ash)) | ||
748 | @endif ash | ||
749 | |||
750 | |||
751 | @@ -3551,7 +3573,8 @@ | ||
752 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
753 | $(HOST_EXPORTS) \ | ||
754 | (cd $(HOST_SUBDIR)/autoconf && \ | ||
755 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-autoconf)) | ||
756 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
757 | + $(TARGET-autoconf)) | ||
758 | @endif autoconf | ||
759 | |||
760 | |||
761 | @@ -3975,7 +3998,8 @@ | ||
762 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
763 | $(HOST_EXPORTS) \ | ||
764 | (cd $(HOST_SUBDIR)/automake && \ | ||
765 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-automake)) | ||
766 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
767 | + $(TARGET-automake)) | ||
768 | @endif automake | ||
769 | |||
770 | |||
771 | @@ -4399,7 +4423,8 @@ | ||
772 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
773 | $(HOST_EXPORTS) \ | ||
774 | (cd $(HOST_SUBDIR)/bash && \ | ||
775 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-bash)) | ||
776 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
777 | + $(TARGET-bash)) | ||
778 | @endif bash | ||
779 | |||
780 | |||
781 | @@ -4816,9 +4841,9 @@ | ||
782 | @r=`${PWD_COMMAND}`; export r; \ | ||
783 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
784 | test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ | ||
785 | - $(HOST_EXPORTS) \ | ||
786 | + $(HOST_EXPORTS) \ | ||
787 | CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ | ||
788 | - LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ | ||
789 | + CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ | ||
790 | echo Configuring stage 1 in $(HOST_SUBDIR)/bfd ; \ | ||
791 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ | ||
792 | cd $(HOST_SUBDIR)/bfd || exit 1; \ | ||
793 | @@ -4847,9 +4872,9 @@ | ||
794 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
795 | test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ | ||
796 | $(HOST_EXPORTS) \ | ||
797 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
798 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
799 | CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ | ||
800 | - LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ | ||
801 | + CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ | ||
802 | echo Configuring stage 2 in $(HOST_SUBDIR)/bfd ; \ | ||
803 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ | ||
804 | cd $(HOST_SUBDIR)/bfd || exit 1; \ | ||
805 | @@ -4878,9 +4903,9 @@ | ||
806 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
807 | test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ | ||
808 | $(HOST_EXPORTS) \ | ||
809 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
810 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
811 | CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ | ||
812 | - LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ | ||
813 | + CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ | ||
814 | echo Configuring stage b2g0 in $(HOST_SUBDIR)/bfd ; \ | ||
815 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ | ||
816 | cd $(HOST_SUBDIR)/bfd || exit 1; \ | ||
817 | @@ -4909,9 +4934,9 @@ | ||
818 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
819 | test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ | ||
820 | $(HOST_EXPORTS) \ | ||
821 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
822 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
823 | CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ | ||
824 | - LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ | ||
825 | + CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ | ||
826 | echo Configuring stage 3 in $(HOST_SUBDIR)/bfd ; \ | ||
827 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ | ||
828 | cd $(HOST_SUBDIR)/bfd || exit 1; \ | ||
829 | @@ -4940,9 +4965,9 @@ | ||
830 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
831 | test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ | ||
832 | $(HOST_EXPORTS) \ | ||
833 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
834 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
835 | CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ | ||
836 | - LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ | ||
837 | + CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ | ||
838 | echo Configuring stage b3g2 in $(HOST_SUBDIR)/bfd ; \ | ||
839 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ | ||
840 | cd $(HOST_SUBDIR)/bfd || exit 1; \ | ||
841 | @@ -4971,9 +4996,9 @@ | ||
842 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
843 | test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ | ||
844 | $(HOST_EXPORTS) \ | ||
845 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
846 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
847 | CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ | ||
848 | - LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ | ||
849 | + CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ | ||
850 | echo Configuring stage 4 in $(HOST_SUBDIR)/bfd ; \ | ||
851 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ | ||
852 | cd $(HOST_SUBDIR)/bfd || exit 1; \ | ||
853 | @@ -5002,9 +5027,9 @@ | ||
854 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
855 | test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ | ||
856 | $(HOST_EXPORTS) \ | ||
857 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
858 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
859 | CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ | ||
860 | - LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ | ||
861 | + CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ | ||
862 | echo Configuring stage profile in $(HOST_SUBDIR)/bfd ; \ | ||
863 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ | ||
864 | cd $(HOST_SUBDIR)/bfd || exit 1; \ | ||
865 | @@ -5033,9 +5058,9 @@ | ||
866 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
867 | test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ | ||
868 | $(HOST_EXPORTS) \ | ||
869 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
870 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
871 | CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ | ||
872 | - LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ | ||
873 | + CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ | ||
874 | echo Configuring stage feedback in $(HOST_SUBDIR)/bfd ; \ | ||
875 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ | ||
876 | cd $(HOST_SUBDIR)/bfd || exit 1; \ | ||
877 | @@ -5070,7 +5095,8 @@ | ||
878 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
879 | $(HOST_EXPORTS) \ | ||
880 | (cd $(HOST_SUBDIR)/bfd && \ | ||
881 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-bfd)) | ||
882 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
883 | + $(TARGET-bfd)) | ||
884 | @endif bfd | ||
885 | |||
886 | |||
887 | @@ -5089,8 +5115,11 @@ | ||
888 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
889 | $(HOST_EXPORTS) \ | ||
890 | cd $(HOST_SUBDIR)/bfd && \ | ||
891 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
892 | - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ | ||
893 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
894 | + CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ | ||
895 | + LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ | ||
896 | + CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ | ||
897 | + CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ | ||
898 | $(TARGET-stage1-bfd) | ||
899 | |||
900 | maybe-clean-stage1-bfd: clean-stage1-bfd | ||
901 | @@ -5103,7 +5132,7 @@ | ||
902 | $(MAKE) stage1-start; \ | ||
903 | fi; \ | ||
904 | cd $(HOST_SUBDIR)/bfd && \ | ||
905 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
906 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
907 | clean | ||
908 | @endif bfd-bootstrap | ||
909 | |||
910 | @@ -5123,8 +5152,11 @@ | ||
911 | $(HOST_EXPORTS) \ | ||
912 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
913 | cd $(HOST_SUBDIR)/bfd && \ | ||
914 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
915 | - CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
916 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
917 | + CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ | ||
918 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ | ||
919 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ | ||
920 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
921 | $(TARGET-stage2-bfd) | ||
922 | |||
923 | maybe-clean-stage2-bfd: clean-stage2-bfd | ||
924 | @@ -5137,7 +5169,7 @@ | ||
925 | $(MAKE) stage2-start; \ | ||
926 | fi; \ | ||
927 | cd $(HOST_SUBDIR)/bfd && \ | ||
928 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
929 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
930 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
931 | clean | ||
932 | @endif bfd-bootstrap | ||
933 | @@ -5158,8 +5190,11 @@ | ||
934 | $(HOST_EXPORTS) \ | ||
935 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
936 | cd $(HOST_SUBDIR)/bfd && \ | ||
937 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
938 | - CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
939 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
940 | + CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ | ||
941 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ | ||
942 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ | ||
943 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
944 | $(TARGET-stageb2g0-bfd) | ||
945 | |||
946 | maybe-clean-stageb2g0-bfd: clean-stageb2g0-bfd | ||
947 | @@ -5172,7 +5207,7 @@ | ||
948 | $(MAKE) stageb2g0-start; \ | ||
949 | fi; \ | ||
950 | cd $(HOST_SUBDIR)/bfd && \ | ||
951 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
952 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
953 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
954 | clean | ||
955 | @endif bfd-bootstrap | ||
956 | @@ -5193,8 +5228,11 @@ | ||
957 | $(HOST_EXPORTS) \ | ||
958 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
959 | cd $(HOST_SUBDIR)/bfd && \ | ||
960 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
961 | - CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
962 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
963 | + CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ | ||
964 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ | ||
965 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ | ||
966 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
967 | $(TARGET-stage3-bfd) | ||
968 | |||
969 | maybe-clean-stage3-bfd: clean-stage3-bfd | ||
970 | @@ -5207,7 +5245,7 @@ | ||
971 | $(MAKE) stage3-start; \ | ||
972 | fi; \ | ||
973 | cd $(HOST_SUBDIR)/bfd && \ | ||
974 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
975 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
976 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
977 | clean | ||
978 | @endif bfd-bootstrap | ||
979 | @@ -5228,8 +5266,11 @@ | ||
980 | $(HOST_EXPORTS) \ | ||
981 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
982 | cd $(HOST_SUBDIR)/bfd && \ | ||
983 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
984 | - CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
985 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
986 | + CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ | ||
987 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ | ||
988 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ | ||
989 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
990 | $(TARGET-stageb3g2-bfd) | ||
991 | |||
992 | maybe-clean-stageb3g2-bfd: clean-stageb3g2-bfd | ||
993 | @@ -5242,7 +5283,7 @@ | ||
994 | $(MAKE) stageb3g2-start; \ | ||
995 | fi; \ | ||
996 | cd $(HOST_SUBDIR)/bfd && \ | ||
997 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
998 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
999 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1000 | clean | ||
1001 | @endif bfd-bootstrap | ||
1002 | @@ -5263,8 +5304,11 @@ | ||
1003 | $(HOST_EXPORTS) \ | ||
1004 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1005 | cd $(HOST_SUBDIR)/bfd && \ | ||
1006 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1007 | - CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1008 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1009 | + CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ | ||
1010 | + LIBCFLAGS="$(STAGE4_CFLAGS)" \ | ||
1011 | + CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ | ||
1012 | + CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1013 | $(TARGET-stage4-bfd) | ||
1014 | |||
1015 | maybe-clean-stage4-bfd: clean-stage4-bfd | ||
1016 | @@ -5277,7 +5321,7 @@ | ||
1017 | $(MAKE) stage4-start; \ | ||
1018 | fi; \ | ||
1019 | cd $(HOST_SUBDIR)/bfd && \ | ||
1020 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1021 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1022 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1023 | clean | ||
1024 | @endif bfd-bootstrap | ||
1025 | @@ -5298,8 +5342,11 @@ | ||
1026 | $(HOST_EXPORTS) \ | ||
1027 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1028 | cd $(HOST_SUBDIR)/bfd && \ | ||
1029 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1030 | - CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1031 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1032 | + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ | ||
1033 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
1034 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
1035 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1036 | $(TARGET-stageprofile-bfd) | ||
1037 | |||
1038 | maybe-clean-stageprofile-bfd: clean-stageprofile-bfd | ||
1039 | @@ -5312,7 +5359,7 @@ | ||
1040 | $(MAKE) stageprofile-start; \ | ||
1041 | fi; \ | ||
1042 | cd $(HOST_SUBDIR)/bfd && \ | ||
1043 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1044 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1045 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1046 | clean | ||
1047 | @endif bfd-bootstrap | ||
1048 | @@ -5333,8 +5380,11 @@ | ||
1049 | $(HOST_EXPORTS) \ | ||
1050 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1051 | cd $(HOST_SUBDIR)/bfd && \ | ||
1052 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1053 | - CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1054 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1055 | + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ | ||
1056 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
1057 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
1058 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1059 | $(TARGET-stagefeedback-bfd) | ||
1060 | |||
1061 | maybe-clean-stagefeedback-bfd: clean-stagefeedback-bfd | ||
1062 | @@ -5347,7 +5397,7 @@ | ||
1063 | $(MAKE) stagefeedback-start; \ | ||
1064 | fi; \ | ||
1065 | cd $(HOST_SUBDIR)/bfd && \ | ||
1066 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1067 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1068 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1069 | clean | ||
1070 | @endif bfd-bootstrap | ||
1071 | @@ -5754,9 +5804,9 @@ | ||
1072 | @r=`${PWD_COMMAND}`; export r; \ | ||
1073 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1074 | test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ | ||
1075 | - $(HOST_EXPORTS) \ | ||
1076 | + $(HOST_EXPORTS) \ | ||
1077 | CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ | ||
1078 | - LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ | ||
1079 | + CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ | ||
1080 | echo Configuring stage 1 in $(HOST_SUBDIR)/opcodes ; \ | ||
1081 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ | ||
1082 | cd $(HOST_SUBDIR)/opcodes || exit 1; \ | ||
1083 | @@ -5785,9 +5835,9 @@ | ||
1084 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1085 | test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ | ||
1086 | $(HOST_EXPORTS) \ | ||
1087 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1088 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1089 | CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ | ||
1090 | - LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ | ||
1091 | + CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ | ||
1092 | echo Configuring stage 2 in $(HOST_SUBDIR)/opcodes ; \ | ||
1093 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ | ||
1094 | cd $(HOST_SUBDIR)/opcodes || exit 1; \ | ||
1095 | @@ -5816,9 +5866,9 @@ | ||
1096 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1097 | test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ | ||
1098 | $(HOST_EXPORTS) \ | ||
1099 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1100 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1101 | CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ | ||
1102 | - LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ | ||
1103 | + CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ | ||
1104 | echo Configuring stage b2g0 in $(HOST_SUBDIR)/opcodes ; \ | ||
1105 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ | ||
1106 | cd $(HOST_SUBDIR)/opcodes || exit 1; \ | ||
1107 | @@ -5847,9 +5897,9 @@ | ||
1108 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1109 | test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ | ||
1110 | $(HOST_EXPORTS) \ | ||
1111 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1112 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1113 | CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ | ||
1114 | - LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ | ||
1115 | + CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ | ||
1116 | echo Configuring stage 3 in $(HOST_SUBDIR)/opcodes ; \ | ||
1117 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ | ||
1118 | cd $(HOST_SUBDIR)/opcodes || exit 1; \ | ||
1119 | @@ -5878,9 +5928,9 @@ | ||
1120 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1121 | test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ | ||
1122 | $(HOST_EXPORTS) \ | ||
1123 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1124 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1125 | CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ | ||
1126 | - LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ | ||
1127 | + CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ | ||
1128 | echo Configuring stage b3g2 in $(HOST_SUBDIR)/opcodes ; \ | ||
1129 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ | ||
1130 | cd $(HOST_SUBDIR)/opcodes || exit 1; \ | ||
1131 | @@ -5909,9 +5959,9 @@ | ||
1132 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1133 | test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ | ||
1134 | $(HOST_EXPORTS) \ | ||
1135 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1136 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1137 | CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ | ||
1138 | - LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ | ||
1139 | + CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ | ||
1140 | echo Configuring stage 4 in $(HOST_SUBDIR)/opcodes ; \ | ||
1141 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ | ||
1142 | cd $(HOST_SUBDIR)/opcodes || exit 1; \ | ||
1143 | @@ -5940,9 +5990,9 @@ | ||
1144 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1145 | test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ | ||
1146 | $(HOST_EXPORTS) \ | ||
1147 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1148 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1149 | CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ | ||
1150 | - LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ | ||
1151 | + CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ | ||
1152 | echo Configuring stage profile in $(HOST_SUBDIR)/opcodes ; \ | ||
1153 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ | ||
1154 | cd $(HOST_SUBDIR)/opcodes || exit 1; \ | ||
1155 | @@ -5971,9 +6021,9 @@ | ||
1156 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1157 | test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ | ||
1158 | $(HOST_EXPORTS) \ | ||
1159 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1160 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1161 | CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ | ||
1162 | - LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ | ||
1163 | + CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ | ||
1164 | echo Configuring stage feedback in $(HOST_SUBDIR)/opcodes ; \ | ||
1165 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ | ||
1166 | cd $(HOST_SUBDIR)/opcodes || exit 1; \ | ||
1167 | @@ -6008,7 +6058,8 @@ | ||
1168 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1169 | $(HOST_EXPORTS) \ | ||
1170 | (cd $(HOST_SUBDIR)/opcodes && \ | ||
1171 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-opcodes)) | ||
1172 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
1173 | + $(TARGET-opcodes)) | ||
1174 | @endif opcodes | ||
1175 | |||
1176 | |||
1177 | @@ -6027,8 +6078,11 @@ | ||
1178 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1179 | $(HOST_EXPORTS) \ | ||
1180 | cd $(HOST_SUBDIR)/opcodes && \ | ||
1181 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1182 | - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ | ||
1183 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1184 | + CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ | ||
1185 | + LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ | ||
1186 | + CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ | ||
1187 | + CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ | ||
1188 | $(TARGET-stage1-opcodes) | ||
1189 | |||
1190 | maybe-clean-stage1-opcodes: clean-stage1-opcodes | ||
1191 | @@ -6041,7 +6095,7 @@ | ||
1192 | $(MAKE) stage1-start; \ | ||
1193 | fi; \ | ||
1194 | cd $(HOST_SUBDIR)/opcodes && \ | ||
1195 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1196 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1197 | clean | ||
1198 | @endif opcodes-bootstrap | ||
1199 | |||
1200 | @@ -6061,8 +6115,11 @@ | ||
1201 | $(HOST_EXPORTS) \ | ||
1202 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1203 | cd $(HOST_SUBDIR)/opcodes && \ | ||
1204 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1205 | - CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1206 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1207 | + CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ | ||
1208 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ | ||
1209 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ | ||
1210 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1211 | $(TARGET-stage2-opcodes) | ||
1212 | |||
1213 | maybe-clean-stage2-opcodes: clean-stage2-opcodes | ||
1214 | @@ -6075,7 +6132,7 @@ | ||
1215 | $(MAKE) stage2-start; \ | ||
1216 | fi; \ | ||
1217 | cd $(HOST_SUBDIR)/opcodes && \ | ||
1218 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1219 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1220 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1221 | clean | ||
1222 | @endif opcodes-bootstrap | ||
1223 | @@ -6096,8 +6153,11 @@ | ||
1224 | $(HOST_EXPORTS) \ | ||
1225 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1226 | cd $(HOST_SUBDIR)/opcodes && \ | ||
1227 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1228 | - CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1229 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1230 | + CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ | ||
1231 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ | ||
1232 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ | ||
1233 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1234 | $(TARGET-stageb2g0-opcodes) | ||
1235 | |||
1236 | maybe-clean-stageb2g0-opcodes: clean-stageb2g0-opcodes | ||
1237 | @@ -6110,7 +6170,7 @@ | ||
1238 | $(MAKE) stageb2g0-start; \ | ||
1239 | fi; \ | ||
1240 | cd $(HOST_SUBDIR)/opcodes && \ | ||
1241 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1242 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1243 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1244 | clean | ||
1245 | @endif opcodes-bootstrap | ||
1246 | @@ -6131,8 +6191,11 @@ | ||
1247 | $(HOST_EXPORTS) \ | ||
1248 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1249 | cd $(HOST_SUBDIR)/opcodes && \ | ||
1250 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1251 | - CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1252 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1253 | + CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ | ||
1254 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ | ||
1255 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ | ||
1256 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1257 | $(TARGET-stage3-opcodes) | ||
1258 | |||
1259 | maybe-clean-stage3-opcodes: clean-stage3-opcodes | ||
1260 | @@ -6145,7 +6208,7 @@ | ||
1261 | $(MAKE) stage3-start; \ | ||
1262 | fi; \ | ||
1263 | cd $(HOST_SUBDIR)/opcodes && \ | ||
1264 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1265 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1266 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1267 | clean | ||
1268 | @endif opcodes-bootstrap | ||
1269 | @@ -6166,8 +6229,11 @@ | ||
1270 | $(HOST_EXPORTS) \ | ||
1271 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1272 | cd $(HOST_SUBDIR)/opcodes && \ | ||
1273 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1274 | - CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1275 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1276 | + CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ | ||
1277 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ | ||
1278 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ | ||
1279 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1280 | $(TARGET-stageb3g2-opcodes) | ||
1281 | |||
1282 | maybe-clean-stageb3g2-opcodes: clean-stageb3g2-opcodes | ||
1283 | @@ -6180,7 +6246,7 @@ | ||
1284 | $(MAKE) stageb3g2-start; \ | ||
1285 | fi; \ | ||
1286 | cd $(HOST_SUBDIR)/opcodes && \ | ||
1287 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1288 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1289 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1290 | clean | ||
1291 | @endif opcodes-bootstrap | ||
1292 | @@ -6201,8 +6267,11 @@ | ||
1293 | $(HOST_EXPORTS) \ | ||
1294 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1295 | cd $(HOST_SUBDIR)/opcodes && \ | ||
1296 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1297 | - CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1298 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1299 | + CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ | ||
1300 | + LIBCFLAGS="$(STAGE4_CFLAGS)" \ | ||
1301 | + CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ | ||
1302 | + CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1303 | $(TARGET-stage4-opcodes) | ||
1304 | |||
1305 | maybe-clean-stage4-opcodes: clean-stage4-opcodes | ||
1306 | @@ -6215,7 +6284,7 @@ | ||
1307 | $(MAKE) stage4-start; \ | ||
1308 | fi; \ | ||
1309 | cd $(HOST_SUBDIR)/opcodes && \ | ||
1310 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1311 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1312 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1313 | clean | ||
1314 | @endif opcodes-bootstrap | ||
1315 | @@ -6236,8 +6305,11 @@ | ||
1316 | $(HOST_EXPORTS) \ | ||
1317 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1318 | cd $(HOST_SUBDIR)/opcodes && \ | ||
1319 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1320 | - CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1321 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1322 | + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ | ||
1323 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
1324 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
1325 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1326 | $(TARGET-stageprofile-opcodes) | ||
1327 | |||
1328 | maybe-clean-stageprofile-opcodes: clean-stageprofile-opcodes | ||
1329 | @@ -6250,7 +6322,7 @@ | ||
1330 | $(MAKE) stageprofile-start; \ | ||
1331 | fi; \ | ||
1332 | cd $(HOST_SUBDIR)/opcodes && \ | ||
1333 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1334 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1335 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1336 | clean | ||
1337 | @endif opcodes-bootstrap | ||
1338 | @@ -6271,8 +6343,11 @@ | ||
1339 | $(HOST_EXPORTS) \ | ||
1340 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1341 | cd $(HOST_SUBDIR)/opcodes && \ | ||
1342 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1343 | - CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1344 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1345 | + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ | ||
1346 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
1347 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
1348 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1349 | $(TARGET-stagefeedback-opcodes) | ||
1350 | |||
1351 | maybe-clean-stagefeedback-opcodes: clean-stagefeedback-opcodes | ||
1352 | @@ -6285,7 +6360,7 @@ | ||
1353 | $(MAKE) stagefeedback-start; \ | ||
1354 | fi; \ | ||
1355 | cd $(HOST_SUBDIR)/opcodes && \ | ||
1356 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1357 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1358 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1359 | clean | ||
1360 | @endif opcodes-bootstrap | ||
1361 | @@ -6692,9 +6767,9 @@ | ||
1362 | @r=`${PWD_COMMAND}`; export r; \ | ||
1363 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1364 | test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ | ||
1365 | - $(HOST_EXPORTS) \ | ||
1366 | + $(HOST_EXPORTS) \ | ||
1367 | CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ | ||
1368 | - LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ | ||
1369 | + CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ | ||
1370 | echo Configuring stage 1 in $(HOST_SUBDIR)/binutils ; \ | ||
1371 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ | ||
1372 | cd $(HOST_SUBDIR)/binutils || exit 1; \ | ||
1373 | @@ -6723,9 +6798,9 @@ | ||
1374 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1375 | test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ | ||
1376 | $(HOST_EXPORTS) \ | ||
1377 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1378 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1379 | CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ | ||
1380 | - LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ | ||
1381 | + CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ | ||
1382 | echo Configuring stage 2 in $(HOST_SUBDIR)/binutils ; \ | ||
1383 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ | ||
1384 | cd $(HOST_SUBDIR)/binutils || exit 1; \ | ||
1385 | @@ -6754,9 +6829,9 @@ | ||
1386 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1387 | test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ | ||
1388 | $(HOST_EXPORTS) \ | ||
1389 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1390 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1391 | CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ | ||
1392 | - LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ | ||
1393 | + CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ | ||
1394 | echo Configuring stage b2g0 in $(HOST_SUBDIR)/binutils ; \ | ||
1395 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ | ||
1396 | cd $(HOST_SUBDIR)/binutils || exit 1; \ | ||
1397 | @@ -6785,9 +6860,9 @@ | ||
1398 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1399 | test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ | ||
1400 | $(HOST_EXPORTS) \ | ||
1401 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1402 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1403 | CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ | ||
1404 | - LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ | ||
1405 | + CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ | ||
1406 | echo Configuring stage 3 in $(HOST_SUBDIR)/binutils ; \ | ||
1407 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ | ||
1408 | cd $(HOST_SUBDIR)/binutils || exit 1; \ | ||
1409 | @@ -6816,9 +6891,9 @@ | ||
1410 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1411 | test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ | ||
1412 | $(HOST_EXPORTS) \ | ||
1413 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1414 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1415 | CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ | ||
1416 | - LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ | ||
1417 | + CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ | ||
1418 | echo Configuring stage b3g2 in $(HOST_SUBDIR)/binutils ; \ | ||
1419 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ | ||
1420 | cd $(HOST_SUBDIR)/binutils || exit 1; \ | ||
1421 | @@ -6847,9 +6922,9 @@ | ||
1422 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1423 | test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ | ||
1424 | $(HOST_EXPORTS) \ | ||
1425 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1426 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1427 | CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ | ||
1428 | - LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ | ||
1429 | + CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ | ||
1430 | echo Configuring stage 4 in $(HOST_SUBDIR)/binutils ; \ | ||
1431 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ | ||
1432 | cd $(HOST_SUBDIR)/binutils || exit 1; \ | ||
1433 | @@ -6878,9 +6953,9 @@ | ||
1434 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1435 | test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ | ||
1436 | $(HOST_EXPORTS) \ | ||
1437 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1438 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1439 | CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ | ||
1440 | - LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ | ||
1441 | + CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ | ||
1442 | echo Configuring stage profile in $(HOST_SUBDIR)/binutils ; \ | ||
1443 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ | ||
1444 | cd $(HOST_SUBDIR)/binutils || exit 1; \ | ||
1445 | @@ -6909,9 +6984,9 @@ | ||
1446 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1447 | test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ | ||
1448 | $(HOST_EXPORTS) \ | ||
1449 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1450 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1451 | CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ | ||
1452 | - LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ | ||
1453 | + CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ | ||
1454 | echo Configuring stage feedback in $(HOST_SUBDIR)/binutils ; \ | ||
1455 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ | ||
1456 | cd $(HOST_SUBDIR)/binutils || exit 1; \ | ||
1457 | @@ -6946,7 +7021,8 @@ | ||
1458 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1459 | $(HOST_EXPORTS) \ | ||
1460 | (cd $(HOST_SUBDIR)/binutils && \ | ||
1461 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-binutils)) | ||
1462 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
1463 | + $(TARGET-binutils)) | ||
1464 | @endif binutils | ||
1465 | |||
1466 | |||
1467 | @@ -6965,8 +7041,11 @@ | ||
1468 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1469 | $(HOST_EXPORTS) \ | ||
1470 | cd $(HOST_SUBDIR)/binutils && \ | ||
1471 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1472 | - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ | ||
1473 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1474 | + CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ | ||
1475 | + LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ | ||
1476 | + CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ | ||
1477 | + CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ | ||
1478 | $(TARGET-stage1-binutils) | ||
1479 | |||
1480 | maybe-clean-stage1-binutils: clean-stage1-binutils | ||
1481 | @@ -6979,7 +7058,7 @@ | ||
1482 | $(MAKE) stage1-start; \ | ||
1483 | fi; \ | ||
1484 | cd $(HOST_SUBDIR)/binutils && \ | ||
1485 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1486 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1487 | clean | ||
1488 | @endif binutils-bootstrap | ||
1489 | |||
1490 | @@ -6999,8 +7078,11 @@ | ||
1491 | $(HOST_EXPORTS) \ | ||
1492 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1493 | cd $(HOST_SUBDIR)/binutils && \ | ||
1494 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1495 | - CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1496 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1497 | + CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ | ||
1498 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ | ||
1499 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ | ||
1500 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1501 | $(TARGET-stage2-binutils) | ||
1502 | |||
1503 | maybe-clean-stage2-binutils: clean-stage2-binutils | ||
1504 | @@ -7013,7 +7095,7 @@ | ||
1505 | $(MAKE) stage2-start; \ | ||
1506 | fi; \ | ||
1507 | cd $(HOST_SUBDIR)/binutils && \ | ||
1508 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1509 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1510 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1511 | clean | ||
1512 | @endif binutils-bootstrap | ||
1513 | @@ -7034,8 +7116,11 @@ | ||
1514 | $(HOST_EXPORTS) \ | ||
1515 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1516 | cd $(HOST_SUBDIR)/binutils && \ | ||
1517 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1518 | - CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1519 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1520 | + CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ | ||
1521 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ | ||
1522 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ | ||
1523 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1524 | $(TARGET-stageb2g0-binutils) | ||
1525 | |||
1526 | maybe-clean-stageb2g0-binutils: clean-stageb2g0-binutils | ||
1527 | @@ -7048,7 +7133,7 @@ | ||
1528 | $(MAKE) stageb2g0-start; \ | ||
1529 | fi; \ | ||
1530 | cd $(HOST_SUBDIR)/binutils && \ | ||
1531 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1532 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1533 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1534 | clean | ||
1535 | @endif binutils-bootstrap | ||
1536 | @@ -7069,8 +7154,11 @@ | ||
1537 | $(HOST_EXPORTS) \ | ||
1538 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1539 | cd $(HOST_SUBDIR)/binutils && \ | ||
1540 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1541 | - CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1542 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1543 | + CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ | ||
1544 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ | ||
1545 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ | ||
1546 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1547 | $(TARGET-stage3-binutils) | ||
1548 | |||
1549 | maybe-clean-stage3-binutils: clean-stage3-binutils | ||
1550 | @@ -7083,7 +7171,7 @@ | ||
1551 | $(MAKE) stage3-start; \ | ||
1552 | fi; \ | ||
1553 | cd $(HOST_SUBDIR)/binutils && \ | ||
1554 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1555 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1556 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1557 | clean | ||
1558 | @endif binutils-bootstrap | ||
1559 | @@ -7104,8 +7192,11 @@ | ||
1560 | $(HOST_EXPORTS) \ | ||
1561 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1562 | cd $(HOST_SUBDIR)/binutils && \ | ||
1563 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1564 | - CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1565 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1566 | + CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ | ||
1567 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ | ||
1568 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ | ||
1569 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1570 | $(TARGET-stageb3g2-binutils) | ||
1571 | |||
1572 | maybe-clean-stageb3g2-binutils: clean-stageb3g2-binutils | ||
1573 | @@ -7118,7 +7209,7 @@ | ||
1574 | $(MAKE) stageb3g2-start; \ | ||
1575 | fi; \ | ||
1576 | cd $(HOST_SUBDIR)/binutils && \ | ||
1577 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1578 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1579 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1580 | clean | ||
1581 | @endif binutils-bootstrap | ||
1582 | @@ -7139,8 +7230,11 @@ | ||
1583 | $(HOST_EXPORTS) \ | ||
1584 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1585 | cd $(HOST_SUBDIR)/binutils && \ | ||
1586 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1587 | - CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1588 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1589 | + CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ | ||
1590 | + LIBCFLAGS="$(STAGE4_CFLAGS)" \ | ||
1591 | + CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ | ||
1592 | + CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1593 | $(TARGET-stage4-binutils) | ||
1594 | |||
1595 | maybe-clean-stage4-binutils: clean-stage4-binutils | ||
1596 | @@ -7153,7 +7247,7 @@ | ||
1597 | $(MAKE) stage4-start; \ | ||
1598 | fi; \ | ||
1599 | cd $(HOST_SUBDIR)/binutils && \ | ||
1600 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1601 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1602 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1603 | clean | ||
1604 | @endif binutils-bootstrap | ||
1605 | @@ -7174,8 +7268,11 @@ | ||
1606 | $(HOST_EXPORTS) \ | ||
1607 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1608 | cd $(HOST_SUBDIR)/binutils && \ | ||
1609 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1610 | - CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1611 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1612 | + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ | ||
1613 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
1614 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
1615 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1616 | $(TARGET-stageprofile-binutils) | ||
1617 | |||
1618 | maybe-clean-stageprofile-binutils: clean-stageprofile-binutils | ||
1619 | @@ -7188,7 +7285,7 @@ | ||
1620 | $(MAKE) stageprofile-start; \ | ||
1621 | fi; \ | ||
1622 | cd $(HOST_SUBDIR)/binutils && \ | ||
1623 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1624 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1625 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1626 | clean | ||
1627 | @endif binutils-bootstrap | ||
1628 | @@ -7209,8 +7306,11 @@ | ||
1629 | $(HOST_EXPORTS) \ | ||
1630 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1631 | cd $(HOST_SUBDIR)/binutils && \ | ||
1632 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1633 | - CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1634 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1635 | + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ | ||
1636 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
1637 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
1638 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1639 | $(TARGET-stagefeedback-binutils) | ||
1640 | |||
1641 | maybe-clean-stagefeedback-binutils: clean-stagefeedback-binutils | ||
1642 | @@ -7223,7 +7323,7 @@ | ||
1643 | $(MAKE) stagefeedback-start; \ | ||
1644 | fi; \ | ||
1645 | cd $(HOST_SUBDIR)/binutils && \ | ||
1646 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1647 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1648 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1649 | clean | ||
1650 | @endif binutils-bootstrap | ||
1651 | @@ -7637,7 +7737,8 @@ | ||
1652 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1653 | $(HOST_EXPORTS) \ | ||
1654 | (cd $(HOST_SUBDIR)/bison && \ | ||
1655 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-bison)) | ||
1656 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
1657 | + $(TARGET-bison)) | ||
1658 | @endif bison | ||
1659 | |||
1660 | |||
1661 | @@ -8064,7 +8165,8 @@ | ||
1662 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1663 | $(HOST_EXPORTS) \ | ||
1664 | (cd $(HOST_SUBDIR)/byacc && \ | ||
1665 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-byacc)) | ||
1666 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
1667 | + $(TARGET-byacc)) | ||
1668 | @endif byacc | ||
1669 | |||
1670 | |||
1671 | @@ -8491,7 +8593,8 @@ | ||
1672 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1673 | $(HOST_EXPORTS) \ | ||
1674 | (cd $(HOST_SUBDIR)/bzip2 && \ | ||
1675 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-bzip2)) | ||
1676 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
1677 | + $(TARGET-bzip2)) | ||
1678 | @endif bzip2 | ||
1679 | |||
1680 | |||
1681 | @@ -8915,7 +9018,8 @@ | ||
1682 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1683 | $(HOST_EXPORTS) \ | ||
1684 | (cd $(HOST_SUBDIR)/dejagnu && \ | ||
1685 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-dejagnu)) | ||
1686 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
1687 | + $(TARGET-dejagnu)) | ||
1688 | @endif dejagnu | ||
1689 | |||
1690 | |||
1691 | @@ -9339,7 +9443,8 @@ | ||
1692 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1693 | $(HOST_EXPORTS) \ | ||
1694 | (cd $(HOST_SUBDIR)/diff && \ | ||
1695 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-diff)) | ||
1696 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
1697 | + $(TARGET-diff)) | ||
1698 | @endif diff | ||
1699 | |||
1700 | |||
1701 | @@ -9763,7 +9868,8 @@ | ||
1702 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1703 | $(HOST_EXPORTS) \ | ||
1704 | (cd $(HOST_SUBDIR)/dosutils && \ | ||
1705 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-dosutils)) | ||
1706 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
1707 | + $(TARGET-dosutils)) | ||
1708 | @endif dosutils | ||
1709 | |||
1710 | |||
1711 | @@ -10181,7 +10287,8 @@ | ||
1712 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1713 | $(HOST_EXPORTS) \ | ||
1714 | (cd $(HOST_SUBDIR)/etc && \ | ||
1715 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-etc)) | ||
1716 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
1717 | + $(TARGET-etc)) | ||
1718 | @endif etc | ||
1719 | |||
1720 | |||
1721 | @@ -10605,7 +10712,8 @@ | ||
1722 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1723 | $(HOST_EXPORTS) \ | ||
1724 | (cd $(HOST_SUBDIR)/fastjar && \ | ||
1725 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-fastjar)) | ||
1726 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
1727 | + $(TARGET-fastjar)) | ||
1728 | @endif fastjar | ||
1729 | |||
1730 | |||
1731 | @@ -11032,7 +11140,8 @@ | ||
1732 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1733 | $(HOST_EXPORTS) \ | ||
1734 | (cd $(HOST_SUBDIR)/fileutils && \ | ||
1735 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-fileutils)) | ||
1736 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
1737 | + $(TARGET-fileutils)) | ||
1738 | @endif fileutils | ||
1739 | |||
1740 | |||
1741 | @@ -11456,7 +11565,8 @@ | ||
1742 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1743 | $(HOST_EXPORTS) \ | ||
1744 | (cd $(HOST_SUBDIR)/findutils && \ | ||
1745 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-findutils)) | ||
1746 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
1747 | + $(TARGET-findutils)) | ||
1748 | @endif findutils | ||
1749 | |||
1750 | |||
1751 | @@ -11880,7 +11990,8 @@ | ||
1752 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1753 | $(HOST_EXPORTS) \ | ||
1754 | (cd $(HOST_SUBDIR)/find && \ | ||
1755 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-find)) | ||
1756 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
1757 | + $(TARGET-find)) | ||
1758 | @endif find | ||
1759 | |||
1760 | |||
1761 | @@ -12304,7 +12415,8 @@ | ||
1762 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1763 | $(HOST_EXPORTS) \ | ||
1764 | (cd $(HOST_SUBDIR)/fixincludes && \ | ||
1765 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-fixincludes)) | ||
1766 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
1767 | + $(TARGET-fixincludes)) | ||
1768 | @endif fixincludes | ||
1769 | |||
1770 | |||
1771 | @@ -12712,7 +12824,8 @@ | ||
1772 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1773 | $(HOST_EXPORTS) \ | ||
1774 | (cd $(HOST_SUBDIR)/flex && \ | ||
1775 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-flex)) | ||
1776 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
1777 | + $(TARGET-flex)) | ||
1778 | @endif flex | ||
1779 | |||
1780 | |||
1781 | @@ -13132,9 +13245,9 @@ | ||
1782 | @r=`${PWD_COMMAND}`; export r; \ | ||
1783 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1784 | test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ | ||
1785 | - $(HOST_EXPORTS) \ | ||
1786 | + $(HOST_EXPORTS) \ | ||
1787 | CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ | ||
1788 | - LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ | ||
1789 | + CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ | ||
1790 | echo Configuring stage 1 in $(HOST_SUBDIR)/gas ; \ | ||
1791 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ | ||
1792 | cd $(HOST_SUBDIR)/gas || exit 1; \ | ||
1793 | @@ -13163,9 +13276,9 @@ | ||
1794 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1795 | test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ | ||
1796 | $(HOST_EXPORTS) \ | ||
1797 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1798 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1799 | CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ | ||
1800 | - LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ | ||
1801 | + CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ | ||
1802 | echo Configuring stage 2 in $(HOST_SUBDIR)/gas ; \ | ||
1803 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ | ||
1804 | cd $(HOST_SUBDIR)/gas || exit 1; \ | ||
1805 | @@ -13194,9 +13307,9 @@ | ||
1806 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1807 | test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ | ||
1808 | $(HOST_EXPORTS) \ | ||
1809 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1810 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1811 | CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ | ||
1812 | - LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ | ||
1813 | + CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ | ||
1814 | echo Configuring stage b2g0 in $(HOST_SUBDIR)/gas ; \ | ||
1815 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ | ||
1816 | cd $(HOST_SUBDIR)/gas || exit 1; \ | ||
1817 | @@ -13225,9 +13338,9 @@ | ||
1818 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1819 | test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ | ||
1820 | $(HOST_EXPORTS) \ | ||
1821 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1822 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1823 | CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ | ||
1824 | - LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ | ||
1825 | + CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ | ||
1826 | echo Configuring stage 3 in $(HOST_SUBDIR)/gas ; \ | ||
1827 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ | ||
1828 | cd $(HOST_SUBDIR)/gas || exit 1; \ | ||
1829 | @@ -13256,9 +13369,9 @@ | ||
1830 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1831 | test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ | ||
1832 | $(HOST_EXPORTS) \ | ||
1833 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1834 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1835 | CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ | ||
1836 | - LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ | ||
1837 | + CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ | ||
1838 | echo Configuring stage b3g2 in $(HOST_SUBDIR)/gas ; \ | ||
1839 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ | ||
1840 | cd $(HOST_SUBDIR)/gas || exit 1; \ | ||
1841 | @@ -13287,9 +13400,9 @@ | ||
1842 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1843 | test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ | ||
1844 | $(HOST_EXPORTS) \ | ||
1845 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1846 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1847 | CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ | ||
1848 | - LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ | ||
1849 | + CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ | ||
1850 | echo Configuring stage 4 in $(HOST_SUBDIR)/gas ; \ | ||
1851 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ | ||
1852 | cd $(HOST_SUBDIR)/gas || exit 1; \ | ||
1853 | @@ -13318,9 +13431,9 @@ | ||
1854 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1855 | test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ | ||
1856 | $(HOST_EXPORTS) \ | ||
1857 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1858 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1859 | CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ | ||
1860 | - LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ | ||
1861 | + CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ | ||
1862 | echo Configuring stage profile in $(HOST_SUBDIR)/gas ; \ | ||
1863 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ | ||
1864 | cd $(HOST_SUBDIR)/gas || exit 1; \ | ||
1865 | @@ -13349,9 +13462,9 @@ | ||
1866 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1867 | test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ | ||
1868 | $(HOST_EXPORTS) \ | ||
1869 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1870 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1871 | CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ | ||
1872 | - LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ | ||
1873 | + CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ | ||
1874 | echo Configuring stage feedback in $(HOST_SUBDIR)/gas ; \ | ||
1875 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ | ||
1876 | cd $(HOST_SUBDIR)/gas || exit 1; \ | ||
1877 | @@ -13386,7 +13499,8 @@ | ||
1878 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1879 | $(HOST_EXPORTS) \ | ||
1880 | (cd $(HOST_SUBDIR)/gas && \ | ||
1881 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gas)) | ||
1882 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
1883 | + $(TARGET-gas)) | ||
1884 | @endif gas | ||
1885 | |||
1886 | |||
1887 | @@ -13405,8 +13519,11 @@ | ||
1888 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
1889 | $(HOST_EXPORTS) \ | ||
1890 | cd $(HOST_SUBDIR)/gas && \ | ||
1891 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1892 | - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ | ||
1893 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1894 | + CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ | ||
1895 | + LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ | ||
1896 | + CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ | ||
1897 | + CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ | ||
1898 | $(TARGET-stage1-gas) | ||
1899 | |||
1900 | maybe-clean-stage1-gas: clean-stage1-gas | ||
1901 | @@ -13419,7 +13536,7 @@ | ||
1902 | $(MAKE) stage1-start; \ | ||
1903 | fi; \ | ||
1904 | cd $(HOST_SUBDIR)/gas && \ | ||
1905 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1906 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1907 | clean | ||
1908 | @endif gas-bootstrap | ||
1909 | |||
1910 | @@ -13439,8 +13556,11 @@ | ||
1911 | $(HOST_EXPORTS) \ | ||
1912 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1913 | cd $(HOST_SUBDIR)/gas && \ | ||
1914 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1915 | - CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1916 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1917 | + CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ | ||
1918 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ | ||
1919 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ | ||
1920 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1921 | $(TARGET-stage2-gas) | ||
1922 | |||
1923 | maybe-clean-stage2-gas: clean-stage2-gas | ||
1924 | @@ -13453,7 +13573,7 @@ | ||
1925 | $(MAKE) stage2-start; \ | ||
1926 | fi; \ | ||
1927 | cd $(HOST_SUBDIR)/gas && \ | ||
1928 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1929 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1930 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1931 | clean | ||
1932 | @endif gas-bootstrap | ||
1933 | @@ -13474,8 +13594,11 @@ | ||
1934 | $(HOST_EXPORTS) \ | ||
1935 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1936 | cd $(HOST_SUBDIR)/gas && \ | ||
1937 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1938 | - CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1939 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1940 | + CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ | ||
1941 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ | ||
1942 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ | ||
1943 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1944 | $(TARGET-stageb2g0-gas) | ||
1945 | |||
1946 | maybe-clean-stageb2g0-gas: clean-stageb2g0-gas | ||
1947 | @@ -13488,7 +13611,7 @@ | ||
1948 | $(MAKE) stageb2g0-start; \ | ||
1949 | fi; \ | ||
1950 | cd $(HOST_SUBDIR)/gas && \ | ||
1951 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1952 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1953 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1954 | clean | ||
1955 | @endif gas-bootstrap | ||
1956 | @@ -13509,8 +13632,11 @@ | ||
1957 | $(HOST_EXPORTS) \ | ||
1958 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1959 | cd $(HOST_SUBDIR)/gas && \ | ||
1960 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1961 | - CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1962 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1963 | + CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ | ||
1964 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ | ||
1965 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ | ||
1966 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1967 | $(TARGET-stage3-gas) | ||
1968 | |||
1969 | maybe-clean-stage3-gas: clean-stage3-gas | ||
1970 | @@ -13523,7 +13649,7 @@ | ||
1971 | $(MAKE) stage3-start; \ | ||
1972 | fi; \ | ||
1973 | cd $(HOST_SUBDIR)/gas && \ | ||
1974 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1975 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1976 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1977 | clean | ||
1978 | @endif gas-bootstrap | ||
1979 | @@ -13544,8 +13670,11 @@ | ||
1980 | $(HOST_EXPORTS) \ | ||
1981 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
1982 | cd $(HOST_SUBDIR)/gas && \ | ||
1983 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1984 | - CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1985 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
1986 | + CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ | ||
1987 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ | ||
1988 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ | ||
1989 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
1990 | $(TARGET-stageb3g2-gas) | ||
1991 | |||
1992 | maybe-clean-stageb3g2-gas: clean-stageb3g2-gas | ||
1993 | @@ -13558,7 +13687,7 @@ | ||
1994 | $(MAKE) stageb3g2-start; \ | ||
1995 | fi; \ | ||
1996 | cd $(HOST_SUBDIR)/gas && \ | ||
1997 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
1998 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
1999 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2000 | clean | ||
2001 | @endif gas-bootstrap | ||
2002 | @@ -13579,8 +13708,11 @@ | ||
2003 | $(HOST_EXPORTS) \ | ||
2004 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2005 | cd $(HOST_SUBDIR)/gas && \ | ||
2006 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2007 | - CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2008 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2009 | + CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ | ||
2010 | + LIBCFLAGS="$(STAGE4_CFLAGS)" \ | ||
2011 | + CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ | ||
2012 | + CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2013 | $(TARGET-stage4-gas) | ||
2014 | |||
2015 | maybe-clean-stage4-gas: clean-stage4-gas | ||
2016 | @@ -13593,7 +13725,7 @@ | ||
2017 | $(MAKE) stage4-start; \ | ||
2018 | fi; \ | ||
2019 | cd $(HOST_SUBDIR)/gas && \ | ||
2020 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2021 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2022 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2023 | clean | ||
2024 | @endif gas-bootstrap | ||
2025 | @@ -13614,8 +13746,11 @@ | ||
2026 | $(HOST_EXPORTS) \ | ||
2027 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2028 | cd $(HOST_SUBDIR)/gas && \ | ||
2029 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2030 | - CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2031 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2032 | + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ | ||
2033 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
2034 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
2035 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2036 | $(TARGET-stageprofile-gas) | ||
2037 | |||
2038 | maybe-clean-stageprofile-gas: clean-stageprofile-gas | ||
2039 | @@ -13628,7 +13763,7 @@ | ||
2040 | $(MAKE) stageprofile-start; \ | ||
2041 | fi; \ | ||
2042 | cd $(HOST_SUBDIR)/gas && \ | ||
2043 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2044 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2045 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2046 | clean | ||
2047 | @endif gas-bootstrap | ||
2048 | @@ -13649,8 +13784,11 @@ | ||
2049 | $(HOST_EXPORTS) \ | ||
2050 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2051 | cd $(HOST_SUBDIR)/gas && \ | ||
2052 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2053 | - CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2054 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2055 | + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ | ||
2056 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
2057 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
2058 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2059 | $(TARGET-stagefeedback-gas) | ||
2060 | |||
2061 | maybe-clean-stagefeedback-gas: clean-stagefeedback-gas | ||
2062 | @@ -13663,7 +13801,7 @@ | ||
2063 | $(MAKE) stagefeedback-start; \ | ||
2064 | fi; \ | ||
2065 | cd $(HOST_SUBDIR)/gas && \ | ||
2066 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2067 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2068 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2069 | clean | ||
2070 | @endif gas-bootstrap | ||
2071 | @@ -14070,9 +14208,9 @@ | ||
2072 | @r=`${PWD_COMMAND}`; export r; \ | ||
2073 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2074 | test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ | ||
2075 | - $(HOST_EXPORTS) \ | ||
2076 | + $(HOST_EXPORTS) \ | ||
2077 | CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ | ||
2078 | - LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ | ||
2079 | + CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ | ||
2080 | echo Configuring stage 1 in $(HOST_SUBDIR)/gcc ; \ | ||
2081 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ | ||
2082 | cd $(HOST_SUBDIR)/gcc || exit 1; \ | ||
2083 | @@ -14101,9 +14239,9 @@ | ||
2084 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2085 | test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ | ||
2086 | $(HOST_EXPORTS) \ | ||
2087 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2088 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2089 | CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ | ||
2090 | - LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ | ||
2091 | + CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ | ||
2092 | echo Configuring stage 2 in $(HOST_SUBDIR)/gcc ; \ | ||
2093 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ | ||
2094 | cd $(HOST_SUBDIR)/gcc || exit 1; \ | ||
2095 | @@ -14132,9 +14270,9 @@ | ||
2096 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2097 | test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ | ||
2098 | $(HOST_EXPORTS) \ | ||
2099 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2100 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2101 | CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ | ||
2102 | - LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ | ||
2103 | + CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ | ||
2104 | echo Configuring stage b2g0 in $(HOST_SUBDIR)/gcc ; \ | ||
2105 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ | ||
2106 | cd $(HOST_SUBDIR)/gcc || exit 1; \ | ||
2107 | @@ -14163,9 +14301,9 @@ | ||
2108 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2109 | test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ | ||
2110 | $(HOST_EXPORTS) \ | ||
2111 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2112 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2113 | CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ | ||
2114 | - LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ | ||
2115 | + CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ | ||
2116 | echo Configuring stage 3 in $(HOST_SUBDIR)/gcc ; \ | ||
2117 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ | ||
2118 | cd $(HOST_SUBDIR)/gcc || exit 1; \ | ||
2119 | @@ -14194,9 +14332,9 @@ | ||
2120 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2121 | test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ | ||
2122 | $(HOST_EXPORTS) \ | ||
2123 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2124 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2125 | CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ | ||
2126 | - LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ | ||
2127 | + CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ | ||
2128 | echo Configuring stage b3g2 in $(HOST_SUBDIR)/gcc ; \ | ||
2129 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ | ||
2130 | cd $(HOST_SUBDIR)/gcc || exit 1; \ | ||
2131 | @@ -14225,9 +14363,9 @@ | ||
2132 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2133 | test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ | ||
2134 | $(HOST_EXPORTS) \ | ||
2135 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2136 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2137 | CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ | ||
2138 | - LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ | ||
2139 | + CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ | ||
2140 | echo Configuring stage 4 in $(HOST_SUBDIR)/gcc ; \ | ||
2141 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ | ||
2142 | cd $(HOST_SUBDIR)/gcc || exit 1; \ | ||
2143 | @@ -14256,9 +14394,9 @@ | ||
2144 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2145 | test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ | ||
2146 | $(HOST_EXPORTS) \ | ||
2147 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2148 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2149 | CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ | ||
2150 | - LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ | ||
2151 | + CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ | ||
2152 | echo Configuring stage profile in $(HOST_SUBDIR)/gcc ; \ | ||
2153 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ | ||
2154 | cd $(HOST_SUBDIR)/gcc || exit 1; \ | ||
2155 | @@ -14287,9 +14425,9 @@ | ||
2156 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2157 | test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ | ||
2158 | $(HOST_EXPORTS) \ | ||
2159 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2160 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2161 | CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ | ||
2162 | - LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ | ||
2163 | + CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ | ||
2164 | echo Configuring stage feedback in $(HOST_SUBDIR)/gcc ; \ | ||
2165 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ | ||
2166 | cd $(HOST_SUBDIR)/gcc || exit 1; \ | ||
2167 | @@ -14324,7 +14462,8 @@ | ||
2168 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2169 | $(HOST_EXPORTS) \ | ||
2170 | (cd $(HOST_SUBDIR)/gcc && \ | ||
2171 | - $(MAKE) $(FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) $(TARGET-gcc)) | ||
2172 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS) \ | ||
2173 | + $(TARGET-gcc)) | ||
2174 | @endif gcc | ||
2175 | |||
2176 | |||
2177 | @@ -14343,8 +14482,11 @@ | ||
2178 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2179 | $(HOST_EXPORTS) \ | ||
2180 | cd $(HOST_SUBDIR)/gcc && \ | ||
2181 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2182 | - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" $(EXTRA_GCC_FLAGS) \ | ||
2183 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2184 | + CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ | ||
2185 | + LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ | ||
2186 | + CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ | ||
2187 | + CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS) \ | ||
2188 | $(TARGET-stage1-gcc) | ||
2189 | |||
2190 | maybe-clean-stage1-gcc: clean-stage1-gcc | ||
2191 | @@ -14357,7 +14499,7 @@ | ||
2192 | $(MAKE) stage1-start; \ | ||
2193 | fi; \ | ||
2194 | cd $(HOST_SUBDIR)/gcc && \ | ||
2195 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2196 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2197 | $(EXTRA_GCC_FLAGS) clean | ||
2198 | @endif gcc-bootstrap | ||
2199 | |||
2200 | @@ -14377,8 +14519,11 @@ | ||
2201 | $(HOST_EXPORTS) \ | ||
2202 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2203 | cd $(HOST_SUBDIR)/gcc && \ | ||
2204 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2205 | - CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ | ||
2206 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2207 | + CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ | ||
2208 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ | ||
2209 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ | ||
2210 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ | ||
2211 | $(TARGET-stage2-gcc) | ||
2212 | |||
2213 | maybe-clean-stage2-gcc: clean-stage2-gcc | ||
2214 | @@ -14391,7 +14536,7 @@ | ||
2215 | $(MAKE) stage2-start; \ | ||
2216 | fi; \ | ||
2217 | cd $(HOST_SUBDIR)/gcc && \ | ||
2218 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2219 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2220 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2221 | $(EXTRA_GCC_FLAGS) clean | ||
2222 | @endif gcc-bootstrap | ||
2223 | @@ -14412,8 +14557,11 @@ | ||
2224 | $(HOST_EXPORTS) \ | ||
2225 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2226 | cd $(HOST_SUBDIR)/gcc && \ | ||
2227 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2228 | - CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ | ||
2229 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2230 | + CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ | ||
2231 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ | ||
2232 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ | ||
2233 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ | ||
2234 | $(TARGET-stageb2g0-gcc) | ||
2235 | |||
2236 | maybe-clean-stageb2g0-gcc: clean-stageb2g0-gcc | ||
2237 | @@ -14426,7 +14574,7 @@ | ||
2238 | $(MAKE) stageb2g0-start; \ | ||
2239 | fi; \ | ||
2240 | cd $(HOST_SUBDIR)/gcc && \ | ||
2241 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2242 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2243 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2244 | $(EXTRA_GCC_FLAGS) clean | ||
2245 | @endif gcc-bootstrap | ||
2246 | @@ -14447,8 +14595,11 @@ | ||
2247 | $(HOST_EXPORTS) \ | ||
2248 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2249 | cd $(HOST_SUBDIR)/gcc && \ | ||
2250 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2251 | - CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ | ||
2252 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2253 | + CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ | ||
2254 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ | ||
2255 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ | ||
2256 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ | ||
2257 | $(TARGET-stage3-gcc) | ||
2258 | |||
2259 | maybe-clean-stage3-gcc: clean-stage3-gcc | ||
2260 | @@ -14461,7 +14612,7 @@ | ||
2261 | $(MAKE) stage3-start; \ | ||
2262 | fi; \ | ||
2263 | cd $(HOST_SUBDIR)/gcc && \ | ||
2264 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2265 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2266 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2267 | $(EXTRA_GCC_FLAGS) clean | ||
2268 | @endif gcc-bootstrap | ||
2269 | @@ -14482,8 +14633,11 @@ | ||
2270 | $(HOST_EXPORTS) \ | ||
2271 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2272 | cd $(HOST_SUBDIR)/gcc && \ | ||
2273 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2274 | - CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ | ||
2275 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2276 | + CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ | ||
2277 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ | ||
2278 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ | ||
2279 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ | ||
2280 | $(TARGET-stageb3g2-gcc) | ||
2281 | |||
2282 | maybe-clean-stageb3g2-gcc: clean-stageb3g2-gcc | ||
2283 | @@ -14496,7 +14650,7 @@ | ||
2284 | $(MAKE) stageb3g2-start; \ | ||
2285 | fi; \ | ||
2286 | cd $(HOST_SUBDIR)/gcc && \ | ||
2287 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2288 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2289 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2290 | $(EXTRA_GCC_FLAGS) clean | ||
2291 | @endif gcc-bootstrap | ||
2292 | @@ -14517,8 +14671,11 @@ | ||
2293 | $(HOST_EXPORTS) \ | ||
2294 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2295 | cd $(HOST_SUBDIR)/gcc && \ | ||
2296 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2297 | - CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ | ||
2298 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2299 | + CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ | ||
2300 | + LIBCFLAGS="$(STAGE4_CFLAGS)" \ | ||
2301 | + CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ | ||
2302 | + CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ | ||
2303 | $(TARGET-stage4-gcc) | ||
2304 | |||
2305 | maybe-clean-stage4-gcc: clean-stage4-gcc | ||
2306 | @@ -14531,7 +14688,7 @@ | ||
2307 | $(MAKE) stage4-start; \ | ||
2308 | fi; \ | ||
2309 | cd $(HOST_SUBDIR)/gcc && \ | ||
2310 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2311 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2312 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2313 | $(EXTRA_GCC_FLAGS) clean | ||
2314 | @endif gcc-bootstrap | ||
2315 | @@ -14552,8 +14709,11 @@ | ||
2316 | $(HOST_EXPORTS) \ | ||
2317 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2318 | cd $(HOST_SUBDIR)/gcc && \ | ||
2319 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2320 | - CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ | ||
2321 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2322 | + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ | ||
2323 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
2324 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
2325 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ | ||
2326 | $(TARGET-stageprofile-gcc) | ||
2327 | |||
2328 | maybe-clean-stageprofile-gcc: clean-stageprofile-gcc | ||
2329 | @@ -14566,7 +14726,7 @@ | ||
2330 | $(MAKE) stageprofile-start; \ | ||
2331 | fi; \ | ||
2332 | cd $(HOST_SUBDIR)/gcc && \ | ||
2333 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2334 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2335 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2336 | $(EXTRA_GCC_FLAGS) clean | ||
2337 | @endif gcc-bootstrap | ||
2338 | @@ -14587,8 +14747,11 @@ | ||
2339 | $(HOST_EXPORTS) \ | ||
2340 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2341 | cd $(HOST_SUBDIR)/gcc && \ | ||
2342 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2343 | - CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ | ||
2344 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2345 | + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ | ||
2346 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
2347 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
2348 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ | ||
2349 | $(TARGET-stagefeedback-gcc) | ||
2350 | |||
2351 | maybe-clean-stagefeedback-gcc: clean-stagefeedback-gcc | ||
2352 | @@ -14601,7 +14764,7 @@ | ||
2353 | $(MAKE) stagefeedback-start; \ | ||
2354 | fi; \ | ||
2355 | cd $(HOST_SUBDIR)/gcc && \ | ||
2356 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2357 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2358 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2359 | $(EXTRA_GCC_FLAGS) clean | ||
2360 | @endif gcc-bootstrap | ||
2361 | @@ -15015,7 +15178,8 @@ | ||
2362 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2363 | $(HOST_EXPORTS) \ | ||
2364 | (cd $(HOST_SUBDIR)/gawk && \ | ||
2365 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gawk)) | ||
2366 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
2367 | + $(TARGET-gawk)) | ||
2368 | @endif gawk | ||
2369 | |||
2370 | |||
2371 | @@ -15439,7 +15603,8 @@ | ||
2372 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2373 | $(HOST_EXPORTS) \ | ||
2374 | (cd $(HOST_SUBDIR)/gettext && \ | ||
2375 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gettext)) | ||
2376 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
2377 | + $(TARGET-gettext)) | ||
2378 | @endif gettext | ||
2379 | |||
2380 | |||
2381 | @@ -15856,9 +16021,9 @@ | ||
2382 | @r=`${PWD_COMMAND}`; export r; \ | ||
2383 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2384 | test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ | ||
2385 | - $(HOST_EXPORTS) \ | ||
2386 | + $(HOST_EXPORTS) \ | ||
2387 | CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ | ||
2388 | - LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ | ||
2389 | + CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ | ||
2390 | echo Configuring stage 1 in $(HOST_SUBDIR)/gmp ; \ | ||
2391 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ | ||
2392 | cd $(HOST_SUBDIR)/gmp || exit 1; \ | ||
2393 | @@ -15887,9 +16052,9 @@ | ||
2394 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2395 | test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ | ||
2396 | $(HOST_EXPORTS) \ | ||
2397 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2398 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2399 | CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ | ||
2400 | - LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ | ||
2401 | + CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ | ||
2402 | echo Configuring stage 2 in $(HOST_SUBDIR)/gmp ; \ | ||
2403 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ | ||
2404 | cd $(HOST_SUBDIR)/gmp || exit 1; \ | ||
2405 | @@ -15918,9 +16083,9 @@ | ||
2406 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2407 | test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ | ||
2408 | $(HOST_EXPORTS) \ | ||
2409 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2410 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2411 | CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ | ||
2412 | - LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ | ||
2413 | + CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ | ||
2414 | echo Configuring stage b2g0 in $(HOST_SUBDIR)/gmp ; \ | ||
2415 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ | ||
2416 | cd $(HOST_SUBDIR)/gmp || exit 1; \ | ||
2417 | @@ -15949,9 +16114,9 @@ | ||
2418 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2419 | test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ | ||
2420 | $(HOST_EXPORTS) \ | ||
2421 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2422 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2423 | CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ | ||
2424 | - LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ | ||
2425 | + CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ | ||
2426 | echo Configuring stage 3 in $(HOST_SUBDIR)/gmp ; \ | ||
2427 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ | ||
2428 | cd $(HOST_SUBDIR)/gmp || exit 1; \ | ||
2429 | @@ -15980,9 +16145,9 @@ | ||
2430 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2431 | test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ | ||
2432 | $(HOST_EXPORTS) \ | ||
2433 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2434 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2435 | CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ | ||
2436 | - LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ | ||
2437 | + CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ | ||
2438 | echo Configuring stage b3g2 in $(HOST_SUBDIR)/gmp ; \ | ||
2439 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ | ||
2440 | cd $(HOST_SUBDIR)/gmp || exit 1; \ | ||
2441 | @@ -16011,9 +16176,9 @@ | ||
2442 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2443 | test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ | ||
2444 | $(HOST_EXPORTS) \ | ||
2445 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2446 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2447 | CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ | ||
2448 | - LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ | ||
2449 | + CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ | ||
2450 | echo Configuring stage 4 in $(HOST_SUBDIR)/gmp ; \ | ||
2451 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ | ||
2452 | cd $(HOST_SUBDIR)/gmp || exit 1; \ | ||
2453 | @@ -16042,9 +16207,9 @@ | ||
2454 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2455 | test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ | ||
2456 | $(HOST_EXPORTS) \ | ||
2457 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2458 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2459 | CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ | ||
2460 | - LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ | ||
2461 | + CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ | ||
2462 | echo Configuring stage profile in $(HOST_SUBDIR)/gmp ; \ | ||
2463 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ | ||
2464 | cd $(HOST_SUBDIR)/gmp || exit 1; \ | ||
2465 | @@ -16073,9 +16238,9 @@ | ||
2466 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2467 | test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ | ||
2468 | $(HOST_EXPORTS) \ | ||
2469 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2470 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2471 | CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ | ||
2472 | - LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ | ||
2473 | + CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ | ||
2474 | echo Configuring stage feedback in $(HOST_SUBDIR)/gmp ; \ | ||
2475 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ | ||
2476 | cd $(HOST_SUBDIR)/gmp || exit 1; \ | ||
2477 | @@ -16110,7 +16275,8 @@ | ||
2478 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2479 | $(HOST_EXPORTS) \ | ||
2480 | (cd $(HOST_SUBDIR)/gmp && \ | ||
2481 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gmp)) | ||
2482 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
2483 | + $(TARGET-gmp)) | ||
2484 | @endif gmp | ||
2485 | |||
2486 | |||
2487 | @@ -16129,8 +16295,11 @@ | ||
2488 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2489 | $(HOST_EXPORTS) \ | ||
2490 | cd $(HOST_SUBDIR)/gmp && \ | ||
2491 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2492 | - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ | ||
2493 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2494 | + CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ | ||
2495 | + LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ | ||
2496 | + CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ | ||
2497 | + CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ | ||
2498 | $(TARGET-stage1-gmp) | ||
2499 | |||
2500 | maybe-clean-stage1-gmp: clean-stage1-gmp | ||
2501 | @@ -16143,7 +16312,7 @@ | ||
2502 | $(MAKE) stage1-start; \ | ||
2503 | fi; \ | ||
2504 | cd $(HOST_SUBDIR)/gmp && \ | ||
2505 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2506 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2507 | clean | ||
2508 | @endif gmp-bootstrap | ||
2509 | |||
2510 | @@ -16163,8 +16332,11 @@ | ||
2511 | $(HOST_EXPORTS) \ | ||
2512 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2513 | cd $(HOST_SUBDIR)/gmp && \ | ||
2514 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2515 | - CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2516 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2517 | + CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ | ||
2518 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ | ||
2519 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ | ||
2520 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2521 | $(TARGET-stage2-gmp) | ||
2522 | |||
2523 | maybe-clean-stage2-gmp: clean-stage2-gmp | ||
2524 | @@ -16177,7 +16349,7 @@ | ||
2525 | $(MAKE) stage2-start; \ | ||
2526 | fi; \ | ||
2527 | cd $(HOST_SUBDIR)/gmp && \ | ||
2528 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2529 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2530 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2531 | clean | ||
2532 | @endif gmp-bootstrap | ||
2533 | @@ -16198,8 +16370,11 @@ | ||
2534 | $(HOST_EXPORTS) \ | ||
2535 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2536 | cd $(HOST_SUBDIR)/gmp && \ | ||
2537 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2538 | - CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2539 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2540 | + CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ | ||
2541 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ | ||
2542 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ | ||
2543 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2544 | $(TARGET-stageb2g0-gmp) | ||
2545 | |||
2546 | maybe-clean-stageb2g0-gmp: clean-stageb2g0-gmp | ||
2547 | @@ -16212,7 +16387,7 @@ | ||
2548 | $(MAKE) stageb2g0-start; \ | ||
2549 | fi; \ | ||
2550 | cd $(HOST_SUBDIR)/gmp && \ | ||
2551 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2552 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2553 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2554 | clean | ||
2555 | @endif gmp-bootstrap | ||
2556 | @@ -16233,8 +16408,11 @@ | ||
2557 | $(HOST_EXPORTS) \ | ||
2558 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2559 | cd $(HOST_SUBDIR)/gmp && \ | ||
2560 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2561 | - CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2562 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2563 | + CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ | ||
2564 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ | ||
2565 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ | ||
2566 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2567 | $(TARGET-stage3-gmp) | ||
2568 | |||
2569 | maybe-clean-stage3-gmp: clean-stage3-gmp | ||
2570 | @@ -16247,7 +16425,7 @@ | ||
2571 | $(MAKE) stage3-start; \ | ||
2572 | fi; \ | ||
2573 | cd $(HOST_SUBDIR)/gmp && \ | ||
2574 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2575 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2576 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2577 | clean | ||
2578 | @endif gmp-bootstrap | ||
2579 | @@ -16268,8 +16446,11 @@ | ||
2580 | $(HOST_EXPORTS) \ | ||
2581 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2582 | cd $(HOST_SUBDIR)/gmp && \ | ||
2583 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2584 | - CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2585 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2586 | + CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ | ||
2587 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ | ||
2588 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ | ||
2589 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2590 | $(TARGET-stageb3g2-gmp) | ||
2591 | |||
2592 | maybe-clean-stageb3g2-gmp: clean-stageb3g2-gmp | ||
2593 | @@ -16282,7 +16463,7 @@ | ||
2594 | $(MAKE) stageb3g2-start; \ | ||
2595 | fi; \ | ||
2596 | cd $(HOST_SUBDIR)/gmp && \ | ||
2597 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2598 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2599 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2600 | clean | ||
2601 | @endif gmp-bootstrap | ||
2602 | @@ -16303,8 +16484,11 @@ | ||
2603 | $(HOST_EXPORTS) \ | ||
2604 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2605 | cd $(HOST_SUBDIR)/gmp && \ | ||
2606 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2607 | - CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2608 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2609 | + CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ | ||
2610 | + LIBCFLAGS="$(STAGE4_CFLAGS)" \ | ||
2611 | + CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ | ||
2612 | + CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2613 | $(TARGET-stage4-gmp) | ||
2614 | |||
2615 | maybe-clean-stage4-gmp: clean-stage4-gmp | ||
2616 | @@ -16317,7 +16501,7 @@ | ||
2617 | $(MAKE) stage4-start; \ | ||
2618 | fi; \ | ||
2619 | cd $(HOST_SUBDIR)/gmp && \ | ||
2620 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2621 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2622 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2623 | clean | ||
2624 | @endif gmp-bootstrap | ||
2625 | @@ -16338,8 +16522,11 @@ | ||
2626 | $(HOST_EXPORTS) \ | ||
2627 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2628 | cd $(HOST_SUBDIR)/gmp && \ | ||
2629 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2630 | - CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2631 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2632 | + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ | ||
2633 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
2634 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
2635 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2636 | $(TARGET-stageprofile-gmp) | ||
2637 | |||
2638 | maybe-clean-stageprofile-gmp: clean-stageprofile-gmp | ||
2639 | @@ -16352,7 +16539,7 @@ | ||
2640 | $(MAKE) stageprofile-start; \ | ||
2641 | fi; \ | ||
2642 | cd $(HOST_SUBDIR)/gmp && \ | ||
2643 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2644 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2645 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2646 | clean | ||
2647 | @endif gmp-bootstrap | ||
2648 | @@ -16373,8 +16560,11 @@ | ||
2649 | $(HOST_EXPORTS) \ | ||
2650 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2651 | cd $(HOST_SUBDIR)/gmp && \ | ||
2652 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2653 | - CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2654 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2655 | + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ | ||
2656 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
2657 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
2658 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2659 | $(TARGET-stagefeedback-gmp) | ||
2660 | |||
2661 | maybe-clean-stagefeedback-gmp: clean-stagefeedback-gmp | ||
2662 | @@ -16387,7 +16577,7 @@ | ||
2663 | $(MAKE) stagefeedback-start; \ | ||
2664 | fi; \ | ||
2665 | cd $(HOST_SUBDIR)/gmp && \ | ||
2666 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2667 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2668 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2669 | clean | ||
2670 | @endif gmp-bootstrap | ||
2671 | @@ -16788,9 +16978,9 @@ | ||
2672 | @r=`${PWD_COMMAND}`; export r; \ | ||
2673 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2674 | test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ | ||
2675 | - $(HOST_EXPORTS) \ | ||
2676 | + $(HOST_EXPORTS) \ | ||
2677 | CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ | ||
2678 | - LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ | ||
2679 | + CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ | ||
2680 | echo Configuring stage 1 in $(HOST_SUBDIR)/mpfr ; \ | ||
2681 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ | ||
2682 | cd $(HOST_SUBDIR)/mpfr || exit 1; \ | ||
2683 | @@ -16819,9 +17009,9 @@ | ||
2684 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2685 | test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ | ||
2686 | $(HOST_EXPORTS) \ | ||
2687 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2688 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2689 | CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ | ||
2690 | - LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ | ||
2691 | + CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ | ||
2692 | echo Configuring stage 2 in $(HOST_SUBDIR)/mpfr ; \ | ||
2693 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ | ||
2694 | cd $(HOST_SUBDIR)/mpfr || exit 1; \ | ||
2695 | @@ -16850,9 +17040,9 @@ | ||
2696 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2697 | test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ | ||
2698 | $(HOST_EXPORTS) \ | ||
2699 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2700 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2701 | CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ | ||
2702 | - LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ | ||
2703 | + CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ | ||
2704 | echo Configuring stage b2g0 in $(HOST_SUBDIR)/mpfr ; \ | ||
2705 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ | ||
2706 | cd $(HOST_SUBDIR)/mpfr || exit 1; \ | ||
2707 | @@ -16881,9 +17071,9 @@ | ||
2708 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2709 | test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ | ||
2710 | $(HOST_EXPORTS) \ | ||
2711 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2712 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2713 | CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ | ||
2714 | - LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ | ||
2715 | + CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ | ||
2716 | echo Configuring stage 3 in $(HOST_SUBDIR)/mpfr ; \ | ||
2717 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ | ||
2718 | cd $(HOST_SUBDIR)/mpfr || exit 1; \ | ||
2719 | @@ -16912,9 +17102,9 @@ | ||
2720 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2721 | test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ | ||
2722 | $(HOST_EXPORTS) \ | ||
2723 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2724 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2725 | CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ | ||
2726 | - LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ | ||
2727 | + CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ | ||
2728 | echo Configuring stage b3g2 in $(HOST_SUBDIR)/mpfr ; \ | ||
2729 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ | ||
2730 | cd $(HOST_SUBDIR)/mpfr || exit 1; \ | ||
2731 | @@ -16943,9 +17133,9 @@ | ||
2732 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2733 | test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ | ||
2734 | $(HOST_EXPORTS) \ | ||
2735 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2736 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2737 | CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ | ||
2738 | - LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ | ||
2739 | + CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ | ||
2740 | echo Configuring stage 4 in $(HOST_SUBDIR)/mpfr ; \ | ||
2741 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ | ||
2742 | cd $(HOST_SUBDIR)/mpfr || exit 1; \ | ||
2743 | @@ -16974,9 +17164,9 @@ | ||
2744 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2745 | test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ | ||
2746 | $(HOST_EXPORTS) \ | ||
2747 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2748 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2749 | CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ | ||
2750 | - LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ | ||
2751 | + CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ | ||
2752 | echo Configuring stage profile in $(HOST_SUBDIR)/mpfr ; \ | ||
2753 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ | ||
2754 | cd $(HOST_SUBDIR)/mpfr || exit 1; \ | ||
2755 | @@ -17005,9 +17195,9 @@ | ||
2756 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2757 | test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ | ||
2758 | $(HOST_EXPORTS) \ | ||
2759 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2760 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2761 | CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ | ||
2762 | - LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ | ||
2763 | + CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ | ||
2764 | echo Configuring stage feedback in $(HOST_SUBDIR)/mpfr ; \ | ||
2765 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ | ||
2766 | cd $(HOST_SUBDIR)/mpfr || exit 1; \ | ||
2767 | @@ -17042,7 +17232,8 @@ | ||
2768 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2769 | $(HOST_EXPORTS) \ | ||
2770 | (cd $(HOST_SUBDIR)/mpfr && \ | ||
2771 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-mpfr)) | ||
2772 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
2773 | + $(TARGET-mpfr)) | ||
2774 | @endif mpfr | ||
2775 | |||
2776 | |||
2777 | @@ -17061,8 +17252,11 @@ | ||
2778 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2779 | $(HOST_EXPORTS) \ | ||
2780 | cd $(HOST_SUBDIR)/mpfr && \ | ||
2781 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2782 | - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ | ||
2783 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2784 | + CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ | ||
2785 | + LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ | ||
2786 | + CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ | ||
2787 | + CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ | ||
2788 | $(TARGET-stage1-mpfr) | ||
2789 | |||
2790 | maybe-clean-stage1-mpfr: clean-stage1-mpfr | ||
2791 | @@ -17075,7 +17269,7 @@ | ||
2792 | $(MAKE) stage1-start; \ | ||
2793 | fi; \ | ||
2794 | cd $(HOST_SUBDIR)/mpfr && \ | ||
2795 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2796 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2797 | clean | ||
2798 | @endif mpfr-bootstrap | ||
2799 | |||
2800 | @@ -17095,8 +17289,11 @@ | ||
2801 | $(HOST_EXPORTS) \ | ||
2802 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2803 | cd $(HOST_SUBDIR)/mpfr && \ | ||
2804 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2805 | - CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2806 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2807 | + CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ | ||
2808 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ | ||
2809 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ | ||
2810 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2811 | $(TARGET-stage2-mpfr) | ||
2812 | |||
2813 | maybe-clean-stage2-mpfr: clean-stage2-mpfr | ||
2814 | @@ -17109,7 +17306,7 @@ | ||
2815 | $(MAKE) stage2-start; \ | ||
2816 | fi; \ | ||
2817 | cd $(HOST_SUBDIR)/mpfr && \ | ||
2818 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2819 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2820 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2821 | clean | ||
2822 | @endif mpfr-bootstrap | ||
2823 | @@ -17130,8 +17327,11 @@ | ||
2824 | $(HOST_EXPORTS) \ | ||
2825 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2826 | cd $(HOST_SUBDIR)/mpfr && \ | ||
2827 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2828 | - CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2829 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2830 | + CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ | ||
2831 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ | ||
2832 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ | ||
2833 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2834 | $(TARGET-stageb2g0-mpfr) | ||
2835 | |||
2836 | maybe-clean-stageb2g0-mpfr: clean-stageb2g0-mpfr | ||
2837 | @@ -17144,7 +17344,7 @@ | ||
2838 | $(MAKE) stageb2g0-start; \ | ||
2839 | fi; \ | ||
2840 | cd $(HOST_SUBDIR)/mpfr && \ | ||
2841 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2842 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2843 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2844 | clean | ||
2845 | @endif mpfr-bootstrap | ||
2846 | @@ -17165,8 +17365,11 @@ | ||
2847 | $(HOST_EXPORTS) \ | ||
2848 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2849 | cd $(HOST_SUBDIR)/mpfr && \ | ||
2850 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2851 | - CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2852 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2853 | + CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ | ||
2854 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ | ||
2855 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ | ||
2856 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2857 | $(TARGET-stage3-mpfr) | ||
2858 | |||
2859 | maybe-clean-stage3-mpfr: clean-stage3-mpfr | ||
2860 | @@ -17179,7 +17382,7 @@ | ||
2861 | $(MAKE) stage3-start; \ | ||
2862 | fi; \ | ||
2863 | cd $(HOST_SUBDIR)/mpfr && \ | ||
2864 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2865 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2866 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2867 | clean | ||
2868 | @endif mpfr-bootstrap | ||
2869 | @@ -17200,8 +17403,11 @@ | ||
2870 | $(HOST_EXPORTS) \ | ||
2871 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2872 | cd $(HOST_SUBDIR)/mpfr && \ | ||
2873 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2874 | - CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2875 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2876 | + CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ | ||
2877 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ | ||
2878 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ | ||
2879 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2880 | $(TARGET-stageb3g2-mpfr) | ||
2881 | |||
2882 | maybe-clean-stageb3g2-mpfr: clean-stageb3g2-mpfr | ||
2883 | @@ -17214,7 +17420,7 @@ | ||
2884 | $(MAKE) stageb3g2-start; \ | ||
2885 | fi; \ | ||
2886 | cd $(HOST_SUBDIR)/mpfr && \ | ||
2887 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2888 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2889 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2890 | clean | ||
2891 | @endif mpfr-bootstrap | ||
2892 | @@ -17235,8 +17441,11 @@ | ||
2893 | $(HOST_EXPORTS) \ | ||
2894 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2895 | cd $(HOST_SUBDIR)/mpfr && \ | ||
2896 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2897 | - CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2898 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2899 | + CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ | ||
2900 | + LIBCFLAGS="$(STAGE4_CFLAGS)" \ | ||
2901 | + CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ | ||
2902 | + CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2903 | $(TARGET-stage4-mpfr) | ||
2904 | |||
2905 | maybe-clean-stage4-mpfr: clean-stage4-mpfr | ||
2906 | @@ -17249,7 +17458,7 @@ | ||
2907 | $(MAKE) stage4-start; \ | ||
2908 | fi; \ | ||
2909 | cd $(HOST_SUBDIR)/mpfr && \ | ||
2910 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2911 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2912 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2913 | clean | ||
2914 | @endif mpfr-bootstrap | ||
2915 | @@ -17270,8 +17479,11 @@ | ||
2916 | $(HOST_EXPORTS) \ | ||
2917 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2918 | cd $(HOST_SUBDIR)/mpfr && \ | ||
2919 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2920 | - CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2921 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2922 | + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ | ||
2923 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
2924 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
2925 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2926 | $(TARGET-stageprofile-mpfr) | ||
2927 | |||
2928 | maybe-clean-stageprofile-mpfr: clean-stageprofile-mpfr | ||
2929 | @@ -17284,7 +17496,7 @@ | ||
2930 | $(MAKE) stageprofile-start; \ | ||
2931 | fi; \ | ||
2932 | cd $(HOST_SUBDIR)/mpfr && \ | ||
2933 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2934 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2935 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2936 | clean | ||
2937 | @endif mpfr-bootstrap | ||
2938 | @@ -17305,8 +17517,11 @@ | ||
2939 | $(HOST_EXPORTS) \ | ||
2940 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
2941 | cd $(HOST_SUBDIR)/mpfr && \ | ||
2942 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2943 | - CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2944 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
2945 | + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ | ||
2946 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
2947 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
2948 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2949 | $(TARGET-stagefeedback-mpfr) | ||
2950 | |||
2951 | maybe-clean-stagefeedback-mpfr: clean-stagefeedback-mpfr | ||
2952 | @@ -17319,7 +17534,7 @@ | ||
2953 | $(MAKE) stagefeedback-start; \ | ||
2954 | fi; \ | ||
2955 | cd $(HOST_SUBDIR)/mpfr && \ | ||
2956 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
2957 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
2958 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
2959 | clean | ||
2960 | @endif mpfr-bootstrap | ||
2961 | @@ -17727,7 +17942,8 @@ | ||
2962 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2963 | $(HOST_EXPORTS) \ | ||
2964 | (cd $(HOST_SUBDIR)/gnuserv && \ | ||
2965 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gnuserv)) | ||
2966 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
2967 | + $(TARGET-gnuserv)) | ||
2968 | @endif gnuserv | ||
2969 | |||
2970 | |||
2971 | @@ -18151,7 +18367,8 @@ | ||
2972 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2973 | $(HOST_EXPORTS) \ | ||
2974 | (cd $(HOST_SUBDIR)/gprof && \ | ||
2975 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gprof)) | ||
2976 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
2977 | + $(TARGET-gprof)) | ||
2978 | @endif gprof | ||
2979 | |||
2980 | |||
2981 | @@ -18575,7 +18792,8 @@ | ||
2982 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2983 | $(HOST_EXPORTS) \ | ||
2984 | (cd $(HOST_SUBDIR)/gzip && \ | ||
2985 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gzip)) | ||
2986 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
2987 | + $(TARGET-gzip)) | ||
2988 | @endif gzip | ||
2989 | |||
2990 | |||
2991 | @@ -18999,7 +19217,8 @@ | ||
2992 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
2993 | $(HOST_EXPORTS) \ | ||
2994 | (cd $(HOST_SUBDIR)/hello && \ | ||
2995 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-hello)) | ||
2996 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
2997 | + $(TARGET-hello)) | ||
2998 | @endif hello | ||
2999 | |||
3000 | |||
3001 | @@ -19423,7 +19642,8 @@ | ||
3002 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3003 | $(HOST_EXPORTS) \ | ||
3004 | (cd $(HOST_SUBDIR)/indent && \ | ||
3005 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-indent)) | ||
3006 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
3007 | + $(TARGET-indent)) | ||
3008 | @endif indent | ||
3009 | |||
3010 | |||
3011 | @@ -19840,9 +20060,9 @@ | ||
3012 | @r=`${PWD_COMMAND}`; export r; \ | ||
3013 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3014 | test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ | ||
3015 | - $(HOST_EXPORTS) \ | ||
3016 | + $(HOST_EXPORTS) \ | ||
3017 | CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ | ||
3018 | - LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ | ||
3019 | + CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ | ||
3020 | echo Configuring stage 1 in $(HOST_SUBDIR)/intl ; \ | ||
3021 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ | ||
3022 | cd $(HOST_SUBDIR)/intl || exit 1; \ | ||
3023 | @@ -19871,9 +20091,9 @@ | ||
3024 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3025 | test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ | ||
3026 | $(HOST_EXPORTS) \ | ||
3027 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3028 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3029 | CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ | ||
3030 | - LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ | ||
3031 | + CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ | ||
3032 | echo Configuring stage 2 in $(HOST_SUBDIR)/intl ; \ | ||
3033 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ | ||
3034 | cd $(HOST_SUBDIR)/intl || exit 1; \ | ||
3035 | @@ -19902,9 +20122,9 @@ | ||
3036 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3037 | test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ | ||
3038 | $(HOST_EXPORTS) \ | ||
3039 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3040 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3041 | CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ | ||
3042 | - LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ | ||
3043 | + CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ | ||
3044 | echo Configuring stage b2g0 in $(HOST_SUBDIR)/intl ; \ | ||
3045 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ | ||
3046 | cd $(HOST_SUBDIR)/intl || exit 1; \ | ||
3047 | @@ -19933,9 +20153,9 @@ | ||
3048 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3049 | test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ | ||
3050 | $(HOST_EXPORTS) \ | ||
3051 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3052 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3053 | CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ | ||
3054 | - LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ | ||
3055 | + CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ | ||
3056 | echo Configuring stage 3 in $(HOST_SUBDIR)/intl ; \ | ||
3057 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ | ||
3058 | cd $(HOST_SUBDIR)/intl || exit 1; \ | ||
3059 | @@ -19964,9 +20184,9 @@ | ||
3060 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3061 | test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ | ||
3062 | $(HOST_EXPORTS) \ | ||
3063 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3064 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3065 | CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ | ||
3066 | - LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ | ||
3067 | + CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ | ||
3068 | echo Configuring stage b3g2 in $(HOST_SUBDIR)/intl ; \ | ||
3069 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ | ||
3070 | cd $(HOST_SUBDIR)/intl || exit 1; \ | ||
3071 | @@ -19995,9 +20215,9 @@ | ||
3072 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3073 | test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ | ||
3074 | $(HOST_EXPORTS) \ | ||
3075 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3076 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3077 | CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ | ||
3078 | - LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ | ||
3079 | + CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ | ||
3080 | echo Configuring stage 4 in $(HOST_SUBDIR)/intl ; \ | ||
3081 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ | ||
3082 | cd $(HOST_SUBDIR)/intl || exit 1; \ | ||
3083 | @@ -20026,9 +20246,9 @@ | ||
3084 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3085 | test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ | ||
3086 | $(HOST_EXPORTS) \ | ||
3087 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3088 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3089 | CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ | ||
3090 | - LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ | ||
3091 | + CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ | ||
3092 | echo Configuring stage profile in $(HOST_SUBDIR)/intl ; \ | ||
3093 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ | ||
3094 | cd $(HOST_SUBDIR)/intl || exit 1; \ | ||
3095 | @@ -20057,9 +20277,9 @@ | ||
3096 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3097 | test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ | ||
3098 | $(HOST_EXPORTS) \ | ||
3099 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3100 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3101 | CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ | ||
3102 | - LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ | ||
3103 | + CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ | ||
3104 | echo Configuring stage feedback in $(HOST_SUBDIR)/intl ; \ | ||
3105 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ | ||
3106 | cd $(HOST_SUBDIR)/intl || exit 1; \ | ||
3107 | @@ -20094,7 +20314,8 @@ | ||
3108 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3109 | $(HOST_EXPORTS) \ | ||
3110 | (cd $(HOST_SUBDIR)/intl && \ | ||
3111 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-intl)) | ||
3112 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
3113 | + $(TARGET-intl)) | ||
3114 | @endif intl | ||
3115 | |||
3116 | |||
3117 | @@ -20113,8 +20334,11 @@ | ||
3118 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3119 | $(HOST_EXPORTS) \ | ||
3120 | cd $(HOST_SUBDIR)/intl && \ | ||
3121 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3122 | - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ | ||
3123 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3124 | + CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ | ||
3125 | + LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ | ||
3126 | + CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ | ||
3127 | + CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ | ||
3128 | $(TARGET-stage1-intl) | ||
3129 | |||
3130 | maybe-clean-stage1-intl: clean-stage1-intl | ||
3131 | @@ -20127,7 +20351,7 @@ | ||
3132 | $(MAKE) stage1-start; \ | ||
3133 | fi; \ | ||
3134 | cd $(HOST_SUBDIR)/intl && \ | ||
3135 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3136 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3137 | clean | ||
3138 | @endif intl-bootstrap | ||
3139 | |||
3140 | @@ -20147,8 +20371,11 @@ | ||
3141 | $(HOST_EXPORTS) \ | ||
3142 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3143 | cd $(HOST_SUBDIR)/intl && \ | ||
3144 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3145 | - CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3146 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3147 | + CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ | ||
3148 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ | ||
3149 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ | ||
3150 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3151 | $(TARGET-stage2-intl) | ||
3152 | |||
3153 | maybe-clean-stage2-intl: clean-stage2-intl | ||
3154 | @@ -20161,7 +20388,7 @@ | ||
3155 | $(MAKE) stage2-start; \ | ||
3156 | fi; \ | ||
3157 | cd $(HOST_SUBDIR)/intl && \ | ||
3158 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3159 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3160 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3161 | clean | ||
3162 | @endif intl-bootstrap | ||
3163 | @@ -20182,8 +20409,11 @@ | ||
3164 | $(HOST_EXPORTS) \ | ||
3165 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3166 | cd $(HOST_SUBDIR)/intl && \ | ||
3167 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3168 | - CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3169 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3170 | + CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ | ||
3171 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ | ||
3172 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ | ||
3173 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3174 | $(TARGET-stageb2g0-intl) | ||
3175 | |||
3176 | maybe-clean-stageb2g0-intl: clean-stageb2g0-intl | ||
3177 | @@ -20196,7 +20426,7 @@ | ||
3178 | $(MAKE) stageb2g0-start; \ | ||
3179 | fi; \ | ||
3180 | cd $(HOST_SUBDIR)/intl && \ | ||
3181 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3182 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3183 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3184 | clean | ||
3185 | @endif intl-bootstrap | ||
3186 | @@ -20217,8 +20447,11 @@ | ||
3187 | $(HOST_EXPORTS) \ | ||
3188 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3189 | cd $(HOST_SUBDIR)/intl && \ | ||
3190 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3191 | - CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3192 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3193 | + CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ | ||
3194 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ | ||
3195 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ | ||
3196 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3197 | $(TARGET-stage3-intl) | ||
3198 | |||
3199 | maybe-clean-stage3-intl: clean-stage3-intl | ||
3200 | @@ -20231,7 +20464,7 @@ | ||
3201 | $(MAKE) stage3-start; \ | ||
3202 | fi; \ | ||
3203 | cd $(HOST_SUBDIR)/intl && \ | ||
3204 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3205 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3206 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3207 | clean | ||
3208 | @endif intl-bootstrap | ||
3209 | @@ -20252,8 +20485,11 @@ | ||
3210 | $(HOST_EXPORTS) \ | ||
3211 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3212 | cd $(HOST_SUBDIR)/intl && \ | ||
3213 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3214 | - CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3215 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3216 | + CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ | ||
3217 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ | ||
3218 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ | ||
3219 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3220 | $(TARGET-stageb3g2-intl) | ||
3221 | |||
3222 | maybe-clean-stageb3g2-intl: clean-stageb3g2-intl | ||
3223 | @@ -20266,7 +20502,7 @@ | ||
3224 | $(MAKE) stageb3g2-start; \ | ||
3225 | fi; \ | ||
3226 | cd $(HOST_SUBDIR)/intl && \ | ||
3227 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3228 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3229 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3230 | clean | ||
3231 | @endif intl-bootstrap | ||
3232 | @@ -20287,8 +20523,11 @@ | ||
3233 | $(HOST_EXPORTS) \ | ||
3234 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3235 | cd $(HOST_SUBDIR)/intl && \ | ||
3236 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3237 | - CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3238 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3239 | + CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ | ||
3240 | + LIBCFLAGS="$(STAGE4_CFLAGS)" \ | ||
3241 | + CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ | ||
3242 | + CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3243 | $(TARGET-stage4-intl) | ||
3244 | |||
3245 | maybe-clean-stage4-intl: clean-stage4-intl | ||
3246 | @@ -20301,7 +20540,7 @@ | ||
3247 | $(MAKE) stage4-start; \ | ||
3248 | fi; \ | ||
3249 | cd $(HOST_SUBDIR)/intl && \ | ||
3250 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3251 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3252 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3253 | clean | ||
3254 | @endif intl-bootstrap | ||
3255 | @@ -20322,8 +20561,11 @@ | ||
3256 | $(HOST_EXPORTS) \ | ||
3257 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3258 | cd $(HOST_SUBDIR)/intl && \ | ||
3259 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3260 | - CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3261 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3262 | + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ | ||
3263 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
3264 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
3265 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3266 | $(TARGET-stageprofile-intl) | ||
3267 | |||
3268 | maybe-clean-stageprofile-intl: clean-stageprofile-intl | ||
3269 | @@ -20336,7 +20578,7 @@ | ||
3270 | $(MAKE) stageprofile-start; \ | ||
3271 | fi; \ | ||
3272 | cd $(HOST_SUBDIR)/intl && \ | ||
3273 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3274 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3275 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3276 | clean | ||
3277 | @endif intl-bootstrap | ||
3278 | @@ -20357,8 +20599,11 @@ | ||
3279 | $(HOST_EXPORTS) \ | ||
3280 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3281 | cd $(HOST_SUBDIR)/intl && \ | ||
3282 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3283 | - CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3284 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3285 | + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ | ||
3286 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
3287 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
3288 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3289 | $(TARGET-stagefeedback-intl) | ||
3290 | |||
3291 | maybe-clean-stagefeedback-intl: clean-stagefeedback-intl | ||
3292 | @@ -20371,7 +20616,7 @@ | ||
3293 | $(MAKE) stagefeedback-start; \ | ||
3294 | fi; \ | ||
3295 | cd $(HOST_SUBDIR)/intl && \ | ||
3296 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3297 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3298 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3299 | clean | ||
3300 | @endif intl-bootstrap | ||
3301 | @@ -20785,7 +21030,8 @@ | ||
3302 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3303 | $(HOST_EXPORTS) \ | ||
3304 | (cd $(HOST_SUBDIR)/tcl && \ | ||
3305 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-tcl)) | ||
3306 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
3307 | + $(TARGET-tcl)) | ||
3308 | @endif tcl | ||
3309 | |||
3310 | |||
3311 | @@ -21194,7 +21440,8 @@ | ||
3312 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3313 | $(HOST_EXPORTS) \ | ||
3314 | (cd $(HOST_SUBDIR)/itcl && \ | ||
3315 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-itcl)) | ||
3316 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
3317 | + $(TARGET-itcl)) | ||
3318 | @endif itcl | ||
3319 | |||
3320 | |||
3321 | @@ -21611,9 +21858,9 @@ | ||
3322 | @r=`${PWD_COMMAND}`; export r; \ | ||
3323 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3324 | test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ | ||
3325 | - $(HOST_EXPORTS) \ | ||
3326 | + $(HOST_EXPORTS) \ | ||
3327 | CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ | ||
3328 | - LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ | ||
3329 | + CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ | ||
3330 | echo Configuring stage 1 in $(HOST_SUBDIR)/ld ; \ | ||
3331 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ | ||
3332 | cd $(HOST_SUBDIR)/ld || exit 1; \ | ||
3333 | @@ -21642,9 +21889,9 @@ | ||
3334 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3335 | test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ | ||
3336 | $(HOST_EXPORTS) \ | ||
3337 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3338 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3339 | CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ | ||
3340 | - LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ | ||
3341 | + CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ | ||
3342 | echo Configuring stage 2 in $(HOST_SUBDIR)/ld ; \ | ||
3343 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ | ||
3344 | cd $(HOST_SUBDIR)/ld || exit 1; \ | ||
3345 | @@ -21673,9 +21920,9 @@ | ||
3346 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3347 | test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ | ||
3348 | $(HOST_EXPORTS) \ | ||
3349 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3350 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3351 | CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ | ||
3352 | - LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ | ||
3353 | + CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ | ||
3354 | echo Configuring stage b2g0 in $(HOST_SUBDIR)/ld ; \ | ||
3355 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ | ||
3356 | cd $(HOST_SUBDIR)/ld || exit 1; \ | ||
3357 | @@ -21704,9 +21951,9 @@ | ||
3358 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3359 | test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ | ||
3360 | $(HOST_EXPORTS) \ | ||
3361 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3362 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3363 | CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ | ||
3364 | - LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ | ||
3365 | + CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ | ||
3366 | echo Configuring stage 3 in $(HOST_SUBDIR)/ld ; \ | ||
3367 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ | ||
3368 | cd $(HOST_SUBDIR)/ld || exit 1; \ | ||
3369 | @@ -21735,9 +21982,9 @@ | ||
3370 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3371 | test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ | ||
3372 | $(HOST_EXPORTS) \ | ||
3373 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3374 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3375 | CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ | ||
3376 | - LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ | ||
3377 | + CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ | ||
3378 | echo Configuring stage b3g2 in $(HOST_SUBDIR)/ld ; \ | ||
3379 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ | ||
3380 | cd $(HOST_SUBDIR)/ld || exit 1; \ | ||
3381 | @@ -21766,9 +22013,9 @@ | ||
3382 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3383 | test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ | ||
3384 | $(HOST_EXPORTS) \ | ||
3385 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3386 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3387 | CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ | ||
3388 | - LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ | ||
3389 | + CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ | ||
3390 | echo Configuring stage 4 in $(HOST_SUBDIR)/ld ; \ | ||
3391 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ | ||
3392 | cd $(HOST_SUBDIR)/ld || exit 1; \ | ||
3393 | @@ -21797,9 +22044,9 @@ | ||
3394 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3395 | test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ | ||
3396 | $(HOST_EXPORTS) \ | ||
3397 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3398 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3399 | CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ | ||
3400 | - LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ | ||
3401 | + CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ | ||
3402 | echo Configuring stage profile in $(HOST_SUBDIR)/ld ; \ | ||
3403 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ | ||
3404 | cd $(HOST_SUBDIR)/ld || exit 1; \ | ||
3405 | @@ -21828,9 +22075,9 @@ | ||
3406 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3407 | test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ | ||
3408 | $(HOST_EXPORTS) \ | ||
3409 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3410 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3411 | CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ | ||
3412 | - LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ | ||
3413 | + CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ | ||
3414 | echo Configuring stage feedback in $(HOST_SUBDIR)/ld ; \ | ||
3415 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ | ||
3416 | cd $(HOST_SUBDIR)/ld || exit 1; \ | ||
3417 | @@ -21865,7 +22112,8 @@ | ||
3418 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3419 | $(HOST_EXPORTS) \ | ||
3420 | (cd $(HOST_SUBDIR)/ld && \ | ||
3421 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-ld)) | ||
3422 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
3423 | + $(TARGET-ld)) | ||
3424 | @endif ld | ||
3425 | |||
3426 | |||
3427 | @@ -21884,8 +22132,11 @@ | ||
3428 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3429 | $(HOST_EXPORTS) \ | ||
3430 | cd $(HOST_SUBDIR)/ld && \ | ||
3431 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3432 | - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ | ||
3433 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3434 | + CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ | ||
3435 | + LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ | ||
3436 | + CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ | ||
3437 | + CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ | ||
3438 | $(TARGET-stage1-ld) | ||
3439 | |||
3440 | maybe-clean-stage1-ld: clean-stage1-ld | ||
3441 | @@ -21898,7 +22149,7 @@ | ||
3442 | $(MAKE) stage1-start; \ | ||
3443 | fi; \ | ||
3444 | cd $(HOST_SUBDIR)/ld && \ | ||
3445 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3446 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3447 | clean | ||
3448 | @endif ld-bootstrap | ||
3449 | |||
3450 | @@ -21918,8 +22169,11 @@ | ||
3451 | $(HOST_EXPORTS) \ | ||
3452 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3453 | cd $(HOST_SUBDIR)/ld && \ | ||
3454 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3455 | - CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3456 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3457 | + CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ | ||
3458 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ | ||
3459 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ | ||
3460 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3461 | $(TARGET-stage2-ld) | ||
3462 | |||
3463 | maybe-clean-stage2-ld: clean-stage2-ld | ||
3464 | @@ -21932,7 +22186,7 @@ | ||
3465 | $(MAKE) stage2-start; \ | ||
3466 | fi; \ | ||
3467 | cd $(HOST_SUBDIR)/ld && \ | ||
3468 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3469 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3470 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3471 | clean | ||
3472 | @endif ld-bootstrap | ||
3473 | @@ -21953,8 +22207,11 @@ | ||
3474 | $(HOST_EXPORTS) \ | ||
3475 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3476 | cd $(HOST_SUBDIR)/ld && \ | ||
3477 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3478 | - CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3479 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3480 | + CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ | ||
3481 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ | ||
3482 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ | ||
3483 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3484 | $(TARGET-stageb2g0-ld) | ||
3485 | |||
3486 | maybe-clean-stageb2g0-ld: clean-stageb2g0-ld | ||
3487 | @@ -21967,7 +22224,7 @@ | ||
3488 | $(MAKE) stageb2g0-start; \ | ||
3489 | fi; \ | ||
3490 | cd $(HOST_SUBDIR)/ld && \ | ||
3491 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3492 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3493 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3494 | clean | ||
3495 | @endif ld-bootstrap | ||
3496 | @@ -21988,8 +22245,11 @@ | ||
3497 | $(HOST_EXPORTS) \ | ||
3498 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3499 | cd $(HOST_SUBDIR)/ld && \ | ||
3500 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3501 | - CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3502 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3503 | + CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ | ||
3504 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ | ||
3505 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ | ||
3506 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3507 | $(TARGET-stage3-ld) | ||
3508 | |||
3509 | maybe-clean-stage3-ld: clean-stage3-ld | ||
3510 | @@ -22002,7 +22262,7 @@ | ||
3511 | $(MAKE) stage3-start; \ | ||
3512 | fi; \ | ||
3513 | cd $(HOST_SUBDIR)/ld && \ | ||
3514 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3515 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3516 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3517 | clean | ||
3518 | @endif ld-bootstrap | ||
3519 | @@ -22023,8 +22283,11 @@ | ||
3520 | $(HOST_EXPORTS) \ | ||
3521 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3522 | cd $(HOST_SUBDIR)/ld && \ | ||
3523 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3524 | - CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3525 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3526 | + CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ | ||
3527 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ | ||
3528 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ | ||
3529 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3530 | $(TARGET-stageb3g2-ld) | ||
3531 | |||
3532 | maybe-clean-stageb3g2-ld: clean-stageb3g2-ld | ||
3533 | @@ -22037,7 +22300,7 @@ | ||
3534 | $(MAKE) stageb3g2-start; \ | ||
3535 | fi; \ | ||
3536 | cd $(HOST_SUBDIR)/ld && \ | ||
3537 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3538 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3539 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3540 | clean | ||
3541 | @endif ld-bootstrap | ||
3542 | @@ -22058,8 +22321,11 @@ | ||
3543 | $(HOST_EXPORTS) \ | ||
3544 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3545 | cd $(HOST_SUBDIR)/ld && \ | ||
3546 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3547 | - CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3548 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3549 | + CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ | ||
3550 | + LIBCFLAGS="$(STAGE4_CFLAGS)" \ | ||
3551 | + CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ | ||
3552 | + CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3553 | $(TARGET-stage4-ld) | ||
3554 | |||
3555 | maybe-clean-stage4-ld: clean-stage4-ld | ||
3556 | @@ -22072,7 +22338,7 @@ | ||
3557 | $(MAKE) stage4-start; \ | ||
3558 | fi; \ | ||
3559 | cd $(HOST_SUBDIR)/ld && \ | ||
3560 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3561 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3562 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3563 | clean | ||
3564 | @endif ld-bootstrap | ||
3565 | @@ -22093,8 +22359,11 @@ | ||
3566 | $(HOST_EXPORTS) \ | ||
3567 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3568 | cd $(HOST_SUBDIR)/ld && \ | ||
3569 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3570 | - CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3571 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3572 | + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ | ||
3573 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
3574 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
3575 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3576 | $(TARGET-stageprofile-ld) | ||
3577 | |||
3578 | maybe-clean-stageprofile-ld: clean-stageprofile-ld | ||
3579 | @@ -22107,7 +22376,7 @@ | ||
3580 | $(MAKE) stageprofile-start; \ | ||
3581 | fi; \ | ||
3582 | cd $(HOST_SUBDIR)/ld && \ | ||
3583 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3584 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3585 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3586 | clean | ||
3587 | @endif ld-bootstrap | ||
3588 | @@ -22128,8 +22397,11 @@ | ||
3589 | $(HOST_EXPORTS) \ | ||
3590 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3591 | cd $(HOST_SUBDIR)/ld && \ | ||
3592 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3593 | - CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3594 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3595 | + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ | ||
3596 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
3597 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
3598 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3599 | $(TARGET-stagefeedback-ld) | ||
3600 | |||
3601 | maybe-clean-stagefeedback-ld: clean-stagefeedback-ld | ||
3602 | @@ -22142,7 +22414,7 @@ | ||
3603 | $(MAKE) stagefeedback-start; \ | ||
3604 | fi; \ | ||
3605 | cd $(HOST_SUBDIR)/ld && \ | ||
3606 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3607 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3608 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3609 | clean | ||
3610 | @endif ld-bootstrap | ||
3611 | @@ -22549,9 +22821,9 @@ | ||
3612 | @r=`${PWD_COMMAND}`; export r; \ | ||
3613 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3614 | test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ | ||
3615 | - $(HOST_EXPORTS) \ | ||
3616 | + $(HOST_EXPORTS) \ | ||
3617 | CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ | ||
3618 | - LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ | ||
3619 | + CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ | ||
3620 | echo Configuring stage 1 in $(HOST_SUBDIR)/libcpp ; \ | ||
3621 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ | ||
3622 | cd $(HOST_SUBDIR)/libcpp || exit 1; \ | ||
3623 | @@ -22580,9 +22852,9 @@ | ||
3624 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3625 | test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ | ||
3626 | $(HOST_EXPORTS) \ | ||
3627 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3628 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3629 | CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ | ||
3630 | - LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ | ||
3631 | + CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ | ||
3632 | echo Configuring stage 2 in $(HOST_SUBDIR)/libcpp ; \ | ||
3633 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ | ||
3634 | cd $(HOST_SUBDIR)/libcpp || exit 1; \ | ||
3635 | @@ -22611,9 +22883,9 @@ | ||
3636 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3637 | test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ | ||
3638 | $(HOST_EXPORTS) \ | ||
3639 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3640 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3641 | CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ | ||
3642 | - LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ | ||
3643 | + CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ | ||
3644 | echo Configuring stage b2g0 in $(HOST_SUBDIR)/libcpp ; \ | ||
3645 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ | ||
3646 | cd $(HOST_SUBDIR)/libcpp || exit 1; \ | ||
3647 | @@ -22642,9 +22914,9 @@ | ||
3648 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3649 | test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ | ||
3650 | $(HOST_EXPORTS) \ | ||
3651 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3652 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3653 | CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ | ||
3654 | - LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ | ||
3655 | + CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ | ||
3656 | echo Configuring stage 3 in $(HOST_SUBDIR)/libcpp ; \ | ||
3657 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ | ||
3658 | cd $(HOST_SUBDIR)/libcpp || exit 1; \ | ||
3659 | @@ -22673,9 +22945,9 @@ | ||
3660 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3661 | test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ | ||
3662 | $(HOST_EXPORTS) \ | ||
3663 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3664 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3665 | CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ | ||
3666 | - LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ | ||
3667 | + CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ | ||
3668 | echo Configuring stage b3g2 in $(HOST_SUBDIR)/libcpp ; \ | ||
3669 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ | ||
3670 | cd $(HOST_SUBDIR)/libcpp || exit 1; \ | ||
3671 | @@ -22704,9 +22976,9 @@ | ||
3672 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3673 | test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ | ||
3674 | $(HOST_EXPORTS) \ | ||
3675 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3676 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3677 | CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ | ||
3678 | - LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ | ||
3679 | + CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ | ||
3680 | echo Configuring stage 4 in $(HOST_SUBDIR)/libcpp ; \ | ||
3681 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ | ||
3682 | cd $(HOST_SUBDIR)/libcpp || exit 1; \ | ||
3683 | @@ -22735,9 +23007,9 @@ | ||
3684 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3685 | test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ | ||
3686 | $(HOST_EXPORTS) \ | ||
3687 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3688 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3689 | CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ | ||
3690 | - LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ | ||
3691 | + CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ | ||
3692 | echo Configuring stage profile in $(HOST_SUBDIR)/libcpp ; \ | ||
3693 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ | ||
3694 | cd $(HOST_SUBDIR)/libcpp || exit 1; \ | ||
3695 | @@ -22766,9 +23038,9 @@ | ||
3696 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3697 | test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ | ||
3698 | $(HOST_EXPORTS) \ | ||
3699 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3700 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3701 | CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ | ||
3702 | - LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ | ||
3703 | + CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ | ||
3704 | echo Configuring stage feedback in $(HOST_SUBDIR)/libcpp ; \ | ||
3705 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ | ||
3706 | cd $(HOST_SUBDIR)/libcpp || exit 1; \ | ||
3707 | @@ -22803,7 +23075,8 @@ | ||
3708 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3709 | $(HOST_EXPORTS) \ | ||
3710 | (cd $(HOST_SUBDIR)/libcpp && \ | ||
3711 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-libcpp)) | ||
3712 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
3713 | + $(TARGET-libcpp)) | ||
3714 | @endif libcpp | ||
3715 | |||
3716 | |||
3717 | @@ -22822,8 +23095,11 @@ | ||
3718 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3719 | $(HOST_EXPORTS) \ | ||
3720 | cd $(HOST_SUBDIR)/libcpp && \ | ||
3721 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3722 | - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ | ||
3723 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3724 | + CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ | ||
3725 | + LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ | ||
3726 | + CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ | ||
3727 | + CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ | ||
3728 | $(TARGET-stage1-libcpp) | ||
3729 | |||
3730 | maybe-clean-stage1-libcpp: clean-stage1-libcpp | ||
3731 | @@ -22836,7 +23112,7 @@ | ||
3732 | $(MAKE) stage1-start; \ | ||
3733 | fi; \ | ||
3734 | cd $(HOST_SUBDIR)/libcpp && \ | ||
3735 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3736 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3737 | clean | ||
3738 | @endif libcpp-bootstrap | ||
3739 | |||
3740 | @@ -22856,8 +23132,11 @@ | ||
3741 | $(HOST_EXPORTS) \ | ||
3742 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3743 | cd $(HOST_SUBDIR)/libcpp && \ | ||
3744 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3745 | - CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3746 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3747 | + CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ | ||
3748 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ | ||
3749 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ | ||
3750 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3751 | $(TARGET-stage2-libcpp) | ||
3752 | |||
3753 | maybe-clean-stage2-libcpp: clean-stage2-libcpp | ||
3754 | @@ -22870,7 +23149,7 @@ | ||
3755 | $(MAKE) stage2-start; \ | ||
3756 | fi; \ | ||
3757 | cd $(HOST_SUBDIR)/libcpp && \ | ||
3758 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3759 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3760 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3761 | clean | ||
3762 | @endif libcpp-bootstrap | ||
3763 | @@ -22891,8 +23170,11 @@ | ||
3764 | $(HOST_EXPORTS) \ | ||
3765 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3766 | cd $(HOST_SUBDIR)/libcpp && \ | ||
3767 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3768 | - CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3769 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3770 | + CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ | ||
3771 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ | ||
3772 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ | ||
3773 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3774 | $(TARGET-stageb2g0-libcpp) | ||
3775 | |||
3776 | maybe-clean-stageb2g0-libcpp: clean-stageb2g0-libcpp | ||
3777 | @@ -22905,7 +23187,7 @@ | ||
3778 | $(MAKE) stageb2g0-start; \ | ||
3779 | fi; \ | ||
3780 | cd $(HOST_SUBDIR)/libcpp && \ | ||
3781 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3782 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3783 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3784 | clean | ||
3785 | @endif libcpp-bootstrap | ||
3786 | @@ -22926,8 +23208,11 @@ | ||
3787 | $(HOST_EXPORTS) \ | ||
3788 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3789 | cd $(HOST_SUBDIR)/libcpp && \ | ||
3790 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3791 | - CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3792 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3793 | + CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ | ||
3794 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ | ||
3795 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ | ||
3796 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3797 | $(TARGET-stage3-libcpp) | ||
3798 | |||
3799 | maybe-clean-stage3-libcpp: clean-stage3-libcpp | ||
3800 | @@ -22940,7 +23225,7 @@ | ||
3801 | $(MAKE) stage3-start; \ | ||
3802 | fi; \ | ||
3803 | cd $(HOST_SUBDIR)/libcpp && \ | ||
3804 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3805 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3806 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3807 | clean | ||
3808 | @endif libcpp-bootstrap | ||
3809 | @@ -22961,8 +23246,11 @@ | ||
3810 | $(HOST_EXPORTS) \ | ||
3811 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3812 | cd $(HOST_SUBDIR)/libcpp && \ | ||
3813 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3814 | - CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3815 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3816 | + CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ | ||
3817 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ | ||
3818 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ | ||
3819 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3820 | $(TARGET-stageb3g2-libcpp) | ||
3821 | |||
3822 | maybe-clean-stageb3g2-libcpp: clean-stageb3g2-libcpp | ||
3823 | @@ -22975,7 +23263,7 @@ | ||
3824 | $(MAKE) stageb3g2-start; \ | ||
3825 | fi; \ | ||
3826 | cd $(HOST_SUBDIR)/libcpp && \ | ||
3827 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3828 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3829 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3830 | clean | ||
3831 | @endif libcpp-bootstrap | ||
3832 | @@ -22996,8 +23284,11 @@ | ||
3833 | $(HOST_EXPORTS) \ | ||
3834 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3835 | cd $(HOST_SUBDIR)/libcpp && \ | ||
3836 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3837 | - CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3838 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3839 | + CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ | ||
3840 | + LIBCFLAGS="$(STAGE4_CFLAGS)" \ | ||
3841 | + CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ | ||
3842 | + CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3843 | $(TARGET-stage4-libcpp) | ||
3844 | |||
3845 | maybe-clean-stage4-libcpp: clean-stage4-libcpp | ||
3846 | @@ -23010,7 +23301,7 @@ | ||
3847 | $(MAKE) stage4-start; \ | ||
3848 | fi; \ | ||
3849 | cd $(HOST_SUBDIR)/libcpp && \ | ||
3850 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3851 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3852 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3853 | clean | ||
3854 | @endif libcpp-bootstrap | ||
3855 | @@ -23031,8 +23322,11 @@ | ||
3856 | $(HOST_EXPORTS) \ | ||
3857 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3858 | cd $(HOST_SUBDIR)/libcpp && \ | ||
3859 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3860 | - CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3861 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3862 | + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ | ||
3863 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
3864 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
3865 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3866 | $(TARGET-stageprofile-libcpp) | ||
3867 | |||
3868 | maybe-clean-stageprofile-libcpp: clean-stageprofile-libcpp | ||
3869 | @@ -23045,7 +23339,7 @@ | ||
3870 | $(MAKE) stageprofile-start; \ | ||
3871 | fi; \ | ||
3872 | cd $(HOST_SUBDIR)/libcpp && \ | ||
3873 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3874 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3875 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3876 | clean | ||
3877 | @endif libcpp-bootstrap | ||
3878 | @@ -23066,8 +23360,11 @@ | ||
3879 | $(HOST_EXPORTS) \ | ||
3880 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3881 | cd $(HOST_SUBDIR)/libcpp && \ | ||
3882 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3883 | - CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3884 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
3885 | + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ | ||
3886 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
3887 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
3888 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3889 | $(TARGET-stagefeedback-libcpp) | ||
3890 | |||
3891 | maybe-clean-stagefeedback-libcpp: clean-stagefeedback-libcpp | ||
3892 | @@ -23080,7 +23377,7 @@ | ||
3893 | $(MAKE) stagefeedback-start; \ | ||
3894 | fi; \ | ||
3895 | cd $(HOST_SUBDIR)/libcpp && \ | ||
3896 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
3897 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
3898 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
3899 | clean | ||
3900 | @endif libcpp-bootstrap | ||
3901 | @@ -23487,9 +23784,9 @@ | ||
3902 | @r=`${PWD_COMMAND}`; export r; \ | ||
3903 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3904 | test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ | ||
3905 | - $(HOST_EXPORTS) \ | ||
3906 | + $(HOST_EXPORTS) \ | ||
3907 | CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ | ||
3908 | - LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ | ||
3909 | + CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ | ||
3910 | echo Configuring stage 1 in $(HOST_SUBDIR)/libdecnumber ; \ | ||
3911 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ | ||
3912 | cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ | ||
3913 | @@ -23518,9 +23815,9 @@ | ||
3914 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3915 | test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ | ||
3916 | $(HOST_EXPORTS) \ | ||
3917 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3918 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3919 | CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ | ||
3920 | - LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ | ||
3921 | + CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ | ||
3922 | echo Configuring stage 2 in $(HOST_SUBDIR)/libdecnumber ; \ | ||
3923 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ | ||
3924 | cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ | ||
3925 | @@ -23549,9 +23846,9 @@ | ||
3926 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3927 | test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ | ||
3928 | $(HOST_EXPORTS) \ | ||
3929 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3930 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3931 | CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ | ||
3932 | - LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ | ||
3933 | + CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ | ||
3934 | echo Configuring stage b2g0 in $(HOST_SUBDIR)/libdecnumber ; \ | ||
3935 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ | ||
3936 | cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ | ||
3937 | @@ -23580,9 +23877,9 @@ | ||
3938 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3939 | test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ | ||
3940 | $(HOST_EXPORTS) \ | ||
3941 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3942 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3943 | CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ | ||
3944 | - LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ | ||
3945 | + CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ | ||
3946 | echo Configuring stage 3 in $(HOST_SUBDIR)/libdecnumber ; \ | ||
3947 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ | ||
3948 | cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ | ||
3949 | @@ -23611,9 +23908,9 @@ | ||
3950 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3951 | test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ | ||
3952 | $(HOST_EXPORTS) \ | ||
3953 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3954 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3955 | CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ | ||
3956 | - LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ | ||
3957 | + CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ | ||
3958 | echo Configuring stage b3g2 in $(HOST_SUBDIR)/libdecnumber ; \ | ||
3959 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ | ||
3960 | cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ | ||
3961 | @@ -23642,9 +23939,9 @@ | ||
3962 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3963 | test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ | ||
3964 | $(HOST_EXPORTS) \ | ||
3965 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3966 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3967 | CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ | ||
3968 | - LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ | ||
3969 | + CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ | ||
3970 | echo Configuring stage 4 in $(HOST_SUBDIR)/libdecnumber ; \ | ||
3971 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ | ||
3972 | cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ | ||
3973 | @@ -23673,9 +23970,9 @@ | ||
3974 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3975 | test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ | ||
3976 | $(HOST_EXPORTS) \ | ||
3977 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3978 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3979 | CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ | ||
3980 | - LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ | ||
3981 | + CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ | ||
3982 | echo Configuring stage profile in $(HOST_SUBDIR)/libdecnumber ; \ | ||
3983 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ | ||
3984 | cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ | ||
3985 | @@ -23704,9 +24001,9 @@ | ||
3986 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3987 | test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ | ||
3988 | $(HOST_EXPORTS) \ | ||
3989 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3990 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
3991 | CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ | ||
3992 | - LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ | ||
3993 | + CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ | ||
3994 | echo Configuring stage feedback in $(HOST_SUBDIR)/libdecnumber ; \ | ||
3995 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ | ||
3996 | cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ | ||
3997 | @@ -23741,7 +24038,8 @@ | ||
3998 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
3999 | $(HOST_EXPORTS) \ | ||
4000 | (cd $(HOST_SUBDIR)/libdecnumber && \ | ||
4001 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-libdecnumber)) | ||
4002 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4003 | + $(TARGET-libdecnumber)) | ||
4004 | @endif libdecnumber | ||
4005 | |||
4006 | |||
4007 | @@ -23760,8 +24058,11 @@ | ||
4008 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4009 | $(HOST_EXPORTS) \ | ||
4010 | cd $(HOST_SUBDIR)/libdecnumber && \ | ||
4011 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4012 | - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ | ||
4013 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4014 | + CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ | ||
4015 | + LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ | ||
4016 | + CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ | ||
4017 | + CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ | ||
4018 | $(TARGET-stage1-libdecnumber) | ||
4019 | |||
4020 | maybe-clean-stage1-libdecnumber: clean-stage1-libdecnumber | ||
4021 | @@ -23774,7 +24075,7 @@ | ||
4022 | $(MAKE) stage1-start; \ | ||
4023 | fi; \ | ||
4024 | cd $(HOST_SUBDIR)/libdecnumber && \ | ||
4025 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4026 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4027 | clean | ||
4028 | @endif libdecnumber-bootstrap | ||
4029 | |||
4030 | @@ -23794,8 +24095,11 @@ | ||
4031 | $(HOST_EXPORTS) \ | ||
4032 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4033 | cd $(HOST_SUBDIR)/libdecnumber && \ | ||
4034 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4035 | - CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4036 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4037 | + CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ | ||
4038 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ | ||
4039 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ | ||
4040 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4041 | $(TARGET-stage2-libdecnumber) | ||
4042 | |||
4043 | maybe-clean-stage2-libdecnumber: clean-stage2-libdecnumber | ||
4044 | @@ -23808,7 +24112,7 @@ | ||
4045 | $(MAKE) stage2-start; \ | ||
4046 | fi; \ | ||
4047 | cd $(HOST_SUBDIR)/libdecnumber && \ | ||
4048 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4049 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4050 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4051 | clean | ||
4052 | @endif libdecnumber-bootstrap | ||
4053 | @@ -23829,8 +24133,11 @@ | ||
4054 | $(HOST_EXPORTS) \ | ||
4055 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4056 | cd $(HOST_SUBDIR)/libdecnumber && \ | ||
4057 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4058 | - CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4059 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4060 | + CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ | ||
4061 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ | ||
4062 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ | ||
4063 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4064 | $(TARGET-stageb2g0-libdecnumber) | ||
4065 | |||
4066 | maybe-clean-stageb2g0-libdecnumber: clean-stageb2g0-libdecnumber | ||
4067 | @@ -23843,7 +24150,7 @@ | ||
4068 | $(MAKE) stageb2g0-start; \ | ||
4069 | fi; \ | ||
4070 | cd $(HOST_SUBDIR)/libdecnumber && \ | ||
4071 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4072 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4073 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4074 | clean | ||
4075 | @endif libdecnumber-bootstrap | ||
4076 | @@ -23864,8 +24171,11 @@ | ||
4077 | $(HOST_EXPORTS) \ | ||
4078 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4079 | cd $(HOST_SUBDIR)/libdecnumber && \ | ||
4080 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4081 | - CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4082 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4083 | + CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ | ||
4084 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ | ||
4085 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ | ||
4086 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4087 | $(TARGET-stage3-libdecnumber) | ||
4088 | |||
4089 | maybe-clean-stage3-libdecnumber: clean-stage3-libdecnumber | ||
4090 | @@ -23878,7 +24188,7 @@ | ||
4091 | $(MAKE) stage3-start; \ | ||
4092 | fi; \ | ||
4093 | cd $(HOST_SUBDIR)/libdecnumber && \ | ||
4094 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4095 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4096 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4097 | clean | ||
4098 | @endif libdecnumber-bootstrap | ||
4099 | @@ -23899,8 +24209,11 @@ | ||
4100 | $(HOST_EXPORTS) \ | ||
4101 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4102 | cd $(HOST_SUBDIR)/libdecnumber && \ | ||
4103 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4104 | - CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4105 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4106 | + CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ | ||
4107 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ | ||
4108 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ | ||
4109 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4110 | $(TARGET-stageb3g2-libdecnumber) | ||
4111 | |||
4112 | maybe-clean-stageb3g2-libdecnumber: clean-stageb3g2-libdecnumber | ||
4113 | @@ -23913,7 +24226,7 @@ | ||
4114 | $(MAKE) stageb3g2-start; \ | ||
4115 | fi; \ | ||
4116 | cd $(HOST_SUBDIR)/libdecnumber && \ | ||
4117 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4118 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4119 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4120 | clean | ||
4121 | @endif libdecnumber-bootstrap | ||
4122 | @@ -23934,8 +24247,11 @@ | ||
4123 | $(HOST_EXPORTS) \ | ||
4124 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4125 | cd $(HOST_SUBDIR)/libdecnumber && \ | ||
4126 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4127 | - CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4128 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4129 | + CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ | ||
4130 | + LIBCFLAGS="$(STAGE4_CFLAGS)" \ | ||
4131 | + CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ | ||
4132 | + CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4133 | $(TARGET-stage4-libdecnumber) | ||
4134 | |||
4135 | maybe-clean-stage4-libdecnumber: clean-stage4-libdecnumber | ||
4136 | @@ -23948,7 +24264,7 @@ | ||
4137 | $(MAKE) stage4-start; \ | ||
4138 | fi; \ | ||
4139 | cd $(HOST_SUBDIR)/libdecnumber && \ | ||
4140 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4141 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4142 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4143 | clean | ||
4144 | @endif libdecnumber-bootstrap | ||
4145 | @@ -23969,8 +24285,11 @@ | ||
4146 | $(HOST_EXPORTS) \ | ||
4147 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4148 | cd $(HOST_SUBDIR)/libdecnumber && \ | ||
4149 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4150 | - CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4151 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4152 | + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ | ||
4153 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
4154 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
4155 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4156 | $(TARGET-stageprofile-libdecnumber) | ||
4157 | |||
4158 | maybe-clean-stageprofile-libdecnumber: clean-stageprofile-libdecnumber | ||
4159 | @@ -23983,7 +24302,7 @@ | ||
4160 | $(MAKE) stageprofile-start; \ | ||
4161 | fi; \ | ||
4162 | cd $(HOST_SUBDIR)/libdecnumber && \ | ||
4163 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4164 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4165 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4166 | clean | ||
4167 | @endif libdecnumber-bootstrap | ||
4168 | @@ -24004,8 +24323,11 @@ | ||
4169 | $(HOST_EXPORTS) \ | ||
4170 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4171 | cd $(HOST_SUBDIR)/libdecnumber && \ | ||
4172 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4173 | - CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4174 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4175 | + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ | ||
4176 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
4177 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
4178 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4179 | $(TARGET-stagefeedback-libdecnumber) | ||
4180 | |||
4181 | maybe-clean-stagefeedback-libdecnumber: clean-stagefeedback-libdecnumber | ||
4182 | @@ -24018,7 +24340,7 @@ | ||
4183 | $(MAKE) stagefeedback-start; \ | ||
4184 | fi; \ | ||
4185 | cd $(HOST_SUBDIR)/libdecnumber && \ | ||
4186 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4187 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4188 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4189 | clean | ||
4190 | @endif libdecnumber-bootstrap | ||
4191 | @@ -24432,7 +24754,8 @@ | ||
4192 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4193 | $(HOST_EXPORTS) \ | ||
4194 | (cd $(HOST_SUBDIR)/libgui && \ | ||
4195 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-libgui)) | ||
4196 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4197 | + $(TARGET-libgui)) | ||
4198 | @endif libgui | ||
4199 | |||
4200 | |||
4201 | @@ -24849,9 +25172,9 @@ | ||
4202 | @r=`${PWD_COMMAND}`; export r; \ | ||
4203 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4204 | test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ | ||
4205 | - $(HOST_EXPORTS) \ | ||
4206 | + $(HOST_EXPORTS) \ | ||
4207 | CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ | ||
4208 | - LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ | ||
4209 | + CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ | ||
4210 | echo Configuring stage 1 in $(HOST_SUBDIR)/libiberty ; \ | ||
4211 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ | ||
4212 | cd $(HOST_SUBDIR)/libiberty || exit 1; \ | ||
4213 | @@ -24880,9 +25203,9 @@ | ||
4214 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4215 | test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ | ||
4216 | $(HOST_EXPORTS) \ | ||
4217 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4218 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4219 | CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ | ||
4220 | - LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ | ||
4221 | + CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ | ||
4222 | echo Configuring stage 2 in $(HOST_SUBDIR)/libiberty ; \ | ||
4223 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ | ||
4224 | cd $(HOST_SUBDIR)/libiberty || exit 1; \ | ||
4225 | @@ -24911,9 +25234,9 @@ | ||
4226 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4227 | test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ | ||
4228 | $(HOST_EXPORTS) \ | ||
4229 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4230 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4231 | CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ | ||
4232 | - LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ | ||
4233 | + CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ | ||
4234 | echo Configuring stage b2g0 in $(HOST_SUBDIR)/libiberty ; \ | ||
4235 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ | ||
4236 | cd $(HOST_SUBDIR)/libiberty || exit 1; \ | ||
4237 | @@ -24942,9 +25265,9 @@ | ||
4238 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4239 | test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ | ||
4240 | $(HOST_EXPORTS) \ | ||
4241 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4242 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4243 | CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ | ||
4244 | - LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ | ||
4245 | + CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ | ||
4246 | echo Configuring stage 3 in $(HOST_SUBDIR)/libiberty ; \ | ||
4247 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ | ||
4248 | cd $(HOST_SUBDIR)/libiberty || exit 1; \ | ||
4249 | @@ -24973,9 +25296,9 @@ | ||
4250 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4251 | test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ | ||
4252 | $(HOST_EXPORTS) \ | ||
4253 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4254 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4255 | CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ | ||
4256 | - LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ | ||
4257 | + CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ | ||
4258 | echo Configuring stage b3g2 in $(HOST_SUBDIR)/libiberty ; \ | ||
4259 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ | ||
4260 | cd $(HOST_SUBDIR)/libiberty || exit 1; \ | ||
4261 | @@ -25004,9 +25327,9 @@ | ||
4262 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4263 | test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ | ||
4264 | $(HOST_EXPORTS) \ | ||
4265 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4266 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4267 | CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ | ||
4268 | - LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ | ||
4269 | + CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ | ||
4270 | echo Configuring stage 4 in $(HOST_SUBDIR)/libiberty ; \ | ||
4271 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ | ||
4272 | cd $(HOST_SUBDIR)/libiberty || exit 1; \ | ||
4273 | @@ -25035,9 +25358,9 @@ | ||
4274 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4275 | test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ | ||
4276 | $(HOST_EXPORTS) \ | ||
4277 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4278 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4279 | CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ | ||
4280 | - LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ | ||
4281 | + CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ | ||
4282 | echo Configuring stage profile in $(HOST_SUBDIR)/libiberty ; \ | ||
4283 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ | ||
4284 | cd $(HOST_SUBDIR)/libiberty || exit 1; \ | ||
4285 | @@ -25066,9 +25389,9 @@ | ||
4286 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4287 | test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ | ||
4288 | $(HOST_EXPORTS) \ | ||
4289 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4290 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4291 | CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ | ||
4292 | - LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ | ||
4293 | + CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ | ||
4294 | echo Configuring stage feedback in $(HOST_SUBDIR)/libiberty ; \ | ||
4295 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ | ||
4296 | cd $(HOST_SUBDIR)/libiberty || exit 1; \ | ||
4297 | @@ -25103,7 +25426,8 @@ | ||
4298 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4299 | $(HOST_EXPORTS) \ | ||
4300 | (cd $(HOST_SUBDIR)/libiberty && \ | ||
4301 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-libiberty)) | ||
4302 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4303 | + $(TARGET-libiberty)) | ||
4304 | @endif libiberty | ||
4305 | |||
4306 | |||
4307 | @@ -25122,8 +25446,11 @@ | ||
4308 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4309 | $(HOST_EXPORTS) \ | ||
4310 | cd $(HOST_SUBDIR)/libiberty && \ | ||
4311 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4312 | - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ | ||
4313 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4314 | + CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ | ||
4315 | + LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ | ||
4316 | + CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ | ||
4317 | + CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ | ||
4318 | $(TARGET-stage1-libiberty) | ||
4319 | |||
4320 | maybe-clean-stage1-libiberty: clean-stage1-libiberty | ||
4321 | @@ -25136,7 +25463,7 @@ | ||
4322 | $(MAKE) stage1-start; \ | ||
4323 | fi; \ | ||
4324 | cd $(HOST_SUBDIR)/libiberty && \ | ||
4325 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4326 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4327 | clean | ||
4328 | @endif libiberty-bootstrap | ||
4329 | |||
4330 | @@ -25156,8 +25483,11 @@ | ||
4331 | $(HOST_EXPORTS) \ | ||
4332 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4333 | cd $(HOST_SUBDIR)/libiberty && \ | ||
4334 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4335 | - CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4336 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4337 | + CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ | ||
4338 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ | ||
4339 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ | ||
4340 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4341 | $(TARGET-stage2-libiberty) | ||
4342 | |||
4343 | maybe-clean-stage2-libiberty: clean-stage2-libiberty | ||
4344 | @@ -25170,7 +25500,7 @@ | ||
4345 | $(MAKE) stage2-start; \ | ||
4346 | fi; \ | ||
4347 | cd $(HOST_SUBDIR)/libiberty && \ | ||
4348 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4349 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4350 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4351 | clean | ||
4352 | @endif libiberty-bootstrap | ||
4353 | @@ -25191,8 +25521,11 @@ | ||
4354 | $(HOST_EXPORTS) \ | ||
4355 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4356 | cd $(HOST_SUBDIR)/libiberty && \ | ||
4357 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4358 | - CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4359 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4360 | + CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ | ||
4361 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ | ||
4362 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ | ||
4363 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4364 | $(TARGET-stageb2g0-libiberty) | ||
4365 | |||
4366 | maybe-clean-stageb2g0-libiberty: clean-stageb2g0-libiberty | ||
4367 | @@ -25205,7 +25538,7 @@ | ||
4368 | $(MAKE) stageb2g0-start; \ | ||
4369 | fi; \ | ||
4370 | cd $(HOST_SUBDIR)/libiberty && \ | ||
4371 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4372 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4373 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4374 | clean | ||
4375 | @endif libiberty-bootstrap | ||
4376 | @@ -25226,8 +25559,11 @@ | ||
4377 | $(HOST_EXPORTS) \ | ||
4378 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4379 | cd $(HOST_SUBDIR)/libiberty && \ | ||
4380 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4381 | - CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4382 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4383 | + CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ | ||
4384 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ | ||
4385 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ | ||
4386 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4387 | $(TARGET-stage3-libiberty) | ||
4388 | |||
4389 | maybe-clean-stage3-libiberty: clean-stage3-libiberty | ||
4390 | @@ -25240,7 +25576,7 @@ | ||
4391 | $(MAKE) stage3-start; \ | ||
4392 | fi; \ | ||
4393 | cd $(HOST_SUBDIR)/libiberty && \ | ||
4394 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4395 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4396 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4397 | clean | ||
4398 | @endif libiberty-bootstrap | ||
4399 | @@ -25261,8 +25597,11 @@ | ||
4400 | $(HOST_EXPORTS) \ | ||
4401 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4402 | cd $(HOST_SUBDIR)/libiberty && \ | ||
4403 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4404 | - CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4405 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4406 | + CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ | ||
4407 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ | ||
4408 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ | ||
4409 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4410 | $(TARGET-stageb3g2-libiberty) | ||
4411 | |||
4412 | maybe-clean-stageb3g2-libiberty: clean-stageb3g2-libiberty | ||
4413 | @@ -25275,7 +25614,7 @@ | ||
4414 | $(MAKE) stageb3g2-start; \ | ||
4415 | fi; \ | ||
4416 | cd $(HOST_SUBDIR)/libiberty && \ | ||
4417 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4418 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4419 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4420 | clean | ||
4421 | @endif libiberty-bootstrap | ||
4422 | @@ -25296,8 +25635,11 @@ | ||
4423 | $(HOST_EXPORTS) \ | ||
4424 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4425 | cd $(HOST_SUBDIR)/libiberty && \ | ||
4426 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4427 | - CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4428 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4429 | + CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ | ||
4430 | + LIBCFLAGS="$(STAGE4_CFLAGS)" \ | ||
4431 | + CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ | ||
4432 | + CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4433 | $(TARGET-stage4-libiberty) | ||
4434 | |||
4435 | maybe-clean-stage4-libiberty: clean-stage4-libiberty | ||
4436 | @@ -25310,7 +25652,7 @@ | ||
4437 | $(MAKE) stage4-start; \ | ||
4438 | fi; \ | ||
4439 | cd $(HOST_SUBDIR)/libiberty && \ | ||
4440 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4441 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4442 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4443 | clean | ||
4444 | @endif libiberty-bootstrap | ||
4445 | @@ -25331,8 +25673,11 @@ | ||
4446 | $(HOST_EXPORTS) \ | ||
4447 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4448 | cd $(HOST_SUBDIR)/libiberty && \ | ||
4449 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4450 | - CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4451 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4452 | + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ | ||
4453 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
4454 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
4455 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4456 | $(TARGET-stageprofile-libiberty) | ||
4457 | |||
4458 | maybe-clean-stageprofile-libiberty: clean-stageprofile-libiberty | ||
4459 | @@ -25345,7 +25690,7 @@ | ||
4460 | $(MAKE) stageprofile-start; \ | ||
4461 | fi; \ | ||
4462 | cd $(HOST_SUBDIR)/libiberty && \ | ||
4463 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4464 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4465 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4466 | clean | ||
4467 | @endif libiberty-bootstrap | ||
4468 | @@ -25366,8 +25711,11 @@ | ||
4469 | $(HOST_EXPORTS) \ | ||
4470 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4471 | cd $(HOST_SUBDIR)/libiberty && \ | ||
4472 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4473 | - CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4474 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4475 | + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ | ||
4476 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
4477 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
4478 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4479 | $(TARGET-stagefeedback-libiberty) | ||
4480 | |||
4481 | maybe-clean-stagefeedback-libiberty: clean-stagefeedback-libiberty | ||
4482 | @@ -25380,7 +25728,7 @@ | ||
4483 | $(MAKE) stagefeedback-start; \ | ||
4484 | fi; \ | ||
4485 | cd $(HOST_SUBDIR)/libiberty && \ | ||
4486 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4487 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4488 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4489 | clean | ||
4490 | @endif libiberty-bootstrap | ||
4491 | @@ -25794,7 +26142,8 @@ | ||
4492 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4493 | $(HOST_EXPORTS) \ | ||
4494 | (cd $(HOST_SUBDIR)/libtool && \ | ||
4495 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-libtool)) | ||
4496 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4497 | + $(TARGET-libtool)) | ||
4498 | @endif libtool | ||
4499 | |||
4500 | |||
4501 | @@ -26218,7 +26567,8 @@ | ||
4502 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4503 | $(HOST_EXPORTS) \ | ||
4504 | (cd $(HOST_SUBDIR)/m4 && \ | ||
4505 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-m4)) | ||
4506 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4507 | + $(TARGET-m4)) | ||
4508 | @endif m4 | ||
4509 | |||
4510 | |||
4511 | @@ -26642,7 +26992,8 @@ | ||
4512 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4513 | $(HOST_EXPORTS) \ | ||
4514 | (cd $(HOST_SUBDIR)/make && \ | ||
4515 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-make)) | ||
4516 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4517 | + $(TARGET-make)) | ||
4518 | @endif make | ||
4519 | |||
4520 | |||
4521 | @@ -27066,7 +27417,8 @@ | ||
4522 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4523 | $(HOST_EXPORTS) \ | ||
4524 | (cd $(HOST_SUBDIR)/mmalloc && \ | ||
4525 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-mmalloc)) | ||
4526 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4527 | + $(TARGET-mmalloc)) | ||
4528 | @endif mmalloc | ||
4529 | |||
4530 | |||
4531 | @@ -27484,7 +27836,8 @@ | ||
4532 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4533 | $(HOST_EXPORTS) \ | ||
4534 | (cd $(HOST_SUBDIR)/patch && \ | ||
4535 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-patch)) | ||
4536 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4537 | + $(TARGET-patch)) | ||
4538 | @endif patch | ||
4539 | |||
4540 | |||
4541 | @@ -27908,7 +28261,8 @@ | ||
4542 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4543 | $(HOST_EXPORTS) \ | ||
4544 | (cd $(HOST_SUBDIR)/perl && \ | ||
4545 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-perl)) | ||
4546 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4547 | + $(TARGET-perl)) | ||
4548 | @endif perl | ||
4549 | |||
4550 | |||
4551 | @@ -28332,7 +28686,8 @@ | ||
4552 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4553 | $(HOST_EXPORTS) \ | ||
4554 | (cd $(HOST_SUBDIR)/prms && \ | ||
4555 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-prms)) | ||
4556 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4557 | + $(TARGET-prms)) | ||
4558 | @endif prms | ||
4559 | |||
4560 | |||
4561 | @@ -28756,7 +29111,8 @@ | ||
4562 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4563 | $(HOST_EXPORTS) \ | ||
4564 | (cd $(HOST_SUBDIR)/rcs && \ | ||
4565 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-rcs)) | ||
4566 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4567 | + $(TARGET-rcs)) | ||
4568 | @endif rcs | ||
4569 | |||
4570 | |||
4571 | @@ -29180,7 +29536,8 @@ | ||
4572 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4573 | $(HOST_EXPORTS) \ | ||
4574 | (cd $(HOST_SUBDIR)/readline && \ | ||
4575 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-readline)) | ||
4576 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4577 | + $(TARGET-readline)) | ||
4578 | @endif readline | ||
4579 | |||
4580 | |||
4581 | @@ -29604,7 +29961,8 @@ | ||
4582 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4583 | $(HOST_EXPORTS) \ | ||
4584 | (cd $(HOST_SUBDIR)/release && \ | ||
4585 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-release)) | ||
4586 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4587 | + $(TARGET-release)) | ||
4588 | @endif release | ||
4589 | |||
4590 | |||
4591 | @@ -30016,7 +30374,8 @@ | ||
4592 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4593 | $(HOST_EXPORTS) \ | ||
4594 | (cd $(HOST_SUBDIR)/recode && \ | ||
4595 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-recode)) | ||
4596 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4597 | + $(TARGET-recode)) | ||
4598 | @endif recode | ||
4599 | |||
4600 | |||
4601 | @@ -30440,7 +30799,8 @@ | ||
4602 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4603 | $(HOST_EXPORTS) \ | ||
4604 | (cd $(HOST_SUBDIR)/sed && \ | ||
4605 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-sed)) | ||
4606 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4607 | + $(TARGET-sed)) | ||
4608 | @endif sed | ||
4609 | |||
4610 | |||
4611 | @@ -30864,7 +31224,8 @@ | ||
4612 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4613 | $(HOST_EXPORTS) \ | ||
4614 | (cd $(HOST_SUBDIR)/send-pr && \ | ||
4615 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-send-pr)) | ||
4616 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4617 | + $(TARGET-send-pr)) | ||
4618 | @endif send-pr | ||
4619 | |||
4620 | |||
4621 | @@ -31288,7 +31649,8 @@ | ||
4622 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4623 | $(HOST_EXPORTS) \ | ||
4624 | (cd $(HOST_SUBDIR)/shellutils && \ | ||
4625 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-shellutils)) | ||
4626 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4627 | + $(TARGET-shellutils)) | ||
4628 | @endif shellutils | ||
4629 | |||
4630 | |||
4631 | @@ -31712,7 +32074,8 @@ | ||
4632 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4633 | $(HOST_EXPORTS) \ | ||
4634 | (cd $(HOST_SUBDIR)/sid && \ | ||
4635 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-sid)) | ||
4636 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4637 | + $(TARGET-sid)) | ||
4638 | @endif sid | ||
4639 | |||
4640 | |||
4641 | @@ -32136,7 +32499,8 @@ | ||
4642 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4643 | $(HOST_EXPORTS) \ | ||
4644 | (cd $(HOST_SUBDIR)/sim && \ | ||
4645 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-sim)) | ||
4646 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4647 | + $(TARGET-sim)) | ||
4648 | @endif sim | ||
4649 | |||
4650 | |||
4651 | @@ -32560,7 +32924,8 @@ | ||
4652 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4653 | $(HOST_EXPORTS) \ | ||
4654 | (cd $(HOST_SUBDIR)/tar && \ | ||
4655 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-tar)) | ||
4656 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4657 | + $(TARGET-tar)) | ||
4658 | @endif tar | ||
4659 | |||
4660 | |||
4661 | @@ -32984,7 +33349,8 @@ | ||
4662 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4663 | $(HOST_EXPORTS) \ | ||
4664 | (cd $(HOST_SUBDIR)/texinfo && \ | ||
4665 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-texinfo)) | ||
4666 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4667 | + $(TARGET-texinfo)) | ||
4668 | @endif texinfo | ||
4669 | |||
4670 | |||
4671 | @@ -33402,7 +33768,8 @@ | ||
4672 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4673 | $(HOST_EXPORTS) \ | ||
4674 | (cd $(HOST_SUBDIR)/textutils && \ | ||
4675 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-textutils)) | ||
4676 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4677 | + $(TARGET-textutils)) | ||
4678 | @endif textutils | ||
4679 | |||
4680 | |||
4681 | @@ -33826,7 +34193,8 @@ | ||
4682 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4683 | $(HOST_EXPORTS) \ | ||
4684 | (cd $(HOST_SUBDIR)/time && \ | ||
4685 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-time)) | ||
4686 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4687 | + $(TARGET-time)) | ||
4688 | @endif time | ||
4689 | |||
4690 | |||
4691 | @@ -34250,7 +34618,8 @@ | ||
4692 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4693 | $(HOST_EXPORTS) \ | ||
4694 | (cd $(HOST_SUBDIR)/uudecode && \ | ||
4695 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-uudecode)) | ||
4696 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4697 | + $(TARGET-uudecode)) | ||
4698 | @endif uudecode | ||
4699 | |||
4700 | |||
4701 | @@ -34674,7 +35043,8 @@ | ||
4702 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4703 | $(HOST_EXPORTS) \ | ||
4704 | (cd $(HOST_SUBDIR)/wdiff && \ | ||
4705 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-wdiff)) | ||
4706 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4707 | + $(TARGET-wdiff)) | ||
4708 | @endif wdiff | ||
4709 | |||
4710 | |||
4711 | @@ -35098,7 +35468,8 @@ | ||
4712 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4713 | $(HOST_EXPORTS) \ | ||
4714 | (cd $(HOST_SUBDIR)/zip && \ | ||
4715 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-zip)) | ||
4716 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4717 | + $(TARGET-zip)) | ||
4718 | @endif zip | ||
4719 | |||
4720 | |||
4721 | @@ -35518,9 +35889,9 @@ | ||
4722 | @r=`${PWD_COMMAND}`; export r; \ | ||
4723 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4724 | test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ | ||
4725 | - $(HOST_EXPORTS) \ | ||
4726 | + $(HOST_EXPORTS) \ | ||
4727 | CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ | ||
4728 | - LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ | ||
4729 | + CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ | ||
4730 | echo Configuring stage 1 in $(HOST_SUBDIR)/zlib ; \ | ||
4731 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ | ||
4732 | cd $(HOST_SUBDIR)/zlib || exit 1; \ | ||
4733 | @@ -35549,9 +35920,9 @@ | ||
4734 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4735 | test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ | ||
4736 | $(HOST_EXPORTS) \ | ||
4737 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4738 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4739 | CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ | ||
4740 | - LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ | ||
4741 | + CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ | ||
4742 | echo Configuring stage 2 in $(HOST_SUBDIR)/zlib ; \ | ||
4743 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ | ||
4744 | cd $(HOST_SUBDIR)/zlib || exit 1; \ | ||
4745 | @@ -35580,9 +35951,9 @@ | ||
4746 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4747 | test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ | ||
4748 | $(HOST_EXPORTS) \ | ||
4749 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4750 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4751 | CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ | ||
4752 | - LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ | ||
4753 | + CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ | ||
4754 | echo Configuring stage b2g0 in $(HOST_SUBDIR)/zlib ; \ | ||
4755 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ | ||
4756 | cd $(HOST_SUBDIR)/zlib || exit 1; \ | ||
4757 | @@ -35611,9 +35982,9 @@ | ||
4758 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4759 | test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ | ||
4760 | $(HOST_EXPORTS) \ | ||
4761 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4762 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4763 | CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ | ||
4764 | - LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ | ||
4765 | + CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ | ||
4766 | echo Configuring stage 3 in $(HOST_SUBDIR)/zlib ; \ | ||
4767 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ | ||
4768 | cd $(HOST_SUBDIR)/zlib || exit 1; \ | ||
4769 | @@ -35642,9 +36013,9 @@ | ||
4770 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4771 | test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ | ||
4772 | $(HOST_EXPORTS) \ | ||
4773 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4774 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4775 | CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ | ||
4776 | - LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ | ||
4777 | + CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ | ||
4778 | echo Configuring stage b3g2 in $(HOST_SUBDIR)/zlib ; \ | ||
4779 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ | ||
4780 | cd $(HOST_SUBDIR)/zlib || exit 1; \ | ||
4781 | @@ -35673,9 +36044,9 @@ | ||
4782 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4783 | test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ | ||
4784 | $(HOST_EXPORTS) \ | ||
4785 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4786 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4787 | CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ | ||
4788 | - LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ | ||
4789 | + CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ | ||
4790 | echo Configuring stage 4 in $(HOST_SUBDIR)/zlib ; \ | ||
4791 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ | ||
4792 | cd $(HOST_SUBDIR)/zlib || exit 1; \ | ||
4793 | @@ -35704,9 +36075,9 @@ | ||
4794 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4795 | test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ | ||
4796 | $(HOST_EXPORTS) \ | ||
4797 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4798 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4799 | CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ | ||
4800 | - LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ | ||
4801 | + CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ | ||
4802 | echo Configuring stage profile in $(HOST_SUBDIR)/zlib ; \ | ||
4803 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ | ||
4804 | cd $(HOST_SUBDIR)/zlib || exit 1; \ | ||
4805 | @@ -35735,9 +36106,9 @@ | ||
4806 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4807 | test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ | ||
4808 | $(HOST_EXPORTS) \ | ||
4809 | - $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4810 | + $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4811 | CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ | ||
4812 | - LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ | ||
4813 | + CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ | ||
4814 | echo Configuring stage feedback in $(HOST_SUBDIR)/zlib ; \ | ||
4815 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ | ||
4816 | cd $(HOST_SUBDIR)/zlib || exit 1; \ | ||
4817 | @@ -35772,7 +36143,8 @@ | ||
4818 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4819 | $(HOST_EXPORTS) \ | ||
4820 | (cd $(HOST_SUBDIR)/zlib && \ | ||
4821 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-zlib)) | ||
4822 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
4823 | + $(TARGET-zlib)) | ||
4824 | @endif zlib | ||
4825 | |||
4826 | |||
4827 | @@ -35791,8 +36163,11 @@ | ||
4828 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
4829 | $(HOST_EXPORTS) \ | ||
4830 | cd $(HOST_SUBDIR)/zlib && \ | ||
4831 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4832 | - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ | ||
4833 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4834 | + CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ | ||
4835 | + LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ | ||
4836 | + CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ | ||
4837 | + CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ | ||
4838 | $(TARGET-stage1-zlib) | ||
4839 | |||
4840 | maybe-clean-stage1-zlib: clean-stage1-zlib | ||
4841 | @@ -35805,7 +36180,7 @@ | ||
4842 | $(MAKE) stage1-start; \ | ||
4843 | fi; \ | ||
4844 | cd $(HOST_SUBDIR)/zlib && \ | ||
4845 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4846 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4847 | clean | ||
4848 | @endif zlib-bootstrap | ||
4849 | |||
4850 | @@ -35825,8 +36200,11 @@ | ||
4851 | $(HOST_EXPORTS) \ | ||
4852 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4853 | cd $(HOST_SUBDIR)/zlib && \ | ||
4854 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4855 | - CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4856 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4857 | + CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ | ||
4858 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ | ||
4859 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ | ||
4860 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4861 | $(TARGET-stage2-zlib) | ||
4862 | |||
4863 | maybe-clean-stage2-zlib: clean-stage2-zlib | ||
4864 | @@ -35839,7 +36217,7 @@ | ||
4865 | $(MAKE) stage2-start; \ | ||
4866 | fi; \ | ||
4867 | cd $(HOST_SUBDIR)/zlib && \ | ||
4868 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4869 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4870 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4871 | clean | ||
4872 | @endif zlib-bootstrap | ||
4873 | @@ -35860,8 +36238,11 @@ | ||
4874 | $(HOST_EXPORTS) \ | ||
4875 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4876 | cd $(HOST_SUBDIR)/zlib && \ | ||
4877 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4878 | - CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4879 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4880 | + CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ | ||
4881 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ | ||
4882 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ | ||
4883 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4884 | $(TARGET-stageb2g0-zlib) | ||
4885 | |||
4886 | maybe-clean-stageb2g0-zlib: clean-stageb2g0-zlib | ||
4887 | @@ -35874,7 +36255,7 @@ | ||
4888 | $(MAKE) stageb2g0-start; \ | ||
4889 | fi; \ | ||
4890 | cd $(HOST_SUBDIR)/zlib && \ | ||
4891 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4892 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4893 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4894 | clean | ||
4895 | @endif zlib-bootstrap | ||
4896 | @@ -35895,8 +36276,11 @@ | ||
4897 | $(HOST_EXPORTS) \ | ||
4898 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4899 | cd $(HOST_SUBDIR)/zlib && \ | ||
4900 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4901 | - CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4902 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4903 | + CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ | ||
4904 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ | ||
4905 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ | ||
4906 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4907 | $(TARGET-stage3-zlib) | ||
4908 | |||
4909 | maybe-clean-stage3-zlib: clean-stage3-zlib | ||
4910 | @@ -35909,7 +36293,7 @@ | ||
4911 | $(MAKE) stage3-start; \ | ||
4912 | fi; \ | ||
4913 | cd $(HOST_SUBDIR)/zlib && \ | ||
4914 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4915 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4916 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4917 | clean | ||
4918 | @endif zlib-bootstrap | ||
4919 | @@ -35930,8 +36314,11 @@ | ||
4920 | $(HOST_EXPORTS) \ | ||
4921 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4922 | cd $(HOST_SUBDIR)/zlib && \ | ||
4923 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4924 | - CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4925 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4926 | + CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ | ||
4927 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ | ||
4928 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ | ||
4929 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4930 | $(TARGET-stageb3g2-zlib) | ||
4931 | |||
4932 | maybe-clean-stageb3g2-zlib: clean-stageb3g2-zlib | ||
4933 | @@ -35944,7 +36331,7 @@ | ||
4934 | $(MAKE) stageb3g2-start; \ | ||
4935 | fi; \ | ||
4936 | cd $(HOST_SUBDIR)/zlib && \ | ||
4937 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4938 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4939 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4940 | clean | ||
4941 | @endif zlib-bootstrap | ||
4942 | @@ -35965,8 +36352,11 @@ | ||
4943 | $(HOST_EXPORTS) \ | ||
4944 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4945 | cd $(HOST_SUBDIR)/zlib && \ | ||
4946 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4947 | - CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4948 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4949 | + CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ | ||
4950 | + LIBCFLAGS="$(STAGE4_CFLAGS)" \ | ||
4951 | + CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ | ||
4952 | + CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4953 | $(TARGET-stage4-zlib) | ||
4954 | |||
4955 | maybe-clean-stage4-zlib: clean-stage4-zlib | ||
4956 | @@ -35979,7 +36369,7 @@ | ||
4957 | $(MAKE) stage4-start; \ | ||
4958 | fi; \ | ||
4959 | cd $(HOST_SUBDIR)/zlib && \ | ||
4960 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4961 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4962 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4963 | clean | ||
4964 | @endif zlib-bootstrap | ||
4965 | @@ -36000,8 +36390,11 @@ | ||
4966 | $(HOST_EXPORTS) \ | ||
4967 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4968 | cd $(HOST_SUBDIR)/zlib && \ | ||
4969 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4970 | - CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4971 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4972 | + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ | ||
4973 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
4974 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
4975 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4976 | $(TARGET-stageprofile-zlib) | ||
4977 | |||
4978 | maybe-clean-stageprofile-zlib: clean-stageprofile-zlib | ||
4979 | @@ -36014,7 +36407,7 @@ | ||
4980 | $(MAKE) stageprofile-start; \ | ||
4981 | fi; \ | ||
4982 | cd $(HOST_SUBDIR)/zlib && \ | ||
4983 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4984 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
4985 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4986 | clean | ||
4987 | @endif zlib-bootstrap | ||
4988 | @@ -36035,8 +36428,11 @@ | ||
4989 | $(HOST_EXPORTS) \ | ||
4990 | $(POSTSTAGE1_HOST_EXPORTS) \ | ||
4991 | cd $(HOST_SUBDIR)/zlib && \ | ||
4992 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
4993 | - CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4994 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
4995 | + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ | ||
4996 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
4997 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
4998 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
4999 | $(TARGET-stagefeedback-zlib) | ||
5000 | |||
5001 | maybe-clean-stagefeedback-zlib: clean-stagefeedback-zlib | ||
5002 | @@ -36049,7 +36445,7 @@ | ||
5003 | $(MAKE) stagefeedback-start; \ | ||
5004 | fi; \ | ||
5005 | cd $(HOST_SUBDIR)/zlib && \ | ||
5006 | - $(MAKE) $(FLAGS_TO_PASS) \ | ||
5007 | + $(MAKE) $(EXTRA_HOST_FLAGS) \ | ||
5008 | $(POSTSTAGE1_FLAGS_TO_PASS) \ | ||
5009 | clean | ||
5010 | @endif zlib-bootstrap | ||
5011 | @@ -36451,7 +36847,8 @@ | ||
5012 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5013 | $(HOST_EXPORTS) \ | ||
5014 | (cd $(HOST_SUBDIR)/gdb && \ | ||
5015 | - $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) $(TARGET-gdb)) | ||
5016 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS) \ | ||
5017 | + $(TARGET-gdb)) | ||
5018 | @endif gdb | ||
5019 | |||
5020 | |||
5021 | @@ -36875,7 +37272,8 @@ | ||
5022 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5023 | $(HOST_EXPORTS) \ | ||
5024 | (cd $(HOST_SUBDIR)/expect && \ | ||
5025 | - $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) $(TARGET-expect)) | ||
5026 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS) \ | ||
5027 | + $(TARGET-expect)) | ||
5028 | @endif expect | ||
5029 | |||
5030 | |||
5031 | @@ -37299,7 +37697,8 @@ | ||
5032 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5033 | $(HOST_EXPORTS) \ | ||
5034 | (cd $(HOST_SUBDIR)/guile && \ | ||
5035 | - $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) $(TARGET-guile)) | ||
5036 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS) \ | ||
5037 | + $(TARGET-guile)) | ||
5038 | @endif guile | ||
5039 | |||
5040 | |||
5041 | @@ -37723,7 +38122,8 @@ | ||
5042 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5043 | $(HOST_EXPORTS) \ | ||
5044 | (cd $(HOST_SUBDIR)/tk && \ | ||
5045 | - $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) $(TARGET-tk)) | ||
5046 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS) \ | ||
5047 | + $(TARGET-tk)) | ||
5048 | @endif tk | ||
5049 | |||
5050 | |||
5051 | @@ -38147,7 +38547,8 @@ | ||
5052 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5053 | $(HOST_EXPORTS) \ | ||
5054 | (cd $(HOST_SUBDIR)/libtermcap && \ | ||
5055 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-libtermcap)) | ||
5056 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
5057 | + $(TARGET-libtermcap)) | ||
5058 | @endif libtermcap | ||
5059 | |||
5060 | |||
5061 | @@ -38505,7 +38906,8 @@ | ||
5062 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5063 | $(HOST_EXPORTS) \ | ||
5064 | (cd $(HOST_SUBDIR)/utils && \ | ||
5065 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-utils)) | ||
5066 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
5067 | + $(TARGET-utils)) | ||
5068 | @endif utils | ||
5069 | |||
5070 | |||
5071 | @@ -38923,7 +39325,8 @@ | ||
5072 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5073 | $(HOST_EXPORTS) \ | ||
5074 | (cd $(HOST_SUBDIR)/gnattools && \ | ||
5075 | - $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gnattools)) | ||
5076 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ | ||
5077 | + $(TARGET-gnattools)) | ||
5078 | @endif gnattools | ||
5079 | |||
5080 | |||
5081 | @@ -39368,7 +39771,8 @@ | ||
5082 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5083 | $(RAW_CXX_TARGET_EXPORTS) \ | ||
5084 | (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ | ||
5085 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' $(TARGET-target-libstdc++-v3)) | ||
5086 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' \ | ||
5087 | + $(TARGET-target-libstdc++-v3)) | ||
5088 | @endif target-libstdc++-v3 | ||
5089 | |||
5090 | |||
5091 | @@ -39809,7 +40213,8 @@ | ||
5092 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5093 | $(NORMAL_TARGET_EXPORTS) \ | ||
5094 | (cd $(TARGET_SUBDIR)/libmudflap && \ | ||
5095 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libmudflap)) | ||
5096 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ | ||
5097 | + $(TARGET-target-libmudflap)) | ||
5098 | @endif target-libmudflap | ||
5099 | |||
5100 | |||
5101 | @@ -40250,7 +40655,8 @@ | ||
5102 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5103 | $(NORMAL_TARGET_EXPORTS) \ | ||
5104 | (cd $(TARGET_SUBDIR)/libssp && \ | ||
5105 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libssp)) | ||
5106 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ | ||
5107 | + $(TARGET-target-libssp)) | ||
5108 | @endif target-libssp | ||
5109 | |||
5110 | |||
5111 | @@ -40691,7 +41097,8 @@ | ||
5112 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5113 | $(NORMAL_TARGET_EXPORTS) \ | ||
5114 | (cd $(TARGET_SUBDIR)/newlib && \ | ||
5115 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-newlib)) | ||
5116 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ | ||
5117 | + $(TARGET-target-newlib)) | ||
5118 | @endif target-newlib | ||
5119 | |||
5120 | |||
5121 | @@ -41137,9 +41544,9 @@ | ||
5122 | mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ | ||
5123 | fi; \ | ||
5124 | test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ | ||
5125 | - $(NORMAL_TARGET_EXPORTS) \ | ||
5126 | - CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ | ||
5127 | - LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ | ||
5128 | + $(NORMAL_TARGET_EXPORTS) \ | ||
5129 | + CFLAGS="$(STAGE1_LIBCFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ | ||
5130 | + CXXFLAGS="$(STAGE1_LIBCFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ | ||
5131 | echo Configuring stage 1 in $(TARGET_SUBDIR)/libgcc ; \ | ||
5132 | $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ | ||
5133 | cd $(TARGET_SUBDIR)/libgcc || exit 1; \ | ||
5134 | @@ -41180,9 +41587,9 @@ | ||
5135 | fi; \ | ||
5136 | test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ | ||
5137 | $(NORMAL_TARGET_EXPORTS) \ | ||
5138 | - \ | ||
5139 | - CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ | ||
5140 | - LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ | ||
5141 | + \ | ||
5142 | + CFLAGS="$(STAGE2_LIBCFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ | ||
5143 | + CXXFLAGS="$(STAGE2_LIBCFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ | ||
5144 | echo Configuring stage 2 in $(TARGET_SUBDIR)/libgcc ; \ | ||
5145 | $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ | ||
5146 | cd $(TARGET_SUBDIR)/libgcc || exit 1; \ | ||
5147 | @@ -41223,9 +41630,9 @@ | ||
5148 | fi; \ | ||
5149 | test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ | ||
5150 | $(NORMAL_TARGET_EXPORTS) \ | ||
5151 | - \ | ||
5152 | - CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ | ||
5153 | - LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ | ||
5154 | + \ | ||
5155 | + CFLAGS="$(STAGE2_LIBCFLAGS) -g0 $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ | ||
5156 | + CXXFLAGS="$(STAGE2_LIBCFLAGS) -g0 $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ | ||
5157 | echo Configuring stage b2g0 in $(TARGET_SUBDIR)/libgcc ; \ | ||
5158 | $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ | ||
5159 | cd $(TARGET_SUBDIR)/libgcc || exit 1; \ | ||
5160 | @@ -41266,9 +41673,9 @@ | ||
5161 | fi; \ | ||
5162 | test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ | ||
5163 | $(NORMAL_TARGET_EXPORTS) \ | ||
5164 | - \ | ||
5165 | - CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ | ||
5166 | - LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ | ||
5167 | + \ | ||
5168 | + CFLAGS="$(STAGE3_LIBCFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ | ||
5169 | + CXXFLAGS="$(STAGE3_LIBCFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ | ||
5170 | echo Configuring stage 3 in $(TARGET_SUBDIR)/libgcc ; \ | ||
5171 | $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ | ||
5172 | cd $(TARGET_SUBDIR)/libgcc || exit 1; \ | ||
5173 | @@ -41309,9 +41716,9 @@ | ||
5174 | fi; \ | ||
5175 | test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ | ||
5176 | $(NORMAL_TARGET_EXPORTS) \ | ||
5177 | - \ | ||
5178 | - CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ | ||
5179 | - LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ | ||
5180 | + \ | ||
5181 | + CFLAGS="$(STAGE3_LIBCFLAGS) -g2 $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ | ||
5182 | + CXXFLAGS="$(STAGE3_LIBCFLAGS) -g2 $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ | ||
5183 | echo Configuring stage b3g2 in $(TARGET_SUBDIR)/libgcc ; \ | ||
5184 | $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ | ||
5185 | cd $(TARGET_SUBDIR)/libgcc || exit 1; \ | ||
5186 | @@ -41352,9 +41759,9 @@ | ||
5187 | fi; \ | ||
5188 | test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ | ||
5189 | $(NORMAL_TARGET_EXPORTS) \ | ||
5190 | - \ | ||
5191 | - CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ | ||
5192 | - LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ | ||
5193 | + \ | ||
5194 | + CFLAGS="$(STAGE4_CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ | ||
5195 | + CXXFLAGS="$(STAGE4_CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ | ||
5196 | echo Configuring stage 4 in $(TARGET_SUBDIR)/libgcc ; \ | ||
5197 | $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ | ||
5198 | cd $(TARGET_SUBDIR)/libgcc || exit 1; \ | ||
5199 | @@ -41395,9 +41802,9 @@ | ||
5200 | fi; \ | ||
5201 | test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ | ||
5202 | $(NORMAL_TARGET_EXPORTS) \ | ||
5203 | - \ | ||
5204 | - CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ | ||
5205 | - LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ | ||
5206 | + \ | ||
5207 | + CFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ | ||
5208 | + CXXFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ | ||
5209 | echo Configuring stage profile in $(TARGET_SUBDIR)/libgcc ; \ | ||
5210 | $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ | ||
5211 | cd $(TARGET_SUBDIR)/libgcc || exit 1; \ | ||
5212 | @@ -41438,9 +41845,9 @@ | ||
5213 | fi; \ | ||
5214 | test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ | ||
5215 | $(NORMAL_TARGET_EXPORTS) \ | ||
5216 | - \ | ||
5217 | - CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ | ||
5218 | - LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ | ||
5219 | + \ | ||
5220 | + CFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ | ||
5221 | + CXXFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ | ||
5222 | echo Configuring stage feedback in $(TARGET_SUBDIR)/libgcc ; \ | ||
5223 | $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ | ||
5224 | cd $(TARGET_SUBDIR)/libgcc || exit 1; \ | ||
5225 | @@ -41475,7 +41882,8 @@ | ||
5226 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5227 | $(NORMAL_TARGET_EXPORTS) \ | ||
5228 | (cd $(TARGET_SUBDIR)/libgcc && \ | ||
5229 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libgcc)) | ||
5230 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ | ||
5231 | + $(TARGET-target-libgcc)) | ||
5232 | @endif target-libgcc | ||
5233 | |||
5234 | |||
5235 | @@ -41494,8 +41902,11 @@ | ||
5236 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5237 | $(NORMAL_TARGET_EXPORTS) \ | ||
5238 | cd $(TARGET_SUBDIR)/libgcc && \ | ||
5239 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) \ | ||
5240 | - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ | ||
5241 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
5242 | + CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ | ||
5243 | + LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ | ||
5244 | + CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ | ||
5245 | + CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_TARGET_FLAGS) \ | ||
5246 | $(TARGET-stage1-target-libgcc) | ||
5247 | |||
5248 | maybe-clean-stage1-target-libgcc: clean-stage1-target-libgcc | ||
5249 | @@ -41508,7 +41919,7 @@ | ||
5250 | $(MAKE) stage1-start; \ | ||
5251 | fi; \ | ||
5252 | cd $(TARGET_SUBDIR)/libgcc && \ | ||
5253 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) \ | ||
5254 | + $(MAKE) $(EXTRA_TARGET_FLAGS) \ | ||
5255 | clean | ||
5256 | @endif target-libgcc-bootstrap | ||
5257 | |||
5258 | @@ -41528,8 +41939,11 @@ | ||
5259 | $(NORMAL_TARGET_EXPORTS) \ | ||
5260 | \ | ||
5261 | cd $(TARGET_SUBDIR)/libgcc && \ | ||
5262 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) \ | ||
5263 | - CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" \ | ||
5264 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
5265 | + CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ | ||
5266 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ | ||
5267 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ | ||
5268 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_TARGET_FLAGS) \ | ||
5269 | $(TARGET-stage2-target-libgcc) | ||
5270 | |||
5271 | maybe-clean-stage2-target-libgcc: clean-stage2-target-libgcc | ||
5272 | @@ -41542,7 +41956,7 @@ | ||
5273 | $(MAKE) stage2-start; \ | ||
5274 | fi; \ | ||
5275 | cd $(TARGET_SUBDIR)/libgcc && \ | ||
5276 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) \ | ||
5277 | + $(MAKE) $(EXTRA_TARGET_FLAGS) \ | ||
5278 | \ | ||
5279 | clean | ||
5280 | @endif target-libgcc-bootstrap | ||
5281 | @@ -41563,8 +41977,11 @@ | ||
5282 | $(NORMAL_TARGET_EXPORTS) \ | ||
5283 | \ | ||
5284 | cd $(TARGET_SUBDIR)/libgcc && \ | ||
5285 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) \ | ||
5286 | - CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" \ | ||
5287 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
5288 | + CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ | ||
5289 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ | ||
5290 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ | ||
5291 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_TARGET_FLAGS) \ | ||
5292 | $(TARGET-stageb2g0-target-libgcc) | ||
5293 | |||
5294 | maybe-clean-stageb2g0-target-libgcc: clean-stageb2g0-target-libgcc | ||
5295 | @@ -41577,7 +41994,7 @@ | ||
5296 | $(MAKE) stageb2g0-start; \ | ||
5297 | fi; \ | ||
5298 | cd $(TARGET_SUBDIR)/libgcc && \ | ||
5299 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) \ | ||
5300 | + $(MAKE) $(EXTRA_TARGET_FLAGS) \ | ||
5301 | \ | ||
5302 | clean | ||
5303 | @endif target-libgcc-bootstrap | ||
5304 | @@ -41598,8 +42015,11 @@ | ||
5305 | $(NORMAL_TARGET_EXPORTS) \ | ||
5306 | \ | ||
5307 | cd $(TARGET_SUBDIR)/libgcc && \ | ||
5308 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) \ | ||
5309 | - CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" \ | ||
5310 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
5311 | + CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ | ||
5312 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ | ||
5313 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ | ||
5314 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_TARGET_FLAGS) \ | ||
5315 | $(TARGET-stage3-target-libgcc) | ||
5316 | |||
5317 | maybe-clean-stage3-target-libgcc: clean-stage3-target-libgcc | ||
5318 | @@ -41612,7 +42032,7 @@ | ||
5319 | $(MAKE) stage3-start; \ | ||
5320 | fi; \ | ||
5321 | cd $(TARGET_SUBDIR)/libgcc && \ | ||
5322 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) \ | ||
5323 | + $(MAKE) $(EXTRA_TARGET_FLAGS) \ | ||
5324 | \ | ||
5325 | clean | ||
5326 | @endif target-libgcc-bootstrap | ||
5327 | @@ -41633,8 +42053,11 @@ | ||
5328 | $(NORMAL_TARGET_EXPORTS) \ | ||
5329 | \ | ||
5330 | cd $(TARGET_SUBDIR)/libgcc && \ | ||
5331 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) \ | ||
5332 | - CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" \ | ||
5333 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
5334 | + CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ | ||
5335 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ | ||
5336 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ | ||
5337 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_TARGET_FLAGS) \ | ||
5338 | $(TARGET-stageb3g2-target-libgcc) | ||
5339 | |||
5340 | maybe-clean-stageb3g2-target-libgcc: clean-stageb3g2-target-libgcc | ||
5341 | @@ -41647,7 +42070,7 @@ | ||
5342 | $(MAKE) stageb3g2-start; \ | ||
5343 | fi; \ | ||
5344 | cd $(TARGET_SUBDIR)/libgcc && \ | ||
5345 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) \ | ||
5346 | + $(MAKE) $(EXTRA_TARGET_FLAGS) \ | ||
5347 | \ | ||
5348 | clean | ||
5349 | @endif target-libgcc-bootstrap | ||
5350 | @@ -41668,8 +42091,11 @@ | ||
5351 | $(NORMAL_TARGET_EXPORTS) \ | ||
5352 | \ | ||
5353 | cd $(TARGET_SUBDIR)/libgcc && \ | ||
5354 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) \ | ||
5355 | - CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" \ | ||
5356 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
5357 | + CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ | ||
5358 | + LIBCFLAGS="$(STAGE4_CFLAGS)" \ | ||
5359 | + CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ | ||
5360 | + CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_TARGET_FLAGS) \ | ||
5361 | $(TARGET-stage4-target-libgcc) | ||
5362 | |||
5363 | maybe-clean-stage4-target-libgcc: clean-stage4-target-libgcc | ||
5364 | @@ -41682,7 +42108,7 @@ | ||
5365 | $(MAKE) stage4-start; \ | ||
5366 | fi; \ | ||
5367 | cd $(TARGET_SUBDIR)/libgcc && \ | ||
5368 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) \ | ||
5369 | + $(MAKE) $(EXTRA_TARGET_FLAGS) \ | ||
5370 | \ | ||
5371 | clean | ||
5372 | @endif target-libgcc-bootstrap | ||
5373 | @@ -41703,8 +42129,11 @@ | ||
5374 | $(NORMAL_TARGET_EXPORTS) \ | ||
5375 | \ | ||
5376 | cd $(TARGET_SUBDIR)/libgcc && \ | ||
5377 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) \ | ||
5378 | - CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ | ||
5379 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
5380 | + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ | ||
5381 | + LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
5382 | + CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ | ||
5383 | + CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_TARGET_FLAGS) \ | ||
5384 | $(TARGET-stageprofile-target-libgcc) | ||
5385 | |||
5386 | maybe-clean-stageprofile-target-libgcc: clean-stageprofile-target-libgcc | ||
5387 | @@ -41717,7 +42146,7 @@ | ||
5388 | $(MAKE) stageprofile-start; \ | ||
5389 | fi; \ | ||
5390 | cd $(TARGET_SUBDIR)/libgcc && \ | ||
5391 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) \ | ||
5392 | + $(MAKE) $(EXTRA_TARGET_FLAGS) \ | ||
5393 | \ | ||
5394 | clean | ||
5395 | @endif target-libgcc-bootstrap | ||
5396 | @@ -41738,8 +42167,11 @@ | ||
5397 | $(NORMAL_TARGET_EXPORTS) \ | ||
5398 | \ | ||
5399 | cd $(TARGET_SUBDIR)/libgcc && \ | ||
5400 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) \ | ||
5401 | - CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ | ||
5402 | + $(MAKE) $(BASE_FLAGS_TO_PASS) \ | ||
5403 | + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ | ||
5404 | + LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
5405 | + CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ | ||
5406 | + CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_TARGET_FLAGS) \ | ||
5407 | $(TARGET-stagefeedback-target-libgcc) | ||
5408 | |||
5409 | maybe-clean-stagefeedback-target-libgcc: clean-stagefeedback-target-libgcc | ||
5410 | @@ -41752,7 +42184,7 @@ | ||
5411 | $(MAKE) stagefeedback-start; \ | ||
5412 | fi; \ | ||
5413 | cd $(TARGET_SUBDIR)/libgcc && \ | ||
5414 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) \ | ||
5415 | + $(MAKE) $(EXTRA_TARGET_FLAGS) \ | ||
5416 | \ | ||
5417 | clean | ||
5418 | @endif target-libgcc-bootstrap | ||
5419 | @@ -42191,7 +42623,8 @@ | ||
5420 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5421 | $(NORMAL_TARGET_EXPORTS) \ | ||
5422 | (cd $(TARGET_SUBDIR)/libgfortran && \ | ||
5423 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libgfortran)) | ||
5424 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ | ||
5425 | + $(TARGET-target-libgfortran)) | ||
5426 | @endif target-libgfortran | ||
5427 | |||
5428 | |||
5429 | @@ -42632,7 +43065,8 @@ | ||
5430 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5431 | $(NORMAL_TARGET_EXPORTS) \ | ||
5432 | (cd $(TARGET_SUBDIR)/libobjc && \ | ||
5433 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libobjc)) | ||
5434 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ | ||
5435 | + $(TARGET-target-libobjc)) | ||
5436 | @endif target-libobjc | ||
5437 | |||
5438 | |||
5439 | @@ -43073,7 +43507,8 @@ | ||
5440 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5441 | $(NORMAL_TARGET_EXPORTS) \ | ||
5442 | (cd $(TARGET_SUBDIR)/libtermcap && \ | ||
5443 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libtermcap)) | ||
5444 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ | ||
5445 | + $(TARGET-target-libtermcap)) | ||
5446 | @endif target-libtermcap | ||
5447 | |||
5448 | |||
5449 | @@ -43449,7 +43884,8 @@ | ||
5450 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5451 | $(NORMAL_TARGET_EXPORTS) \ | ||
5452 | (cd $(TARGET_SUBDIR)/winsup && \ | ||
5453 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-winsup)) | ||
5454 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ | ||
5455 | + $(TARGET-target-winsup)) | ||
5456 | @endif target-winsup | ||
5457 | |||
5458 | |||
5459 | @@ -43890,7 +44326,8 @@ | ||
5460 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5461 | $(NORMAL_TARGET_EXPORTS) \ | ||
5462 | (cd $(TARGET_SUBDIR)/libgloss && \ | ||
5463 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libgloss)) | ||
5464 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ | ||
5465 | + $(TARGET-target-libgloss)) | ||
5466 | @endif target-libgloss | ||
5467 | |||
5468 | |||
5469 | @@ -44326,7 +44763,8 @@ | ||
5470 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5471 | $(NORMAL_TARGET_EXPORTS) \ | ||
5472 | (cd $(TARGET_SUBDIR)/libiberty && \ | ||
5473 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libiberty)) | ||
5474 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ | ||
5475 | + $(TARGET-target-libiberty)) | ||
5476 | @endif target-libiberty | ||
5477 | |||
5478 | |||
5479 | @@ -44767,7 +45205,8 @@ | ||
5480 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5481 | $(NORMAL_TARGET_EXPORTS) \ | ||
5482 | (cd $(TARGET_SUBDIR)/gperf && \ | ||
5483 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-gperf)) | ||
5484 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ | ||
5485 | + $(TARGET-target-gperf)) | ||
5486 | @endif target-gperf | ||
5487 | |||
5488 | |||
5489 | @@ -45208,7 +45647,8 @@ | ||
5490 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5491 | $(NORMAL_TARGET_EXPORTS) \ | ||
5492 | (cd $(TARGET_SUBDIR)/examples && \ | ||
5493 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-examples)) | ||
5494 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ | ||
5495 | + $(TARGET-target-examples)) | ||
5496 | @endif target-examples | ||
5497 | |||
5498 | |||
5499 | @@ -45639,7 +46079,8 @@ | ||
5500 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5501 | $(NORMAL_TARGET_EXPORTS) \ | ||
5502 | (cd $(TARGET_SUBDIR)/libffi && \ | ||
5503 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libffi)) | ||
5504 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ | ||
5505 | + $(TARGET-target-libffi)) | ||
5506 | @endif target-libffi | ||
5507 | |||
5508 | |||
5509 | @@ -46080,7 +46521,8 @@ | ||
5510 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5511 | $(RAW_CXX_TARGET_EXPORTS) \ | ||
5512 | (cd $(TARGET_SUBDIR)/libjava && \ | ||
5513 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' $(TARGET-target-libjava)) | ||
5514 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' \ | ||
5515 | + $(TARGET-target-libjava)) | ||
5516 | @endif target-libjava | ||
5517 | |||
5518 | |||
5519 | @@ -46521,7 +46963,8 @@ | ||
5520 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5521 | $(NORMAL_TARGET_EXPORTS) \ | ||
5522 | (cd $(TARGET_SUBDIR)/zlib && \ | ||
5523 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-zlib)) | ||
5524 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ | ||
5525 | + $(TARGET-target-zlib)) | ||
5526 | @endif target-zlib | ||
5527 | |||
5528 | |||
5529 | @@ -46962,7 +47405,8 @@ | ||
5530 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5531 | $(NORMAL_TARGET_EXPORTS) \ | ||
5532 | (cd $(TARGET_SUBDIR)/boehm-gc && \ | ||
5533 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-boehm-gc)) | ||
5534 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ | ||
5535 | + $(TARGET-target-boehm-gc)) | ||
5536 | @endif target-boehm-gc | ||
5537 | |||
5538 | |||
5539 | @@ -47403,7 +47847,8 @@ | ||
5540 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5541 | $(NORMAL_TARGET_EXPORTS) \ | ||
5542 | (cd $(TARGET_SUBDIR)/qthreads && \ | ||
5543 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-qthreads)) | ||
5544 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ | ||
5545 | + $(TARGET-target-qthreads)) | ||
5546 | @endif target-qthreads | ||
5547 | |||
5548 | |||
5549 | @@ -47844,7 +48289,8 @@ | ||
5550 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5551 | $(NORMAL_TARGET_EXPORTS) \ | ||
5552 | (cd $(TARGET_SUBDIR)/rda && \ | ||
5553 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-rda)) | ||
5554 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ | ||
5555 | + $(TARGET-target-rda)) | ||
5556 | @endif target-rda | ||
5557 | |||
5558 | |||
5559 | @@ -48285,7 +48731,8 @@ | ||
5560 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5561 | $(NORMAL_TARGET_EXPORTS) \ | ||
5562 | (cd $(TARGET_SUBDIR)/libada && \ | ||
5563 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libada)) | ||
5564 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ | ||
5565 | + $(TARGET-target-libada)) | ||
5566 | @endif target-libada | ||
5567 | |||
5568 | |||
5569 | @@ -48726,7 +49173,8 @@ | ||
5570 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
5571 | $(NORMAL_TARGET_EXPORTS) \ | ||
5572 | (cd $(TARGET_SUBDIR)/libgomp && \ | ||
5573 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libgomp)) | ||
5574 | + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ | ||
5575 | + $(TARGET-target-libgomp)) | ||
5576 | @endif target-libgomp | ||
5577 | |||
5578 | |||
5579 | @@ -49359,7 +49807,7 @@ | ||
5580 | |||
5581 | # Bubble a bug fix through all the stages up to stage 1. They are | ||
5582 | # remade, but not reconfigured. The next stage (if any) will not be | ||
5583 | -# reconfigured as well. | ||
5584 | +# reconfigured either. | ||
5585 | .PHONY: stage1-bubble | ||
5586 | stage1-bubble:: | ||
5587 | @r=`${PWD_COMMAND}`; export r; \ | ||
5588 | @@ -49570,7 +50018,7 @@ | ||
5589 | |||
5590 | # Bubble a bug fix through all the stages up to stage 2. They are | ||
5591 | # remade, but not reconfigured. The next stage (if any) will not be | ||
5592 | -# reconfigured as well. | ||
5593 | +# reconfigured either. | ||
5594 | .PHONY: stage2-bubble | ||
5595 | stage2-bubble:: stage1-bubble | ||
5596 | @r=`${PWD_COMMAND}`; export r; \ | ||
5597 | @@ -49802,7 +50250,7 @@ | ||
5598 | |||
5599 | # Bubble a bug fix through all the stages up to stage b2g0. They are | ||
5600 | # remade, but not reconfigured. The next stage (if any) will not be | ||
5601 | -# reconfigured as well. | ||
5602 | +# reconfigured either. | ||
5603 | .PHONY: stageb2g0-bubble | ||
5604 | stageb2g0-bubble:: stage1-bubble | ||
5605 | @r=`${PWD_COMMAND}`; export r; \ | ||
5606 | @@ -50034,7 +50482,7 @@ | ||
5607 | |||
5608 | # Bubble a bug fix through all the stages up to stage 3. They are | ||
5609 | # remade, but not reconfigured. The next stage (if any) will not be | ||
5610 | -# reconfigured as well. | ||
5611 | +# reconfigured either. | ||
5612 | .PHONY: stage3-bubble | ||
5613 | stage3-bubble:: stage2-bubble | ||
5614 | @r=`${PWD_COMMAND}`; export r; \ | ||
5615 | @@ -50320,7 +50768,7 @@ | ||
5616 | |||
5617 | # Bubble a bug fix through all the stages up to stage b3g2. They are | ||
5618 | # remade, but not reconfigured. The next stage (if any) will not be | ||
5619 | -# reconfigured as well. | ||
5620 | +# reconfigured either. | ||
5621 | .PHONY: stageb3g2-bubble | ||
5622 | stageb3g2-bubble:: stageb2g0-bubble | ||
5623 | @r=`${PWD_COMMAND}`; export r; \ | ||
5624 | @@ -50606,7 +51054,7 @@ | ||
5625 | |||
5626 | # Bubble a bug fix through all the stages up to stage 4. They are | ||
5627 | # remade, but not reconfigured. The next stage (if any) will not be | ||
5628 | -# reconfigured as well. | ||
5629 | +# reconfigured either. | ||
5630 | .PHONY: stage4-bubble | ||
5631 | stage4-bubble:: stage3-bubble | ||
5632 | @r=`${PWD_COMMAND}`; export r; \ | ||
5633 | @@ -50881,7 +51329,7 @@ | ||
5634 | |||
5635 | # Bubble a bug fix through all the stages up to stage profile. They are | ||
5636 | # remade, but not reconfigured. The next stage (if any) will not be | ||
5637 | -# reconfigured as well. | ||
5638 | +# reconfigured either. | ||
5639 | .PHONY: stageprofile-bubble | ||
5640 | stageprofile-bubble:: stage1-bubble | ||
5641 | @r=`${PWD_COMMAND}`; export r; \ | ||
5642 | @@ -51092,7 +51540,7 @@ | ||
5643 | |||
5644 | # Bubble a bug fix through all the stages up to stage feedback. They are | ||
5645 | # remade, but not reconfigured. The next stage (if any) will not be | ||
5646 | -# reconfigured as well. | ||
5647 | +# reconfigured either. | ||
5648 | .PHONY: stagefeedback-bubble | ||
5649 | stagefeedback-bubble:: stageprofile-bubble | ||
5650 | @r=`${PWD_COMMAND}`; export r; \ | ||
5651 | @@ -51175,10 +51623,10 @@ | ||
5652 | @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi | ||
5653 | |||
5654 | .PHONY: restrap | ||
5655 | -restrap: | ||
5656 | +restrap:: | ||
5657 | @: $(MAKE); $(stage) | ||
5658 | rm -rf stage1-$(TARGET_SUBDIR) stage2-* stageb2g0-* stage3-* stageb3g2-* stage4-* stageprofile-* stagefeedback-* | ||
5659 | - $(MAKE) $(RECURSE_FLAGS_TO_PASS) all | ||
5660 | +restrap:: all | ||
5661 | @endif gcc-bootstrap | ||
5662 | |||
5663 | # -------------------------------------- | ||
5664 | @@ -52004,7 +52452,8 @@ | ||
5665 | |||
5666 | # Rebuilding configure. | ||
5667 | AUTOCONF = autoconf | ||
5668 | -$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 | ||
5669 | +$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 \ | ||
5670 | + $(srcdir)/config/override.m4 $(srcdir)/config/proginstall.m4 | ||
5671 | cd $(srcdir) && $(AUTOCONF) | ||
5672 | |||
5673 | # ------------------------------ | ||
5674 | Index: gcc-4.3.3/configure | ||
5675 | =================================================================== | ||
5676 | --- gcc-4.3.3.orig/configure 2008-02-01 20:29:30.000000000 -0700 | ||
5677 | +++ gcc-4.3.3/configure 2009-04-29 18:03:50.204611816 -0700 | ||
5678 | @@ -272,7 +272,7 @@ | ||
5679 | PACKAGE_BUGREPORT= | ||
5680 | |||
5681 | ac_unique_file="move-if-change" | ||
5682 | -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os build_noncanonical host_noncanonical target_noncanonical host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN LN_S TOPLEVEL_CONFIGURE_ARGUMENTS build_libsubdir build_subdir host_subdir target_subdir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE do_compare gmplibs gmpinc stage1_languages SYSROOT_CFLAGS_FOR_TARGET DEBUG_PREFIX_CFLAGS_FOR_TARGET RPATH_ENVVAR tooldir build_tooldir CONFIGURE_GDB_TK GDB_TK INSTALL_GDB_TK build_configargs build_configdirs host_configargs configdirs target_configargs AR_FOR_BUILD AS_FOR_BUILD CC_FOR_BUILD CFLAGS_FOR_BUILD CXXFLAGS_FOR_BUILD CXX_FOR_BUILD DLLTOOL_FOR_BUILD GCJ_FOR_BUILD GFORTRAN_FOR_BUILD LDFLAGS_FOR_BUILD LD_FOR_BUILD NM_FOR_BUILD RANLIB_FOR_BUILD WINDMC_FOR_BUILD WINDRES_FOR_BUILD config_shell YACC BISON M4 LEX FLEX MAKEINFO EXPECT RUNTEST AR AS DLLTOOL LD LIPO NM RANLIB STRIP WINDRES WINDMC OBJCOPY OBJDUMP CC_FOR_TARGET CXX_FOR_TARGET GCC_FOR_TARGET GCJ_FOR_TARGET GFORTRAN_FOR_TARGET AR_FOR_TARGET AS_FOR_TARGET DLLTOOL_FOR_TARGET LD_FOR_TARGET LIPO_FOR_TARGET NM_FOR_TARGET OBJDUMP_FOR_TARGET RANLIB_FOR_TARGET STRIP_FOR_TARGET WINDRES_FOR_TARGET WINDMC_FOR_TARGET RAW_CXX_FOR_TARGET FLAGS_FOR_TARGET COMPILER_AS_FOR_TARGET COMPILER_LD_FOR_TARGET COMPILER_NM_FOR_TARGET MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT stage1_cflags stage1_checking stage2_werror_flag datarootdir docdir pdfdir htmldir LIBOBJS LTLIBOBJS' | ||
5683 | +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os build_noncanonical host_noncanonical target_noncanonical host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN LN_S TOPLEVEL_CONFIGURE_ARGUMENTS build_libsubdir build_subdir host_subdir target_subdir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE do_compare gmplibs gmpinc stage1_languages SYSROOT_CFLAGS_FOR_TARGET DEBUG_PREFIX_CFLAGS_FOR_TARGET CFLAGS_FOR_TARGET CXXFLAGS_FOR_TARGET RPATH_ENVVAR tooldir build_tooldir CONFIGURE_GDB_TK GDB_TK INSTALL_GDB_TK build_configargs build_configdirs host_configargs configdirs target_configargs AR_FOR_BUILD AS_FOR_BUILD CC_FOR_BUILD CFLAGS_FOR_BUILD CXXFLAGS_FOR_BUILD CXX_FOR_BUILD DLLTOOL_FOR_BUILD GCJ_FOR_BUILD GFORTRAN_FOR_BUILD LDFLAGS_FOR_BUILD LD_FOR_BUILD NM_FOR_BUILD RANLIB_FOR_BUILD WINDMC_FOR_BUILD WINDRES_FOR_BUILD config_shell YACC BISON M4 LEX FLEX MAKEINFO EXPECT RUNTEST AR AS DLLTOOL LD LIPO NM RANLIB STRIP WINDRES WINDMC OBJCOPY OBJDUMP CC_FOR_TARGET CXX_FOR_TARGET GCC_FOR_TARGET GCJ_FOR_TARGET GFORTRAN_FOR_TARGET AR_FOR_TARGET AS_FOR_TARGET DLLTOOL_FOR_TARGET LD_FOR_TARGET LIPO_FOR_TARGET NM_FOR_TARGET OBJDUMP_FOR_TARGET RANLIB_FOR_TARGET STRIP_FOR_TARGET WINDRES_FOR_TARGET WINDMC_FOR_TARGET RAW_CXX_FOR_TARGET FLAGS_FOR_TARGET COMPILER_AS_FOR_TARGET COMPILER_LD_FOR_TARGET COMPILER_NM_FOR_TARGET MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT stage1_cflags stage1_checking stage2_werror_flag datarootdir docdir pdfdir htmldir LIBOBJS LTLIBOBJS' | ||
5684 | ac_subst_files='serialization_dependencies host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag' | ||
5685 | |||
5686 | # Initialize some variables set by options. | ||
5687 | @@ -5147,6 +5147,38 @@ | ||
5688 | fi; | ||
5689 | |||
5690 | |||
5691 | +# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS | ||
5692 | +# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS | ||
5693 | +# might also be empty (or "-g", if a non-GCC C++ compiler is in the path). | ||
5694 | +# We want to ensure that TARGET libraries (which we know are built with | ||
5695 | +# gcc) are built with "-O2 -g", so include those options when setting | ||
5696 | +# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET. | ||
5697 | +if test "x$CFLAGS_FOR_TARGET" = x; then | ||
5698 | + CFLAGS_FOR_TARGET=$CFLAGS | ||
5699 | + case " $CFLAGS " in | ||
5700 | + *" -O2 "*) ;; | ||
5701 | + *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;; | ||
5702 | + esac | ||
5703 | + case " $CFLAGS " in | ||
5704 | + *" -g "* | *" -g3 "*) ;; | ||
5705 | + *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;; | ||
5706 | + esac | ||
5707 | +fi | ||
5708 | + | ||
5709 | + | ||
5710 | +if test "x$CXXFLAGS_FOR_TARGET" = x; then | ||
5711 | + CXXFLAGS_FOR_TARGET=$CXXFLAGS | ||
5712 | + case " $CXXFLAGS " in | ||
5713 | + *" -O2 "*) ;; | ||
5714 | + *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS" ;; | ||
5715 | + esac | ||
5716 | + case " $CXXFLAGS " in | ||
5717 | + *" -g "* | *" -g3 "*) ;; | ||
5718 | + *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;; | ||
5719 | + esac | ||
5720 | +fi | ||
5721 | + | ||
5722 | + | ||
5723 | # Handle --with-headers=XXX. If the value is not "yes", the contents of | ||
5724 | # the named directory are copied to $(tooldir)/sys-include. | ||
5725 | if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then | ||
5726 | @@ -12825,6 +12857,8 @@ | ||
5727 | s,@stage1_languages@,$stage1_languages,;t t | ||
5728 | s,@SYSROOT_CFLAGS_FOR_TARGET@,$SYSROOT_CFLAGS_FOR_TARGET,;t t | ||
5729 | s,@DEBUG_PREFIX_CFLAGS_FOR_TARGET@,$DEBUG_PREFIX_CFLAGS_FOR_TARGET,;t t | ||
5730 | +s,@CFLAGS_FOR_TARGET@,$CFLAGS_FOR_TARGET,;t t | ||
5731 | +s,@CXXFLAGS_FOR_TARGET@,$CXXFLAGS_FOR_TARGET,;t t | ||
5732 | s,@RPATH_ENVVAR@,$RPATH_ENVVAR,;t t | ||
5733 | s,@tooldir@,$tooldir,;t t | ||
5734 | s,@build_tooldir@,$build_tooldir,;t t | ||
5735 | Index: gcc-4.3.3/libiberty/Makefile.in | ||
5736 | =================================================================== | ||
5737 | --- gcc-4.3.3.orig/libiberty/Makefile.in 2007-07-24 23:26:45.000000000 -0700 | ||
5738 | +++ gcc-4.3.3/libiberty/Makefile.in 2009-04-29 18:03:50.212612133 -0700 | ||
5739 | @@ -60,7 +60,7 @@ | ||
5740 | MAKEINFO = @MAKEINFO@ | ||
5741 | PERL = @PERL@ | ||
5742 | |||
5743 | -PICFLAG = | ||
5744 | +PICFLAG = @PICFLAG@ | ||
5745 | |||
5746 | MAKEOVERRIDES = | ||
5747 | |||
5748 | @@ -143,10 +143,11 @@ | ||
5749 | pex-unix.c pex-win32.c \ | ||
5750 | physmem.c putenv.c \ | ||
5751 | random.c regex.c rename.c rindex.c \ | ||
5752 | - safe-ctype.c setenv.c sigsetmask.c snprintf.c sort.c spaces.c \ | ||
5753 | - splay-tree.c stpcpy.c stpncpy.c strcasecmp.c strchr.c strdup.c \ | ||
5754 | - strerror.c strncasecmp.c strncmp.c strrchr.c strsignal.c \ | ||
5755 | - strstr.c strtod.c strtol.c strtoul.c strndup.c strverscmp.c \ | ||
5756 | + safe-ctype.c setenv.c sigsetmask.c snprintf.c sort.c \ | ||
5757 | + spaces.c splay-tree.c stpcpy.c stpncpy.c strcasecmp.c \ | ||
5758 | + strchr.c strdup.c strerror.c strncasecmp.c strncmp.c \ | ||
5759 | + strrchr.c strsignal.c strstr.c strtod.c strtol.c strtoul.c \ | ||
5760 | + strndup.c strverscmp.c \ | ||
5761 | tmpnam.c \ | ||
5762 | unlink-if-ordinary.c \ | ||
5763 | vasprintf.c vfork.c vfprintf.c vprintf.c vsnprintf.c vsprintf.c \ | ||
5764 | @@ -156,7 +157,8 @@ | ||
5765 | |||
5766 | # These are always included in the library. The first four are listed | ||
5767 | # first and by compile time to optimize parallel builds. | ||
5768 | -REQUIRED_OFILES = ./regex.o ./cplus-dem.o ./cp-demangle.o ./md5.o \ | ||
5769 | +REQUIRED_OFILES = \ | ||
5770 | + ./regex.o ./cplus-dem.o ./cp-demangle.o ./md5.o \ | ||
5771 | ./alloca.o ./argv.o \ | ||
5772 | ./choose-temp.o ./concat.o ./cp-demint.o \ | ||
5773 | ./dyn-string.o \ | ||
5774 | @@ -473,13 +475,13 @@ | ||
5775 | config.status: $(srcdir)/configure | ||
5776 | $(SHELL) ./config.status --recheck | ||
5777 | |||
5778 | -# Depending on stamp-h makes sure that config.status has been re-run | ||
5779 | +# Depending on config.h makes sure that config.status has been re-run | ||
5780 | # if needed. This prevents problems with parallel builds, in case | ||
5781 | # subdirectories need to run config.status also. | ||
5782 | all-subdir check-subdir installcheck-subdir info-subdir \ | ||
5783 | install-info-subdir clean-info-subdir dvi-subdir pdf-subdir install-subdir \ | ||
5784 | etags-subdir mostlyclean-subdir clean-subdir distclean-subdir \ | ||
5785 | -maintainer-clean-subdir: stamp-h | ||
5786 | +maintainer-clean-subdir: config.h | ||
5787 | @subdirs='$(SUBDIRS)'; \ | ||
5788 | target=`echo $@ | sed -e 's/-subdir//'`; \ | ||
5789 | for dir in $$subdirs ; do \ | ||
5790 | @@ -496,40 +498,41 @@ | ||
5791 | # The dependencies in the remainder of this file are automatically | ||
5792 | # generated by "make maint-deps". Manual edits will be lost. | ||
5793 | |||
5794 | -./_doprnt.o: $(srcdir)/_doprnt.c stamp-h $(INCDIR)/ansidecl.h \ | ||
5795 | +./_doprnt.o: $(srcdir)/_doprnt.c config.h $(INCDIR)/ansidecl.h \ | ||
5796 | $(INCDIR)/safe-ctype.h | ||
5797 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5798 | $(COMPILE.c) $(PICFLAG) $(srcdir)/_doprnt.c -o pic/$@; \ | ||
5799 | else true; fi | ||
5800 | $(COMPILE.c) $(srcdir)/_doprnt.c $(OUTPUT_OPTION) | ||
5801 | |||
5802 | -./alloca.o: $(srcdir)/alloca.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h | ||
5803 | +./alloca.o: $(srcdir)/alloca.c config.h $(INCDIR)/ansidecl.h \ | ||
5804 | + $(INCDIR)/libiberty.h | ||
5805 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5806 | $(COMPILE.c) $(PICFLAG) $(srcdir)/alloca.c -o pic/$@; \ | ||
5807 | else true; fi | ||
5808 | $(COMPILE.c) $(srcdir)/alloca.c $(OUTPUT_OPTION) | ||
5809 | |||
5810 | -./argv.o: $(srcdir)/argv.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ | ||
5811 | +./argv.o: $(srcdir)/argv.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ | ||
5812 | $(INCDIR)/safe-ctype.h | ||
5813 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5814 | $(COMPILE.c) $(PICFLAG) $(srcdir)/argv.c -o pic/$@; \ | ||
5815 | else true; fi | ||
5816 | $(COMPILE.c) $(srcdir)/argv.c $(OUTPUT_OPTION) | ||
5817 | |||
5818 | -./asprintf.o: $(srcdir)/asprintf.c stamp-h $(INCDIR)/ansidecl.h \ | ||
5819 | +./asprintf.o: $(srcdir)/asprintf.c config.h $(INCDIR)/ansidecl.h \ | ||
5820 | $(INCDIR)/libiberty.h | ||
5821 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5822 | $(COMPILE.c) $(PICFLAG) $(srcdir)/asprintf.c -o pic/$@; \ | ||
5823 | else true; fi | ||
5824 | $(COMPILE.c) $(srcdir)/asprintf.c $(OUTPUT_OPTION) | ||
5825 | |||
5826 | -./atexit.o: $(srcdir)/atexit.c stamp-h | ||
5827 | +./atexit.o: $(srcdir)/atexit.c config.h | ||
5828 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5829 | $(COMPILE.c) $(PICFLAG) $(srcdir)/atexit.c -o pic/$@; \ | ||
5830 | else true; fi | ||
5831 | $(COMPILE.c) $(srcdir)/atexit.c $(OUTPUT_OPTION) | ||
5832 | |||
5833 | -./basename.o: $(srcdir)/basename.c stamp-h $(INCDIR)/ansidecl.h \ | ||
5834 | +./basename.o: $(srcdir)/basename.c config.h $(INCDIR)/ansidecl.h \ | ||
5835 | $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h | ||
5836 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5837 | $(COMPILE.c) $(PICFLAG) $(srcdir)/basename.c -o pic/$@; \ | ||
5838 | @@ -548,7 +551,7 @@ | ||
5839 | else true; fi | ||
5840 | $(COMPILE.c) $(srcdir)/bcopy.c $(OUTPUT_OPTION) | ||
5841 | |||
5842 | -./bsearch.o: $(srcdir)/bsearch.c stamp-h $(INCDIR)/ansidecl.h | ||
5843 | +./bsearch.o: $(srcdir)/bsearch.c config.h $(INCDIR)/ansidecl.h | ||
5844 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5845 | $(COMPILE.c) $(PICFLAG) $(srcdir)/bsearch.c -o pic/$@; \ | ||
5846 | else true; fi | ||
5847 | @@ -566,20 +569,21 @@ | ||
5848 | else true; fi | ||
5849 | $(COMPILE.c) $(srcdir)/calloc.c $(OUTPUT_OPTION) | ||
5850 | |||
5851 | -./choose-temp.o: $(srcdir)/choose-temp.c stamp-h $(INCDIR)/ansidecl.h \ | ||
5852 | +./choose-temp.o: $(srcdir)/choose-temp.c config.h $(INCDIR)/ansidecl.h \ | ||
5853 | $(INCDIR)/libiberty.h | ||
5854 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5855 | $(COMPILE.c) $(PICFLAG) $(srcdir)/choose-temp.c -o pic/$@; \ | ||
5856 | else true; fi | ||
5857 | $(COMPILE.c) $(srcdir)/choose-temp.c $(OUTPUT_OPTION) | ||
5858 | |||
5859 | -./clock.o: $(srcdir)/clock.c stamp-h | ||
5860 | +./clock.o: $(srcdir)/clock.c config.h | ||
5861 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5862 | $(COMPILE.c) $(PICFLAG) $(srcdir)/clock.c -o pic/$@; \ | ||
5863 | else true; fi | ||
5864 | $(COMPILE.c) $(srcdir)/clock.c $(OUTPUT_OPTION) | ||
5865 | |||
5866 | -./concat.o: $(srcdir)/concat.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h | ||
5867 | +./concat.o: $(srcdir)/concat.c config.h $(INCDIR)/ansidecl.h \ | ||
5868 | + $(INCDIR)/libiberty.h | ||
5869 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5870 | $(COMPILE.c) $(PICFLAG) $(srcdir)/concat.c -o pic/$@; \ | ||
5871 | else true; fi | ||
5872 | @@ -591,7 +595,7 @@ | ||
5873 | else true; fi | ||
5874 | $(COMPILE.c) $(srcdir)/copysign.c $(OUTPUT_OPTION) | ||
5875 | |||
5876 | -./cp-demangle.o: $(srcdir)/cp-demangle.c stamp-h $(INCDIR)/ansidecl.h \ | ||
5877 | +./cp-demangle.o: $(srcdir)/cp-demangle.c config.h $(INCDIR)/ansidecl.h \ | ||
5878 | $(srcdir)/cp-demangle.h $(INCDIR)/demangle.h \ | ||
5879 | $(INCDIR)/dyn-string.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h | ||
5880 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5881 | @@ -599,7 +603,7 @@ | ||
5882 | else true; fi | ||
5883 | $(COMPILE.c) $(srcdir)/cp-demangle.c $(OUTPUT_OPTION) | ||
5884 | |||
5885 | -./cp-demint.o: $(srcdir)/cp-demint.c stamp-h $(INCDIR)/ansidecl.h \ | ||
5886 | +./cp-demint.o: $(srcdir)/cp-demint.c config.h $(INCDIR)/ansidecl.h \ | ||
5887 | $(srcdir)/cp-demangle.h $(INCDIR)/demangle.h \ | ||
5888 | $(INCDIR)/libiberty.h | ||
5889 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5890 | @@ -607,7 +611,7 @@ | ||
5891 | else true; fi | ||
5892 | $(COMPILE.c) $(srcdir)/cp-demint.c $(OUTPUT_OPTION) | ||
5893 | |||
5894 | -./cplus-dem.o: $(srcdir)/cplus-dem.c stamp-h $(INCDIR)/ansidecl.h \ | ||
5895 | +./cplus-dem.o: $(srcdir)/cplus-dem.c config.h $(INCDIR)/ansidecl.h \ | ||
5896 | $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \ | ||
5897 | $(INCDIR)/safe-ctype.h | ||
5898 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5899 | @@ -615,14 +619,14 @@ | ||
5900 | else true; fi | ||
5901 | $(COMPILE.c) $(srcdir)/cplus-dem.c $(OUTPUT_OPTION) | ||
5902 | |||
5903 | -./dyn-string.o: $(srcdir)/dyn-string.c stamp-h $(INCDIR)/ansidecl.h \ | ||
5904 | +./dyn-string.o: $(srcdir)/dyn-string.c config.h $(INCDIR)/ansidecl.h \ | ||
5905 | $(INCDIR)/dyn-string.h $(INCDIR)/libiberty.h | ||
5906 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5907 | $(COMPILE.c) $(PICFLAG) $(srcdir)/dyn-string.c -o pic/$@; \ | ||
5908 | else true; fi | ||
5909 | $(COMPILE.c) $(srcdir)/dyn-string.c $(OUTPUT_OPTION) | ||
5910 | |||
5911 | -./fdmatch.o: $(srcdir)/fdmatch.c stamp-h $(INCDIR)/ansidecl.h \ | ||
5912 | +./fdmatch.o: $(srcdir)/fdmatch.c config.h $(INCDIR)/ansidecl.h \ | ||
5913 | $(INCDIR)/libiberty.h | ||
5914 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5915 | $(COMPILE.c) $(PICFLAG) $(srcdir)/fdmatch.c -o pic/$@; \ | ||
5916 | @@ -635,93 +639,94 @@ | ||
5917 | else true; fi | ||
5918 | $(COMPILE.c) $(srcdir)/ffs.c $(OUTPUT_OPTION) | ||
5919 | |||
5920 | -./fibheap.o: $(srcdir)/fibheap.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/fibheap.h \ | ||
5921 | - $(INCDIR)/libiberty.h | ||
5922 | +./fibheap.o: $(srcdir)/fibheap.c config.h $(INCDIR)/ansidecl.h \ | ||
5923 | + $(INCDIR)/fibheap.h $(INCDIR)/libiberty.h | ||
5924 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5925 | $(COMPILE.c) $(PICFLAG) $(srcdir)/fibheap.c -o pic/$@; \ | ||
5926 | else true; fi | ||
5927 | $(COMPILE.c) $(srcdir)/fibheap.c $(OUTPUT_OPTION) | ||
5928 | |||
5929 | -./filename_cmp.o: $(srcdir)/filename_cmp.c stamp-h $(INCDIR)/filenames.h \ | ||
5930 | +./filename_cmp.o: $(srcdir)/filename_cmp.c config.h $(INCDIR)/filenames.h \ | ||
5931 | $(INCDIR)/safe-ctype.h | ||
5932 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5933 | $(COMPILE.c) $(PICFLAG) $(srcdir)/filename_cmp.c -o pic/$@; \ | ||
5934 | else true; fi | ||
5935 | $(COMPILE.c) $(srcdir)/filename_cmp.c $(OUTPUT_OPTION) | ||
5936 | |||
5937 | -./floatformat.o: $(srcdir)/floatformat.c stamp-h $(INCDIR)/ansidecl.h \ | ||
5938 | +./floatformat.o: $(srcdir)/floatformat.c config.h $(INCDIR)/ansidecl.h \ | ||
5939 | $(INCDIR)/floatformat.h $(INCDIR)/libiberty.h | ||
5940 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5941 | $(COMPILE.c) $(PICFLAG) $(srcdir)/floatformat.c -o pic/$@; \ | ||
5942 | else true; fi | ||
5943 | $(COMPILE.c) $(srcdir)/floatformat.c $(OUTPUT_OPTION) | ||
5944 | |||
5945 | -./fnmatch.o: $(srcdir)/fnmatch.c stamp-h $(INCDIR)/fnmatch.h \ | ||
5946 | +./fnmatch.o: $(srcdir)/fnmatch.c config.h $(INCDIR)/fnmatch.h \ | ||
5947 | $(INCDIR)/safe-ctype.h | ||
5948 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5949 | $(COMPILE.c) $(PICFLAG) $(srcdir)/fnmatch.c -o pic/$@; \ | ||
5950 | else true; fi | ||
5951 | $(COMPILE.c) $(srcdir)/fnmatch.c $(OUTPUT_OPTION) | ||
5952 | |||
5953 | -./fopen_unlocked.o: $(srcdir)/fopen_unlocked.c stamp-h $(INCDIR)/ansidecl.h \ | ||
5954 | +./fopen_unlocked.o: $(srcdir)/fopen_unlocked.c config.h $(INCDIR)/ansidecl.h \ | ||
5955 | $(INCDIR)/libiberty.h | ||
5956 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5957 | $(COMPILE.c) $(PICFLAG) $(srcdir)/fopen_unlocked.c -o pic/$@; \ | ||
5958 | else true; fi | ||
5959 | $(COMPILE.c) $(srcdir)/fopen_unlocked.c $(OUTPUT_OPTION) | ||
5960 | |||
5961 | -./getcwd.o: $(srcdir)/getcwd.c stamp-h | ||
5962 | +./getcwd.o: $(srcdir)/getcwd.c config.h | ||
5963 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5964 | $(COMPILE.c) $(PICFLAG) $(srcdir)/getcwd.c -o pic/$@; \ | ||
5965 | else true; fi | ||
5966 | $(COMPILE.c) $(srcdir)/getcwd.c $(OUTPUT_OPTION) | ||
5967 | |||
5968 | -./getopt.o: $(srcdir)/getopt.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/getopt.h | ||
5969 | +./getopt.o: $(srcdir)/getopt.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/getopt.h | ||
5970 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5971 | $(COMPILE.c) $(PICFLAG) $(srcdir)/getopt.c -o pic/$@; \ | ||
5972 | else true; fi | ||
5973 | $(COMPILE.c) $(srcdir)/getopt.c $(OUTPUT_OPTION) | ||
5974 | |||
5975 | -./getopt1.o: $(srcdir)/getopt1.c stamp-h $(INCDIR)/getopt.h | ||
5976 | +./getopt1.o: $(srcdir)/getopt1.c config.h $(INCDIR)/getopt.h | ||
5977 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5978 | $(COMPILE.c) $(PICFLAG) $(srcdir)/getopt1.c -o pic/$@; \ | ||
5979 | else true; fi | ||
5980 | $(COMPILE.c) $(srcdir)/getopt1.c $(OUTPUT_OPTION) | ||
5981 | |||
5982 | -./getpagesize.o: $(srcdir)/getpagesize.c stamp-h | ||
5983 | +./getpagesize.o: $(srcdir)/getpagesize.c config.h | ||
5984 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5985 | $(COMPILE.c) $(PICFLAG) $(srcdir)/getpagesize.c -o pic/$@; \ | ||
5986 | else true; fi | ||
5987 | $(COMPILE.c) $(srcdir)/getpagesize.c $(OUTPUT_OPTION) | ||
5988 | |||
5989 | -./getpwd.o: $(srcdir)/getpwd.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h | ||
5990 | +./getpwd.o: $(srcdir)/getpwd.c config.h $(INCDIR)/ansidecl.h \ | ||
5991 | + $(INCDIR)/libiberty.h | ||
5992 | if [ x"$(PICFLAG)" != x ]; then \ | ||
5993 | $(COMPILE.c) $(PICFLAG) $(srcdir)/getpwd.c -o pic/$@; \ | ||
5994 | else true; fi | ||
5995 | $(COMPILE.c) $(srcdir)/getpwd.c $(OUTPUT_OPTION) | ||
5996 | |||
5997 | -./getruntime.o: $(srcdir)/getruntime.c stamp-h $(INCDIR)/ansidecl.h \ | ||
5998 | +./getruntime.o: $(srcdir)/getruntime.c config.h $(INCDIR)/ansidecl.h \ | ||
5999 | $(INCDIR)/libiberty.h | ||
6000 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6001 | $(COMPILE.c) $(PICFLAG) $(srcdir)/getruntime.c -o pic/$@; \ | ||
6002 | else true; fi | ||
6003 | $(COMPILE.c) $(srcdir)/getruntime.c $(OUTPUT_OPTION) | ||
6004 | |||
6005 | -./gettimeofday.o: $(srcdir)/gettimeofday.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6006 | +./gettimeofday.o: $(srcdir)/gettimeofday.c config.h $(INCDIR)/ansidecl.h \ | ||
6007 | $(INCDIR)/libiberty.h | ||
6008 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6009 | $(COMPILE.c) $(PICFLAG) $(srcdir)/gettimeofday.c -o pic/$@; \ | ||
6010 | else true; fi | ||
6011 | $(COMPILE.c) $(srcdir)/gettimeofday.c $(OUTPUT_OPTION) | ||
6012 | |||
6013 | -./hashtab.o: $(srcdir)/hashtab.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/hashtab.h \ | ||
6014 | - $(INCDIR)/libiberty.h | ||
6015 | +./hashtab.o: $(srcdir)/hashtab.c config.h $(INCDIR)/ansidecl.h \ | ||
6016 | + $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h | ||
6017 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6018 | $(COMPILE.c) $(PICFLAG) $(srcdir)/hashtab.c -o pic/$@; \ | ||
6019 | else true; fi | ||
6020 | $(COMPILE.c) $(srcdir)/hashtab.c $(OUTPUT_OPTION) | ||
6021 | |||
6022 | -./hex.o: $(srcdir)/hex.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ | ||
6023 | +./hex.o: $(srcdir)/hex.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ | ||
6024 | $(INCDIR)/safe-ctype.h | ||
6025 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6026 | $(COMPILE.c) $(PICFLAG) $(srcdir)/hex.c -o pic/$@; \ | ||
6027 | @@ -740,7 +745,7 @@ | ||
6028 | else true; fi | ||
6029 | $(COMPILE.c) $(srcdir)/insque.c $(OUTPUT_OPTION) | ||
6030 | |||
6031 | -./lbasename.o: $(srcdir)/lbasename.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6032 | +./lbasename.o: $(srcdir)/lbasename.c config.h $(INCDIR)/ansidecl.h \ | ||
6033 | $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ | ||
6034 | $(INCDIR)/safe-ctype.h | ||
6035 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6036 | @@ -748,28 +753,28 @@ | ||
6037 | else true; fi | ||
6038 | $(COMPILE.c) $(srcdir)/lbasename.c $(OUTPUT_OPTION) | ||
6039 | |||
6040 | -./lrealpath.o: $(srcdir)/lrealpath.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6041 | +./lrealpath.o: $(srcdir)/lrealpath.c config.h $(INCDIR)/ansidecl.h \ | ||
6042 | $(INCDIR)/libiberty.h | ||
6043 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6044 | $(COMPILE.c) $(PICFLAG) $(srcdir)/lrealpath.c -o pic/$@; \ | ||
6045 | else true; fi | ||
6046 | $(COMPILE.c) $(srcdir)/lrealpath.c $(OUTPUT_OPTION) | ||
6047 | |||
6048 | -./make-relative-prefix.o: $(srcdir)/make-relative-prefix.c stamp-h \ | ||
6049 | +./make-relative-prefix.o: $(srcdir)/make-relative-prefix.c config.h \ | ||
6050 | $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h | ||
6051 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6052 | $(COMPILE.c) $(PICFLAG) $(srcdir)/make-relative-prefix.c -o pic/$@; \ | ||
6053 | else true; fi | ||
6054 | $(COMPILE.c) $(srcdir)/make-relative-prefix.c $(OUTPUT_OPTION) | ||
6055 | |||
6056 | -./make-temp-file.o: $(srcdir)/make-temp-file.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6057 | +./make-temp-file.o: $(srcdir)/make-temp-file.c config.h $(INCDIR)/ansidecl.h \ | ||
6058 | $(INCDIR)/libiberty.h | ||
6059 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6060 | $(COMPILE.c) $(PICFLAG) $(srcdir)/make-temp-file.c -o pic/$@; \ | ||
6061 | else true; fi | ||
6062 | $(COMPILE.c) $(srcdir)/make-temp-file.c $(OUTPUT_OPTION) | ||
6063 | |||
6064 | -./md5.o: $(srcdir)/md5.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/md5.h | ||
6065 | +./md5.o: $(srcdir)/md5.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/md5.h | ||
6066 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6067 | $(COMPILE.c) $(PICFLAG) $(srcdir)/md5.c -o pic/$@; \ | ||
6068 | else true; fi | ||
6069 | @@ -811,7 +816,7 @@ | ||
6070 | else true; fi | ||
6071 | $(COMPILE.c) $(srcdir)/memset.c $(OUTPUT_OPTION) | ||
6072 | |||
6073 | -./mkstemps.o: $(srcdir)/mkstemps.c stamp-h $(INCDIR)/ansidecl.h | ||
6074 | +./mkstemps.o: $(srcdir)/mkstemps.c config.h $(INCDIR)/ansidecl.h | ||
6075 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6076 | $(COMPILE.c) $(PICFLAG) $(srcdir)/mkstemps.c -o pic/$@; \ | ||
6077 | else true; fi | ||
6078 | @@ -823,41 +828,41 @@ | ||
6079 | else true; fi | ||
6080 | $(COMPILE.c) $(srcdir)/msdos.c $(OUTPUT_OPTION) | ||
6081 | |||
6082 | -./objalloc.o: $(srcdir)/objalloc.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6083 | +./objalloc.o: $(srcdir)/objalloc.c config.h $(INCDIR)/ansidecl.h \ | ||
6084 | $(INCDIR)/objalloc.h | ||
6085 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6086 | $(COMPILE.c) $(PICFLAG) $(srcdir)/objalloc.c -o pic/$@; \ | ||
6087 | else true; fi | ||
6088 | $(COMPILE.c) $(srcdir)/objalloc.c $(OUTPUT_OPTION) | ||
6089 | |||
6090 | -./obstack.o: $(srcdir)/obstack.c stamp-h $(INCDIR)/obstack.h | ||
6091 | +./obstack.o: $(srcdir)/obstack.c config.h $(INCDIR)/obstack.h | ||
6092 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6093 | $(COMPILE.c) $(PICFLAG) $(srcdir)/obstack.c -o pic/$@; \ | ||
6094 | else true; fi | ||
6095 | $(COMPILE.c) $(srcdir)/obstack.c $(OUTPUT_OPTION) | ||
6096 | |||
6097 | -./partition.o: $(srcdir)/partition.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6098 | +./partition.o: $(srcdir)/partition.c config.h $(INCDIR)/ansidecl.h \ | ||
6099 | $(INCDIR)/libiberty.h $(INCDIR)/partition.h | ||
6100 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6101 | $(COMPILE.c) $(PICFLAG) $(srcdir)/partition.c -o pic/$@; \ | ||
6102 | else true; fi | ||
6103 | $(COMPILE.c) $(srcdir)/partition.c $(OUTPUT_OPTION) | ||
6104 | |||
6105 | -./pex-common.o: $(srcdir)/pex-common.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6106 | +./pex-common.o: $(srcdir)/pex-common.c config.h $(INCDIR)/ansidecl.h \ | ||
6107 | $(INCDIR)/libiberty.h $(srcdir)/pex-common.h | ||
6108 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6109 | $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-common.c -o pic/$@; \ | ||
6110 | else true; fi | ||
6111 | $(COMPILE.c) $(srcdir)/pex-common.c $(OUTPUT_OPTION) | ||
6112 | |||
6113 | -./pex-djgpp.o: $(srcdir)/pex-djgpp.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6114 | +./pex-djgpp.o: $(srcdir)/pex-djgpp.c config.h $(INCDIR)/ansidecl.h \ | ||
6115 | $(INCDIR)/libiberty.h $(srcdir)/pex-common.h | ||
6116 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6117 | $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-djgpp.c -o pic/$@; \ | ||
6118 | else true; fi | ||
6119 | $(COMPILE.c) $(srcdir)/pex-djgpp.c $(OUTPUT_OPTION) | ||
6120 | |||
6121 | -./pex-msdos.o: $(srcdir)/pex-msdos.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6122 | +./pex-msdos.o: $(srcdir)/pex-msdos.c config.h $(INCDIR)/ansidecl.h \ | ||
6123 | $(INCDIR)/libiberty.h $(srcdir)/pex-common.h \ | ||
6124 | $(INCDIR)/safe-ctype.h | ||
6125 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6126 | @@ -865,42 +870,42 @@ | ||
6127 | else true; fi | ||
6128 | $(COMPILE.c) $(srcdir)/pex-msdos.c $(OUTPUT_OPTION) | ||
6129 | |||
6130 | -./pex-one.o: $(srcdir)/pex-one.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6131 | +./pex-one.o: $(srcdir)/pex-one.c config.h $(INCDIR)/ansidecl.h \ | ||
6132 | $(INCDIR)/libiberty.h | ||
6133 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6134 | $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-one.c -o pic/$@; \ | ||
6135 | else true; fi | ||
6136 | $(COMPILE.c) $(srcdir)/pex-one.c $(OUTPUT_OPTION) | ||
6137 | |||
6138 | -./pex-unix.o: $(srcdir)/pex-unix.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6139 | +./pex-unix.o: $(srcdir)/pex-unix.c config.h $(INCDIR)/ansidecl.h \ | ||
6140 | $(INCDIR)/libiberty.h $(srcdir)/pex-common.h | ||
6141 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6142 | $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-unix.c -o pic/$@; \ | ||
6143 | else true; fi | ||
6144 | $(COMPILE.c) $(srcdir)/pex-unix.c $(OUTPUT_OPTION) | ||
6145 | |||
6146 | -./pex-win32.o: $(srcdir)/pex-win32.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6147 | +./pex-win32.o: $(srcdir)/pex-win32.c config.h $(INCDIR)/ansidecl.h \ | ||
6148 | $(INCDIR)/libiberty.h $(srcdir)/pex-common.h | ||
6149 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6150 | $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-win32.c -o pic/$@; \ | ||
6151 | else true; fi | ||
6152 | $(COMPILE.c) $(srcdir)/pex-win32.c $(OUTPUT_OPTION) | ||
6153 | |||
6154 | -./pexecute.o: $(srcdir)/pexecute.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6155 | +./pexecute.o: $(srcdir)/pexecute.c config.h $(INCDIR)/ansidecl.h \ | ||
6156 | $(INCDIR)/libiberty.h | ||
6157 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6158 | $(COMPILE.c) $(PICFLAG) $(srcdir)/pexecute.c -o pic/$@; \ | ||
6159 | else true; fi | ||
6160 | $(COMPILE.c) $(srcdir)/pexecute.c $(OUTPUT_OPTION) | ||
6161 | |||
6162 | -./physmem.o: $(srcdir)/physmem.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6163 | +./physmem.o: $(srcdir)/physmem.c config.h $(INCDIR)/ansidecl.h \ | ||
6164 | $(INCDIR)/libiberty.h | ||
6165 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6166 | $(COMPILE.c) $(PICFLAG) $(srcdir)/physmem.c -o pic/$@; \ | ||
6167 | else true; fi | ||
6168 | $(COMPILE.c) $(srcdir)/physmem.c $(OUTPUT_OPTION) | ||
6169 | |||
6170 | -./putenv.o: $(srcdir)/putenv.c stamp-h $(INCDIR)/ansidecl.h | ||
6171 | +./putenv.o: $(srcdir)/putenv.c config.h $(INCDIR)/ansidecl.h | ||
6172 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6173 | $(COMPILE.c) $(PICFLAG) $(srcdir)/putenv.c -o pic/$@; \ | ||
6174 | else true; fi | ||
6175 | @@ -912,14 +917,14 @@ | ||
6176 | else true; fi | ||
6177 | $(COMPILE.c) $(srcdir)/random.c $(OUTPUT_OPTION) | ||
6178 | |||
6179 | -./regex.o: $(srcdir)/regex.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/xregex.h \ | ||
6180 | +./regex.o: $(srcdir)/regex.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/xregex.h \ | ||
6181 | $(INCDIR)/xregex2.h | ||
6182 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6183 | $(COMPILE.c) $(PICFLAG) $(srcdir)/regex.c -o pic/$@; \ | ||
6184 | else true; fi | ||
6185 | $(COMPILE.c) $(srcdir)/regex.c $(OUTPUT_OPTION) | ||
6186 | |||
6187 | -./rename.o: $(srcdir)/rename.c stamp-h $(INCDIR)/ansidecl.h | ||
6188 | +./rename.o: $(srcdir)/rename.c config.h $(INCDIR)/ansidecl.h | ||
6189 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6190 | $(COMPILE.c) $(PICFLAG) $(srcdir)/rename.c -o pic/$@; \ | ||
6191 | else true; fi | ||
6192 | @@ -938,7 +943,7 @@ | ||
6193 | else true; fi | ||
6194 | $(COMPILE.c) $(srcdir)/safe-ctype.c $(OUTPUT_OPTION) | ||
6195 | |||
6196 | -./setenv.o: $(srcdir)/setenv.c stamp-h $(INCDIR)/ansidecl.h | ||
6197 | +./setenv.o: $(srcdir)/setenv.c config.h $(INCDIR)/ansidecl.h | ||
6198 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6199 | $(COMPILE.c) $(PICFLAG) $(srcdir)/setenv.c -o pic/$@; \ | ||
6200 | else true; fi | ||
6201 | @@ -956,20 +961,21 @@ | ||
6202 | else true; fi | ||
6203 | $(COMPILE.c) $(srcdir)/snprintf.c $(OUTPUT_OPTION) | ||
6204 | |||
6205 | -./sort.o: $(srcdir)/sort.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ | ||
6206 | +./sort.o: $(srcdir)/sort.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ | ||
6207 | $(INCDIR)/sort.h | ||
6208 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6209 | $(COMPILE.c) $(PICFLAG) $(srcdir)/sort.c -o pic/$@; \ | ||
6210 | else true; fi | ||
6211 | $(COMPILE.c) $(srcdir)/sort.c $(OUTPUT_OPTION) | ||
6212 | |||
6213 | -./spaces.o: $(srcdir)/spaces.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h | ||
6214 | +./spaces.o: $(srcdir)/spaces.c config.h $(INCDIR)/ansidecl.h \ | ||
6215 | + $(INCDIR)/libiberty.h | ||
6216 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6217 | $(COMPILE.c) $(PICFLAG) $(srcdir)/spaces.c -o pic/$@; \ | ||
6218 | else true; fi | ||
6219 | $(COMPILE.c) $(srcdir)/spaces.c $(OUTPUT_OPTION) | ||
6220 | |||
6221 | -./splay-tree.o: $(srcdir)/splay-tree.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6222 | +./splay-tree.o: $(srcdir)/splay-tree.c config.h $(INCDIR)/ansidecl.h \ | ||
6223 | $(INCDIR)/libiberty.h $(INCDIR)/splay-tree.h | ||
6224 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6225 | $(COMPILE.c) $(PICFLAG) $(srcdir)/splay-tree.c -o pic/$@; \ | ||
6226 | @@ -1006,7 +1012,7 @@ | ||
6227 | else true; fi | ||
6228 | $(COMPILE.c) $(srcdir)/strdup.c $(OUTPUT_OPTION) | ||
6229 | |||
6230 | -./strerror.o: $(srcdir)/strerror.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6231 | +./strerror.o: $(srcdir)/strerror.c config.h $(INCDIR)/ansidecl.h \ | ||
6232 | $(INCDIR)/libiberty.h | ||
6233 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6234 | $(COMPILE.c) $(PICFLAG) $(srcdir)/strerror.c -o pic/$@; \ | ||
6235 | @@ -1037,7 +1043,7 @@ | ||
6236 | else true; fi | ||
6237 | $(COMPILE.c) $(srcdir)/strrchr.c $(OUTPUT_OPTION) | ||
6238 | |||
6239 | -./strsignal.o: $(srcdir)/strsignal.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6240 | +./strsignal.o: $(srcdir)/strsignal.c config.h $(INCDIR)/ansidecl.h \ | ||
6241 | $(INCDIR)/libiberty.h | ||
6242 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6243 | $(COMPILE.c) $(PICFLAG) $(srcdir)/strsignal.c -o pic/$@; \ | ||
6244 | @@ -1056,13 +1062,13 @@ | ||
6245 | else true; fi | ||
6246 | $(COMPILE.c) $(srcdir)/strtod.c $(OUTPUT_OPTION) | ||
6247 | |||
6248 | -./strtol.o: $(srcdir)/strtol.c stamp-h $(INCDIR)/safe-ctype.h | ||
6249 | +./strtol.o: $(srcdir)/strtol.c config.h $(INCDIR)/safe-ctype.h | ||
6250 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6251 | $(COMPILE.c) $(PICFLAG) $(srcdir)/strtol.c -o pic/$@; \ | ||
6252 | else true; fi | ||
6253 | $(COMPILE.c) $(srcdir)/strtol.c $(OUTPUT_OPTION) | ||
6254 | |||
6255 | -./strtoul.o: $(srcdir)/strtoul.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6256 | +./strtoul.o: $(srcdir)/strtoul.c config.h $(INCDIR)/ansidecl.h \ | ||
6257 | $(INCDIR)/safe-ctype.h | ||
6258 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6259 | $(COMPILE.c) $(PICFLAG) $(srcdir)/strtoul.c -o pic/$@; \ | ||
6260 | @@ -1082,14 +1088,14 @@ | ||
6261 | else true; fi | ||
6262 | $(COMPILE.c) $(srcdir)/tmpnam.c $(OUTPUT_OPTION) | ||
6263 | |||
6264 | -./unlink-if-ordinary.o: $(srcdir)/unlink-if-ordinary.c stamp-h \ | ||
6265 | +./unlink-if-ordinary.o: $(srcdir)/unlink-if-ordinary.c config.h \ | ||
6266 | $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h | ||
6267 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6268 | $(COMPILE.c) $(PICFLAG) $(srcdir)/unlink-if-ordinary.c -o pic/$@; \ | ||
6269 | else true; fi | ||
6270 | $(COMPILE.c) $(srcdir)/unlink-if-ordinary.c $(OUTPUT_OPTION) | ||
6271 | |||
6272 | -./vasprintf.o: $(srcdir)/vasprintf.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6273 | +./vasprintf.o: $(srcdir)/vasprintf.c config.h $(INCDIR)/ansidecl.h \ | ||
6274 | $(INCDIR)/libiberty.h | ||
6275 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6276 | $(COMPILE.c) $(PICFLAG) $(srcdir)/vasprintf.c -o pic/$@; \ | ||
6277 | @@ -1114,7 +1120,7 @@ | ||
6278 | else true; fi | ||
6279 | $(COMPILE.c) $(srcdir)/vprintf.c $(OUTPUT_OPTION) | ||
6280 | |||
6281 | -./vsnprintf.o: $(srcdir)/vsnprintf.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6282 | +./vsnprintf.o: $(srcdir)/vsnprintf.c config.h $(INCDIR)/ansidecl.h \ | ||
6283 | $(INCDIR)/libiberty.h | ||
6284 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6285 | $(COMPILE.c) $(PICFLAG) $(srcdir)/vsnprintf.c -o pic/$@; \ | ||
6286 | @@ -1127,54 +1133,54 @@ | ||
6287 | else true; fi | ||
6288 | $(COMPILE.c) $(srcdir)/vsprintf.c $(OUTPUT_OPTION) | ||
6289 | |||
6290 | -./waitpid.o: $(srcdir)/waitpid.c stamp-h $(INCDIR)/ansidecl.h | ||
6291 | +./waitpid.o: $(srcdir)/waitpid.c config.h $(INCDIR)/ansidecl.h | ||
6292 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6293 | $(COMPILE.c) $(PICFLAG) $(srcdir)/waitpid.c -o pic/$@; \ | ||
6294 | else true; fi | ||
6295 | $(COMPILE.c) $(srcdir)/waitpid.c $(OUTPUT_OPTION) | ||
6296 | |||
6297 | -./xatexit.o: $(srcdir)/xatexit.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6298 | +./xatexit.o: $(srcdir)/xatexit.c config.h $(INCDIR)/ansidecl.h \ | ||
6299 | $(INCDIR)/libiberty.h | ||
6300 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6301 | $(COMPILE.c) $(PICFLAG) $(srcdir)/xatexit.c -o pic/$@; \ | ||
6302 | else true; fi | ||
6303 | $(COMPILE.c) $(srcdir)/xatexit.c $(OUTPUT_OPTION) | ||
6304 | |||
6305 | -./xexit.o: $(srcdir)/xexit.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h | ||
6306 | +./xexit.o: $(srcdir)/xexit.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h | ||
6307 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6308 | $(COMPILE.c) $(PICFLAG) $(srcdir)/xexit.c -o pic/$@; \ | ||
6309 | else true; fi | ||
6310 | $(COMPILE.c) $(srcdir)/xexit.c $(OUTPUT_OPTION) | ||
6311 | |||
6312 | -./xmalloc.o: $(srcdir)/xmalloc.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6313 | +./xmalloc.o: $(srcdir)/xmalloc.c config.h $(INCDIR)/ansidecl.h \ | ||
6314 | $(INCDIR)/libiberty.h | ||
6315 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6316 | $(COMPILE.c) $(PICFLAG) $(srcdir)/xmalloc.c -o pic/$@; \ | ||
6317 | else true; fi | ||
6318 | $(COMPILE.c) $(srcdir)/xmalloc.c $(OUTPUT_OPTION) | ||
6319 | |||
6320 | -./xmemdup.o: $(srcdir)/xmemdup.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6321 | +./xmemdup.o: $(srcdir)/xmemdup.c config.h $(INCDIR)/ansidecl.h \ | ||
6322 | $(INCDIR)/libiberty.h | ||
6323 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6324 | $(COMPILE.c) $(PICFLAG) $(srcdir)/xmemdup.c -o pic/$@; \ | ||
6325 | else true; fi | ||
6326 | $(COMPILE.c) $(srcdir)/xmemdup.c $(OUTPUT_OPTION) | ||
6327 | |||
6328 | -./xstrdup.o: $(srcdir)/xstrdup.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6329 | +./xstrdup.o: $(srcdir)/xstrdup.c config.h $(INCDIR)/ansidecl.h \ | ||
6330 | $(INCDIR)/libiberty.h | ||
6331 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6332 | $(COMPILE.c) $(PICFLAG) $(srcdir)/xstrdup.c -o pic/$@; \ | ||
6333 | else true; fi | ||
6334 | $(COMPILE.c) $(srcdir)/xstrdup.c $(OUTPUT_OPTION) | ||
6335 | |||
6336 | -./xstrerror.o: $(srcdir)/xstrerror.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6337 | +./xstrerror.o: $(srcdir)/xstrerror.c config.h $(INCDIR)/ansidecl.h \ | ||
6338 | $(INCDIR)/libiberty.h | ||
6339 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6340 | $(COMPILE.c) $(PICFLAG) $(srcdir)/xstrerror.c -o pic/$@; \ | ||
6341 | else true; fi | ||
6342 | $(COMPILE.c) $(srcdir)/xstrerror.c $(OUTPUT_OPTION) | ||
6343 | |||
6344 | -./xstrndup.o: $(srcdir)/xstrndup.c stamp-h $(INCDIR)/ansidecl.h \ | ||
6345 | +./xstrndup.o: $(srcdir)/xstrndup.c config.h $(INCDIR)/ansidecl.h \ | ||
6346 | $(INCDIR)/libiberty.h | ||
6347 | if [ x"$(PICFLAG)" != x ]; then \ | ||
6348 | $(COMPILE.c) $(PICFLAG) $(srcdir)/xstrndup.c -o pic/$@; \ | ||
6349 | Index: gcc-4.3.3/libiberty/configure | ||
6350 | =================================================================== | ||
6351 | --- gcc-4.3.3.orig/libiberty/configure 2007-07-17 10:52:28.000000000 -0700 | ||
6352 | +++ gcc-4.3.3/libiberty/configure 2009-04-29 18:03:50.224612238 -0700 | ||
6353 | @@ -309,7 +309,7 @@ | ||
6354 | # include <unistd.h> | ||
6355 | #endif" | ||
6356 | |||
6357 | -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libiberty_topdir MAINT NOTMAINT MAKEINFO BUILD_INFO PERL HAVE_PERL build build_cpu build_vendor build_os host host_cpu host_vendor host_os AR ac_ct_AR RANLIB ac_ct_RANLIB CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP ac_libiberty_warn_cflags NO_MINUS_C_MINUS_O OUTPUT_OPTION INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA EGREP LIBOBJS CHECK target_header_dir pexecute INSTALL_DEST datarootdir docdir htmldir LTLIBOBJS' | ||
6358 | +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libiberty_topdir MAINT NOTMAINT MAKEINFO BUILD_INFO PERL HAVE_PERL build build_cpu build_vendor build_os host host_cpu host_vendor host_os AR ac_ct_AR RANLIB ac_ct_RANLIB CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP ac_libiberty_warn_cflags NO_MINUS_C_MINUS_O OUTPUT_OPTION INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PICFLAG EGREP LIBOBJS CHECK target_header_dir pexecute INSTALL_DEST datarootdir docdir htmldir LTLIBOBJS' | ||
6359 | ac_subst_files='host_makefile_frag' | ||
6360 | |||
6361 | # Initialize some variables set by options. | ||
6362 | @@ -3699,9 +3699,7 @@ | ||
6363 | esac | ||
6364 | |||
6365 | if [ -n "${frag}" ]; then | ||
6366 | - frags=${libiberty_topdir}/libiberty/config/$frag | ||
6367 | -else | ||
6368 | - frags= | ||
6369 | + frag=${libiberty_topdir}/libiberty/config/$frag | ||
6370 | fi | ||
6371 | |||
6372 | # If they didn't specify --enable-shared, don't generate shared libs. | ||
6373 | @@ -3712,34 +3710,35 @@ | ||
6374 | *) shared=yes ;; | ||
6375 | esac | ||
6376 | if [ "${shared}" = "yes" ]; then | ||
6377 | - frag= | ||
6378 | case "${host}" in | ||
6379 | *-*-cygwin*) ;; | ||
6380 | - alpha*-*-linux*) frag=mh-elfalphapic ;; | ||
6381 | - arm*-*-*) frag=mh-armpic ;; | ||
6382 | - hppa*-*-*) frag=mh-papic ;; | ||
6383 | + alpha*-*-linux*) PICFLAG=-fPIC ;; | ||
6384 | + arm*-*-*) PICFLAG=-fPIC ;; | ||
6385 | + hppa*-*-*) PICFLAG=-fPIC ;; | ||
6386 | + i370-*-*) PICFLAG=-fPIC ;; | ||
6387 | + ia64-*-*) PICFLAG=-fpic ;; | ||
6388 | i[34567]86-*-* | x86_64-*-*) | ||
6389 | - frag=mh-x86pic ;; | ||
6390 | + PICFLAG=-fpic ;; | ||
6391 | + m68k-*-*) PICFLAG=-fpic ;; | ||
6392 | + mips*-*-linux) PICFLAG=-fPIC ;; | ||
6393 | powerpc*-*-aix*) ;; | ||
6394 | - powerpc*-*-*) frag=mh-ppcpic ;; | ||
6395 | - sparc*-*-*) frag=mh-sparcpic ;; | ||
6396 | - s390*-*-*) frag=mh-s390pic ;; | ||
6397 | - *) frag=mh-${host_cpu}pic ;; | ||
6398 | + powerpc*-*-*) PICFLAG=-fPIC ;; | ||
6399 | + sparc*-*-*) case "${CFLAGS}" in | ||
6400 | + *-fpic* ) PICFLAG=-fpic ;; | ||
6401 | + * ) PICFLAG=-fPIC ;; | ||
6402 | + esac ;; | ||
6403 | + s390*-*-*) PICFLAG=-fpic ;; | ||
6404 | esac | ||
6405 | - if [ -n "${frag}" ]; then | ||
6406 | - frags="${frags} ${libiberty_topdir}/config/${frag}" | ||
6407 | - fi | ||
6408 | fi | ||
6409 | |||
6410 | + | ||
6411 | echo "# Warning: this fragment is automatically generated" > temp-frag | ||
6412 | |||
6413 | -for frag in ${frags}; do | ||
6414 | - if [ -f ${frag} ]; then | ||
6415 | - echo "Appending ${frag} to xhost-mkfrag" | ||
6416 | - echo "# Following fragment copied from ${frag}" >> temp-frag | ||
6417 | - cat ${frag} >> temp-frag | ||
6418 | - fi | ||
6419 | -done | ||
6420 | +if [ -n "${frag}" ] && [ -f "${frag}" ]; then | ||
6421 | + echo "Appending ${frag} to xhost-mkfrag" | ||
6422 | + echo "# Following fragment copied from ${frag}" >> temp-frag | ||
6423 | + cat ${frag} >> temp-frag | ||
6424 | +fi | ||
6425 | |||
6426 | # record if we want to build shared libs. | ||
6427 | if [ "${shared}" = "yes" ]; then | ||
6428 | @@ -9671,6 +9670,7 @@ | ||
6429 | s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t | ||
6430 | s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t | ||
6431 | s,@INSTALL_DATA@,$INSTALL_DATA,;t t | ||
6432 | +s,@PICFLAG@,$PICFLAG,;t t | ||
6433 | s,@EGREP@,$EGREP,;t t | ||
6434 | s,@LIBOBJS@,$LIBOBJS,;t t | ||
6435 | s,@CHECK@,$CHECK,;t t | ||
6436 | Index: gcc-4.3.3/libiberty/configure.ac | ||
6437 | =================================================================== | ||
6438 | --- gcc-4.3.3.orig/libiberty/configure.ac 2007-07-17 10:52:28.000000000 -0700 | ||
6439 | +++ gcc-4.3.3/libiberty/configure.ac 2009-04-29 18:03:50.224612238 -0700 | ||
6440 | @@ -187,9 +187,7 @@ | ||
6441 | esac | ||
6442 | |||
6443 | if [[ -n "${frag}" ]]; then | ||
6444 | - frags=${libiberty_topdir}/libiberty/config/$frag | ||
6445 | -else | ||
6446 | - frags= | ||
6447 | + frag=${libiberty_topdir}/libiberty/config/$frag | ||
6448 | fi | ||
6449 | |||
6450 | # If they didn't specify --enable-shared, don't generate shared libs. | ||
6451 | @@ -200,34 +198,35 @@ | ||
6452 | *) shared=yes ;; | ||
6453 | esac | ||
6454 | if [[ "${shared}" = "yes" ]]; then | ||
6455 | - frag= | ||
6456 | case "${host}" in | ||
6457 | *-*-cygwin*) ;; | ||
6458 | - alpha*-*-linux*) frag=mh-elfalphapic ;; | ||
6459 | - arm*-*-*) frag=mh-armpic ;; | ||
6460 | - hppa*-*-*) frag=mh-papic ;; | ||
6461 | + alpha*-*-linux*) PICFLAG=-fPIC ;; | ||
6462 | + arm*-*-*) PICFLAG=-fPIC ;; | ||
6463 | + hppa*-*-*) PICFLAG=-fPIC ;; | ||
6464 | + i370-*-*) PICFLAG=-fPIC ;; | ||
6465 | + ia64-*-*) PICFLAG=-fpic ;; | ||
6466 | i[[34567]]86-*-* | x86_64-*-*) | ||
6467 | - frag=mh-x86pic ;; | ||
6468 | + PICFLAG=-fpic ;; | ||
6469 | + m68k-*-*) PICFLAG=-fpic ;; | ||
6470 | + mips*-*-linux) PICFLAG=-fPIC ;; | ||
6471 | powerpc*-*-aix*) ;; | ||
6472 | - powerpc*-*-*) frag=mh-ppcpic ;; | ||
6473 | - sparc*-*-*) frag=mh-sparcpic ;; | ||
6474 | - s390*-*-*) frag=mh-s390pic ;; | ||
6475 | - *) frag=mh-${host_cpu}pic ;; | ||
6476 | + powerpc*-*-*) PICFLAG=-fPIC ;; | ||
6477 | + sparc*-*-*) case "${CFLAGS}" in | ||
6478 | + *-fpic* ) PICFLAG=-fpic ;; | ||
6479 | + * ) PICFLAG=-fPIC ;; | ||
6480 | + esac ;; | ||
6481 | + s390*-*-*) PICFLAG=-fpic ;; | ||
6482 | esac | ||
6483 | - if [[ -n "${frag}" ]]; then | ||
6484 | - frags="${frags} ${libiberty_topdir}/config/${frag}" | ||
6485 | - fi | ||
6486 | fi | ||
6487 | +AC_SUBST(PICFLAG) | ||
6488 | |||
6489 | echo "# Warning: this fragment is automatically generated" > temp-frag | ||
6490 | |||
6491 | -for frag in ${frags}; do | ||
6492 | - if [[ -f ${frag} ]]; then | ||
6493 | - echo "Appending ${frag} to xhost-mkfrag" | ||
6494 | - echo "# Following fragment copied from ${frag}" >> temp-frag | ||
6495 | - cat ${frag} >> temp-frag | ||
6496 | - fi | ||
6497 | -done | ||
6498 | +if [[ -n "${frag}" ]] && [[ -f "${frag}" ]]; then | ||
6499 | + echo "Appending ${frag} to xhost-mkfrag" | ||
6500 | + echo "# Following fragment copied from ${frag}" >> temp-frag | ||
6501 | + cat ${frag} >> temp-frag | ||
6502 | +fi | ||
6503 | |||
6504 | # record if we want to build shared libs. | ||
6505 | if [[ "${shared}" = "yes" ]]; then | ||
6506 | Index: gcc-4.3.3/gcc/Makefile.in | ||
6507 | =================================================================== | ||
6508 | --- gcc-4.3.3.orig/gcc/Makefile.in 2009-04-29 17:55:20.000000000 -0700 | ||
6509 | +++ gcc-4.3.3/gcc/Makefile.in 2009-04-29 18:03:50.236612117 -0700 | ||
6510 | @@ -689,7 +689,7 @@ | ||
6511 | BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE | ||
6512 | |||
6513 | # Native linker and preprocessor flags. For x-fragment overrides. | ||
6514 | -BUILD_LDFLAGS=$(LDFLAGS) | ||
6515 | +BUILD_LDFLAGS=@BUILD_LDFLAGS@ | ||
6516 | BUILD_CPPFLAGS=$(ALL_CPPFLAGS) | ||
6517 | |||
6518 | # Actual name to use when installing a native compiler. | ||
6519 | Index: gcc-4.3.3/gcc/configure | ||
6520 | =================================================================== | ||
6521 | --- gcc-4.3.3.orig/gcc/configure 2009-04-29 17:55:27.000000000 -0700 | ||
6522 | +++ gcc-4.3.3/gcc/configure 2009-04-29 18:03:50.256611768 -0700 | ||
6523 | @@ -458,7 +458,7 @@ | ||
6524 | # include <unistd.h> | ||
6525 | #endif" | ||
6526 | |||
6527 | -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn cxx_compat_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT host_cc_for_libada CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN ac_ct_AR STRIP ac_ct_STRIP lt_ECHO objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS' | ||
6528 | +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn cxx_compat_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT host_cc_for_libada CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS BUILD_LDFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN ac_ct_AR STRIP ac_ct_STRIP lt_ECHO objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS' | ||
6529 | ac_subst_files='language_hooks' | ||
6530 | |||
6531 | # Initialize some variables set by options. | ||
6532 | @@ -12972,6 +12972,7 @@ | ||
6533 | esac | ||
6534 | saved_CFLAGS="${CFLAGS}" | ||
6535 | CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ | ||
6536 | + LDFLAGS="${LDFLAGS_FOR_BUILD}" \ | ||
6537 | CONFIG_SITE= ${realsrcdir}/configure --cache-file=./other.cache \ | ||
6538 | --enable-languages=${enable_languages-all} \ | ||
6539 | --target=$target_alias --host=$build_alias --build=$build_alias | ||
6540 | @@ -13469,6 +13470,7 @@ | ||
6541 | # These are the normal (build=host) settings: | ||
6542 | CC_FOR_BUILD='$(CC)' | ||
6543 | BUILD_CFLAGS='$(ALL_CFLAGS)' | ||
6544 | +BUILD_LDFLAGS='$(LDFLAGS)' | ||
6545 | STMP_FIXINC=stmp-fixinc | ||
6546 | |||
6547 | # Possibly disable fixproto, on a per-target basis. | ||
6548 | @@ -13486,6 +13488,7 @@ | ||
6549 | if test x$build != x$host || test "x$coverage_flags" != x | ||
6550 | then | ||
6551 | BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' | ||
6552 | + BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)' | ||
6553 | |||
6554 | if test "x$TARGET_SYSTEM_ROOT" = x; then | ||
6555 | if test "x$STMP_FIXPROTO" != x; then | ||
6556 | @@ -14064,13 +14067,13 @@ | ||
6557 | else | ||
6558 | lt_cv_nm_interface="BSD nm" | ||
6559 | echo "int some_variable = 0;" > conftest.$ac_ext | ||
6560 | - (eval echo "\"\$as_me:14067: $ac_compile\"" >&5) | ||
6561 | + (eval echo "\"\$as_me:14070: $ac_compile\"" >&5) | ||
6562 | (eval "$ac_compile" 2>conftest.err) | ||
6563 | cat conftest.err >&5 | ||
6564 | - (eval echo "\"\$as_me:14070: $NM \\\"conftest.$ac_objext\\\"\"" >&5) | ||
6565 | + (eval echo "\"\$as_me:14073: $NM \\\"conftest.$ac_objext\\\"\"" >&5) | ||
6566 | (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) | ||
6567 | cat conftest.err >&5 | ||
6568 | - (eval echo "\"\$as_me:14073: output\"" >&5) | ||
6569 | + (eval echo "\"\$as_me:14076: output\"" >&5) | ||
6570 | cat conftest.out >&5 | ||
6571 | if $GREP 'External.*some_variable' conftest.out > /dev/null; then | ||
6572 | lt_cv_nm_interface="MS dumpbin" | ||
6573 | @@ -15125,7 +15128,7 @@ | ||
6574 | ;; | ||
6575 | *-*-irix6*) | ||
6576 | # Find out which ABI we are using. | ||
6577 | - echo '#line 15128 "configure"' > conftest.$ac_ext | ||
6578 | + echo '#line 15131 "configure"' > conftest.$ac_ext | ||
6579 | if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 | ||
6580 | (eval $ac_compile) 2>&5 | ||
6581 | ac_status=$? | ||
6582 | @@ -15745,11 +15748,11 @@ | ||
6583 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | ||
6584 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||
6585 | -e 's:$: $lt_compiler_flag:'` | ||
6586 | - (eval echo "\"\$as_me:15748: $lt_compile\"" >&5) | ||
6587 | + (eval echo "\"\$as_me:15751: $lt_compile\"" >&5) | ||
6588 | (eval "$lt_compile" 2>conftest.err) | ||
6589 | ac_status=$? | ||
6590 | cat conftest.err >&5 | ||
6591 | - echo "$as_me:15752: \$? = $ac_status" >&5 | ||
6592 | + echo "$as_me:15755: \$? = $ac_status" >&5 | ||
6593 | if (exit $ac_status) && test -s "$ac_outfile"; then | ||
6594 | # The compiler can only warn and ignore the option if not recognized | ||
6595 | # So say no if there are warnings other than the usual output. | ||
6596 | @@ -16067,11 +16070,11 @@ | ||
6597 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | ||
6598 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||
6599 | -e 's:$: $lt_compiler_flag:'` | ||
6600 | - (eval echo "\"\$as_me:16070: $lt_compile\"" >&5) | ||
6601 | + (eval echo "\"\$as_me:16073: $lt_compile\"" >&5) | ||
6602 | (eval "$lt_compile" 2>conftest.err) | ||
6603 | ac_status=$? | ||
6604 | cat conftest.err >&5 | ||
6605 | - echo "$as_me:16074: \$? = $ac_status" >&5 | ||
6606 | + echo "$as_me:16077: \$? = $ac_status" >&5 | ||
6607 | if (exit $ac_status) && test -s "$ac_outfile"; then | ||
6608 | # The compiler can only warn and ignore the option if not recognized | ||
6609 | # So say no if there are warnings other than the usual output. | ||
6610 | @@ -16172,11 +16175,11 @@ | ||
6611 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | ||
6612 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||
6613 | -e 's:$: $lt_compiler_flag:'` | ||
6614 | - (eval echo "\"\$as_me:16175: $lt_compile\"" >&5) | ||
6615 | + (eval echo "\"\$as_me:16178: $lt_compile\"" >&5) | ||
6616 | (eval "$lt_compile" 2>out/conftest.err) | ||
6617 | ac_status=$? | ||
6618 | cat out/conftest.err >&5 | ||
6619 | - echo "$as_me:16179: \$? = $ac_status" >&5 | ||
6620 | + echo "$as_me:16182: \$? = $ac_status" >&5 | ||
6621 | if (exit $ac_status) && test -s out/conftest2.$ac_objext | ||
6622 | then | ||
6623 | # The compiler can only warn and ignore the option if not recognized | ||
6624 | @@ -16227,11 +16230,11 @@ | ||
6625 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | ||
6626 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||
6627 | -e 's:$: $lt_compiler_flag:'` | ||
6628 | - (eval echo "\"\$as_me:16230: $lt_compile\"" >&5) | ||
6629 | + (eval echo "\"\$as_me:16233: $lt_compile\"" >&5) | ||
6630 | (eval "$lt_compile" 2>out/conftest.err) | ||
6631 | ac_status=$? | ||
6632 | cat out/conftest.err >&5 | ||
6633 | - echo "$as_me:16234: \$? = $ac_status" >&5 | ||
6634 | + echo "$as_me:16237: \$? = $ac_status" >&5 | ||
6635 | if (exit $ac_status) && test -s out/conftest2.$ac_objext | ||
6636 | then | ||
6637 | # The compiler can only warn and ignore the option if not recognized | ||
6638 | @@ -19024,7 +19027,7 @@ | ||
6639 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
6640 | lt_status=$lt_dlunknown | ||
6641 | cat > conftest.$ac_ext <<_LT_EOF | ||
6642 | -#line 19027 "configure" | ||
6643 | +#line 19030 "configure" | ||
6644 | #include "confdefs.h" | ||
6645 | |||
6646 | #if HAVE_DLFCN_H | ||
6647 | @@ -19124,7 +19127,7 @@ | ||
6648 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
6649 | lt_status=$lt_dlunknown | ||
6650 | cat > conftest.$ac_ext <<_LT_EOF | ||
6651 | -#line 19127 "configure" | ||
6652 | +#line 19130 "configure" | ||
6653 | #include "confdefs.h" | ||
6654 | |||
6655 | #if HAVE_DLFCN_H | ||
6656 | @@ -23934,6 +23937,7 @@ | ||
6657 | s,@inhibit_libc@,$inhibit_libc,;t t | ||
6658 | s,@CC_FOR_BUILD@,$CC_FOR_BUILD,;t t | ||
6659 | s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t | ||
6660 | +s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t | ||
6661 | s,@STMP_FIXINC@,$STMP_FIXINC,;t t | ||
6662 | s,@STMP_FIXPROTO@,$STMP_FIXPROTO,;t t | ||
6663 | s,@collect2@,$collect2,;t t | ||
6664 | Index: gcc-4.3.3/gcc/configure.ac | ||
6665 | =================================================================== | ||
6666 | --- gcc-4.3.3.orig/gcc/configure.ac 2009-04-29 17:55:27.000000000 -0700 | ||
6667 | +++ gcc-4.3.3/gcc/configure.ac 2009-04-29 18:03:50.264611238 -0700 | ||
6668 | @@ -1480,6 +1480,7 @@ | ||
6669 | esac | ||
6670 | saved_CFLAGS="${CFLAGS}" | ||
6671 | CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ | ||
6672 | + LDFLAGS="${LDFLAGS_FOR_BUILD}" \ | ||
6673 | CONFIG_SITE= ${realsrcdir}/configure --cache-file=./other.cache \ | ||
6674 | --enable-languages=${enable_languages-all} \ | ||
6675 | --target=$target_alias --host=$build_alias --build=$build_alias | ||
6676 | @@ -1776,6 +1777,7 @@ | ||
6677 | # These are the normal (build=host) settings: | ||
6678 | CC_FOR_BUILD='$(CC)' AC_SUBST(CC_FOR_BUILD) | ||
6679 | BUILD_CFLAGS='$(ALL_CFLAGS)' AC_SUBST(BUILD_CFLAGS) | ||
6680 | +BUILD_LDFLAGS='$(LDFLAGS)' AC_SUBST(BUILD_LDFLAGS) | ||
6681 | STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_FIXINC) | ||
6682 | |||
6683 | # Possibly disable fixproto, on a per-target basis. | ||
6684 | @@ -1793,6 +1795,7 @@ | ||
6685 | if test x$build != x$host || test "x$coverage_flags" != x | ||
6686 | then | ||
6687 | BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' | ||
6688 | + BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)' | ||
6689 | |||
6690 | if test "x$TARGET_SYSTEM_ROOT" = x; then | ||
6691 | if test "x$STMP_FIXPROTO" != x; then | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-arm-frename-registers.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-arm-frename-registers.patch new file mode 100644 index 0000000000..280b90358e --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-arm-frename-registers.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35964 | ||
2 | Index: gcc-4.3.0/gcc/regrename.c | ||
3 | =================================================================== | ||
4 | --- gcc-4.3.0.orig/gcc/regrename.c 2008-05-28 08:31:15.000000000 -0700 | ||
5 | +++ gcc-4.3.0/gcc/regrename.c 2008-05-28 08:34:00.000000000 -0700 | ||
6 | @@ -782,6 +782,10 @@ | ||
7 | || (predicated && recog_data.operand_type[i] == OP_OUT)) | ||
8 | recog_data.operand_type[i] = OP_INOUT; | ||
9 | } | ||
10 | + /* Unshare dup_loc RTL */ | ||
11 | + for (i = 0; i < recog_data.n_dups; i++) | ||
12 | + *recog_data.dup_loc[i] = copy_rtx(*recog_data.dup_loc[i]); | ||
13 | + | ||
14 | |||
15 | /* Step 1: Close chains for which we have overlapping reads. */ | ||
16 | for (i = 0; i < n_ops; i++) | ||
17 | @@ -813,7 +817,7 @@ | ||
18 | OP_IN, 0); | ||
19 | |||
20 | for (i = 0; i < recog_data.n_dups; i++) | ||
21 | - *recog_data.dup_loc[i] = copy_rtx (old_dups[i]); | ||
22 | + *recog_data.dup_loc[i] = old_dups[i]; | ||
23 | for (i = 0; i < n_ops; i++) | ||
24 | *recog_data.operand_loc[i] = old_operands[i]; | ||
25 | if (recog_data.n_dups) | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-flags-for-build.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-flags-for-build.patch new file mode 100644 index 0000000000..43a9d73dcf --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-flags-for-build.patch | |||
@@ -0,0 +1,279 @@ | |||
1 | Index: gcc-4.3.2/Makefile.def | ||
2 | =================================================================== | ||
3 | --- gcc-4.3.2.orig/Makefile.def 2008-08-28 18:21:19.000000000 -0700 | ||
4 | +++ gcc-4.3.2/Makefile.def 2008-08-28 18:21:41.000000000 -0700 | ||
5 | @@ -207,6 +207,7 @@ | ||
6 | flags_to_pass = { flag= BISON ; }; | ||
7 | flags_to_pass = { flag= CC_FOR_BUILD ; }; | ||
8 | flags_to_pass = { flag= CFLAGS_FOR_BUILD ; }; | ||
9 | +flags_to_pass = { flag= CPPFLAGS_FOR_BUILD ; }; | ||
10 | flags_to_pass = { flag= CXX_FOR_BUILD ; }; | ||
11 | flags_to_pass = { flag= EXPECT ; }; | ||
12 | flags_to_pass = { flag= FLEX ; }; | ||
13 | Index: gcc-4.3.2/gcc/Makefile.in | ||
14 | =================================================================== | ||
15 | --- gcc-4.3.2.orig/gcc/Makefile.in 2008-08-28 18:21:20.000000000 -0700 | ||
16 | +++ gcc-4.3.2/gcc/Makefile.in 2008-08-28 18:21:41.000000000 -0700 | ||
17 | @@ -673,7 +673,7 @@ | ||
18 | |||
19 | # Native linker and preprocessor flags. For x-fragment overrides. | ||
20 | BUILD_LDFLAGS=@BUILD_LDFLAGS@ | ||
21 | -BUILD_CPPFLAGS=$(ALL_CPPFLAGS) | ||
22 | +BUILD_CPPFLAGS=$(INCLUDES) @BUILD_CPPFLAGS@ $(X_CPPFLAGS) | ||
23 | |||
24 | # Actual name to use when installing a native compiler. | ||
25 | GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)') | ||
26 | Index: gcc-4.3.2/gcc/configure.ac | ||
27 | =================================================================== | ||
28 | --- gcc-4.3.2.orig/gcc/configure.ac 2008-08-28 18:21:20.000000000 -0700 | ||
29 | +++ gcc-4.3.2/gcc/configure.ac 2008-08-28 18:21:41.000000000 -0700 | ||
30 | @@ -1775,10 +1775,11 @@ | ||
31 | # Also, we cannot run fixincludes or fix-header. | ||
32 | |||
33 | # These are the normal (build=host) settings: | ||
34 | -CC_FOR_BUILD='$(CC)' AC_SUBST(CC_FOR_BUILD) | ||
35 | -BUILD_CFLAGS='$(ALL_CFLAGS)' AC_SUBST(BUILD_CFLAGS) | ||
36 | -BUILD_LDFLAGS='$(LDFLAGS)' AC_SUBST(BUILD_LDFLAGS) | ||
37 | -STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_FIXINC) | ||
38 | +CC_FOR_BUILD='$(CC)' AC_SUBST(CC_FOR_BUILD) | ||
39 | +BUILD_CFLAGS='$(ALL_CFLAGS)' AC_SUBST(BUILD_CFLAGS) | ||
40 | +BUILD_LDFLAGS='$(LDFLAGS)' AC_SUBST(BUILD_LDFLAGS) | ||
41 | +BUILD_CPPFLAGS='$(ALL_CPPFLAGS)' AC_SUBST(BUILD_CPPFLAGS) | ||
42 | +STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_FIXINC) | ||
43 | |||
44 | # Possibly disable fixproto, on a per-target basis. | ||
45 | case ${use_fixproto} in | ||
46 | @@ -1796,6 +1797,7 @@ | ||
47 | then | ||
48 | BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' | ||
49 | BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)' | ||
50 | + BUILD_CPPFLAGS='$(CPPFLAGS_FOR_BUILD)' | ||
51 | |||
52 | if test "x$TARGET_SYSTEM_ROOT" = x; then | ||
53 | if test "x$STMP_FIXPROTO" != x; then | ||
54 | Index: gcc-4.3.2/Makefile.in | ||
55 | =================================================================== | ||
56 | --- gcc-4.3.2.orig/Makefile.in 2008-08-28 18:21:20.000000000 -0700 | ||
57 | +++ gcc-4.3.2/Makefile.in 2008-08-28 18:21:41.000000000 -0700 | ||
58 | @@ -272,6 +272,7 @@ | ||
59 | AS_FOR_BUILD = @AS_FOR_BUILD@ | ||
60 | CC_FOR_BUILD = @CC_FOR_BUILD@ | ||
61 | CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ | ||
62 | +CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ | ||
63 | CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@ | ||
64 | CXX_FOR_BUILD = @CXX_FOR_BUILD@ | ||
65 | DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@ | ||
66 | @@ -502,6 +503,7 @@ | ||
67 | "BISON=$(BISON)" \ | ||
68 | "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ | ||
69 | "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ | ||
70 | + "CPPFLAGS_FOR_BUILD=$(CPPFLAGS_FOR_BUILD)" \ | ||
71 | "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \ | ||
72 | "EXPECT=$(EXPECT)" \ | ||
73 | "FLEX=$(FLEX)" \ | ||
74 | Index: gcc-4.3.2/gcc/configure | ||
75 | =================================================================== | ||
76 | --- gcc-4.3.2.orig/gcc/configure 2008-08-28 18:21:20.000000000 -0700 | ||
77 | +++ gcc-4.3.2/gcc/configure 2008-08-28 18:21:50.000000000 -0700 | ||
78 | @@ -458,7 +458,7 @@ | ||
79 | # include <unistd.h> | ||
80 | #endif" | ||
81 | |||
82 | -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn cxx_compat_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT host_cc_for_libada CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS BUILD_LDFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN ac_ct_AR STRIP ac_ct_STRIP lt_ECHO objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS' | ||
83 | +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn cxx_compat_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT host_cc_for_libada CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS BUILD_LDFLAGS BUILD_CPPFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN ac_ct_AR STRIP ac_ct_STRIP lt_ECHO objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS' | ||
84 | ac_subst_files='language_hooks' | ||
85 | |||
86 | # Initialize some variables set by options. | ||
87 | @@ -13471,6 +13471,7 @@ | ||
88 | CC_FOR_BUILD='$(CC)' | ||
89 | BUILD_CFLAGS='$(ALL_CFLAGS)' | ||
90 | BUILD_LDFLAGS='$(LDFLAGS)' | ||
91 | +BUILD_CPPFLAGS='$(ALL_CPPFLAGS)' | ||
92 | STMP_FIXINC=stmp-fixinc | ||
93 | |||
94 | # Possibly disable fixproto, on a per-target basis. | ||
95 | @@ -13489,6 +13490,7 @@ | ||
96 | then | ||
97 | BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' | ||
98 | BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)' | ||
99 | + BUILD_CPPFLAGS='$(CPPFLAGS_FOR_BUILD)' | ||
100 | |||
101 | if test "x$TARGET_SYSTEM_ROOT" = x; then | ||
102 | if test "x$STMP_FIXPROTO" != x; then | ||
103 | @@ -14067,13 +14069,13 @@ | ||
104 | else | ||
105 | lt_cv_nm_interface="BSD nm" | ||
106 | echo "int some_variable = 0;" > conftest.$ac_ext | ||
107 | - (eval echo "\"\$as_me:14070: $ac_compile\"" >&5) | ||
108 | + (eval echo "\"\$as_me:14072: $ac_compile\"" >&5) | ||
109 | (eval "$ac_compile" 2>conftest.err) | ||
110 | cat conftest.err >&5 | ||
111 | - (eval echo "\"\$as_me:14073: $NM \\\"conftest.$ac_objext\\\"\"" >&5) | ||
112 | + (eval echo "\"\$as_me:14075: $NM \\\"conftest.$ac_objext\\\"\"" >&5) | ||
113 | (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) | ||
114 | cat conftest.err >&5 | ||
115 | - (eval echo "\"\$as_me:14076: output\"" >&5) | ||
116 | + (eval echo "\"\$as_me:14078: output\"" >&5) | ||
117 | cat conftest.out >&5 | ||
118 | if $GREP 'External.*some_variable' conftest.out > /dev/null; then | ||
119 | lt_cv_nm_interface="MS dumpbin" | ||
120 | @@ -15128,7 +15130,7 @@ | ||
121 | ;; | ||
122 | *-*-irix6*) | ||
123 | # Find out which ABI we are using. | ||
124 | - echo '#line 15131 "configure"' > conftest.$ac_ext | ||
125 | + echo '#line 15133 "configure"' > conftest.$ac_ext | ||
126 | if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 | ||
127 | (eval $ac_compile) 2>&5 | ||
128 | ac_status=$? | ||
129 | @@ -15748,11 +15750,11 @@ | ||
130 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | ||
131 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||
132 | -e 's:$: $lt_compiler_flag:'` | ||
133 | - (eval echo "\"\$as_me:15751: $lt_compile\"" >&5) | ||
134 | + (eval echo "\"\$as_me:15753: $lt_compile\"" >&5) | ||
135 | (eval "$lt_compile" 2>conftest.err) | ||
136 | ac_status=$? | ||
137 | cat conftest.err >&5 | ||
138 | - echo "$as_me:15755: \$? = $ac_status" >&5 | ||
139 | + echo "$as_me:15757: \$? = $ac_status" >&5 | ||
140 | if (exit $ac_status) && test -s "$ac_outfile"; then | ||
141 | # The compiler can only warn and ignore the option if not recognized | ||
142 | # So say no if there are warnings other than the usual output. | ||
143 | @@ -16070,11 +16072,11 @@ | ||
144 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | ||
145 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||
146 | -e 's:$: $lt_compiler_flag:'` | ||
147 | - (eval echo "\"\$as_me:16073: $lt_compile\"" >&5) | ||
148 | + (eval echo "\"\$as_me:16075: $lt_compile\"" >&5) | ||
149 | (eval "$lt_compile" 2>conftest.err) | ||
150 | ac_status=$? | ||
151 | cat conftest.err >&5 | ||
152 | - echo "$as_me:16077: \$? = $ac_status" >&5 | ||
153 | + echo "$as_me:16079: \$? = $ac_status" >&5 | ||
154 | if (exit $ac_status) && test -s "$ac_outfile"; then | ||
155 | # The compiler can only warn and ignore the option if not recognized | ||
156 | # So say no if there are warnings other than the usual output. | ||
157 | @@ -16175,11 +16177,11 @@ | ||
158 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | ||
159 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||
160 | -e 's:$: $lt_compiler_flag:'` | ||
161 | - (eval echo "\"\$as_me:16178: $lt_compile\"" >&5) | ||
162 | + (eval echo "\"\$as_me:16180: $lt_compile\"" >&5) | ||
163 | (eval "$lt_compile" 2>out/conftest.err) | ||
164 | ac_status=$? | ||
165 | cat out/conftest.err >&5 | ||
166 | - echo "$as_me:16182: \$? = $ac_status" >&5 | ||
167 | + echo "$as_me:16184: \$? = $ac_status" >&5 | ||
168 | if (exit $ac_status) && test -s out/conftest2.$ac_objext | ||
169 | then | ||
170 | # The compiler can only warn and ignore the option if not recognized | ||
171 | @@ -16230,11 +16232,11 @@ | ||
172 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | ||
173 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||
174 | -e 's:$: $lt_compiler_flag:'` | ||
175 | - (eval echo "\"\$as_me:16233: $lt_compile\"" >&5) | ||
176 | + (eval echo "\"\$as_me:16235: $lt_compile\"" >&5) | ||
177 | (eval "$lt_compile" 2>out/conftest.err) | ||
178 | ac_status=$? | ||
179 | cat out/conftest.err >&5 | ||
180 | - echo "$as_me:16237: \$? = $ac_status" >&5 | ||
181 | + echo "$as_me:16239: \$? = $ac_status" >&5 | ||
182 | if (exit $ac_status) && test -s out/conftest2.$ac_objext | ||
183 | then | ||
184 | # The compiler can only warn and ignore the option if not recognized | ||
185 | @@ -19027,7 +19029,7 @@ | ||
186 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
187 | lt_status=$lt_dlunknown | ||
188 | cat > conftest.$ac_ext <<_LT_EOF | ||
189 | -#line 19030 "configure" | ||
190 | +#line 19032 "configure" | ||
191 | #include "confdefs.h" | ||
192 | |||
193 | #if HAVE_DLFCN_H | ||
194 | @@ -19127,7 +19129,7 @@ | ||
195 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
196 | lt_status=$lt_dlunknown | ||
197 | cat > conftest.$ac_ext <<_LT_EOF | ||
198 | -#line 19130 "configure" | ||
199 | +#line 19132 "configure" | ||
200 | #include "confdefs.h" | ||
201 | |||
202 | #if HAVE_DLFCN_H | ||
203 | @@ -23938,6 +23940,7 @@ | ||
204 | s,@CC_FOR_BUILD@,$CC_FOR_BUILD,;t t | ||
205 | s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t | ||
206 | s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t | ||
207 | +s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t | ||
208 | s,@STMP_FIXINC@,$STMP_FIXINC,;t t | ||
209 | s,@STMP_FIXPROTO@,$STMP_FIXPROTO,;t t | ||
210 | s,@collect2@,$collect2,;t t | ||
211 | Index: gcc-4.3.2/Makefile.tpl | ||
212 | =================================================================== | ||
213 | --- gcc-4.3.2.orig/Makefile.tpl 2008-08-28 18:21:20.000000000 -0700 | ||
214 | +++ gcc-4.3.2/Makefile.tpl 2008-08-28 18:21:41.000000000 -0700 | ||
215 | @@ -275,6 +275,7 @@ | ||
216 | AS_FOR_BUILD = @AS_FOR_BUILD@ | ||
217 | CC_FOR_BUILD = @CC_FOR_BUILD@ | ||
218 | CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ | ||
219 | +CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ | ||
220 | CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@ | ||
221 | CXX_FOR_BUILD = @CXX_FOR_BUILD@ | ||
222 | DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@ | ||
223 | Index: gcc-4.3.2/configure | ||
224 | =================================================================== | ||
225 | --- gcc-4.3.2.orig/configure 2008-08-28 18:21:20.000000000 -0700 | ||
226 | +++ gcc-4.3.2/configure 2008-08-28 18:21:41.000000000 -0700 | ||
227 | @@ -272,7 +272,7 @@ | ||
228 | PACKAGE_BUGREPORT= | ||
229 | |||
230 | ac_unique_file="move-if-change" | ||
231 | -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os build_noncanonical host_noncanonical target_noncanonical host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN LN_S TOPLEVEL_CONFIGURE_ARGUMENTS build_libsubdir build_subdir host_subdir target_subdir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE do_compare gmplibs gmpinc stage1_languages SYSROOT_CFLAGS_FOR_TARGET DEBUG_PREFIX_CFLAGS_FOR_TARGET CFLAGS_FOR_TARGET CXXFLAGS_FOR_TARGET RPATH_ENVVAR tooldir build_tooldir CONFIGURE_GDB_TK GDB_TK INSTALL_GDB_TK build_configargs build_configdirs host_configargs configdirs target_configargs AR_FOR_BUILD AS_FOR_BUILD CC_FOR_BUILD CFLAGS_FOR_BUILD CXXFLAGS_FOR_BUILD CXX_FOR_BUILD DLLTOOL_FOR_BUILD GCJ_FOR_BUILD GFORTRAN_FOR_BUILD LDFLAGS_FOR_BUILD LD_FOR_BUILD NM_FOR_BUILD RANLIB_FOR_BUILD WINDMC_FOR_BUILD WINDRES_FOR_BUILD config_shell YACC BISON M4 LEX FLEX MAKEINFO EXPECT RUNTEST AR AS DLLTOOL LD LIPO NM RANLIB STRIP WINDRES WINDMC OBJCOPY OBJDUMP CC_FOR_TARGET CXX_FOR_TARGET GCC_FOR_TARGET GCJ_FOR_TARGET GFORTRAN_FOR_TARGET AR_FOR_TARGET AS_FOR_TARGET DLLTOOL_FOR_TARGET LD_FOR_TARGET LIPO_FOR_TARGET NM_FOR_TARGET OBJDUMP_FOR_TARGET RANLIB_FOR_TARGET STRIP_FOR_TARGET WINDRES_FOR_TARGET WINDMC_FOR_TARGET RAW_CXX_FOR_TARGET FLAGS_FOR_TARGET COMPILER_AS_FOR_TARGET COMPILER_LD_FOR_TARGET COMPILER_NM_FOR_TARGET MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT stage1_cflags stage1_checking stage2_werror_flag datarootdir docdir pdfdir htmldir LIBOBJS LTLIBOBJS' | ||
232 | +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os build_noncanonical host_noncanonical target_noncanonical host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN LN_S TOPLEVEL_CONFIGURE_ARGUMENTS build_libsubdir build_subdir host_subdir target_subdir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE do_compare gmplibs gmpinc stage1_languages SYSROOT_CFLAGS_FOR_TARGET DEBUG_PREFIX_CFLAGS_FOR_TARGET CFLAGS_FOR_TARGET CXXFLAGS_FOR_TARGET RPATH_ENVVAR tooldir build_tooldir CONFIGURE_GDB_TK GDB_TK INSTALL_GDB_TK build_configargs build_configdirs host_configargs configdirs target_configargs AR_FOR_BUILD AS_FOR_BUILD CC_FOR_BUILD CFLAGS_FOR_BUILD CPPFLAGS_FOR_BUILD CXXFLAGS_FOR_BUILD CXX_FOR_BUILD DLLTOOL_FOR_BUILD GCJ_FOR_BUILD GFORTRAN_FOR_BUILD LDFLAGS_FOR_BUILD LD_FOR_BUILD NM_FOR_BUILD RANLIB_FOR_BUILD WINDMC_FOR_BUILD WINDRES_FOR_BUILD config_shell YACC BISON M4 LEX FLEX MAKEINFO EXPECT RUNTEST AR AS DLLTOOL LD LIPO NM RANLIB STRIP WINDRES WINDMC OBJCOPY OBJDUMP CC_FOR_TARGET CXX_FOR_TARGET GCC_FOR_TARGET GCJ_FOR_TARGET GFORTRAN_FOR_TARGET AR_FOR_TARGET AS_FOR_TARGET DLLTOOL_FOR_TARGET LD_FOR_TARGET LIPO_FOR_TARGET NM_FOR_TARGET OBJDUMP_FOR_TARGET RANLIB_FOR_TARGET STRIP_FOR_TARGET WINDRES_FOR_TARGET WINDMC_FOR_TARGET RAW_CXX_FOR_TARGET FLAGS_FOR_TARGET COMPILER_AS_FOR_TARGET COMPILER_LD_FOR_TARGET COMPILER_NM_FOR_TARGET MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT stage1_cflags stage1_checking stage2_werror_flag datarootdir docdir pdfdir htmldir LIBOBJS LTLIBOBJS' | ||
233 | ac_subst_files='serialization_dependencies host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag' | ||
234 | |||
235 | # Initialize some variables set by options. | ||
236 | @@ -5914,6 +5914,7 @@ | ||
237 | # our build compiler if desired. | ||
238 | if test x"${build}" = x"${host}" ; then | ||
239 | CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}} | ||
240 | + CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-${CPPFLAGS}} | ||
241 | CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CXXFLAGS}} | ||
242 | LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}} | ||
243 | fi | ||
244 | @@ -5991,6 +5992,7 @@ | ||
245 | |||
246 | |||
247 | |||
248 | + | ||
249 | # Generate default definitions for YACC, M4, LEX and other programs that run | ||
250 | # on the build machine. These are used if the Makefile can't locate these | ||
251 | # programs in objdir. | ||
252 | @@ -12874,6 +12876,7 @@ | ||
253 | s,@AS_FOR_BUILD@,$AS_FOR_BUILD,;t t | ||
254 | s,@CC_FOR_BUILD@,$CC_FOR_BUILD,;t t | ||
255 | s,@CFLAGS_FOR_BUILD@,$CFLAGS_FOR_BUILD,;t t | ||
256 | +s,@CPPFLAGS_FOR_BUILD@,$CPPFLAGS_FOR_BUILD,;t t | ||
257 | s,@CXXFLAGS_FOR_BUILD@,$CXXFLAGS_FOR_BUILD,;t t | ||
258 | s,@CXX_FOR_BUILD@,$CXX_FOR_BUILD,;t t | ||
259 | s,@DLLTOOL_FOR_BUILD@,$DLLTOOL_FOR_BUILD,;t t | ||
260 | Index: gcc-4.3.2/configure.ac | ||
261 | =================================================================== | ||
262 | --- gcc-4.3.2.orig/configure.ac 2008-08-28 18:21:20.000000000 -0700 | ||
263 | +++ gcc-4.3.2/configure.ac 2008-08-28 18:21:41.000000000 -0700 | ||
264 | @@ -2425,6 +2425,7 @@ | ||
265 | # our build compiler if desired. | ||
266 | if test x"${build}" = x"${host}" ; then | ||
267 | CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}} | ||
268 | + CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-${CPPFLAGS}} | ||
269 | CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CXXFLAGS}} | ||
270 | LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}} | ||
271 | fi | ||
272 | @@ -2489,6 +2490,7 @@ | ||
273 | AC_SUBST(AS_FOR_BUILD) | ||
274 | AC_SUBST(CC_FOR_BUILD) | ||
275 | AC_SUBST(CFLAGS_FOR_BUILD) | ||
276 | +AC_SUBST(CPPFLAGS_FOR_BUILD) | ||
277 | AC_SUBST(CXXFLAGS_FOR_BUILD) | ||
278 | AC_SUBST(CXX_FOR_BUILD) | ||
279 | AC_SUBST(DLLTOOL_FOR_BUILD) | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-release-branch/PR-36500-fix-neon.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-release-branch/PR-36500-fix-neon.patch new file mode 100644 index 0000000000..971dfe7e29 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc-release-branch/PR-36500-fix-neon.patch | |||
@@ -0,0 +1,265 @@ | |||
1 | --- foo/gcc/config/arm/arm.c 2008/06/11 10:51:34 136660 | ||
2 | +++ foo/gcc/config/arm/arm.c 2008/06/11 10:52:55 136661 | ||
3 | @@ -14830,124 +14830,190 @@ | ||
4 | { | ||
5 | unsigned int i, fcode = ARM_BUILTIN_NEON_BASE; | ||
6 | |||
7 | + tree neon_intQI_type_node; | ||
8 | + tree neon_intHI_type_node; | ||
9 | + tree neon_polyQI_type_node; | ||
10 | + tree neon_polyHI_type_node; | ||
11 | + tree neon_intSI_type_node; | ||
12 | + tree neon_intDI_type_node; | ||
13 | + tree neon_float_type_node; | ||
14 | + | ||
15 | + tree intQI_pointer_node; | ||
16 | + tree intHI_pointer_node; | ||
17 | + tree intSI_pointer_node; | ||
18 | + tree intDI_pointer_node; | ||
19 | + tree float_pointer_node; | ||
20 | + | ||
21 | + tree const_intQI_node; | ||
22 | + tree const_intHI_node; | ||
23 | + tree const_intSI_node; | ||
24 | + tree const_intDI_node; | ||
25 | + tree const_float_node; | ||
26 | + | ||
27 | + tree const_intQI_pointer_node; | ||
28 | + tree const_intHI_pointer_node; | ||
29 | + tree const_intSI_pointer_node; | ||
30 | + tree const_intDI_pointer_node; | ||
31 | + tree const_float_pointer_node; | ||
32 | + | ||
33 | + tree V8QI_type_node; | ||
34 | + tree V4HI_type_node; | ||
35 | + tree V2SI_type_node; | ||
36 | + tree V2SF_type_node; | ||
37 | + tree V16QI_type_node; | ||
38 | + tree V8HI_type_node; | ||
39 | + tree V4SI_type_node; | ||
40 | + tree V4SF_type_node; | ||
41 | + tree V2DI_type_node; | ||
42 | + | ||
43 | + tree intUQI_type_node; | ||
44 | + tree intUHI_type_node; | ||
45 | + tree intUSI_type_node; | ||
46 | + tree intUDI_type_node; | ||
47 | + | ||
48 | + tree intEI_type_node; | ||
49 | + tree intOI_type_node; | ||
50 | + tree intCI_type_node; | ||
51 | + tree intXI_type_node; | ||
52 | + | ||
53 | + tree V8QI_pointer_node; | ||
54 | + tree V4HI_pointer_node; | ||
55 | + tree V2SI_pointer_node; | ||
56 | + tree V2SF_pointer_node; | ||
57 | + tree V16QI_pointer_node; | ||
58 | + tree V8HI_pointer_node; | ||
59 | + tree V4SI_pointer_node; | ||
60 | + tree V4SF_pointer_node; | ||
61 | + tree V2DI_pointer_node; | ||
62 | + | ||
63 | + tree void_ftype_pv8qi_v8qi_v8qi; | ||
64 | + tree void_ftype_pv4hi_v4hi_v4hi; | ||
65 | + tree void_ftype_pv2si_v2si_v2si; | ||
66 | + tree void_ftype_pv2sf_v2sf_v2sf; | ||
67 | + tree void_ftype_pdi_di_di; | ||
68 | + tree void_ftype_pv16qi_v16qi_v16qi; | ||
69 | + tree void_ftype_pv8hi_v8hi_v8hi; | ||
70 | + tree void_ftype_pv4si_v4si_v4si; | ||
71 | + tree void_ftype_pv4sf_v4sf_v4sf; | ||
72 | + tree void_ftype_pv2di_v2di_v2di; | ||
73 | + | ||
74 | + tree reinterp_ftype_dreg[5][5]; | ||
75 | + tree reinterp_ftype_qreg[5][5]; | ||
76 | + tree dreg_types[5], qreg_types[5]; | ||
77 | + | ||
78 | /* Create distinguished type nodes for NEON vector element types, | ||
79 | and pointers to values of such types, so we can detect them later. */ | ||
80 | - tree neon_intQI_type_node = make_signed_type (GET_MODE_PRECISION (QImode)); | ||
81 | - tree neon_intHI_type_node = make_signed_type (GET_MODE_PRECISION (HImode)); | ||
82 | - tree neon_polyQI_type_node = make_signed_type (GET_MODE_PRECISION (QImode)); | ||
83 | - tree neon_polyHI_type_node = make_signed_type (GET_MODE_PRECISION (HImode)); | ||
84 | - tree neon_intSI_type_node = make_signed_type (GET_MODE_PRECISION (SImode)); | ||
85 | - tree neon_intDI_type_node = make_signed_type (GET_MODE_PRECISION (DImode)); | ||
86 | - tree neon_float_type_node = make_node (REAL_TYPE); | ||
87 | - | ||
88 | - tree intQI_pointer_node = build_pointer_type (neon_intQI_type_node); | ||
89 | - tree intHI_pointer_node = build_pointer_type (neon_intHI_type_node); | ||
90 | - tree intSI_pointer_node = build_pointer_type (neon_intSI_type_node); | ||
91 | - tree intDI_pointer_node = build_pointer_type (neon_intDI_type_node); | ||
92 | - tree float_pointer_node = build_pointer_type (neon_float_type_node); | ||
93 | + neon_intQI_type_node = make_signed_type (GET_MODE_PRECISION (QImode)); | ||
94 | + neon_intHI_type_node = make_signed_type (GET_MODE_PRECISION (HImode)); | ||
95 | + neon_polyQI_type_node = make_signed_type (GET_MODE_PRECISION (QImode)); | ||
96 | + neon_polyHI_type_node = make_signed_type (GET_MODE_PRECISION (HImode)); | ||
97 | + neon_intSI_type_node = make_signed_type (GET_MODE_PRECISION (SImode)); | ||
98 | + neon_intDI_type_node = make_signed_type (GET_MODE_PRECISION (DImode)); | ||
99 | + neon_float_type_node = make_node (REAL_TYPE); | ||
100 | + TYPE_PRECISION (neon_float_type_node) = FLOAT_TYPE_SIZE; | ||
101 | + layout_type (neon_float_type_node); | ||
102 | + | ||
103 | + intQI_pointer_node = build_pointer_type (neon_intQI_type_node); | ||
104 | + intHI_pointer_node = build_pointer_type (neon_intHI_type_node); | ||
105 | + intSI_pointer_node = build_pointer_type (neon_intSI_type_node); | ||
106 | + intDI_pointer_node = build_pointer_type (neon_intDI_type_node); | ||
107 | + float_pointer_node = build_pointer_type (neon_float_type_node); | ||
108 | |||
109 | /* Next create constant-qualified versions of the above types. */ | ||
110 | - tree const_intQI_node = build_qualified_type (neon_intQI_type_node, | ||
111 | - TYPE_QUAL_CONST); | ||
112 | - tree const_intHI_node = build_qualified_type (neon_intHI_type_node, | ||
113 | - TYPE_QUAL_CONST); | ||
114 | - tree const_intSI_node = build_qualified_type (neon_intSI_type_node, | ||
115 | - TYPE_QUAL_CONST); | ||
116 | - tree const_intDI_node = build_qualified_type (neon_intDI_type_node, | ||
117 | - TYPE_QUAL_CONST); | ||
118 | - tree const_float_node = build_qualified_type (neon_float_type_node, | ||
119 | - TYPE_QUAL_CONST); | ||
120 | - | ||
121 | - tree const_intQI_pointer_node = build_pointer_type (const_intQI_node); | ||
122 | - tree const_intHI_pointer_node = build_pointer_type (const_intHI_node); | ||
123 | - tree const_intSI_pointer_node = build_pointer_type (const_intSI_node); | ||
124 | - tree const_intDI_pointer_node = build_pointer_type (const_intDI_node); | ||
125 | - tree const_float_pointer_node = build_pointer_type (const_float_node); | ||
126 | + const_intQI_node = build_qualified_type (neon_intQI_type_node, | ||
127 | + TYPE_QUAL_CONST); | ||
128 | + const_intHI_node = build_qualified_type (neon_intHI_type_node, | ||
129 | + TYPE_QUAL_CONST); | ||
130 | + const_intSI_node = build_qualified_type (neon_intSI_type_node, | ||
131 | + TYPE_QUAL_CONST); | ||
132 | + const_intDI_node = build_qualified_type (neon_intDI_type_node, | ||
133 | + TYPE_QUAL_CONST); | ||
134 | + const_float_node = build_qualified_type (neon_float_type_node, | ||
135 | + TYPE_QUAL_CONST); | ||
136 | + | ||
137 | + const_intQI_pointer_node = build_pointer_type (const_intQI_node); | ||
138 | + const_intHI_pointer_node = build_pointer_type (const_intHI_node); | ||
139 | + const_intSI_pointer_node = build_pointer_type (const_intSI_node); | ||
140 | + const_intDI_pointer_node = build_pointer_type (const_intDI_node); | ||
141 | + const_float_pointer_node = build_pointer_type (const_float_node); | ||
142 | |||
143 | /* Now create vector types based on our NEON element types. */ | ||
144 | /* 64-bit vectors. */ | ||
145 | - tree V8QI_type_node = | ||
146 | + V8QI_type_node = | ||
147 | build_vector_type_for_mode (neon_intQI_type_node, V8QImode); | ||
148 | - tree V4HI_type_node = | ||
149 | + V4HI_type_node = | ||
150 | build_vector_type_for_mode (neon_intHI_type_node, V4HImode); | ||
151 | - tree V2SI_type_node = | ||
152 | + V2SI_type_node = | ||
153 | build_vector_type_for_mode (neon_intSI_type_node, V2SImode); | ||
154 | - tree V2SF_type_node = | ||
155 | + V2SF_type_node = | ||
156 | build_vector_type_for_mode (neon_float_type_node, V2SFmode); | ||
157 | /* 128-bit vectors. */ | ||
158 | - tree V16QI_type_node = | ||
159 | + V16QI_type_node = | ||
160 | build_vector_type_for_mode (neon_intQI_type_node, V16QImode); | ||
161 | - tree V8HI_type_node = | ||
162 | + V8HI_type_node = | ||
163 | build_vector_type_for_mode (neon_intHI_type_node, V8HImode); | ||
164 | - tree V4SI_type_node = | ||
165 | + V4SI_type_node = | ||
166 | build_vector_type_for_mode (neon_intSI_type_node, V4SImode); | ||
167 | - tree V4SF_type_node = | ||
168 | + V4SF_type_node = | ||
169 | build_vector_type_for_mode (neon_float_type_node, V4SFmode); | ||
170 | - tree V2DI_type_node = | ||
171 | + V2DI_type_node = | ||
172 | build_vector_type_for_mode (neon_intDI_type_node, V2DImode); | ||
173 | |||
174 | /* Unsigned integer types for various mode sizes. */ | ||
175 | - tree intUQI_type_node = make_unsigned_type (GET_MODE_PRECISION (QImode)); | ||
176 | - tree intUHI_type_node = make_unsigned_type (GET_MODE_PRECISION (HImode)); | ||
177 | - tree intUSI_type_node = make_unsigned_type (GET_MODE_PRECISION (SImode)); | ||
178 | - tree intUDI_type_node = make_unsigned_type (GET_MODE_PRECISION (DImode)); | ||
179 | + intUQI_type_node = make_unsigned_type (GET_MODE_PRECISION (QImode)); | ||
180 | + intUHI_type_node = make_unsigned_type (GET_MODE_PRECISION (HImode)); | ||
181 | + intUSI_type_node = make_unsigned_type (GET_MODE_PRECISION (SImode)); | ||
182 | + intUDI_type_node = make_unsigned_type (GET_MODE_PRECISION (DImode)); | ||
183 | |||
184 | /* Opaque integer types for structures of vectors. */ | ||
185 | - tree intEI_type_node = make_signed_type (GET_MODE_PRECISION (EImode)); | ||
186 | - tree intOI_type_node = make_signed_type (GET_MODE_PRECISION (OImode)); | ||
187 | - tree intCI_type_node = make_signed_type (GET_MODE_PRECISION (CImode)); | ||
188 | - tree intXI_type_node = make_signed_type (GET_MODE_PRECISION (XImode)); | ||
189 | + intEI_type_node = make_signed_type (GET_MODE_PRECISION (EImode)); | ||
190 | + intOI_type_node = make_signed_type (GET_MODE_PRECISION (OImode)); | ||
191 | + intCI_type_node = make_signed_type (GET_MODE_PRECISION (CImode)); | ||
192 | + intXI_type_node = make_signed_type (GET_MODE_PRECISION (XImode)); | ||
193 | |||
194 | /* Pointers to vector types. */ | ||
195 | - tree V8QI_pointer_node = build_pointer_type (V8QI_type_node); | ||
196 | - tree V4HI_pointer_node = build_pointer_type (V4HI_type_node); | ||
197 | - tree V2SI_pointer_node = build_pointer_type (V2SI_type_node); | ||
198 | - tree V2SF_pointer_node = build_pointer_type (V2SF_type_node); | ||
199 | - tree V16QI_pointer_node = build_pointer_type (V16QI_type_node); | ||
200 | - tree V8HI_pointer_node = build_pointer_type (V8HI_type_node); | ||
201 | - tree V4SI_pointer_node = build_pointer_type (V4SI_type_node); | ||
202 | - tree V4SF_pointer_node = build_pointer_type (V4SF_type_node); | ||
203 | - tree V2DI_pointer_node = build_pointer_type (V2DI_type_node); | ||
204 | + V8QI_pointer_node = build_pointer_type (V8QI_type_node); | ||
205 | + V4HI_pointer_node = build_pointer_type (V4HI_type_node); | ||
206 | + V2SI_pointer_node = build_pointer_type (V2SI_type_node); | ||
207 | + V2SF_pointer_node = build_pointer_type (V2SF_type_node); | ||
208 | + V16QI_pointer_node = build_pointer_type (V16QI_type_node); | ||
209 | + V8HI_pointer_node = build_pointer_type (V8HI_type_node); | ||
210 | + V4SI_pointer_node = build_pointer_type (V4SI_type_node); | ||
211 | + V4SF_pointer_node = build_pointer_type (V4SF_type_node); | ||
212 | + V2DI_pointer_node = build_pointer_type (V2DI_type_node); | ||
213 | |||
214 | /* Operations which return results as pairs. */ | ||
215 | - tree void_ftype_pv8qi_v8qi_v8qi = | ||
216 | + void_ftype_pv8qi_v8qi_v8qi = | ||
217 | build_function_type_list (void_type_node, V8QI_pointer_node, V8QI_type_node, | ||
218 | V8QI_type_node, NULL); | ||
219 | - tree void_ftype_pv4hi_v4hi_v4hi = | ||
220 | + void_ftype_pv4hi_v4hi_v4hi = | ||
221 | build_function_type_list (void_type_node, V4HI_pointer_node, V4HI_type_node, | ||
222 | V4HI_type_node, NULL); | ||
223 | - tree void_ftype_pv2si_v2si_v2si = | ||
224 | + void_ftype_pv2si_v2si_v2si = | ||
225 | build_function_type_list (void_type_node, V2SI_pointer_node, V2SI_type_node, | ||
226 | V2SI_type_node, NULL); | ||
227 | - tree void_ftype_pv2sf_v2sf_v2sf = | ||
228 | + void_ftype_pv2sf_v2sf_v2sf = | ||
229 | build_function_type_list (void_type_node, V2SF_pointer_node, V2SF_type_node, | ||
230 | V2SF_type_node, NULL); | ||
231 | - tree void_ftype_pdi_di_di = | ||
232 | + void_ftype_pdi_di_di = | ||
233 | build_function_type_list (void_type_node, intDI_pointer_node, | ||
234 | neon_intDI_type_node, neon_intDI_type_node, NULL); | ||
235 | - tree void_ftype_pv16qi_v16qi_v16qi = | ||
236 | + void_ftype_pv16qi_v16qi_v16qi = | ||
237 | build_function_type_list (void_type_node, V16QI_pointer_node, | ||
238 | V16QI_type_node, V16QI_type_node, NULL); | ||
239 | - tree void_ftype_pv8hi_v8hi_v8hi = | ||
240 | + void_ftype_pv8hi_v8hi_v8hi = | ||
241 | build_function_type_list (void_type_node, V8HI_pointer_node, V8HI_type_node, | ||
242 | V8HI_type_node, NULL); | ||
243 | - tree void_ftype_pv4si_v4si_v4si = | ||
244 | + void_ftype_pv4si_v4si_v4si = | ||
245 | build_function_type_list (void_type_node, V4SI_pointer_node, V4SI_type_node, | ||
246 | V4SI_type_node, NULL); | ||
247 | - tree void_ftype_pv4sf_v4sf_v4sf = | ||
248 | + void_ftype_pv4sf_v4sf_v4sf = | ||
249 | build_function_type_list (void_type_node, V4SF_pointer_node, V4SF_type_node, | ||
250 | V4SF_type_node, NULL); | ||
251 | - tree void_ftype_pv2di_v2di_v2di = | ||
252 | + void_ftype_pv2di_v2di_v2di = | ||
253 | build_function_type_list (void_type_node, V2DI_pointer_node, V2DI_type_node, | ||
254 | V2DI_type_node, NULL); | ||
255 | |||
256 | - tree reinterp_ftype_dreg[5][5]; | ||
257 | - tree reinterp_ftype_qreg[5][5]; | ||
258 | - tree dreg_types[5], qreg_types[5]; | ||
259 | - | ||
260 | - TYPE_PRECISION (neon_float_type_node) = FLOAT_TYPE_SIZE; | ||
261 | - layout_type (neon_float_type_node); | ||
262 | - | ||
263 | /* Define typedefs which exactly correspond to the modes we are basing vector | ||
264 | types on. If you change these names you'll need to change | ||
265 | the table used by arm_mangle_type too. */ | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/gcc41-configure.in.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc41-configure.in.patch new file mode 100644 index 0000000000..3d33bcb978 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc41-configure.in.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | --- gcc-3.4.4/configure.in.orig 2005-08-09 19:57:51.504323183 -0700 | ||
2 | +++ gcc-3.4.4/configure.in 2005-08-09 20:00:12.073168623 -0700 | ||
3 | @@ -1907,7 +1907,7 @@ | ||
4 | *) gxx_include_dir=${with_gxx_include_dir} ;; | ||
5 | esac | ||
6 | |||
7 | -FLAGS_FOR_TARGET= | ||
8 | +FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET" | ||
9 | case " $target_configdirs " in | ||
10 | *" newlib "*) | ||
11 | case " $target_configargs " in | ||
12 | --- gcc-3.4.4/configure.orig 2005-08-09 21:02:29.668360660 -0700 | ||
13 | +++ gcc-3.4.4/configure 2005-08-09 21:02:50.157649970 -0700 | ||
14 | @@ -2669,7 +2669,7 @@ | ||
15 | *) gxx_include_dir=${with_gxx_include_dir} ;; | ||
16 | esac | ||
17 | |||
18 | -FLAGS_FOR_TARGET= | ||
19 | +FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET" | ||
20 | case " $target_configdirs " in | ||
21 | *" newlib "*) | ||
22 | case " $target_configargs " in | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/gcc43-build-id.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc43-build-id.patch new file mode 100644 index 0000000000..4e162e6472 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc43-build-id.patch | |||
@@ -0,0 +1,74 @@ | |||
1 | 2007-07-22 Roland McGrath <roland@redhat.com> | ||
2 | |||
3 | * config/rs6000/sysv4.h (LINK_EH_SPEC): Add --build-id for | ||
4 | non-relocatable link. | ||
5 | * config/linux.h (LINK_EH_SPEC): Likewise. | ||
6 | * config/sparc/linux.h (LINK_EH_SPEC): Likewise. | ||
7 | * config/sparc/linux64.h (LINK_EH_SPEC): Likewise. | ||
8 | * config/alpha/elf.h (LINK_EH_SPEC): Likewise. | ||
9 | * config/ia64/linux.h (LINK_EH_SPEC): Likewise. | ||
10 | |||
11 | --- gcc/config/rs6000/sysv4.h.~1~ | ||
12 | +++ gcc/config/rs6000/sysv4.h | ||
13 | @@ -1044,7 +1044,7 @@ extern int fixuplabelno; | ||
14 | %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}" | ||
15 | |||
16 | #if defined(HAVE_LD_EH_FRAME_HDR) | ||
17 | -# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " | ||
18 | +# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} %{!r:--build-id} " | ||
19 | #endif | ||
20 | |||
21 | #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \ | ||
22 | --- gcc/config/linux.h.~1~ | ||
23 | +++ gcc/config/linux.h | ||
24 | @@ -85,7 +85,7 @@ Boston, MA 02110-1301, USA. */ | ||
25 | } while (0) | ||
26 | |||
27 | #if defined(HAVE_LD_EH_FRAME_HDR) | ||
28 | -#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " | ||
29 | +#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} %{!r:--build-id} " | ||
30 | #endif | ||
31 | |||
32 | /* Define this so we can compile MS code for use with WINE. */ | ||
33 | --- gcc/config/sparc/linux64.h.~1~ | ||
34 | +++ gcc/config/sparc/linux64.h | ||
35 | @@ -316,7 +316,7 @@ do { \ | ||
36 | #define DITF_CONVERSION_LIBFUNCS 1 | ||
37 | |||
38 | #if defined(HAVE_LD_EH_FRAME_HDR) | ||
39 | -#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " | ||
40 | +#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} %{!r:--build-id} " | ||
41 | #endif | ||
42 | |||
43 | #ifdef HAVE_AS_TLS | ||
44 | --- gcc/config/sparc/linux.h.~1~ | ||
45 | +++ gcc/config/sparc/linux.h | ||
46 | @@ -188,7 +188,7 @@ do { \ | ||
47 | #define DITF_CONVERSION_LIBFUNCS 1 | ||
48 | |||
49 | #if defined(HAVE_LD_EH_FRAME_HDR) | ||
50 | -#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " | ||
51 | +#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} %{!r:--build-id} " | ||
52 | #endif | ||
53 | |||
54 | #ifdef HAVE_AS_TLS | ||
55 | --- gcc/config/alpha/elf.h.~1~ | ||
56 | +++ gcc/config/alpha/elf.h | ||
57 | @@ -453,5 +453,5 @@ extern int alpha_this_gpdisp_sequence_nu | ||
58 | I imagine that other systems will catch up. In the meantime, it | ||
59 | doesn't harm to make sure that the data exists to be used later. */ | ||
60 | #if defined(HAVE_LD_EH_FRAME_HDR) | ||
61 | -#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " | ||
62 | +#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} %{!r:--build-id} " | ||
63 | #endif | ||
64 | --- gcc/config/ia64/linux.h.~1~ | ||
65 | +++ gcc/config/ia64/linux.h | ||
66 | @@ -56,7 +56,7 @@ do { \ | ||
67 | Signalize that because we have fde-glibc, we don't need all C shared libs | ||
68 | linked against -lgcc_s. */ | ||
69 | #undef LINK_EH_SPEC | ||
70 | -#define LINK_EH_SPEC "" | ||
71 | +#define LINK_EH_SPEC "%{!r:--build-id} " | ||
72 | |||
73 | #define MD_UNWIND_SUPPORT "config/ia64/linux-unwind.h" | ||
74 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/gcc43-ppc64-ia64-GNU-stack.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc43-ppc64-ia64-GNU-stack.patch new file mode 100644 index 0000000000..d49f2b9855 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/gcc43-ppc64-ia64-GNU-stack.patch | |||
@@ -0,0 +1,86 @@ | |||
1 | 2007-08-27 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | * config/rs6000/rs6000.c (rs6000_elf_end_indicate_exec_stack): New. | ||
4 | * config/rs6000/linux64.h (TARGET_ASM_FILE_END): Use | ||
5 | rs6000_elf_end_indicate_exec_stack. | ||
6 | * config/ia64/ia64.c (ia64_linux_file_end): new. | ||
7 | * config/ia64/linux.h (TARGET_ASM_FILE_END): Use ia64_linux_file_end. | ||
8 | |||
9 | --- gcc/config/rs6000/rs6000.c.jj 2007-12-07 18:41:08.000000000 +0100 | ||
10 | +++ gcc/config/rs6000/rs6000.c 2007-12-07 18:42:12.000000000 +0100 | ||
11 | @@ -746,6 +746,7 @@ static void rs6000_file_start (void); | ||
12 | static int rs6000_elf_reloc_rw_mask (void); | ||
13 | static void rs6000_elf_asm_out_constructor (rtx, int); | ||
14 | static void rs6000_elf_asm_out_destructor (rtx, int); | ||
15 | +static void rs6000_elf_end_indicate_exec_stack (void) ATTRIBUTE_UNUSED; | ||
16 | static void rs6000_elf_asm_init_sections (void); | ||
17 | static section *rs6000_elf_select_rtx_section (enum machine_mode, rtx, | ||
18 | unsigned HOST_WIDE_INT); | ||
19 | @@ -20418,6 +20419,20 @@ rs6000_elf_declare_function_name (FILE * | ||
20 | } | ||
21 | ASM_OUTPUT_LABEL (file, name); | ||
22 | } | ||
23 | + | ||
24 | +static void | ||
25 | +rs6000_elf_end_indicate_exec_stack (void) | ||
26 | +{ | ||
27 | + if (TARGET_32BIT) | ||
28 | + file_end_indicate_exec_stack (); | ||
29 | + else | ||
30 | + { | ||
31 | + int saved_trampolines_created = trampolines_created; | ||
32 | + trampolines_created = 0; | ||
33 | + file_end_indicate_exec_stack (); | ||
34 | + trampolines_created = saved_trampolines_created; | ||
35 | + } | ||
36 | +} | ||
37 | #endif | ||
38 | |||
39 | #if TARGET_XCOFF | ||
40 | --- gcc/config/rs6000/linux64.h.jj 2007-12-07 17:18:06.000000000 +0100 | ||
41 | +++ gcc/config/rs6000/linux64.h 2007-12-07 18:41:21.000000000 +0100 | ||
42 | @@ -504,7 +504,7 @@ extern int dot_symbols; | ||
43 | #undef DRAFT_V4_STRUCT_RET | ||
44 | #define DRAFT_V4_STRUCT_RET (!TARGET_64BIT) | ||
45 | |||
46 | -#define TARGET_ASM_FILE_END file_end_indicate_exec_stack | ||
47 | +#define TARGET_ASM_FILE_END rs6000_elf_end_indicate_exec_stack | ||
48 | |||
49 | #define TARGET_POSIX_IO | ||
50 | |||
51 | --- gcc/config/ia64/linux.h.jj 2007-12-07 18:17:43.000000000 +0100 | ||
52 | +++ gcc/config/ia64/linux.h 2007-12-07 18:41:21.000000000 +0100 | ||
53 | @@ -5,7 +5,7 @@ | ||
54 | |||
55 | #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux"); | ||
56 | |||
57 | -#define TARGET_ASM_FILE_END file_end_indicate_exec_stack | ||
58 | +#define TARGET_ASM_FILE_END ia64_linux_file_end | ||
59 | |||
60 | /* This is for -profile to use -lc_p instead of -lc. */ | ||
61 | #undef CC1_SPEC | ||
62 | --- gcc/config/ia64/ia64.c.jj 2007-12-07 15:41:58.000000000 +0100 | ||
63 | +++ gcc/config/ia64/ia64.c 2007-12-07 18:43:18.000000000 +0100 | ||
64 | @@ -262,6 +262,8 @@ static section *ia64_select_rtx_section | ||
65 | static void ia64_output_dwarf_dtprel (FILE *, int, rtx) | ||
66 | ATTRIBUTE_UNUSED; | ||
67 | static unsigned int ia64_section_type_flags (tree, const char *, int); | ||
68 | +static void ia64_linux_file_end (void) | ||
69 | + ATTRIBUTE_UNUSED; | ||
70 | static void ia64_init_libfuncs (void) | ||
71 | ATTRIBUTE_UNUSED; | ||
72 | static void ia64_hpux_init_libfuncs (void) | ||
73 | @@ -9957,4 +9959,13 @@ ia64_c_mode_for_suffix (char suffix) | ||
74 | return VOIDmode; | ||
75 | } | ||
76 | |||
77 | +static void | ||
78 | +ia64_linux_file_end (void) | ||
79 | +{ | ||
80 | + int saved_trampolines_created = trampolines_created; | ||
81 | + trampolines_created = 0; | ||
82 | + file_end_indicate_exec_stack (); | ||
83 | + trampolines_created = saved_trampolines_created; | ||
84 | +} | ||
85 | + | ||
86 | #include "gt-ia64.h" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/gfortran.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/gfortran.patch new file mode 100644 index 0000000000..96905e5d7d --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/gfortran.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | The patch below fixes a crash building libgfortran on arm-linux-gnueabi. | ||
2 | |||
3 | This target doesn't really have a 128-bit integer type, however it does use | ||
4 | TImode to represent the return value of certain special ABI defined library | ||
5 | functions. This results in type_for_size(TImode) being called. | ||
6 | |||
7 | Because TImode deosn't correspond to any gfortran integer kind | ||
8 | gfc_type_for_size returns NULL and we segfault shortly after. | ||
9 | |||
10 | The patch below fixes this by making gfc_type_for_size handle TImode in the | ||
11 | same way as the C frontend. | ||
12 | |||
13 | Tested on x86_64-linux and arm-linux-gnueabi. | ||
14 | Applied to trunk. | ||
15 | |||
16 | Paul | ||
17 | |||
18 | 2007-05-15 Paul Brook <paul@codesourcery.com> | ||
19 | |||
20 | gcc/fortran/ | ||
21 | * trans-types.c (gfc_type_for_size): Handle signed TImode. | ||
22 | |||
23 | Index: gcc-4.2.1/gcc/fortran/trans-types.c | ||
24 | =================================================================== | ||
25 | --- gcc-4.2.1/gcc/fortran/trans-types.c (revision 170435) | ||
26 | +++ gcc-4.2.1/gcc/fortran/trans-types.c (working copy) | ||
27 | @@ -1800,6 +1800,13 @@ gfc_type_for_size (unsigned bits, int un | ||
28 | if (type && bits == TYPE_PRECISION (type)) | ||
29 | return type; | ||
30 | } | ||
31 | + | ||
32 | + /* Handle TImode as a special case because it is used by some backends | ||
33 | + (eg. ARM) even though it is not available for normal use. */ | ||
34 | +#if HOST_BITS_PER_WIDE_INT >= 64 | ||
35 | + if (bits == TYPE_PRECISION (intTI_type_node)) | ||
36 | + return intTI_type_node; | ||
37 | +#endif | ||
38 | } | ||
39 | else | ||
40 | { | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/headerpath.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/headerpath.patch new file mode 100644 index 0000000000..a3a6aff270 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/headerpath.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | Index: gcc-4.3.3/gcc/Makefile.in | ||
2 | =================================================================== | ||
3 | --- gcc-4.3.3.orig/gcc/Makefile.in 2009-09-11 17:51:50.000000000 +0100 | ||
4 | +++ gcc-4.3.3/gcc/Makefile.in 2009-09-11 17:56:48.000000000 +0100 | ||
5 | @@ -378,7 +378,7 @@ | ||
6 | MD5_H = $(srcdir)/../include/md5.h | ||
7 | |||
8 | # Default native SYSTEM_HEADER_DIR, to be overridden by targets. | ||
9 | -NATIVE_SYSTEM_HEADER_DIR = /usr/include | ||
10 | +NATIVE_SYSTEM_HEADER_DIR = @NATIVE_SYSTEM_HEADER_DIR@ | ||
11 | # Default cross SYSTEM_HEADER_DIR, to be overridden by targets. | ||
12 | CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@ | ||
13 | |||
14 | Index: gcc-4.3.3/gcc/configure | ||
15 | =================================================================== | ||
16 | --- gcc-4.3.3.orig/gcc/configure 2009-09-11 17:49:58.000000000 +0100 | ||
17 | +++ gcc-4.3.3/gcc/configure 2009-09-11 18:00:16.000000000 +0100 | ||
18 | @@ -7315,7 +7315,7 @@ | ||
19 | enable_shared=yes | ||
20 | fi; | ||
21 | |||
22 | - | ||
23 | +NATIVE_SYSTEM_HEADER_DIR=$NATIVE_SYSTEM_HEADER_DIR | ||
24 | |||
25 | # Check whether --with-build-sysroot or --without-build-sysroot was given. | ||
26 | if test "${with_build_sysroot+set}" = set; then | ||
27 | @@ -7323,7 +7323,6 @@ | ||
28 | |||
29 | fi; | ||
30 | |||
31 | - | ||
32 | # Check whether --with-sysroot or --without-sysroot was given. | ||
33 | if test "${with_sysroot+set}" = set; then | ||
34 | withval="$with_sysroot" | ||
35 | @@ -23882,6 +23881,7 @@ | ||
36 | s,@TARGET_SYSTEM_ROOT@,$TARGET_SYSTEM_ROOT,;t t | ||
37 | s,@TARGET_SYSTEM_ROOT_DEFINE@,$TARGET_SYSTEM_ROOT_DEFINE,;t t | ||
38 | s,@CROSS_SYSTEM_HEADER_DIR@,$CROSS_SYSTEM_HEADER_DIR,;t t | ||
39 | +s,@NATIVE_SYSTEM_HEADER_DIR@,$NATIVE_SYSTEM_HEADER_DIR,;t t | ||
40 | s,@onestep@,$onestep,;t t | ||
41 | s,@PKGVERSION@,$PKGVERSION,;t t | ||
42 | s,@REPORT_BUGS_TO@,$REPORT_BUGS_TO,;t t | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/intermask-bigendian.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/intermask-bigendian.patch new file mode 100644 index 0000000000..fdff3d3d86 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/intermask-bigendian.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | --- gcc-4.2.0/gcc/config/arm/bpabi.h | ||
2 | +++ gcc-4.2.0/gcc/config/arm/bpabi.h | ||
3 | @@ -33,9 +33,19 @@ | ||
4 | #undef FPUTYPE_DEFAULT | ||
5 | #define FPUTYPE_DEFAULT FPUTYPE_VFP | ||
6 | |||
7 | +/* | ||
8 | + * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-* | ||
9 | + * (big endian) configurations. | ||
10 | + */ | ||
11 | +#if TARGET_BIG_ENDIAN_DEFAULT | ||
12 | +#define TARGET_ENDIAN_DEFAULT MASK_BIG_END | ||
13 | +#else | ||
14 | +#define TARGET_ENDIAN_DEFAULT 0 | ||
15 | +#endif | ||
16 | + | ||
17 | /* EABI targets should enable interworking by default. */ | ||
18 | #undef TARGET_DEFAULT | ||
19 | -#define TARGET_DEFAULT MASK_INTERWORK | ||
20 | +#define TARGET_DEFAULT (MASK_INTERWORK | TARGET_ENDIAN_DEFAULT) | ||
21 | |||
22 | /* The ARM BPABI functions return a boolean; they use no special | ||
23 | calling convention. */ | ||
24 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/ldflags.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/ldflags.patch new file mode 100644 index 0000000000..9576f60778 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/ldflags.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | --- /tmp/Makefile.in 2006-02-23 20:56:01.399758728 +0100 | ||
2 | +++ gcc-4.1-20060217/Makefile.in 2006-02-23 20:56:16.874406224 +0100 | ||
3 | @@ -334,7 +334,7 @@ | ||
4 | CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) | ||
5 | LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) | ||
6 | LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates | ||
7 | -LDFLAGS_FOR_TARGET = | ||
8 | +LDFLAGS_FOR_TARGET = @LDFLAGS@ | ||
9 | PICFLAG_FOR_TARGET = | ||
10 | |||
11 | # ------------------------------------ | ||
12 | --- /tmp/Makefile.tpl 2006-02-23 20:50:34.077519272 +0100 | ||
13 | +++ gcc-4.1-20060217/Makefile.tpl 2006-02-23 21:04:31.092273688 +0100 | ||
14 | @@ -337,7 +337,7 @@ | ||
15 | CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) | ||
16 | LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) | ||
17 | LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates | ||
18 | -LDFLAGS_FOR_TARGET = | ||
19 | +LDFLAGS_FOR_TARGET = @LDFLAGS@ | ||
20 | PICFLAG_FOR_TARGET = | ||
21 | |||
22 | # ------------------------------------ | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/optional_libstdc.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/optional_libstdc.patch new file mode 100644 index 0000000000..0f74353a1f --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/optional_libstdc.patch | |||
@@ -0,0 +1,23 @@ | |||
1 | gcc-runtime builds libstdc++ separately from gcc-cross-*. Its configure tests using g++ | ||
2 | will not run correctly since my default the linker will try and link against libstdc++ | ||
3 | which shouldn't exist yet. We need an option to disable the automatically added -lstdc++ | ||
4 | option whilst leaving -lc, -lgcc and other automatic library dependencies. This patch | ||
5 | adds such an option which only disables the -lstdc++ linkage. | ||
6 | |||
7 | A "standard" gcc build uses xgcc and hence avoids this. We should ask upstream how to | ||
8 | do this officially, the likely answer is don't build libstdc++ separately. | ||
9 | |||
10 | RP 29/6/10 | ||
11 | |||
12 | Index: gcc-4.3.3/gcc/cp/g++spec.c | ||
13 | =================================================================== | ||
14 | --- gcc-4.3.3.orig/gcc/cp/g++spec.c 2010-06-29 00:06:03.901695025 +0100 | ||
15 | +++ gcc-4.3.3/gcc/cp/g++spec.c 2010-06-29 00:06:58.800325439 +0100 | ||
16 | @@ -131,6 +131,7 @@ | ||
17 | if (argv[i][0] == '-') | ||
18 | { | ||
19 | if (strcmp (argv[i], "-nostdlib") == 0 | ||
20 | + || strcmp (argv[i], "-nostdlib++") == 0 | ||
21 | || strcmp (argv[i], "-nodefaultlibs") == 0) | ||
22 | { | ||
23 | library = -1; | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/pr34130.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/pr34130.patch new file mode 100644 index 0000000000..415335f4b4 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/pr34130.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | Index: gcc-4.1.2/gcc/fold-const.c | ||
2 | =================================================================== | ||
3 | --- gcc-4.1.2.orig/gcc/fold-const.c 2007-11-21 18:53:42.000000000 +0100 | ||
4 | +++ gcc-4.1.2/gcc/fold-const.c 2007-11-21 18:56:26.000000000 +0100 | ||
5 | @@ -5339,7 +5339,10 @@ | ||
6 | } | ||
7 | break; | ||
8 | } | ||
9 | - /* FALLTHROUGH */ | ||
10 | + /* If the constant is negative, we cannot simplify this. */ | ||
11 | + if (tree_int_cst_sgn (c) == -1) | ||
12 | + break; | ||
13 | + /* FALLTHROUGH */ | ||
14 | case NEGATE_EXPR: | ||
15 | if ((t1 = extract_muldiv (op0, c, code, wide_type)) != 0) | ||
16 | return fold_build1 (tcode, ctype, fold_convert (ctype, t1)); | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/pr35942.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/pr35942.patch new file mode 100644 index 0000000000..da610f5189 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/pr35942.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | Fix PR 35942: remove -lstdc++ from libtool postdeps for CXX. | ||
2 | |||
3 | libstdc++-v3/ChangeLog: | ||
4 | 2010-01-04 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | ||
5 | |||
6 | PR libstdc++/35942 | ||
7 | * configure.ac: Remove -lstdc++ from libtool's postdeps_CXX. | ||
8 | * configure: Regenerate. | ||
9 | |||
10 | |||
11 | Index: gcc-4.3.3/libstdc++-v3/configure | ||
12 | =================================================================== | ||
13 | --- gcc-4.3.3.orig/libstdc++-v3/configure 2010-03-26 17:57:51.000000000 +0000 | ||
14 | +++ gcc-4.3.3/libstdc++-v3/configure 2010-03-26 17:57:58.000000000 +0000 | ||
15 | @@ -13759,6 +13759,9 @@ | ||
16 | |||
17 | |||
18 | |||
19 | +# Eliminate -lstdc++ addition to postdeps for cross compiles. | ||
20 | +postdeps_CXX=`echo " $postdeps_CXX " | sed 's, -lstdc++ ,,g'` | ||
21 | + | ||
22 | # Possibly disable most of the library. | ||
23 | ## TODO: Consider skipping unncessary tests altogether in this case, rather | ||
24 | ## than just ignoring the results. Faster /and/ more correct, win win. | ||
25 | Index: gcc-4.3.3/libstdc++-v3/configure.ac | ||
26 | =================================================================== | ||
27 | --- gcc-4.3.3.orig/libstdc++-v3/configure.ac 2010-03-26 17:57:54.000000000 +0000 | ||
28 | +++ gcc-4.3.3/libstdc++-v3/configure.ac 2010-03-26 17:57:58.000000000 +0000 | ||
29 | @@ -89,6 +89,9 @@ | ||
30 | AC_SUBST(enable_shared) | ||
31 | AC_SUBST(enable_static) | ||
32 | |||
33 | +# Eliminate -lstdc++ addition to postdeps for cross compiles. | ||
34 | +postdeps_CXX=`echo " $postdeps_CXX " | sed 's, -lstdc++ ,,g'` | ||
35 | + | ||
36 | # Possibly disable most of the library. | ||
37 | ## TODO: Consider skipping unncessary tests altogether in this case, rather | ||
38 | ## than just ignoring the results. Faster /and/ more correct, win win. | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/sdk-libstdc++-includes.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/sdk-libstdc++-includes.patch new file mode 100644 index 0000000000..4377c2143b --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/sdk-libstdc++-includes.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | --- gcc-3.4.1/libstdc++-v3/libmath/Makefile.am~ 2003-08-27 22:29:42.000000000 +0100 | ||
2 | +++ gcc-3.4.1/libstdc++-v3/libmath/Makefile.am 2004-07-22 16:41:45.152130128 +0100 | ||
3 | @@ -32,7 +32,7 @@ | ||
4 | |||
5 | libmath_la_SOURCES = stubs.c | ||
6 | |||
7 | -AM_CPPFLAGS = $(CANADIAN_INCLUDES) | ||
8 | +AM_CPPFLAGS = $(CANADIAN_INCLUDES) -I$(toplevel_srcdir)/include | ||
9 | |||
10 | # Only compiling "C" sources in this directory. | ||
11 | LIBTOOL = @LIBTOOL@ --tag CC | ||
12 | --- gcc-3.4.1/libstdc++-v3/fragment.am.old 2004-07-22 18:24:58.024083656 +0100 | ||
13 | +++ gcc-3.4.1/libstdc++-v3/fragment.am 2004-07-22 18:24:59.019932264 +0100 | ||
14 | @@ -18,7 +18,7 @@ | ||
15 | $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once | ||
16 | |||
17 | # -I/-D flags to pass when compiling. | ||
18 | -AM_CPPFLAGS = $(GLIBCXX_INCLUDES) | ||
19 | +AM_CPPFLAGS = $(GLIBCXX_INCLUDES) -I$(toplevel_srcdir)/include | ||
20 | |||
21 | |||
22 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/sh3-installfix-fixheaders.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/sh3-installfix-fixheaders.patch new file mode 100644 index 0000000000..a06cd2e075 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/sh3-installfix-fixheaders.patch | |||
@@ -0,0 +1,11 @@ | |||
1 | --- gcc-4.1.1/gcc/Makefile.in_orig 2007-01-31 21:24:23.000000000 +0000 | ||
2 | +++ gcc-4.1.1/gcc/Makefile.in 2007-01-31 21:24:43.000000000 +0000 | ||
3 | @@ -3772,8 +3772,6 @@ | ||
4 | $(INSTALL_SCRIPT) $(mkinstalldirs) \ | ||
5 | $(DESTDIR)$(itoolsdir)/mkinstalldirs ; \ | ||
6 | $(INSTALL_SCRIPT) $(srcdir)/fixproto $(DESTDIR)$(itoolsdir)/fixproto ; \ | ||
7 | - $(INSTALL_PROGRAM) build/fix-header$(build_exeext) \ | ||
8 | - $(DESTDIR)$(itoolsdir)/fix-header$(build_exeext) ; \ | ||
9 | else :; fi | ||
10 | echo 'SYSTEM_HEADER_DIR="'"$(SYSTEM_HEADER_DIR)"'"' \ | ||
11 | > $(DESTDIR)$(itoolsdatadir)/mkheaders.conf | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/sh_unwind.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/sh_unwind.patch new file mode 100644 index 0000000000..94921636bc --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/sh_unwind.patch | |||
@@ -0,0 +1,18 @@ | |||
1 | Index: gcc-4.2.4/gcc/config/sh/linux-unwind.h | ||
2 | =================================================================== | ||
3 | --- gcc-4.2.4.orig/gcc/config/sh/linux-unwind.h 2008-10-04 00:05:29.434889757 +0200 | ||
4 | +++ gcc-4.2.4/gcc/config/sh/linux-unwind.h 2008-10-04 00:06:02.594883544 +0200 | ||
5 | @@ -26,6 +26,7 @@ | ||
6 | the Free Software Foundation, 51 Franklin Street, Fifth Floor, | ||
7 | Boston, MA 02110-1301, USA. */ | ||
8 | |||
9 | +#ifndef inhibit_libc | ||
10 | /* Do code reading to identify a signal frame, and set the frame | ||
11 | state data appropriately. See unwind-dw2.c for the structs. */ | ||
12 | |||
13 | @@ -251,3 +252,5 @@ | ||
14 | return _URC_NO_REASON; | ||
15 | } | ||
16 | #endif /* defined (__SH5__) */ | ||
17 | + | ||
18 | +#endif /* defined inhibit_libc */ | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/sparseset_rule.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/sparseset_rule.patch new file mode 100644 index 0000000000..7c8113add1 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/sparseset_rule.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | Fix a missing config.h dependency when building sparseset.o to prevent | ||
2 | "conflicting types for 'strsignal'" error, which can intermittently crop | ||
3 | up for high values of make -j. | ||
4 | |||
5 | Thanks to Richard Purdie and Jeff Dike for their help in tracking this | ||
6 | down. | ||
7 | |||
8 | Scott Garman <scott.a.garman@intel.com> 2010-07-13 | ||
9 | diff -urN gcc-4.3.3.orig//gcc/Makefile.in gcc-4.3.3/gcc/Makefile.in | ||
10 | --- gcc-4.3.3.orig//gcc/Makefile.in 2008-12-04 15:00:19.000000000 -0800 | ||
11 | +++ gcc-4.3.3/gcc/Makefile.in 2010-07-13 21:30:01.864681358 -0700 | ||
12 | @@ -1789,7 +1789,7 @@ | ||
13 | $(FLAGS_H) hard-reg-set.h $(BASIC_BLOCK_H) $(OBSTACK_H) | ||
14 | ebitmap.o: ebitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ | ||
15 | $(EBITMAP_H) | ||
16 | -sparseset.o: sparseset.c $(SYSTEM_H) sparseset.h | ||
17 | +sparseset.o: sparseset.c $(CONFIG_H) $(SYSTEM_H) sparseset.h | ||
18 | |||
19 | COLLECT2_OBJS = collect2.o tlink.o intl.o version.o | ||
20 | COLLECT2_LIBS = @COLLECT2_LIBS@ | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/unbreak-armv4t.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/unbreak-armv4t.patch new file mode 100644 index 0000000000..b3399abfdb --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/unbreak-armv4t.patch | |||
@@ -0,0 +1,12 @@ | |||
1 | diff -urN gcc-4.1.1/gcc/config/arm/linux-eabi.h gcc-4.1.1-arm9tdmi/gcc/config/arm/linux-eabi.h | ||
2 | --- gcc-4.1.1/gcc/config/arm/linux-eabi.h 2006-10-22 11:11:49.000000000 -0700 | ||
3 | +++ gcc-4.1.1-arm9tdmi/gcc/config/arm/linux-eabi.h 2006-10-24 21:34:01.000000000 -0700 | ||
4 | @@ -45,7 +45,7 @@ | ||
5 | The ARM10TDMI core is the default for armv5t, so set | ||
6 | SUBTARGET_CPU_DEFAULT to achieve this. */ | ||
7 | #undef SUBTARGET_CPU_DEFAULT | ||
8 | -#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi | ||
9 | +#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi | ||
10 | |||
11 | #undef SUBTARGET_EXTRA_LINK_SPEC | ||
12 | #define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/zecke-no-host-includes.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/zecke-no-host-includes.patch new file mode 100644 index 0000000000..1f3b062feb --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/zecke-no-host-includes.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | Index: gcc-4.0.2/gcc/c-incpath.c | ||
2 | =================================================================== | ||
3 | --- gcc-4.0.2.orig/gcc/c-incpath.c 2005-01-23 16:05:27.000000000 +0100 | ||
4 | +++ gcc-4.0.2/gcc/c-incpath.c 2006-05-15 21:23:02.000000000 +0200 | ||
5 | @@ -350,6 +350,26 @@ | ||
6 | p->construct = 0; | ||
7 | p->user_supplied_p = user_supplied_p; | ||
8 | |||
9 | +#ifdef CROSS_DIRECTORY_STRUCTURE | ||
10 | + /* A common error when cross compiling is including | ||
11 | + host headers. This code below will try to fail fast | ||
12 | + for cross compiling. Currently we consider /usr/include, | ||
13 | + /opt/include and /sw/include as harmful. */ | ||
14 | + { | ||
15 | + /* printf("Adding Path: %s\n", p->name ); */ | ||
16 | + if( strstr(p->name, "/usr/include" ) == p->name ) { | ||
17 | + fprintf(stderr, _("CROSS COMPILE Badness: /usr/include in INCLUDEPATH: %s\n"), p->name); | ||
18 | + abort(); | ||
19 | + } else if( strstr(p->name, "/sw/include") == p->name ) { | ||
20 | + fprintf(stderr, _("CROSS COMPILE Badness: /sw/include in INCLUDEPATH: %s\n"), p->name); | ||
21 | + abort(); | ||
22 | + } else if( strstr(p->name, "/opt/include") == p->name ) { | ||
23 | + fprintf(stderr, _("CROSS COMPILE Badness: /opt/include in INCLUDEPATH: %s\n"), p->name); | ||
24 | + abort(); | ||
25 | + } | ||
26 | + } | ||
27 | +#endif | ||
28 | + | ||
29 | add_cpp_dir_path (p, chain); | ||
30 | } | ||
31 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-4.3.3/zecke-xgcc-cpp.patch b/meta/recipes-devtools/gcc/gcc-4.3.3/zecke-xgcc-cpp.patch new file mode 100644 index 0000000000..a7722cbfc4 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.3.3/zecke-xgcc-cpp.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | upstream: n/a | ||
2 | comment: Use the preprocessor we have just compiled instead the one of | ||
3 | the system. There might be incompabilities between us and them. | ||
4 | |||
5 | Index: gcc-4.3.1/Makefile.in | ||
6 | =================================================================== | ||
7 | --- gcc-4.3.1.orig/Makefile.in 2008-08-19 01:09:56.000000000 -0700 | ||
8 | +++ gcc-4.3.1/Makefile.in 2008-08-19 01:13:27.000000000 -0700 | ||
9 | @@ -204,6 +204,7 @@ | ||
10 | AR="$(AR_FOR_TARGET)"; export AR; \ | ||
11 | AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \ | ||
12 | CC="$(CC_FOR_TARGET)"; export CC; \ | ||
13 | + CPP="$(CC_FOR_TARGET) -E"; export CPP; \ | ||
14 | CFLAGS="$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ | ||
15 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
16 | CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ | ||
17 | Index: gcc-4.3.1/Makefile.tpl | ||
18 | =================================================================== | ||
19 | --- gcc-4.3.1.orig/Makefile.tpl 2008-08-21 00:07:58.000000000 -0700 | ||
20 | +++ gcc-4.3.1/Makefile.tpl 2008-08-21 00:09:52.000000000 -0700 | ||
21 | @@ -223,6 +223,7 @@ | ||
22 | AR="$(AR_FOR_TARGET)"; export AR; \ | ||
23 | AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \ | ||
24 | CC="$(CC_FOR_TARGET)"; export CC; \ | ||
25 | + CPP="$(CC_FOR_TARGET) -E"; export CPP; \ | ||
26 | CFLAGS="$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ | ||
27 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
28 | CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0.inc b/meta/recipes-devtools/gcc/gcc-4.5.0.inc new file mode 100644 index 0000000000..6ca2f98bc8 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0.inc | |||
@@ -0,0 +1,81 @@ | |||
1 | require gcc-common.inc | ||
2 | LICENSE = "GPLv3" | ||
3 | |||
4 | DEPENDS =+ "mpfr gmp libmpc elfutils" | ||
5 | NATIVEDEPS = "mpfr-native gmp-native gettext-native libmpc-native elfutils-native" | ||
6 | |||
7 | SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \ | ||
8 | file://gcc-4.5.0_to_svn_162697.patch.bz2 \ | ||
9 | file://gcc_revert_base_version_to_4.5.0.patch \ | ||
10 | file://gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \ | ||
11 | file://100-uclibc-conf.patch \ | ||
12 | file://gcc-uclibc-locale-ctype_touplow_t.patch \ | ||
13 | file://cache-amnesia.patch \ | ||
14 | file://gcc-flags-for-build.patch \ | ||
15 | file://libstdc++-emit-__cxa_end_cleanup-in-text.patch \ | ||
16 | file://arm-bswapsi2.patch \ | ||
17 | file://gcc-pr43698-arm-rev-instr.patch \ | ||
18 | \ | ||
19 | file://fedora/gcc43-c++-builtin-redecl.patch;striplevel=0 \ | ||
20 | file://fedora/gcc43-ia64-libunwind.patch;striplevel=0 \ | ||
21 | file://fedora/gcc43-java-nomulti.patch;striplevel=0 \ | ||
22 | file://fedora/gcc43-ppc32-retaddr.patch;striplevel=0 \ | ||
23 | file://fedora/gcc43-pr32139.patch;striplevel=0 \ | ||
24 | file://fedora/gcc43-pr33763.patch;striplevel=0 \ | ||
25 | file://fedora/gcc43-rh330771.patch;striplevel=0 \ | ||
26 | file://fedora/gcc43-rh341221.patch;striplevel=0 \ | ||
27 | file://fedora/gcc43-java-debug-iface-type.patch;striplevel=0 \ | ||
28 | file://fedora/gcc43-i386-libgomp.patch;striplevel=0 \ | ||
29 | file://103-uclibc-conf-noupstream.patch \ | ||
30 | file://200-uclibc-locale.patch \ | ||
31 | file://203-uclibc-locale-no__x.patch;striplevel=1 \ | ||
32 | file://204-uclibc-locale-wchar_fix.patch;striplevel=1 \ | ||
33 | file://205-uclibc-locale-update.patch;striplevel=1 \ | ||
34 | file://301-missing-execinfo_h.patch \ | ||
35 | file://302-c99-snprintf.patch \ | ||
36 | file://303-c99-complex-ugly-hack.patch \ | ||
37 | file://304-index_macro.patch \ | ||
38 | file://305-libmudflap-susv3-legacy.patch \ | ||
39 | file://306-libstdc++-namespace.patch \ | ||
40 | file://740-sh-pr24836.patch \ | ||
41 | file://800-arm-bigendian.patch \ | ||
42 | file://904-flatten-switch-stmt-00.patch \ | ||
43 | file://arm-nolibfloat.patch \ | ||
44 | file://arm-softfloat.patch \ | ||
45 | file://zecke-xgcc-cpp.patch \ | ||
46 | file://gcc-poison-system-directories.patch \ | ||
47 | file://gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \ | ||
48 | file://64bithack.patch \ | ||
49 | file://optional_libstdc.patch \ | ||
50 | " | ||
51 | |||
52 | SRC_URI_append_sh3 = " file://sh3-installfix-fixheaders.patch;patch=1 " | ||
53 | |||
54 | # Language Overrides | ||
55 | FORTRAN = "" | ||
56 | JAVA = "" | ||
57 | |||
58 | #EXTRA_OECONF_BASE = " --enable-cheaders=c_std \ | ||
59 | # --enable-libssp \ | ||
60 | # --disable-bootstrap \ | ||
61 | # --disable-libgomp \ | ||
62 | # --disable-libmudflap" | ||
63 | EXTRA_OECONF_BASE = " --enable-lto \ | ||
64 | --enable-libssp \ | ||
65 | --disable-bootstrap \ | ||
66 | --disable-libgomp \ | ||
67 | --disable-libmudflap \ | ||
68 | --enable-cheaders=c_global " | ||
69 | |||
70 | EXTRA_OECONF_INITIAL = "--disable-libmudflap \ | ||
71 | --disable-libgomp \ | ||
72 | --disable-libssp \ | ||
73 | --enable-decimal-float=no" | ||
74 | |||
75 | EXTRA_OECONF_INTERMEDIATE = "--disable-libmudflap \ | ||
76 | --disable-libgomp \ | ||
77 | --disable-libssp" | ||
78 | |||
79 | EXTRA_OECONF_append_linux-uclibc = " --disable-decimal-float " | ||
80 | EXTRA_OECONF_append_linux-uclibceabi = " --disable-decimal-float " | ||
81 | EXTRA_OECONF_append_linux-uclibcspe = " --disable-decimal-float " | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/100-uclibc-conf.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/100-uclibc-conf.patch new file mode 100644 index 0000000000..0b799607e8 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/100-uclibc-conf.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | Index: gcc-4.3.1/contrib/regression/objs-gcc.sh | ||
2 | =================================================================== | ||
3 | --- gcc-4.3.1.orig/contrib/regression/objs-gcc.sh 2007-12-24 15:18:57.000000000 -0800 | ||
4 | +++ gcc-4.3.1/contrib/regression/objs-gcc.sh 2008-08-16 01:15:12.000000000 -0700 | ||
5 | @@ -105,6 +105,10 @@ | ||
6 | then | ||
7 | make all-gdb all-dejagnu all-ld || exit 1 | ||
8 | make install-gdb install-dejagnu install-ld || exit 1 | ||
9 | +elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ] | ||
10 | + then | ||
11 | + make all-gdb all-dejagnu all-ld || exit 1 | ||
12 | + make install-gdb install-dejagnu install-ld || exit 1 | ||
13 | elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then | ||
14 | make bootstrap || exit 1 | ||
15 | make install || exit 1 | ||
16 | Index: gcc-4.3.1/libjava/classpath/ltconfig | ||
17 | =================================================================== | ||
18 | --- gcc-4.3.1.orig/libjava/classpath/ltconfig 2007-06-03 16:18:43.000000000 -0700 | ||
19 | +++ gcc-4.3.1/libjava/classpath/ltconfig 2008-08-16 01:15:12.000000000 -0700 | ||
20 | @@ -603,7 +603,7 @@ | ||
21 | |||
22 | # Transform linux* to *-*-linux-gnu*, to support old configure scripts. | ||
23 | case $host_os in | ||
24 | -linux-gnu*) ;; | ||
25 | +linux-gnu*|linux-uclibc*) ;; | ||
26 | linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` | ||
27 | esac | ||
28 | |||
29 | @@ -1251,7 +1251,7 @@ | ||
30 | ;; | ||
31 | |||
32 | # This must be Linux ELF. | ||
33 | -linux-gnu*) | ||
34 | +linux*) | ||
35 | version_type=linux | ||
36 | need_lib_prefix=no | ||
37 | need_version=no | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/103-uclibc-conf-noupstream.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/103-uclibc-conf-noupstream.patch new file mode 100644 index 0000000000..f9d8ad9252 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/103-uclibc-conf-noupstream.patch | |||
@@ -0,0 +1,15 @@ | |||
1 | Corrects sub machine arch corectly | ||
2 | |||
3 | Index: gcc-4.5.0/gcc/config.gcc | ||
4 | =================================================================== | ||
5 | --- gcc-4.5.0.orig/gcc/config.gcc 2010-06-25 10:17:43.809880847 -0700 | ||
6 | +++ gcc-4.5.0/gcc/config.gcc 2010-06-25 10:38:09.689882136 -0700 | ||
7 | @@ -2171,7 +2171,7 @@ | ||
8 | ;; | ||
9 | sh-*-elf* | sh[12346l]*-*-elf* | \ | ||
10 | sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \ | ||
11 | - sh-*-linux* | sh[2346lbe]*-*-linux* | \ | ||
12 | + sh*-*-linux* | sh[2346lbe]*-*-linux* | \ | ||
13 | sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \ | ||
14 | sh64-*-netbsd* | sh64l*-*-netbsd*) | ||
15 | tmake_file="${tmake_file} sh/t-sh sh/t-elf" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/200-uclibc-locale.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/200-uclibc-locale.patch new file mode 100644 index 0000000000..32de11fc74 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/200-uclibc-locale.patch | |||
@@ -0,0 +1,2840 @@ | |||
1 | Index: gcc-4.5.0/libstdc++-v3/acinclude.m4 | ||
2 | =================================================================== | ||
3 | --- gcc-4.5.0.orig/libstdc++-v3/acinclude.m4 2010-04-05 18:27:44.000000000 -0700 | ||
4 | +++ gcc-4.5.0/libstdc++-v3/acinclude.m4 2010-06-25 10:42:34.913881064 -0700 | ||
5 | @@ -1703,7 +1703,7 @@ | ||
6 | AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [ | ||
7 | GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@], | ||
8 | [use MODEL for target locale package], | ||
9 | - [permit generic|gnu|ieee_1003.1-2001|yes|no|auto]) | ||
10 | + [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto]) | ||
11 | |||
12 | # Deal with gettext issues. Default to not using it (=no) until we detect | ||
13 | # support for it later. Let the user turn it off via --e/d, but let that | ||
14 | @@ -1724,6 +1724,9 @@ | ||
15 | # Default to "generic". | ||
16 | if test $enable_clocale_flag = auto; then | ||
17 | case ${target_os} in | ||
18 | + *-uclibc*) | ||
19 | + enable_clocale_flag=uclibc | ||
20 | + ;; | ||
21 | linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) | ||
22 | enable_clocale_flag=gnu | ||
23 | ;; | ||
24 | @@ -1895,6 +1898,40 @@ | ||
25 | CTIME_CC=config/locale/generic/time_members.cc | ||
26 | CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h | ||
27 | ;; | ||
28 | + uclibc) | ||
29 | + AC_MSG_RESULT(uclibc) | ||
30 | + | ||
31 | + # Declare intention to use gettext, and add support for specific | ||
32 | + # languages. | ||
33 | + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT | ||
34 | + ALL_LINGUAS="de fr" | ||
35 | + | ||
36 | + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. | ||
37 | + AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no) | ||
38 | + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then | ||
39 | + USE_NLS=yes | ||
40 | + fi | ||
41 | + # Export the build objects. | ||
42 | + for ling in $ALL_LINGUAS; do \ | ||
43 | + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ | ||
44 | + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ | ||
45 | + done | ||
46 | + AC_SUBST(glibcxx_MOFILES) | ||
47 | + AC_SUBST(glibcxx_POFILES) | ||
48 | + | ||
49 | + CLOCALE_H=config/locale/uclibc/c_locale.h | ||
50 | + CLOCALE_CC=config/locale/uclibc/c_locale.cc | ||
51 | + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc | ||
52 | + CCOLLATE_CC=config/locale/uclibc/collate_members.cc | ||
53 | + CCTYPE_CC=config/locale/uclibc/ctype_members.cc | ||
54 | + CMESSAGES_H=config/locale/uclibc/messages_members.h | ||
55 | + CMESSAGES_CC=config/locale/uclibc/messages_members.cc | ||
56 | + CMONEY_CC=config/locale/uclibc/monetary_members.cc | ||
57 | + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc | ||
58 | + CTIME_H=config/locale/uclibc/time_members.h | ||
59 | + CTIME_CC=config/locale/uclibc/time_members.cc | ||
60 | + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h | ||
61 | + ;; | ||
62 | esac | ||
63 | |||
64 | # This is where the testsuite looks for locale catalogs, using the | ||
65 | Index: gcc-4.5.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h | ||
66 | =================================================================== | ||
67 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
68 | +++ gcc-4.5.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2010-06-25 10:42:34.913881064 -0700 | ||
69 | @@ -0,0 +1,63 @@ | ||
70 | +// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*- | ||
71 | + | ||
72 | +// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. | ||
73 | +// | ||
74 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
75 | +// software; you can redistribute it and/or modify it under the | ||
76 | +// terms of the GNU General Public License as published by the | ||
77 | +// Free Software Foundation; either version 2, or (at your option) | ||
78 | +// any later version. | ||
79 | + | ||
80 | +// This library is distributed in the hope that it will be useful, | ||
81 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
82 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
83 | +// GNU General Public License for more details. | ||
84 | + | ||
85 | +// You should have received a copy of the GNU General Public License along | ||
86 | +// with this library; see the file COPYING. If not, write to the Free | ||
87 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
88 | +// USA. | ||
89 | + | ||
90 | +// As a special exception, you may use this file as part of a free software | ||
91 | +// library without restriction. Specifically, if other files instantiate | ||
92 | +// templates or use macros or inline functions from this file, or you compile | ||
93 | +// this file and link it with other files to produce an executable, this | ||
94 | +// file does not by itself cause the resulting executable to be covered by | ||
95 | +// the GNU General Public License. This exception does not however | ||
96 | +// invalidate any other reasons why the executable file might be covered by | ||
97 | +// the GNU General Public License. | ||
98 | + | ||
99 | +// Written by Jakub Jelinek <jakub@redhat.com> | ||
100 | + | ||
101 | +#include <bits/c++config.h> | ||
102 | +#include <clocale> | ||
103 | + | ||
104 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
105 | +#warning clean this up | ||
106 | +#endif | ||
107 | + | ||
108 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
109 | + | ||
110 | +extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l; | ||
111 | +extern "C" __typeof(strcoll_l) __strcoll_l; | ||
112 | +extern "C" __typeof(strftime_l) __strftime_l; | ||
113 | +extern "C" __typeof(strtod_l) __strtod_l; | ||
114 | +extern "C" __typeof(strtof_l) __strtof_l; | ||
115 | +extern "C" __typeof(strtold_l) __strtold_l; | ||
116 | +extern "C" __typeof(strxfrm_l) __strxfrm_l; | ||
117 | +extern "C" __typeof(newlocale) __newlocale; | ||
118 | +extern "C" __typeof(freelocale) __freelocale; | ||
119 | +extern "C" __typeof(duplocale) __duplocale; | ||
120 | +extern "C" __typeof(uselocale) __uselocale; | ||
121 | + | ||
122 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
123 | +extern "C" __typeof(iswctype_l) __iswctype_l; | ||
124 | +extern "C" __typeof(towlower_l) __towlower_l; | ||
125 | +extern "C" __typeof(towupper_l) __towupper_l; | ||
126 | +extern "C" __typeof(wcscoll_l) __wcscoll_l; | ||
127 | +extern "C" __typeof(wcsftime_l) __wcsftime_l; | ||
128 | +extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l; | ||
129 | +extern "C" __typeof(wctype_l) __wctype_l; | ||
130 | +#endif | ||
131 | + | ||
132 | +#endif // GLIBC 2.3 and later | ||
133 | Index: gcc-4.5.0/libstdc++-v3/config/locale/uclibc/c_locale.cc | ||
134 | =================================================================== | ||
135 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
136 | +++ gcc-4.5.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2010-06-25 10:42:34.913881064 -0700 | ||
137 | @@ -0,0 +1,160 @@ | ||
138 | +// Wrapper for underlying C-language localization -*- C++ -*- | ||
139 | + | ||
140 | +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. | ||
141 | +// | ||
142 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
143 | +// software; you can redistribute it and/or modify it under the | ||
144 | +// terms of the GNU General Public License as published by the | ||
145 | +// Free Software Foundation; either version 2, or (at your option) | ||
146 | +// any later version. | ||
147 | + | ||
148 | +// This library is distributed in the hope that it will be useful, | ||
149 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
150 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
151 | +// GNU General Public License for more details. | ||
152 | + | ||
153 | +// You should have received a copy of the GNU General Public License along | ||
154 | +// with this library; see the file COPYING. If not, write to the Free | ||
155 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
156 | +// USA. | ||
157 | + | ||
158 | +// As a special exception, you may use this file as part of a free software | ||
159 | +// library without restriction. Specifically, if other files instantiate | ||
160 | +// templates or use macros or inline functions from this file, or you compile | ||
161 | +// this file and link it with other files to produce an executable, this | ||
162 | +// file does not by itself cause the resulting executable to be covered by | ||
163 | +// the GNU General Public License. This exception does not however | ||
164 | +// invalidate any other reasons why the executable file might be covered by | ||
165 | +// the GNU General Public License. | ||
166 | + | ||
167 | +// | ||
168 | +// ISO C++ 14882: 22.8 Standard locale categories. | ||
169 | +// | ||
170 | + | ||
171 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
172 | + | ||
173 | +#include <cerrno> // For errno | ||
174 | +#include <locale> | ||
175 | +#include <stdexcept> | ||
176 | +#include <langinfo.h> | ||
177 | +#include <bits/c++locale_internal.h> | ||
178 | + | ||
179 | +#ifndef __UCLIBC_HAS_XLOCALE__ | ||
180 | +#define __strtol_l(S, E, B, L) strtol((S), (E), (B)) | ||
181 | +#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B)) | ||
182 | +#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B)) | ||
183 | +#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B)) | ||
184 | +#define __strtof_l(S, E, L) strtof((S), (E)) | ||
185 | +#define __strtod_l(S, E, L) strtod((S), (E)) | ||
186 | +#define __strtold_l(S, E, L) strtold((S), (E)) | ||
187 | +#warning should dummy __newlocale check for C|POSIX ? | ||
188 | +#define __newlocale(a, b, c) NULL | ||
189 | +#define __freelocale(a) ((void)0) | ||
190 | +#define __duplocale(a) __c_locale() | ||
191 | +#endif | ||
192 | + | ||
193 | +namespace std | ||
194 | +{ | ||
195 | + template<> | ||
196 | + void | ||
197 | + __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, | ||
198 | + const __c_locale& __cloc) | ||
199 | + { | ||
200 | + if (!(__err & ios_base::failbit)) | ||
201 | + { | ||
202 | + char* __sanity; | ||
203 | + errno = 0; | ||
204 | + float __f = __strtof_l(__s, &__sanity, __cloc); | ||
205 | + if (__sanity != __s && errno != ERANGE) | ||
206 | + __v = __f; | ||
207 | + else | ||
208 | + __err |= ios_base::failbit; | ||
209 | + } | ||
210 | + } | ||
211 | + | ||
212 | + template<> | ||
213 | + void | ||
214 | + __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, | ||
215 | + const __c_locale& __cloc) | ||
216 | + { | ||
217 | + if (!(__err & ios_base::failbit)) | ||
218 | + { | ||
219 | + char* __sanity; | ||
220 | + errno = 0; | ||
221 | + double __d = __strtod_l(__s, &__sanity, __cloc); | ||
222 | + if (__sanity != __s && errno != ERANGE) | ||
223 | + __v = __d; | ||
224 | + else | ||
225 | + __err |= ios_base::failbit; | ||
226 | + } | ||
227 | + } | ||
228 | + | ||
229 | + template<> | ||
230 | + void | ||
231 | + __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err, | ||
232 | + const __c_locale& __cloc) | ||
233 | + { | ||
234 | + if (!(__err & ios_base::failbit)) | ||
235 | + { | ||
236 | + char* __sanity; | ||
237 | + errno = 0; | ||
238 | + long double __ld = __strtold_l(__s, &__sanity, __cloc); | ||
239 | + if (__sanity != __s && errno != ERANGE) | ||
240 | + __v = __ld; | ||
241 | + else | ||
242 | + __err |= ios_base::failbit; | ||
243 | + } | ||
244 | + } | ||
245 | + | ||
246 | + void | ||
247 | + locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, | ||
248 | + __c_locale __old) | ||
249 | + { | ||
250 | + __cloc = __newlocale(1 << LC_ALL, __s, __old); | ||
251 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
252 | + if (!__cloc) | ||
253 | + { | ||
254 | + // This named locale is not supported by the underlying OS. | ||
255 | + __throw_runtime_error(__N("locale::facet::_S_create_c_locale " | ||
256 | + "name not valid")); | ||
257 | + } | ||
258 | +#endif | ||
259 | + } | ||
260 | + | ||
261 | + void | ||
262 | + locale::facet::_S_destroy_c_locale(__c_locale& __cloc) | ||
263 | + { | ||
264 | + if (_S_get_c_locale() != __cloc) | ||
265 | + __freelocale(__cloc); | ||
266 | + } | ||
267 | + | ||
268 | + __c_locale | ||
269 | + locale::facet::_S_clone_c_locale(__c_locale& __cloc) | ||
270 | + { return __duplocale(__cloc); } | ||
271 | +} // namespace std | ||
272 | + | ||
273 | +namespace __gnu_cxx | ||
274 | +{ | ||
275 | + const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] = | ||
276 | + { | ||
277 | + "LC_CTYPE", | ||
278 | + "LC_NUMERIC", | ||
279 | + "LC_TIME", | ||
280 | + "LC_COLLATE", | ||
281 | + "LC_MONETARY", | ||
282 | + "LC_MESSAGES", | ||
283 | +#if _GLIBCXX_NUM_CATEGORIES != 0 | ||
284 | + "LC_PAPER", | ||
285 | + "LC_NAME", | ||
286 | + "LC_ADDRESS", | ||
287 | + "LC_TELEPHONE", | ||
288 | + "LC_MEASUREMENT", | ||
289 | + "LC_IDENTIFICATION" | ||
290 | +#endif | ||
291 | + }; | ||
292 | +} | ||
293 | + | ||
294 | +namespace std | ||
295 | +{ | ||
296 | + const char* const* const locale::_S_categories = __gnu_cxx::category_names; | ||
297 | +} // namespace std | ||
298 | Index: gcc-4.5.0/libstdc++-v3/config/locale/uclibc/c_locale.h | ||
299 | =================================================================== | ||
300 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
301 | +++ gcc-4.5.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2010-06-25 10:42:34.913881064 -0700 | ||
302 | @@ -0,0 +1,117 @@ | ||
303 | +// Wrapper for underlying C-language localization -*- C++ -*- | ||
304 | + | ||
305 | +// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. | ||
306 | +// | ||
307 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
308 | +// software; you can redistribute it and/or modify it under the | ||
309 | +// terms of the GNU General Public License as published by the | ||
310 | +// Free Software Foundation; either version 2, or (at your option) | ||
311 | +// any later version. | ||
312 | + | ||
313 | +// This library is distributed in the hope that it will be useful, | ||
314 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
315 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
316 | +// GNU General Public License for more details. | ||
317 | + | ||
318 | +// You should have received a copy of the GNU General Public License along | ||
319 | +// with this library; see the file COPYING. If not, write to the Free | ||
320 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
321 | +// USA. | ||
322 | + | ||
323 | +// As a special exception, you may use this file as part of a free software | ||
324 | +// library without restriction. Specifically, if other files instantiate | ||
325 | +// templates or use macros or inline functions from this file, or you compile | ||
326 | +// this file and link it with other files to produce an executable, this | ||
327 | +// file does not by itself cause the resulting executable to be covered by | ||
328 | +// the GNU General Public License. This exception does not however | ||
329 | +// invalidate any other reasons why the executable file might be covered by | ||
330 | +// the GNU General Public License. | ||
331 | + | ||
332 | +// | ||
333 | +// ISO C++ 14882: 22.8 Standard locale categories. | ||
334 | +// | ||
335 | + | ||
336 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
337 | + | ||
338 | +#ifndef _C_LOCALE_H | ||
339 | +#define _C_LOCALE_H 1 | ||
340 | + | ||
341 | +#pragma GCC system_header | ||
342 | + | ||
343 | +#include <cstring> // get std::strlen | ||
344 | +#include <cstdio> // get std::snprintf or std::sprintf | ||
345 | +#include <clocale> | ||
346 | +#include <langinfo.h> // For codecvt | ||
347 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
348 | +#warning fix this | ||
349 | +#endif | ||
350 | +#ifdef __UCLIBC_HAS_LOCALE__ | ||
351 | +#include <iconv.h> // For codecvt using iconv, iconv_t | ||
352 | +#endif | ||
353 | +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ | ||
354 | +#include <libintl.h> // For messages | ||
355 | +#endif | ||
356 | + | ||
357 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
358 | +#warning what is _GLIBCXX_C_LOCALE_GNU for | ||
359 | +#endif | ||
360 | +#define _GLIBCXX_C_LOCALE_GNU 1 | ||
361 | + | ||
362 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
363 | +#warning fix categories | ||
364 | +#endif | ||
365 | +// #define _GLIBCXX_NUM_CATEGORIES 6 | ||
366 | +#define _GLIBCXX_NUM_CATEGORIES 0 | ||
367 | + | ||
368 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
369 | +namespace __gnu_cxx | ||
370 | +{ | ||
371 | + extern "C" __typeof(uselocale) __uselocale; | ||
372 | +} | ||
373 | +#endif | ||
374 | + | ||
375 | +namespace std | ||
376 | +{ | ||
377 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
378 | + typedef __locale_t __c_locale; | ||
379 | +#else | ||
380 | + typedef int* __c_locale; | ||
381 | +#endif | ||
382 | + | ||
383 | + // Convert numeric value of type _Tv to string and return length of | ||
384 | + // string. If snprintf is available use it, otherwise fall back to | ||
385 | + // the unsafe sprintf which, in general, can be dangerous and should | ||
386 | + // be avoided. | ||
387 | + template<typename _Tv> | ||
388 | + int | ||
389 | + __convert_from_v(char* __out, | ||
390 | + const int __size __attribute__ ((__unused__)), | ||
391 | + const char* __fmt, | ||
392 | +#ifdef __UCLIBC_HAS_XCLOCALE__ | ||
393 | + _Tv __v, const __c_locale& __cloc, int __prec) | ||
394 | + { | ||
395 | + __c_locale __old = __gnu_cxx::__uselocale(__cloc); | ||
396 | +#else | ||
397 | + _Tv __v, const __c_locale&, int __prec) | ||
398 | + { | ||
399 | +# ifdef __UCLIBC_HAS_LOCALE__ | ||
400 | + char* __old = std::setlocale(LC_ALL, NULL); | ||
401 | + char* __sav = new char[std::strlen(__old) + 1]; | ||
402 | + std::strcpy(__sav, __old); | ||
403 | + std::setlocale(LC_ALL, "C"); | ||
404 | +# endif | ||
405 | +#endif | ||
406 | + | ||
407 | + const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); | ||
408 | + | ||
409 | +#ifdef __UCLIBC_HAS_XCLOCALE__ | ||
410 | + __gnu_cxx::__uselocale(__old); | ||
411 | +#elif defined __UCLIBC_HAS_LOCALE__ | ||
412 | + std::setlocale(LC_ALL, __sav); | ||
413 | + delete [] __sav; | ||
414 | +#endif | ||
415 | + return __ret; | ||
416 | + } | ||
417 | +} | ||
418 | + | ||
419 | +#endif | ||
420 | Index: gcc-4.5.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc | ||
421 | =================================================================== | ||
422 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
423 | +++ gcc-4.5.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2010-06-25 10:42:34.913881064 -0700 | ||
424 | @@ -0,0 +1,308 @@ | ||
425 | +// std::codecvt implementation details, GNU version -*- C++ -*- | ||
426 | + | ||
427 | +// Copyright (C) 2002, 2003 Free Software Foundation, Inc. | ||
428 | +// | ||
429 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
430 | +// software; you can redistribute it and/or modify it under the | ||
431 | +// terms of the GNU General Public License as published by the | ||
432 | +// Free Software Foundation; either version 2, or (at your option) | ||
433 | +// any later version. | ||
434 | + | ||
435 | +// This library is distributed in the hope that it will be useful, | ||
436 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
437 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
438 | +// GNU General Public License for more details. | ||
439 | + | ||
440 | +// You should have received a copy of the GNU General Public License along | ||
441 | +// with this library; see the file COPYING. If not, write to the Free | ||
442 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
443 | +// USA. | ||
444 | + | ||
445 | +// As a special exception, you may use this file as part of a free software | ||
446 | +// library without restriction. Specifically, if other files instantiate | ||
447 | +// templates or use macros or inline functions from this file, or you compile | ||
448 | +// this file and link it with other files to produce an executable, this | ||
449 | +// file does not by itself cause the resulting executable to be covered by | ||
450 | +// the GNU General Public License. This exception does not however | ||
451 | +// invalidate any other reasons why the executable file might be covered by | ||
452 | +// the GNU General Public License. | ||
453 | + | ||
454 | +// | ||
455 | +// ISO C++ 14882: 22.2.1.5 - Template class codecvt | ||
456 | +// | ||
457 | + | ||
458 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
459 | + | ||
460 | +#include <locale> | ||
461 | +#include <cstdlib> // For MB_CUR_MAX | ||
462 | +#include <climits> // For MB_LEN_MAX | ||
463 | +#include <bits/c++locale_internal.h> | ||
464 | + | ||
465 | +namespace std | ||
466 | +{ | ||
467 | + // Specializations. | ||
468 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
469 | + codecvt_base::result | ||
470 | + codecvt<wchar_t, char, mbstate_t>:: | ||
471 | + do_out(state_type& __state, const intern_type* __from, | ||
472 | + const intern_type* __from_end, const intern_type*& __from_next, | ||
473 | + extern_type* __to, extern_type* __to_end, | ||
474 | + extern_type*& __to_next) const | ||
475 | + { | ||
476 | + result __ret = ok; | ||
477 | + state_type __tmp_state(__state); | ||
478 | + | ||
479 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
480 | + __c_locale __old = __uselocale(_M_c_locale_codecvt); | ||
481 | +#endif | ||
482 | + | ||
483 | + // wcsnrtombs is *very* fast but stops if encounters NUL characters: | ||
484 | + // in case we fall back to wcrtomb and then continue, in a loop. | ||
485 | + // NB: wcsnrtombs is a GNU extension | ||
486 | + for (__from_next = __from, __to_next = __to; | ||
487 | + __from_next < __from_end && __to_next < __to_end | ||
488 | + && __ret == ok;) | ||
489 | + { | ||
490 | + const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0', | ||
491 | + __from_end - __from_next); | ||
492 | + if (!__from_chunk_end) | ||
493 | + __from_chunk_end = __from_end; | ||
494 | + | ||
495 | + __from = __from_next; | ||
496 | + const size_t __conv = wcsnrtombs(__to_next, &__from_next, | ||
497 | + __from_chunk_end - __from_next, | ||
498 | + __to_end - __to_next, &__state); | ||
499 | + if (__conv == static_cast<size_t>(-1)) | ||
500 | + { | ||
501 | + // In case of error, in order to stop at the exact place we | ||
502 | + // have to start again from the beginning with a series of | ||
503 | + // wcrtomb. | ||
504 | + for (; __from < __from_next; ++__from) | ||
505 | + __to_next += wcrtomb(__to_next, *__from, &__tmp_state); | ||
506 | + __state = __tmp_state; | ||
507 | + __ret = error; | ||
508 | + } | ||
509 | + else if (__from_next && __from_next < __from_chunk_end) | ||
510 | + { | ||
511 | + __to_next += __conv; | ||
512 | + __ret = partial; | ||
513 | + } | ||
514 | + else | ||
515 | + { | ||
516 | + __from_next = __from_chunk_end; | ||
517 | + __to_next += __conv; | ||
518 | + } | ||
519 | + | ||
520 | + if (__from_next < __from_end && __ret == ok) | ||
521 | + { | ||
522 | + extern_type __buf[MB_LEN_MAX]; | ||
523 | + __tmp_state = __state; | ||
524 | + const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state); | ||
525 | + if (__conv > static_cast<size_t>(__to_end - __to_next)) | ||
526 | + __ret = partial; | ||
527 | + else | ||
528 | + { | ||
529 | + memcpy(__to_next, __buf, __conv); | ||
530 | + __state = __tmp_state; | ||
531 | + __to_next += __conv; | ||
532 | + ++__from_next; | ||
533 | + } | ||
534 | + } | ||
535 | + } | ||
536 | + | ||
537 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
538 | + __uselocale(__old); | ||
539 | +#endif | ||
540 | + | ||
541 | + return __ret; | ||
542 | + } | ||
543 | + | ||
544 | + codecvt_base::result | ||
545 | + codecvt<wchar_t, char, mbstate_t>:: | ||
546 | + do_in(state_type& __state, const extern_type* __from, | ||
547 | + const extern_type* __from_end, const extern_type*& __from_next, | ||
548 | + intern_type* __to, intern_type* __to_end, | ||
549 | + intern_type*& __to_next) const | ||
550 | + { | ||
551 | + result __ret = ok; | ||
552 | + state_type __tmp_state(__state); | ||
553 | + | ||
554 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
555 | + __c_locale __old = __uselocale(_M_c_locale_codecvt); | ||
556 | +#endif | ||
557 | + | ||
558 | + // mbsnrtowcs is *very* fast but stops if encounters NUL characters: | ||
559 | + // in case we store a L'\0' and then continue, in a loop. | ||
560 | + // NB: mbsnrtowcs is a GNU extension | ||
561 | + for (__from_next = __from, __to_next = __to; | ||
562 | + __from_next < __from_end && __to_next < __to_end | ||
563 | + && __ret == ok;) | ||
564 | + { | ||
565 | + const extern_type* __from_chunk_end; | ||
566 | + __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0', | ||
567 | + __from_end | ||
568 | + - __from_next)); | ||
569 | + if (!__from_chunk_end) | ||
570 | + __from_chunk_end = __from_end; | ||
571 | + | ||
572 | + __from = __from_next; | ||
573 | + size_t __conv = mbsnrtowcs(__to_next, &__from_next, | ||
574 | + __from_chunk_end - __from_next, | ||
575 | + __to_end - __to_next, &__state); | ||
576 | + if (__conv == static_cast<size_t>(-1)) | ||
577 | + { | ||
578 | + // In case of error, in order to stop at the exact place we | ||
579 | + // have to start again from the beginning with a series of | ||
580 | + // mbrtowc. | ||
581 | + for (;; ++__to_next, __from += __conv) | ||
582 | + { | ||
583 | + __conv = mbrtowc(__to_next, __from, __from_end - __from, | ||
584 | + &__tmp_state); | ||
585 | + if (__conv == static_cast<size_t>(-1) | ||
586 | + || __conv == static_cast<size_t>(-2)) | ||
587 | + break; | ||
588 | + } | ||
589 | + __from_next = __from; | ||
590 | + __state = __tmp_state; | ||
591 | + __ret = error; | ||
592 | + } | ||
593 | + else if (__from_next && __from_next < __from_chunk_end) | ||
594 | + { | ||
595 | + // It is unclear what to return in this case (see DR 382). | ||
596 | + __to_next += __conv; | ||
597 | + __ret = partial; | ||
598 | + } | ||
599 | + else | ||
600 | + { | ||
601 | + __from_next = __from_chunk_end; | ||
602 | + __to_next += __conv; | ||
603 | + } | ||
604 | + | ||
605 | + if (__from_next < __from_end && __ret == ok) | ||
606 | + { | ||
607 | + if (__to_next < __to_end) | ||
608 | + { | ||
609 | + // XXX Probably wrong for stateful encodings | ||
610 | + __tmp_state = __state; | ||
611 | + ++__from_next; | ||
612 | + *__to_next++ = L'\0'; | ||
613 | + } | ||
614 | + else | ||
615 | + __ret = partial; | ||
616 | + } | ||
617 | + } | ||
618 | + | ||
619 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
620 | + __uselocale(__old); | ||
621 | +#endif | ||
622 | + | ||
623 | + return __ret; | ||
624 | + } | ||
625 | + | ||
626 | + int | ||
627 | + codecvt<wchar_t, char, mbstate_t>:: | ||
628 | + do_encoding() const throw() | ||
629 | + { | ||
630 | + // XXX This implementation assumes that the encoding is | ||
631 | + // stateless and is either single-byte or variable-width. | ||
632 | + int __ret = 0; | ||
633 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
634 | + __c_locale __old = __uselocale(_M_c_locale_codecvt); | ||
635 | +#endif | ||
636 | + if (MB_CUR_MAX == 1) | ||
637 | + __ret = 1; | ||
638 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
639 | + __uselocale(__old); | ||
640 | +#endif | ||
641 | + return __ret; | ||
642 | + } | ||
643 | + | ||
644 | + int | ||
645 | + codecvt<wchar_t, char, mbstate_t>:: | ||
646 | + do_max_length() const throw() | ||
647 | + { | ||
648 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
649 | + __c_locale __old = __uselocale(_M_c_locale_codecvt); | ||
650 | +#endif | ||
651 | + // XXX Probably wrong for stateful encodings. | ||
652 | + int __ret = MB_CUR_MAX; | ||
653 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
654 | + __uselocale(__old); | ||
655 | +#endif | ||
656 | + return __ret; | ||
657 | + } | ||
658 | + | ||
659 | + int | ||
660 | + codecvt<wchar_t, char, mbstate_t>:: | ||
661 | + do_length(state_type& __state, const extern_type* __from, | ||
662 | + const extern_type* __end, size_t __max) const | ||
663 | + { | ||
664 | + int __ret = 0; | ||
665 | + state_type __tmp_state(__state); | ||
666 | + | ||
667 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
668 | + __c_locale __old = __uselocale(_M_c_locale_codecvt); | ||
669 | +#endif | ||
670 | + | ||
671 | + // mbsnrtowcs is *very* fast but stops if encounters NUL characters: | ||
672 | + // in case we advance past it and then continue, in a loop. | ||
673 | + // NB: mbsnrtowcs is a GNU extension | ||
674 | + | ||
675 | + // A dummy internal buffer is needed in order for mbsnrtocws to consider | ||
676 | + // its fourth parameter (it wouldn't with NULL as first parameter). | ||
677 | + wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) | ||
678 | + * __max)); | ||
679 | + while (__from < __end && __max) | ||
680 | + { | ||
681 | + const extern_type* __from_chunk_end; | ||
682 | + __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0', | ||
683 | + __end | ||
684 | + - __from)); | ||
685 | + if (!__from_chunk_end) | ||
686 | + __from_chunk_end = __end; | ||
687 | + | ||
688 | + const extern_type* __tmp_from = __from; | ||
689 | + size_t __conv = mbsnrtowcs(__to, &__from, | ||
690 | + __from_chunk_end - __from, | ||
691 | + __max, &__state); | ||
692 | + if (__conv == static_cast<size_t>(-1)) | ||
693 | + { | ||
694 | + // In case of error, in order to stop at the exact place we | ||
695 | + // have to start again from the beginning with a series of | ||
696 | + // mbrtowc. | ||
697 | + for (__from = __tmp_from;; __from += __conv) | ||
698 | + { | ||
699 | + __conv = mbrtowc(NULL, __from, __end - __from, | ||
700 | + &__tmp_state); | ||
701 | + if (__conv == static_cast<size_t>(-1) | ||
702 | + || __conv == static_cast<size_t>(-2)) | ||
703 | + break; | ||
704 | + } | ||
705 | + __state = __tmp_state; | ||
706 | + __ret += __from - __tmp_from; | ||
707 | + break; | ||
708 | + } | ||
709 | + if (!__from) | ||
710 | + __from = __from_chunk_end; | ||
711 | + | ||
712 | + __ret += __from - __tmp_from; | ||
713 | + __max -= __conv; | ||
714 | + | ||
715 | + if (__from < __end && __max) | ||
716 | + { | ||
717 | + // XXX Probably wrong for stateful encodings | ||
718 | + __tmp_state = __state; | ||
719 | + ++__from; | ||
720 | + ++__ret; | ||
721 | + --__max; | ||
722 | + } | ||
723 | + } | ||
724 | + | ||
725 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
726 | + __uselocale(__old); | ||
727 | +#endif | ||
728 | + | ||
729 | + return __ret; | ||
730 | + } | ||
731 | +#endif | ||
732 | +} | ||
733 | Index: gcc-4.5.0/libstdc++-v3/config/locale/uclibc/collate_members.cc | ||
734 | =================================================================== | ||
735 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
736 | +++ gcc-4.5.0/libstdc++-v3/config/locale/uclibc/collate_members.cc 2010-06-25 10:42:34.913881064 -0700 | ||
737 | @@ -0,0 +1,80 @@ | ||
738 | +// std::collate implementation details, GNU version -*- C++ -*- | ||
739 | + | ||
740 | +// Copyright (C) 2001, 2002 Free Software Foundation, Inc. | ||
741 | +// | ||
742 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
743 | +// software; you can redistribute it and/or modify it under the | ||
744 | +// terms of the GNU General Public License as published by the | ||
745 | +// Free Software Foundation; either version 2, or (at your option) | ||
746 | +// any later version. | ||
747 | + | ||
748 | +// This library is distributed in the hope that it will be useful, | ||
749 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
750 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
751 | +// GNU General Public License for more details. | ||
752 | + | ||
753 | +// You should have received a copy of the GNU General Public License along | ||
754 | +// with this library; see the file COPYING. If not, write to the Free | ||
755 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
756 | +// USA. | ||
757 | + | ||
758 | +// As a special exception, you may use this file as part of a free software | ||
759 | +// library without restriction. Specifically, if other files instantiate | ||
760 | +// templates or use macros or inline functions from this file, or you compile | ||
761 | +// this file and link it with other files to produce an executable, this | ||
762 | +// file does not by itself cause the resulting executable to be covered by | ||
763 | +// the GNU General Public License. This exception does not however | ||
764 | +// invalidate any other reasons why the executable file might be covered by | ||
765 | +// the GNU General Public License. | ||
766 | + | ||
767 | +// | ||
768 | +// ISO C++ 14882: 22.2.4.1.2 collate virtual functions | ||
769 | +// | ||
770 | + | ||
771 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
772 | + | ||
773 | +#include <locale> | ||
774 | +#include <bits/c++locale_internal.h> | ||
775 | + | ||
776 | +#ifndef __UCLIBC_HAS_XLOCALE__ | ||
777 | +#define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) | ||
778 | +#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) | ||
779 | +#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) | ||
780 | +#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) | ||
781 | +#endif | ||
782 | + | ||
783 | +namespace std | ||
784 | +{ | ||
785 | + // These are basically extensions to char_traits, and perhaps should | ||
786 | + // be put there instead of here. | ||
787 | + template<> | ||
788 | + int | ||
789 | + collate<char>::_M_compare(const char* __one, const char* __two) const | ||
790 | + { | ||
791 | + int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate); | ||
792 | + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); | ||
793 | + } | ||
794 | + | ||
795 | + template<> | ||
796 | + size_t | ||
797 | + collate<char>::_M_transform(char* __to, const char* __from, | ||
798 | + size_t __n) const | ||
799 | + { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); } | ||
800 | + | ||
801 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
802 | + template<> | ||
803 | + int | ||
804 | + collate<wchar_t>::_M_compare(const wchar_t* __one, | ||
805 | + const wchar_t* __two) const | ||
806 | + { | ||
807 | + int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate); | ||
808 | + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); | ||
809 | + } | ||
810 | + | ||
811 | + template<> | ||
812 | + size_t | ||
813 | + collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from, | ||
814 | + size_t __n) const | ||
815 | + { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); } | ||
816 | +#endif | ||
817 | +} | ||
818 | Index: gcc-4.5.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc | ||
819 | =================================================================== | ||
820 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
821 | +++ gcc-4.5.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2010-06-25 10:42:34.913881064 -0700 | ||
822 | @@ -0,0 +1,300 @@ | ||
823 | +// std::ctype implementation details, GNU version -*- C++ -*- | ||
824 | + | ||
825 | +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | ||
826 | +// | ||
827 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
828 | +// software; you can redistribute it and/or modify it under the | ||
829 | +// terms of the GNU General Public License as published by the | ||
830 | +// Free Software Foundation; either version 2, or (at your option) | ||
831 | +// any later version. | ||
832 | + | ||
833 | +// This library is distributed in the hope that it will be useful, | ||
834 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
835 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
836 | +// GNU General Public License for more details. | ||
837 | + | ||
838 | +// You should have received a copy of the GNU General Public License along | ||
839 | +// with this library; see the file COPYING. If not, write to the Free | ||
840 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
841 | +// USA. | ||
842 | + | ||
843 | +// As a special exception, you may use this file as part of a free software | ||
844 | +// library without restriction. Specifically, if other files instantiate | ||
845 | +// templates or use macros or inline functions from this file, or you compile | ||
846 | +// this file and link it with other files to produce an executable, this | ||
847 | +// file does not by itself cause the resulting executable to be covered by | ||
848 | +// the GNU General Public License. This exception does not however | ||
849 | +// invalidate any other reasons why the executable file might be covered by | ||
850 | +// the GNU General Public License. | ||
851 | + | ||
852 | +// | ||
853 | +// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions. | ||
854 | +// | ||
855 | + | ||
856 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
857 | + | ||
858 | +#define _LIBC | ||
859 | +#include <locale> | ||
860 | +#undef _LIBC | ||
861 | +#include <bits/c++locale_internal.h> | ||
862 | + | ||
863 | +#ifndef __UCLIBC_HAS_XLOCALE__ | ||
864 | +#define __wctype_l(S, L) wctype((S)) | ||
865 | +#define __towupper_l(C, L) towupper((C)) | ||
866 | +#define __towlower_l(C, L) towlower((C)) | ||
867 | +#define __iswctype_l(C, M, L) iswctype((C), (M)) | ||
868 | +#endif | ||
869 | + | ||
870 | +namespace std | ||
871 | +{ | ||
872 | + // NB: The other ctype<char> specializations are in src/locale.cc and | ||
873 | + // various /config/os/* files. | ||
874 | + template<> | ||
875 | + ctype_byname<char>::ctype_byname(const char* __s, size_t __refs) | ||
876 | + : ctype<char>(0, false, __refs) | ||
877 | + { | ||
878 | + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) | ||
879 | + { | ||
880 | + this->_S_destroy_c_locale(this->_M_c_locale_ctype); | ||
881 | + this->_S_create_c_locale(this->_M_c_locale_ctype, __s); | ||
882 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
883 | + this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper; | ||
884 | + this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower; | ||
885 | + this->_M_table = this->_M_c_locale_ctype->__ctype_b; | ||
886 | +#endif | ||
887 | + } | ||
888 | + } | ||
889 | + | ||
890 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
891 | + ctype<wchar_t>::__wmask_type | ||
892 | + ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const | ||
893 | + { | ||
894 | + __wmask_type __ret; | ||
895 | + switch (__m) | ||
896 | + { | ||
897 | + case space: | ||
898 | + __ret = __wctype_l("space", _M_c_locale_ctype); | ||
899 | + break; | ||
900 | + case print: | ||
901 | + __ret = __wctype_l("print", _M_c_locale_ctype); | ||
902 | + break; | ||
903 | + case cntrl: | ||
904 | + __ret = __wctype_l("cntrl", _M_c_locale_ctype); | ||
905 | + break; | ||
906 | + case upper: | ||
907 | + __ret = __wctype_l("upper", _M_c_locale_ctype); | ||
908 | + break; | ||
909 | + case lower: | ||
910 | + __ret = __wctype_l("lower", _M_c_locale_ctype); | ||
911 | + break; | ||
912 | + case alpha: | ||
913 | + __ret = __wctype_l("alpha", _M_c_locale_ctype); | ||
914 | + break; | ||
915 | + case digit: | ||
916 | + __ret = __wctype_l("digit", _M_c_locale_ctype); | ||
917 | + break; | ||
918 | + case punct: | ||
919 | + __ret = __wctype_l("punct", _M_c_locale_ctype); | ||
920 | + break; | ||
921 | + case xdigit: | ||
922 | + __ret = __wctype_l("xdigit", _M_c_locale_ctype); | ||
923 | + break; | ||
924 | + case alnum: | ||
925 | + __ret = __wctype_l("alnum", _M_c_locale_ctype); | ||
926 | + break; | ||
927 | + case graph: | ||
928 | + __ret = __wctype_l("graph", _M_c_locale_ctype); | ||
929 | + break; | ||
930 | + default: | ||
931 | + __ret = __wmask_type(); | ||
932 | + } | ||
933 | + return __ret; | ||
934 | + } | ||
935 | + | ||
936 | + wchar_t | ||
937 | + ctype<wchar_t>::do_toupper(wchar_t __c) const | ||
938 | + { return __towupper_l(__c, _M_c_locale_ctype); } | ||
939 | + | ||
940 | + const wchar_t* | ||
941 | + ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const | ||
942 | + { | ||
943 | + while (__lo < __hi) | ||
944 | + { | ||
945 | + *__lo = __towupper_l(*__lo, _M_c_locale_ctype); | ||
946 | + ++__lo; | ||
947 | + } | ||
948 | + return __hi; | ||
949 | + } | ||
950 | + | ||
951 | + wchar_t | ||
952 | + ctype<wchar_t>::do_tolower(wchar_t __c) const | ||
953 | + { return __towlower_l(__c, _M_c_locale_ctype); } | ||
954 | + | ||
955 | + const wchar_t* | ||
956 | + ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const | ||
957 | + { | ||
958 | + while (__lo < __hi) | ||
959 | + { | ||
960 | + *__lo = __towlower_l(*__lo, _M_c_locale_ctype); | ||
961 | + ++__lo; | ||
962 | + } | ||
963 | + return __hi; | ||
964 | + } | ||
965 | + | ||
966 | + bool | ||
967 | + ctype<wchar_t>:: | ||
968 | + do_is(mask __m, wchar_t __c) const | ||
969 | + { | ||
970 | + // Highest bitmask in ctype_base == 10, but extra in "C" | ||
971 | + // library for blank. | ||
972 | + bool __ret = false; | ||
973 | + const size_t __bitmasksize = 11; | ||
974 | + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) | ||
975 | + if (__m & _M_bit[__bitcur] | ||
976 | + && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) | ||
977 | + { | ||
978 | + __ret = true; | ||
979 | + break; | ||
980 | + } | ||
981 | + return __ret; | ||
982 | + } | ||
983 | + | ||
984 | + const wchar_t* | ||
985 | + ctype<wchar_t>:: | ||
986 | + do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const | ||
987 | + { | ||
988 | + for (; __lo < __hi; ++__vec, ++__lo) | ||
989 | + { | ||
990 | + // Highest bitmask in ctype_base == 10, but extra in "C" | ||
991 | + // library for blank. | ||
992 | + const size_t __bitmasksize = 11; | ||
993 | + mask __m = 0; | ||
994 | + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) | ||
995 | + if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype)) | ||
996 | + __m |= _M_bit[__bitcur]; | ||
997 | + *__vec = __m; | ||
998 | + } | ||
999 | + return __hi; | ||
1000 | + } | ||
1001 | + | ||
1002 | + const wchar_t* | ||
1003 | + ctype<wchar_t>:: | ||
1004 | + do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const | ||
1005 | + { | ||
1006 | + while (__lo < __hi && !this->do_is(__m, *__lo)) | ||
1007 | + ++__lo; | ||
1008 | + return __lo; | ||
1009 | + } | ||
1010 | + | ||
1011 | + const wchar_t* | ||
1012 | + ctype<wchar_t>:: | ||
1013 | + do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const | ||
1014 | + { | ||
1015 | + while (__lo < __hi && this->do_is(__m, *__lo) != 0) | ||
1016 | + ++__lo; | ||
1017 | + return __lo; | ||
1018 | + } | ||
1019 | + | ||
1020 | + wchar_t | ||
1021 | + ctype<wchar_t>:: | ||
1022 | + do_widen(char __c) const | ||
1023 | + { return _M_widen[static_cast<unsigned char>(__c)]; } | ||
1024 | + | ||
1025 | + const char* | ||
1026 | + ctype<wchar_t>:: | ||
1027 | + do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const | ||
1028 | + { | ||
1029 | + while (__lo < __hi) | ||
1030 | + { | ||
1031 | + *__dest = _M_widen[static_cast<unsigned char>(*__lo)]; | ||
1032 | + ++__lo; | ||
1033 | + ++__dest; | ||
1034 | + } | ||
1035 | + return __hi; | ||
1036 | + } | ||
1037 | + | ||
1038 | + char | ||
1039 | + ctype<wchar_t>:: | ||
1040 | + do_narrow(wchar_t __wc, char __dfault) const | ||
1041 | + { | ||
1042 | + if (__wc >= 0 && __wc < 128 && _M_narrow_ok) | ||
1043 | + return _M_narrow[__wc]; | ||
1044 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1045 | + __c_locale __old = __uselocale(_M_c_locale_ctype); | ||
1046 | +#endif | ||
1047 | + const int __c = wctob(__wc); | ||
1048 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1049 | + __uselocale(__old); | ||
1050 | +#endif | ||
1051 | + return (__c == EOF ? __dfault : static_cast<char>(__c)); | ||
1052 | + } | ||
1053 | + | ||
1054 | + const wchar_t* | ||
1055 | + ctype<wchar_t>:: | ||
1056 | + do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, | ||
1057 | + char* __dest) const | ||
1058 | + { | ||
1059 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1060 | + __c_locale __old = __uselocale(_M_c_locale_ctype); | ||
1061 | +#endif | ||
1062 | + if (_M_narrow_ok) | ||
1063 | + while (__lo < __hi) | ||
1064 | + { | ||
1065 | + if (*__lo >= 0 && *__lo < 128) | ||
1066 | + *__dest = _M_narrow[*__lo]; | ||
1067 | + else | ||
1068 | + { | ||
1069 | + const int __c = wctob(*__lo); | ||
1070 | + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c)); | ||
1071 | + } | ||
1072 | + ++__lo; | ||
1073 | + ++__dest; | ||
1074 | + } | ||
1075 | + else | ||
1076 | + while (__lo < __hi) | ||
1077 | + { | ||
1078 | + const int __c = wctob(*__lo); | ||
1079 | + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c)); | ||
1080 | + ++__lo; | ||
1081 | + ++__dest; | ||
1082 | + } | ||
1083 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1084 | + __uselocale(__old); | ||
1085 | +#endif | ||
1086 | + return __hi; | ||
1087 | + } | ||
1088 | + | ||
1089 | + void | ||
1090 | + ctype<wchar_t>::_M_initialize_ctype() | ||
1091 | + { | ||
1092 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1093 | + __c_locale __old = __uselocale(_M_c_locale_ctype); | ||
1094 | +#endif | ||
1095 | + wint_t __i; | ||
1096 | + for (__i = 0; __i < 128; ++__i) | ||
1097 | + { | ||
1098 | + const int __c = wctob(__i); | ||
1099 | + if (__c == EOF) | ||
1100 | + break; | ||
1101 | + else | ||
1102 | + _M_narrow[__i] = static_cast<char>(__c); | ||
1103 | + } | ||
1104 | + if (__i == 128) | ||
1105 | + _M_narrow_ok = true; | ||
1106 | + else | ||
1107 | + _M_narrow_ok = false; | ||
1108 | + for (size_t __j = 0; | ||
1109 | + __j < sizeof(_M_widen) / sizeof(wint_t); ++__j) | ||
1110 | + _M_widen[__j] = btowc(__j); | ||
1111 | + | ||
1112 | + for (size_t __k = 0; __k <= 11; ++__k) | ||
1113 | + { | ||
1114 | + _M_bit[__k] = static_cast<mask>(_ISbit(__k)); | ||
1115 | + _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]); | ||
1116 | + } | ||
1117 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1118 | + __uselocale(__old); | ||
1119 | +#endif | ||
1120 | + } | ||
1121 | +#endif // _GLIBCXX_USE_WCHAR_T | ||
1122 | +} | ||
1123 | Index: gcc-4.5.0/libstdc++-v3/config/locale/uclibc/messages_members.cc | ||
1124 | =================================================================== | ||
1125 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
1126 | +++ gcc-4.5.0/libstdc++-v3/config/locale/uclibc/messages_members.cc 2010-06-25 10:42:34.913881064 -0700 | ||
1127 | @@ -0,0 +1,100 @@ | ||
1128 | +// std::messages implementation details, GNU version -*- C++ -*- | ||
1129 | + | ||
1130 | +// Copyright (C) 2001, 2002 Free Software Foundation, Inc. | ||
1131 | +// | ||
1132 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
1133 | +// software; you can redistribute it and/or modify it under the | ||
1134 | +// terms of the GNU General Public License as published by the | ||
1135 | +// Free Software Foundation; either version 2, or (at your option) | ||
1136 | +// any later version. | ||
1137 | + | ||
1138 | +// This library is distributed in the hope that it will be useful, | ||
1139 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1140 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1141 | +// GNU General Public License for more details. | ||
1142 | + | ||
1143 | +// You should have received a copy of the GNU General Public License along | ||
1144 | +// with this library; see the file COPYING. If not, write to the Free | ||
1145 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
1146 | +// USA. | ||
1147 | + | ||
1148 | +// As a special exception, you may use this file as part of a free software | ||
1149 | +// library without restriction. Specifically, if other files instantiate | ||
1150 | +// templates or use macros or inline functions from this file, or you compile | ||
1151 | +// this file and link it with other files to produce an executable, this | ||
1152 | +// file does not by itself cause the resulting executable to be covered by | ||
1153 | +// the GNU General Public License. This exception does not however | ||
1154 | +// invalidate any other reasons why the executable file might be covered by | ||
1155 | +// the GNU General Public License. | ||
1156 | + | ||
1157 | +// | ||
1158 | +// ISO C++ 14882: 22.2.7.1.2 messages virtual functions | ||
1159 | +// | ||
1160 | + | ||
1161 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
1162 | + | ||
1163 | +#include <locale> | ||
1164 | +#include <bits/c++locale_internal.h> | ||
1165 | + | ||
1166 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
1167 | +#warning fix gettext stuff | ||
1168 | +#endif | ||
1169 | +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ | ||
1170 | +extern "C" char *__dcgettext(const char *domainname, | ||
1171 | + const char *msgid, int category); | ||
1172 | +#undef gettext | ||
1173 | +#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES) | ||
1174 | +#else | ||
1175 | +#undef gettext | ||
1176 | +#define gettext(msgid) (msgid) | ||
1177 | +#endif | ||
1178 | + | ||
1179 | +namespace std | ||
1180 | +{ | ||
1181 | + // Specializations. | ||
1182 | + template<> | ||
1183 | + string | ||
1184 | + messages<char>::do_get(catalog, int, int, const string& __dfault) const | ||
1185 | + { | ||
1186 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1187 | + __c_locale __old = __uselocale(_M_c_locale_messages); | ||
1188 | + const char* __msg = const_cast<const char*>(gettext(__dfault.c_str())); | ||
1189 | + __uselocale(__old); | ||
1190 | + return string(__msg); | ||
1191 | +#elif defined __UCLIBC_HAS_LOCALE__ | ||
1192 | + char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
1193 | + setlocale(LC_ALL, _M_name_messages); | ||
1194 | + const char* __msg = gettext(__dfault.c_str()); | ||
1195 | + setlocale(LC_ALL, __old); | ||
1196 | + free(__old); | ||
1197 | + return string(__msg); | ||
1198 | +#else | ||
1199 | + const char* __msg = gettext(__dfault.c_str()); | ||
1200 | + return string(__msg); | ||
1201 | +#endif | ||
1202 | + } | ||
1203 | + | ||
1204 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
1205 | + template<> | ||
1206 | + wstring | ||
1207 | + messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const | ||
1208 | + { | ||
1209 | +# ifdef __UCLIBC_HAS_XLOCALE__ | ||
1210 | + __c_locale __old = __uselocale(_M_c_locale_messages); | ||
1211 | + char* __msg = gettext(_M_convert_to_char(__dfault)); | ||
1212 | + __uselocale(__old); | ||
1213 | + return _M_convert_from_char(__msg); | ||
1214 | +# elif defined __UCLIBC_HAS_LOCALE__ | ||
1215 | + char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
1216 | + setlocale(LC_ALL, _M_name_messages); | ||
1217 | + char* __msg = gettext(_M_convert_to_char(__dfault)); | ||
1218 | + setlocale(LC_ALL, __old); | ||
1219 | + free(__old); | ||
1220 | + return _M_convert_from_char(__msg); | ||
1221 | +# else | ||
1222 | + char* __msg = gettext(_M_convert_to_char(__dfault)); | ||
1223 | + return _M_convert_from_char(__msg); | ||
1224 | +# endif | ||
1225 | + } | ||
1226 | +#endif | ||
1227 | +} | ||
1228 | Index: gcc-4.5.0/libstdc++-v3/config/locale/uclibc/messages_members.h | ||
1229 | =================================================================== | ||
1230 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
1231 | +++ gcc-4.5.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2010-06-25 10:42:34.913881064 -0700 | ||
1232 | @@ -0,0 +1,118 @@ | ||
1233 | +// std::messages implementation details, GNU version -*- C++ -*- | ||
1234 | + | ||
1235 | +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | ||
1236 | +// | ||
1237 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
1238 | +// software; you can redistribute it and/or modify it under the | ||
1239 | +// terms of the GNU General Public License as published by the | ||
1240 | +// Free Software Foundation; either version 2, or (at your option) | ||
1241 | +// any later version. | ||
1242 | + | ||
1243 | +// This library is distributed in the hope that it will be useful, | ||
1244 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1245 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1246 | +// GNU General Public License for more details. | ||
1247 | + | ||
1248 | +// You should have received a copy of the GNU General Public License along | ||
1249 | +// with this library; see the file COPYING. If not, write to the Free | ||
1250 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
1251 | +// USA. | ||
1252 | + | ||
1253 | +// As a special exception, you may use this file as part of a free software | ||
1254 | +// library without restriction. Specifically, if other files instantiate | ||
1255 | +// templates or use macros or inline functions from this file, or you compile | ||
1256 | +// this file and link it with other files to produce an executable, this | ||
1257 | +// file does not by itself cause the resulting executable to be covered by | ||
1258 | +// the GNU General Public License. This exception does not however | ||
1259 | +// invalidate any other reasons why the executable file might be covered by | ||
1260 | +// the GNU General Public License. | ||
1261 | + | ||
1262 | +// | ||
1263 | +// ISO C++ 14882: 22.2.7.1.2 messages functions | ||
1264 | +// | ||
1265 | + | ||
1266 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
1267 | + | ||
1268 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
1269 | +#warning fix prototypes for *textdomain funcs | ||
1270 | +#endif | ||
1271 | +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ | ||
1272 | +extern "C" char *__textdomain(const char *domainname); | ||
1273 | +extern "C" char *__bindtextdomain(const char *domainname, | ||
1274 | + const char *dirname); | ||
1275 | +#else | ||
1276 | +#undef __textdomain | ||
1277 | +#undef __bindtextdomain | ||
1278 | +#define __textdomain(D) ((void)0) | ||
1279 | +#define __bindtextdomain(D,P) ((void)0) | ||
1280 | +#endif | ||
1281 | + | ||
1282 | + // Non-virtual member functions. | ||
1283 | + template<typename _CharT> | ||
1284 | + messages<_CharT>::messages(size_t __refs) | ||
1285 | + : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), | ||
1286 | + _M_name_messages(_S_get_c_name()) | ||
1287 | + { } | ||
1288 | + | ||
1289 | + template<typename _CharT> | ||
1290 | + messages<_CharT>::messages(__c_locale __cloc, const char* __s, | ||
1291 | + size_t __refs) | ||
1292 | + : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)), | ||
1293 | + _M_name_messages(__s) | ||
1294 | + { | ||
1295 | + char* __tmp = new char[std::strlen(__s) + 1]; | ||
1296 | + std::strcpy(__tmp, __s); | ||
1297 | + _M_name_messages = __tmp; | ||
1298 | + } | ||
1299 | + | ||
1300 | + template<typename _CharT> | ||
1301 | + typename messages<_CharT>::catalog | ||
1302 | + messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, | ||
1303 | + const char* __dir) const | ||
1304 | + { | ||
1305 | + __bindtextdomain(__s.c_str(), __dir); | ||
1306 | + return this->do_open(__s, __loc); | ||
1307 | + } | ||
1308 | + | ||
1309 | + // Virtual member functions. | ||
1310 | + template<typename _CharT> | ||
1311 | + messages<_CharT>::~messages() | ||
1312 | + { | ||
1313 | + if (_M_name_messages != _S_get_c_name()) | ||
1314 | + delete [] _M_name_messages; | ||
1315 | + _S_destroy_c_locale(_M_c_locale_messages); | ||
1316 | + } | ||
1317 | + | ||
1318 | + template<typename _CharT> | ||
1319 | + typename messages<_CharT>::catalog | ||
1320 | + messages<_CharT>::do_open(const basic_string<char>& __s, | ||
1321 | + const locale&) const | ||
1322 | + { | ||
1323 | + // No error checking is done, assume the catalog exists and can | ||
1324 | + // be used. | ||
1325 | + __textdomain(__s.c_str()); | ||
1326 | + return 0; | ||
1327 | + } | ||
1328 | + | ||
1329 | + template<typename _CharT> | ||
1330 | + void | ||
1331 | + messages<_CharT>::do_close(catalog) const | ||
1332 | + { } | ||
1333 | + | ||
1334 | + // messages_byname | ||
1335 | + template<typename _CharT> | ||
1336 | + messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs) | ||
1337 | + : messages<_CharT>(__refs) | ||
1338 | + { | ||
1339 | + if (this->_M_name_messages != locale::facet::_S_get_c_name()) | ||
1340 | + delete [] this->_M_name_messages; | ||
1341 | + char* __tmp = new char[std::strlen(__s) + 1]; | ||
1342 | + std::strcpy(__tmp, __s); | ||
1343 | + this->_M_name_messages = __tmp; | ||
1344 | + | ||
1345 | + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) | ||
1346 | + { | ||
1347 | + this->_S_destroy_c_locale(this->_M_c_locale_messages); | ||
1348 | + this->_S_create_c_locale(this->_M_c_locale_messages, __s); | ||
1349 | + } | ||
1350 | + } | ||
1351 | Index: gcc-4.5.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc | ||
1352 | =================================================================== | ||
1353 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
1354 | +++ gcc-4.5.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2010-06-25 10:42:34.913881064 -0700 | ||
1355 | @@ -0,0 +1,692 @@ | ||
1356 | +// std::moneypunct implementation details, GNU version -*- C++ -*- | ||
1357 | + | ||
1358 | +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | ||
1359 | +// | ||
1360 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
1361 | +// software; you can redistribute it and/or modify it under the | ||
1362 | +// terms of the GNU General Public License as published by the | ||
1363 | +// Free Software Foundation; either version 2, or (at your option) | ||
1364 | +// any later version. | ||
1365 | + | ||
1366 | +// This library is distributed in the hope that it will be useful, | ||
1367 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1368 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1369 | +// GNU General Public License for more details. | ||
1370 | + | ||
1371 | +// You should have received a copy of the GNU General Public License along | ||
1372 | +// with this library; see the file COPYING. If not, write to the Free | ||
1373 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
1374 | +// USA. | ||
1375 | + | ||
1376 | +// As a special exception, you may use this file as part of a free software | ||
1377 | +// library without restriction. Specifically, if other files instantiate | ||
1378 | +// templates or use macros or inline functions from this file, or you compile | ||
1379 | +// this file and link it with other files to produce an executable, this | ||
1380 | +// file does not by itself cause the resulting executable to be covered by | ||
1381 | +// the GNU General Public License. This exception does not however | ||
1382 | +// invalidate any other reasons why the executable file might be covered by | ||
1383 | +// the GNU General Public License. | ||
1384 | + | ||
1385 | +// | ||
1386 | +// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions | ||
1387 | +// | ||
1388 | + | ||
1389 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
1390 | + | ||
1391 | +#define _LIBC | ||
1392 | +#include <locale> | ||
1393 | +#undef _LIBC | ||
1394 | +#include <bits/c++locale_internal.h> | ||
1395 | + | ||
1396 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
1397 | +#warning optimize this for uclibc | ||
1398 | +#warning tailor for stub locale support | ||
1399 | +#endif | ||
1400 | + | ||
1401 | +#ifndef __UCLIBC_HAS_XLOCALE__ | ||
1402 | +#define __nl_langinfo_l(N, L) nl_langinfo((N)) | ||
1403 | +#endif | ||
1404 | + | ||
1405 | +namespace std | ||
1406 | +{ | ||
1407 | + // Construct and return valid pattern consisting of some combination of: | ||
1408 | + // space none symbol sign value | ||
1409 | + money_base::pattern | ||
1410 | + money_base::_S_construct_pattern(char __precedes, char __space, char __posn) | ||
1411 | + { | ||
1412 | + pattern __ret; | ||
1413 | + | ||
1414 | + // This insanely complicated routine attempts to construct a valid | ||
1415 | + // pattern for use with monyepunct. A couple of invariants: | ||
1416 | + | ||
1417 | + // if (__precedes) symbol -> value | ||
1418 | + // else value -> symbol | ||
1419 | + | ||
1420 | + // if (__space) space | ||
1421 | + // else none | ||
1422 | + | ||
1423 | + // none == never first | ||
1424 | + // space never first or last | ||
1425 | + | ||
1426 | + // Any elegant implementations of this are welcome. | ||
1427 | + switch (__posn) | ||
1428 | + { | ||
1429 | + case 0: | ||
1430 | + case 1: | ||
1431 | + // 1 The sign precedes the value and symbol. | ||
1432 | + __ret.field[0] = sign; | ||
1433 | + if (__space) | ||
1434 | + { | ||
1435 | + // Pattern starts with sign. | ||
1436 | + if (__precedes) | ||
1437 | + { | ||
1438 | + __ret.field[1] = symbol; | ||
1439 | + __ret.field[3] = value; | ||
1440 | + } | ||
1441 | + else | ||
1442 | + { | ||
1443 | + __ret.field[1] = value; | ||
1444 | + __ret.field[3] = symbol; | ||
1445 | + } | ||
1446 | + __ret.field[2] = space; | ||
1447 | + } | ||
1448 | + else | ||
1449 | + { | ||
1450 | + // Pattern starts with sign and ends with none. | ||
1451 | + if (__precedes) | ||
1452 | + { | ||
1453 | + __ret.field[1] = symbol; | ||
1454 | + __ret.field[2] = value; | ||
1455 | + } | ||
1456 | + else | ||
1457 | + { | ||
1458 | + __ret.field[1] = value; | ||
1459 | + __ret.field[2] = symbol; | ||
1460 | + } | ||
1461 | + __ret.field[3] = none; | ||
1462 | + } | ||
1463 | + break; | ||
1464 | + case 2: | ||
1465 | + // 2 The sign follows the value and symbol. | ||
1466 | + if (__space) | ||
1467 | + { | ||
1468 | + // Pattern either ends with sign. | ||
1469 | + if (__precedes) | ||
1470 | + { | ||
1471 | + __ret.field[0] = symbol; | ||
1472 | + __ret.field[2] = value; | ||
1473 | + } | ||
1474 | + else | ||
1475 | + { | ||
1476 | + __ret.field[0] = value; | ||
1477 | + __ret.field[2] = symbol; | ||
1478 | + } | ||
1479 | + __ret.field[1] = space; | ||
1480 | + __ret.field[3] = sign; | ||
1481 | + } | ||
1482 | + else | ||
1483 | + { | ||
1484 | + // Pattern ends with sign then none. | ||
1485 | + if (__precedes) | ||
1486 | + { | ||
1487 | + __ret.field[0] = symbol; | ||
1488 | + __ret.field[1] = value; | ||
1489 | + } | ||
1490 | + else | ||
1491 | + { | ||
1492 | + __ret.field[0] = value; | ||
1493 | + __ret.field[1] = symbol; | ||
1494 | + } | ||
1495 | + __ret.field[2] = sign; | ||
1496 | + __ret.field[3] = none; | ||
1497 | + } | ||
1498 | + break; | ||
1499 | + case 3: | ||
1500 | + // 3 The sign immediately precedes the symbol. | ||
1501 | + if (__precedes) | ||
1502 | + { | ||
1503 | + __ret.field[0] = sign; | ||
1504 | + __ret.field[1] = symbol; | ||
1505 | + if (__space) | ||
1506 | + { | ||
1507 | + __ret.field[2] = space; | ||
1508 | + __ret.field[3] = value; | ||
1509 | + } | ||
1510 | + else | ||
1511 | + { | ||
1512 | + __ret.field[2] = value; | ||
1513 | + __ret.field[3] = none; | ||
1514 | + } | ||
1515 | + } | ||
1516 | + else | ||
1517 | + { | ||
1518 | + __ret.field[0] = value; | ||
1519 | + if (__space) | ||
1520 | + { | ||
1521 | + __ret.field[1] = space; | ||
1522 | + __ret.field[2] = sign; | ||
1523 | + __ret.field[3] = symbol; | ||
1524 | + } | ||
1525 | + else | ||
1526 | + { | ||
1527 | + __ret.field[1] = sign; | ||
1528 | + __ret.field[2] = symbol; | ||
1529 | + __ret.field[3] = none; | ||
1530 | + } | ||
1531 | + } | ||
1532 | + break; | ||
1533 | + case 4: | ||
1534 | + // 4 The sign immediately follows the symbol. | ||
1535 | + if (__precedes) | ||
1536 | + { | ||
1537 | + __ret.field[0] = symbol; | ||
1538 | + __ret.field[1] = sign; | ||
1539 | + if (__space) | ||
1540 | + { | ||
1541 | + __ret.field[2] = space; | ||
1542 | + __ret.field[3] = value; | ||
1543 | + } | ||
1544 | + else | ||
1545 | + { | ||
1546 | + __ret.field[2] = value; | ||
1547 | + __ret.field[3] = none; | ||
1548 | + } | ||
1549 | + } | ||
1550 | + else | ||
1551 | + { | ||
1552 | + __ret.field[0] = value; | ||
1553 | + if (__space) | ||
1554 | + { | ||
1555 | + __ret.field[1] = space; | ||
1556 | + __ret.field[2] = symbol; | ||
1557 | + __ret.field[3] = sign; | ||
1558 | + } | ||
1559 | + else | ||
1560 | + { | ||
1561 | + __ret.field[1] = symbol; | ||
1562 | + __ret.field[2] = sign; | ||
1563 | + __ret.field[3] = none; | ||
1564 | + } | ||
1565 | + } | ||
1566 | + break; | ||
1567 | + default: | ||
1568 | + ; | ||
1569 | + } | ||
1570 | + return __ret; | ||
1571 | + } | ||
1572 | + | ||
1573 | + template<> | ||
1574 | + void | ||
1575 | + moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, | ||
1576 | + const char*) | ||
1577 | + { | ||
1578 | + if (!_M_data) | ||
1579 | + _M_data = new __moneypunct_cache<char, true>; | ||
1580 | + | ||
1581 | + if (!__cloc) | ||
1582 | + { | ||
1583 | + // "C" locale | ||
1584 | + _M_data->_M_decimal_point = '.'; | ||
1585 | + _M_data->_M_thousands_sep = ','; | ||
1586 | + _M_data->_M_grouping = ""; | ||
1587 | + _M_data->_M_grouping_size = 0; | ||
1588 | + _M_data->_M_curr_symbol = ""; | ||
1589 | + _M_data->_M_curr_symbol_size = 0; | ||
1590 | + _M_data->_M_positive_sign = ""; | ||
1591 | + _M_data->_M_positive_sign_size = 0; | ||
1592 | + _M_data->_M_negative_sign = ""; | ||
1593 | + _M_data->_M_negative_sign_size = 0; | ||
1594 | + _M_data->_M_frac_digits = 0; | ||
1595 | + _M_data->_M_pos_format = money_base::_S_default_pattern; | ||
1596 | + _M_data->_M_neg_format = money_base::_S_default_pattern; | ||
1597 | + | ||
1598 | + for (size_t __i = 0; __i < money_base::_S_end; ++__i) | ||
1599 | + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; | ||
1600 | + } | ||
1601 | + else | ||
1602 | + { | ||
1603 | + // Named locale. | ||
1604 | + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, | ||
1605 | + __cloc)); | ||
1606 | + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, | ||
1607 | + __cloc)); | ||
1608 | + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); | ||
1609 | + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); | ||
1610 | + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); | ||
1611 | + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); | ||
1612 | + | ||
1613 | + char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); | ||
1614 | + if (!__nposn) | ||
1615 | + _M_data->_M_negative_sign = "()"; | ||
1616 | + else | ||
1617 | + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, | ||
1618 | + __cloc); | ||
1619 | + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); | ||
1620 | + | ||
1621 | + // _Intl == true | ||
1622 | + _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); | ||
1623 | + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); | ||
1624 | + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, | ||
1625 | + __cloc)); | ||
1626 | + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); | ||
1627 | + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); | ||
1628 | + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); | ||
1629 | + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, | ||
1630 | + __pposn); | ||
1631 | + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); | ||
1632 | + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); | ||
1633 | + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, | ||
1634 | + __nposn); | ||
1635 | + } | ||
1636 | + } | ||
1637 | + | ||
1638 | + template<> | ||
1639 | + void | ||
1640 | + moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, | ||
1641 | + const char*) | ||
1642 | + { | ||
1643 | + if (!_M_data) | ||
1644 | + _M_data = new __moneypunct_cache<char, false>; | ||
1645 | + | ||
1646 | + if (!__cloc) | ||
1647 | + { | ||
1648 | + // "C" locale | ||
1649 | + _M_data->_M_decimal_point = '.'; | ||
1650 | + _M_data->_M_thousands_sep = ','; | ||
1651 | + _M_data->_M_grouping = ""; | ||
1652 | + _M_data->_M_grouping_size = 0; | ||
1653 | + _M_data->_M_curr_symbol = ""; | ||
1654 | + _M_data->_M_curr_symbol_size = 0; | ||
1655 | + _M_data->_M_positive_sign = ""; | ||
1656 | + _M_data->_M_positive_sign_size = 0; | ||
1657 | + _M_data->_M_negative_sign = ""; | ||
1658 | + _M_data->_M_negative_sign_size = 0; | ||
1659 | + _M_data->_M_frac_digits = 0; | ||
1660 | + _M_data->_M_pos_format = money_base::_S_default_pattern; | ||
1661 | + _M_data->_M_neg_format = money_base::_S_default_pattern; | ||
1662 | + | ||
1663 | + for (size_t __i = 0; __i < money_base::_S_end; ++__i) | ||
1664 | + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; | ||
1665 | + } | ||
1666 | + else | ||
1667 | + { | ||
1668 | + // Named locale. | ||
1669 | + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, | ||
1670 | + __cloc)); | ||
1671 | + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, | ||
1672 | + __cloc)); | ||
1673 | + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); | ||
1674 | + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); | ||
1675 | + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); | ||
1676 | + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); | ||
1677 | + | ||
1678 | + char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); | ||
1679 | + if (!__nposn) | ||
1680 | + _M_data->_M_negative_sign = "()"; | ||
1681 | + else | ||
1682 | + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, | ||
1683 | + __cloc); | ||
1684 | + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); | ||
1685 | + | ||
1686 | + // _Intl == false | ||
1687 | + _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); | ||
1688 | + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); | ||
1689 | + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); | ||
1690 | + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); | ||
1691 | + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); | ||
1692 | + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); | ||
1693 | + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, | ||
1694 | + __pposn); | ||
1695 | + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); | ||
1696 | + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); | ||
1697 | + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, | ||
1698 | + __nposn); | ||
1699 | + } | ||
1700 | + } | ||
1701 | + | ||
1702 | + template<> | ||
1703 | + moneypunct<char, true>::~moneypunct() | ||
1704 | + { delete _M_data; } | ||
1705 | + | ||
1706 | + template<> | ||
1707 | + moneypunct<char, false>::~moneypunct() | ||
1708 | + { delete _M_data; } | ||
1709 | + | ||
1710 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
1711 | + template<> | ||
1712 | + void | ||
1713 | + moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, | ||
1714 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1715 | + const char*) | ||
1716 | +#else | ||
1717 | + const char* __name) | ||
1718 | +#endif | ||
1719 | + { | ||
1720 | + if (!_M_data) | ||
1721 | + _M_data = new __moneypunct_cache<wchar_t, true>; | ||
1722 | + | ||
1723 | + if (!__cloc) | ||
1724 | + { | ||
1725 | + // "C" locale | ||
1726 | + _M_data->_M_decimal_point = L'.'; | ||
1727 | + _M_data->_M_thousands_sep = L','; | ||
1728 | + _M_data->_M_grouping = ""; | ||
1729 | + _M_data->_M_grouping_size = 0; | ||
1730 | + _M_data->_M_curr_symbol = L""; | ||
1731 | + _M_data->_M_curr_symbol_size = 0; | ||
1732 | + _M_data->_M_positive_sign = L""; | ||
1733 | + _M_data->_M_positive_sign_size = 0; | ||
1734 | + _M_data->_M_negative_sign = L""; | ||
1735 | + _M_data->_M_negative_sign_size = 0; | ||
1736 | + _M_data->_M_frac_digits = 0; | ||
1737 | + _M_data->_M_pos_format = money_base::_S_default_pattern; | ||
1738 | + _M_data->_M_neg_format = money_base::_S_default_pattern; | ||
1739 | + | ||
1740 | + // Use ctype::widen code without the facet... | ||
1741 | + for (size_t __i = 0; __i < money_base::_S_end; ++__i) | ||
1742 | + _M_data->_M_atoms[__i] = | ||
1743 | + static_cast<wchar_t>(money_base::_S_atoms[__i]); | ||
1744 | + } | ||
1745 | + else | ||
1746 | + { | ||
1747 | + // Named locale. | ||
1748 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1749 | + __c_locale __old = __uselocale(__cloc); | ||
1750 | +#else | ||
1751 | + // Switch to named locale so that mbsrtowcs will work. | ||
1752 | + char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
1753 | + setlocale(LC_ALL, __name); | ||
1754 | +#endif | ||
1755 | + | ||
1756 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
1757 | +#warning fix this... should be monetary | ||
1758 | +#endif | ||
1759 | +#ifdef __UCLIBC__ | ||
1760 | +# ifdef __UCLIBC_HAS_XLOCALE__ | ||
1761 | + _M_data->_M_decimal_point = __cloc->decimal_point_wc; | ||
1762 | + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; | ||
1763 | +# else | ||
1764 | + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; | ||
1765 | + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; | ||
1766 | +# endif | ||
1767 | +#else | ||
1768 | + union { char *__s; wchar_t __w; } __u; | ||
1769 | + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); | ||
1770 | + _M_data->_M_decimal_point = __u.__w; | ||
1771 | + | ||
1772 | + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); | ||
1773 | + _M_data->_M_thousands_sep = __u.__w; | ||
1774 | +#endif | ||
1775 | + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); | ||
1776 | + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); | ||
1777 | + | ||
1778 | + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); | ||
1779 | + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); | ||
1780 | + const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); | ||
1781 | + | ||
1782 | + wchar_t* __wcs_ps = 0; | ||
1783 | + wchar_t* __wcs_ns = 0; | ||
1784 | + const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); | ||
1785 | + try | ||
1786 | + { | ||
1787 | + mbstate_t __state; | ||
1788 | + size_t __len = strlen(__cpossign); | ||
1789 | + if (__len) | ||
1790 | + { | ||
1791 | + ++__len; | ||
1792 | + memset(&__state, 0, sizeof(mbstate_t)); | ||
1793 | + __wcs_ps = new wchar_t[__len]; | ||
1794 | + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); | ||
1795 | + _M_data->_M_positive_sign = __wcs_ps; | ||
1796 | + } | ||
1797 | + else | ||
1798 | + _M_data->_M_positive_sign = L""; | ||
1799 | + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); | ||
1800 | + | ||
1801 | + __len = strlen(__cnegsign); | ||
1802 | + if (!__nposn) | ||
1803 | + _M_data->_M_negative_sign = L"()"; | ||
1804 | + else if (__len) | ||
1805 | + { | ||
1806 | + ++__len; | ||
1807 | + memset(&__state, 0, sizeof(mbstate_t)); | ||
1808 | + __wcs_ns = new wchar_t[__len]; | ||
1809 | + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); | ||
1810 | + _M_data->_M_negative_sign = __wcs_ns; | ||
1811 | + } | ||
1812 | + else | ||
1813 | + _M_data->_M_negative_sign = L""; | ||
1814 | + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); | ||
1815 | + | ||
1816 | + // _Intl == true. | ||
1817 | + __len = strlen(__ccurr); | ||
1818 | + if (__len) | ||
1819 | + { | ||
1820 | + ++__len; | ||
1821 | + memset(&__state, 0, sizeof(mbstate_t)); | ||
1822 | + wchar_t* __wcs = new wchar_t[__len]; | ||
1823 | + mbsrtowcs(__wcs, &__ccurr, __len, &__state); | ||
1824 | + _M_data->_M_curr_symbol = __wcs; | ||
1825 | + } | ||
1826 | + else | ||
1827 | + _M_data->_M_curr_symbol = L""; | ||
1828 | + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); | ||
1829 | + } | ||
1830 | + catch (...) | ||
1831 | + { | ||
1832 | + delete _M_data; | ||
1833 | + _M_data = 0; | ||
1834 | + delete __wcs_ps; | ||
1835 | + delete __wcs_ns; | ||
1836 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1837 | + __uselocale(__old); | ||
1838 | +#else | ||
1839 | + setlocale(LC_ALL, __old); | ||
1840 | + free(__old); | ||
1841 | +#endif | ||
1842 | + __throw_exception_again; | ||
1843 | + } | ||
1844 | + | ||
1845 | + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, | ||
1846 | + __cloc)); | ||
1847 | + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); | ||
1848 | + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); | ||
1849 | + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); | ||
1850 | + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, | ||
1851 | + __pposn); | ||
1852 | + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); | ||
1853 | + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); | ||
1854 | + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, | ||
1855 | + __nposn); | ||
1856 | + | ||
1857 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1858 | + __uselocale(__old); | ||
1859 | +#else | ||
1860 | + setlocale(LC_ALL, __old); | ||
1861 | + free(__old); | ||
1862 | +#endif | ||
1863 | + } | ||
1864 | + } | ||
1865 | + | ||
1866 | + template<> | ||
1867 | + void | ||
1868 | + moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc, | ||
1869 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1870 | + const char*) | ||
1871 | +#else | ||
1872 | + const char* __name) | ||
1873 | +#endif | ||
1874 | + { | ||
1875 | + if (!_M_data) | ||
1876 | + _M_data = new __moneypunct_cache<wchar_t, false>; | ||
1877 | + | ||
1878 | + if (!__cloc) | ||
1879 | + { | ||
1880 | + // "C" locale | ||
1881 | + _M_data->_M_decimal_point = L'.'; | ||
1882 | + _M_data->_M_thousands_sep = L','; | ||
1883 | + _M_data->_M_grouping = ""; | ||
1884 | + _M_data->_M_grouping_size = 0; | ||
1885 | + _M_data->_M_curr_symbol = L""; | ||
1886 | + _M_data->_M_curr_symbol_size = 0; | ||
1887 | + _M_data->_M_positive_sign = L""; | ||
1888 | + _M_data->_M_positive_sign_size = 0; | ||
1889 | + _M_data->_M_negative_sign = L""; | ||
1890 | + _M_data->_M_negative_sign_size = 0; | ||
1891 | + _M_data->_M_frac_digits = 0; | ||
1892 | + _M_data->_M_pos_format = money_base::_S_default_pattern; | ||
1893 | + _M_data->_M_neg_format = money_base::_S_default_pattern; | ||
1894 | + | ||
1895 | + // Use ctype::widen code without the facet... | ||
1896 | + for (size_t __i = 0; __i < money_base::_S_end; ++__i) | ||
1897 | + _M_data->_M_atoms[__i] = | ||
1898 | + static_cast<wchar_t>(money_base::_S_atoms[__i]); | ||
1899 | + } | ||
1900 | + else | ||
1901 | + { | ||
1902 | + // Named locale. | ||
1903 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1904 | + __c_locale __old = __uselocale(__cloc); | ||
1905 | +#else | ||
1906 | + // Switch to named locale so that mbsrtowcs will work. | ||
1907 | + char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
1908 | + setlocale(LC_ALL, __name); | ||
1909 | +#endif | ||
1910 | + | ||
1911 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
1912 | +#warning fix this... should be monetary | ||
1913 | +#endif | ||
1914 | +#ifdef __UCLIBC__ | ||
1915 | +# ifdef __UCLIBC_HAS_XLOCALE__ | ||
1916 | + _M_data->_M_decimal_point = __cloc->decimal_point_wc; | ||
1917 | + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; | ||
1918 | +# else | ||
1919 | + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; | ||
1920 | + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; | ||
1921 | +# endif | ||
1922 | +#else | ||
1923 | + union { char *__s; wchar_t __w; } __u; | ||
1924 | + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); | ||
1925 | + _M_data->_M_decimal_point = __u.__w; | ||
1926 | + | ||
1927 | + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); | ||
1928 | + _M_data->_M_thousands_sep = __u.__w; | ||
1929 | +#endif | ||
1930 | + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); | ||
1931 | + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); | ||
1932 | + | ||
1933 | + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); | ||
1934 | + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); | ||
1935 | + const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); | ||
1936 | + | ||
1937 | + wchar_t* __wcs_ps = 0; | ||
1938 | + wchar_t* __wcs_ns = 0; | ||
1939 | + const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); | ||
1940 | + try | ||
1941 | + { | ||
1942 | + mbstate_t __state; | ||
1943 | + size_t __len; | ||
1944 | + __len = strlen(__cpossign); | ||
1945 | + if (__len) | ||
1946 | + { | ||
1947 | + ++__len; | ||
1948 | + memset(&__state, 0, sizeof(mbstate_t)); | ||
1949 | + __wcs_ps = new wchar_t[__len]; | ||
1950 | + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); | ||
1951 | + _M_data->_M_positive_sign = __wcs_ps; | ||
1952 | + } | ||
1953 | + else | ||
1954 | + _M_data->_M_positive_sign = L""; | ||
1955 | + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); | ||
1956 | + | ||
1957 | + __len = strlen(__cnegsign); | ||
1958 | + if (!__nposn) | ||
1959 | + _M_data->_M_negative_sign = L"()"; | ||
1960 | + else if (__len) | ||
1961 | + { | ||
1962 | + ++__len; | ||
1963 | + memset(&__state, 0, sizeof(mbstate_t)); | ||
1964 | + __wcs_ns = new wchar_t[__len]; | ||
1965 | + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); | ||
1966 | + _M_data->_M_negative_sign = __wcs_ns; | ||
1967 | + } | ||
1968 | + else | ||
1969 | + _M_data->_M_negative_sign = L""; | ||
1970 | + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); | ||
1971 | + | ||
1972 | + // _Intl == true. | ||
1973 | + __len = strlen(__ccurr); | ||
1974 | + if (__len) | ||
1975 | + { | ||
1976 | + ++__len; | ||
1977 | + memset(&__state, 0, sizeof(mbstate_t)); | ||
1978 | + wchar_t* __wcs = new wchar_t[__len]; | ||
1979 | + mbsrtowcs(__wcs, &__ccurr, __len, &__state); | ||
1980 | + _M_data->_M_curr_symbol = __wcs; | ||
1981 | + } | ||
1982 | + else | ||
1983 | + _M_data->_M_curr_symbol = L""; | ||
1984 | + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); | ||
1985 | + } | ||
1986 | + catch (...) | ||
1987 | + { | ||
1988 | + delete _M_data; | ||
1989 | + _M_data = 0; | ||
1990 | + delete __wcs_ps; | ||
1991 | + delete __wcs_ns; | ||
1992 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
1993 | + __uselocale(__old); | ||
1994 | +#else | ||
1995 | + setlocale(LC_ALL, __old); | ||
1996 | + free(__old); | ||
1997 | +#endif | ||
1998 | + __throw_exception_again; | ||
1999 | + } | ||
2000 | + | ||
2001 | + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); | ||
2002 | + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); | ||
2003 | + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); | ||
2004 | + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); | ||
2005 | + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, | ||
2006 | + __pposn); | ||
2007 | + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); | ||
2008 | + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); | ||
2009 | + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, | ||
2010 | + __nposn); | ||
2011 | + | ||
2012 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
2013 | + __uselocale(__old); | ||
2014 | +#else | ||
2015 | + setlocale(LC_ALL, __old); | ||
2016 | + free(__old); | ||
2017 | +#endif | ||
2018 | + } | ||
2019 | + } | ||
2020 | + | ||
2021 | + template<> | ||
2022 | + moneypunct<wchar_t, true>::~moneypunct() | ||
2023 | + { | ||
2024 | + if (_M_data->_M_positive_sign_size) | ||
2025 | + delete [] _M_data->_M_positive_sign; | ||
2026 | + if (_M_data->_M_negative_sign_size | ||
2027 | + && wcscmp(_M_data->_M_negative_sign, L"()") != 0) | ||
2028 | + delete [] _M_data->_M_negative_sign; | ||
2029 | + if (_M_data->_M_curr_symbol_size) | ||
2030 | + delete [] _M_data->_M_curr_symbol; | ||
2031 | + delete _M_data; | ||
2032 | + } | ||
2033 | + | ||
2034 | + template<> | ||
2035 | + moneypunct<wchar_t, false>::~moneypunct() | ||
2036 | + { | ||
2037 | + if (_M_data->_M_positive_sign_size) | ||
2038 | + delete [] _M_data->_M_positive_sign; | ||
2039 | + if (_M_data->_M_negative_sign_size | ||
2040 | + && wcscmp(_M_data->_M_negative_sign, L"()") != 0) | ||
2041 | + delete [] _M_data->_M_negative_sign; | ||
2042 | + if (_M_data->_M_curr_symbol_size) | ||
2043 | + delete [] _M_data->_M_curr_symbol; | ||
2044 | + delete _M_data; | ||
2045 | + } | ||
2046 | +#endif | ||
2047 | +} | ||
2048 | Index: gcc-4.5.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc | ||
2049 | =================================================================== | ||
2050 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
2051 | +++ gcc-4.5.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2010-06-25 10:42:34.913881064 -0700 | ||
2052 | @@ -0,0 +1,160 @@ | ||
2053 | +// std::numpunct implementation details, GNU version -*- C++ -*- | ||
2054 | + | ||
2055 | +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | ||
2056 | +// | ||
2057 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
2058 | +// software; you can redistribute it and/or modify it under the | ||
2059 | +// terms of the GNU General Public License as published by the | ||
2060 | +// Free Software Foundation; either version 2, or (at your option) | ||
2061 | +// any later version. | ||
2062 | + | ||
2063 | +// This library is distributed in the hope that it will be useful, | ||
2064 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2065 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2066 | +// GNU General Public License for more details. | ||
2067 | + | ||
2068 | +// You should have received a copy of the GNU General Public License along | ||
2069 | +// with this library; see the file COPYING. If not, write to the Free | ||
2070 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
2071 | +// USA. | ||
2072 | + | ||
2073 | +// As a special exception, you may use this file as part of a free software | ||
2074 | +// library without restriction. Specifically, if other files instantiate | ||
2075 | +// templates or use macros or inline functions from this file, or you compile | ||
2076 | +// this file and link it with other files to produce an executable, this | ||
2077 | +// file does not by itself cause the resulting executable to be covered by | ||
2078 | +// the GNU General Public License. This exception does not however | ||
2079 | +// invalidate any other reasons why the executable file might be covered by | ||
2080 | +// the GNU General Public License. | ||
2081 | + | ||
2082 | +// | ||
2083 | +// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions | ||
2084 | +// | ||
2085 | + | ||
2086 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
2087 | + | ||
2088 | +#define _LIBC | ||
2089 | +#include <locale> | ||
2090 | +#undef _LIBC | ||
2091 | +#include <bits/c++locale_internal.h> | ||
2092 | + | ||
2093 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
2094 | +#warning tailor for stub locale support | ||
2095 | +#endif | ||
2096 | +#ifndef __UCLIBC_HAS_XLOCALE__ | ||
2097 | +#define __nl_langinfo_l(N, L) nl_langinfo((N)) | ||
2098 | +#endif | ||
2099 | + | ||
2100 | +namespace std | ||
2101 | +{ | ||
2102 | + template<> | ||
2103 | + void | ||
2104 | + numpunct<char>::_M_initialize_numpunct(__c_locale __cloc) | ||
2105 | + { | ||
2106 | + if (!_M_data) | ||
2107 | + _M_data = new __numpunct_cache<char>; | ||
2108 | + | ||
2109 | + if (!__cloc) | ||
2110 | + { | ||
2111 | + // "C" locale | ||
2112 | + _M_data->_M_grouping = ""; | ||
2113 | + _M_data->_M_grouping_size = 0; | ||
2114 | + _M_data->_M_use_grouping = false; | ||
2115 | + | ||
2116 | + _M_data->_M_decimal_point = '.'; | ||
2117 | + _M_data->_M_thousands_sep = ','; | ||
2118 | + | ||
2119 | + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) | ||
2120 | + _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i]; | ||
2121 | + | ||
2122 | + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) | ||
2123 | + _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j]; | ||
2124 | + } | ||
2125 | + else | ||
2126 | + { | ||
2127 | + // Named locale. | ||
2128 | + _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, | ||
2129 | + __cloc)); | ||
2130 | + _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, | ||
2131 | + __cloc)); | ||
2132 | + | ||
2133 | + // Check for NULL, which implies no grouping. | ||
2134 | + if (_M_data->_M_thousands_sep == '\0') | ||
2135 | + _M_data->_M_grouping = ""; | ||
2136 | + else | ||
2137 | + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); | ||
2138 | + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); | ||
2139 | + } | ||
2140 | + | ||
2141 | + // NB: There is no way to extact this info from posix locales. | ||
2142 | + // _M_truename = __nl_langinfo_l(YESSTR, __cloc); | ||
2143 | + _M_data->_M_truename = "true"; | ||
2144 | + _M_data->_M_truename_size = 4; | ||
2145 | + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); | ||
2146 | + _M_data->_M_falsename = "false"; | ||
2147 | + _M_data->_M_falsename_size = 5; | ||
2148 | + } | ||
2149 | + | ||
2150 | + template<> | ||
2151 | + numpunct<char>::~numpunct() | ||
2152 | + { delete _M_data; } | ||
2153 | + | ||
2154 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
2155 | + template<> | ||
2156 | + void | ||
2157 | + numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc) | ||
2158 | + { | ||
2159 | + if (!_M_data) | ||
2160 | + _M_data = new __numpunct_cache<wchar_t>; | ||
2161 | + | ||
2162 | + if (!__cloc) | ||
2163 | + { | ||
2164 | + // "C" locale | ||
2165 | + _M_data->_M_grouping = ""; | ||
2166 | + _M_data->_M_grouping_size = 0; | ||
2167 | + _M_data->_M_use_grouping = false; | ||
2168 | + | ||
2169 | + _M_data->_M_decimal_point = L'.'; | ||
2170 | + _M_data->_M_thousands_sep = L','; | ||
2171 | + | ||
2172 | + // Use ctype::widen code without the facet... | ||
2173 | + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) | ||
2174 | + _M_data->_M_atoms_out[__i] = | ||
2175 | + static_cast<wchar_t>(__num_base::_S_atoms_out[__i]); | ||
2176 | + | ||
2177 | + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) | ||
2178 | + _M_data->_M_atoms_in[__j] = | ||
2179 | + static_cast<wchar_t>(__num_base::_S_atoms_in[__j]); | ||
2180 | + } | ||
2181 | + else | ||
2182 | + { | ||
2183 | + // Named locale. | ||
2184 | + // NB: In the GNU model wchar_t is always 32 bit wide. | ||
2185 | + union { char *__s; wchar_t __w; } __u; | ||
2186 | + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc); | ||
2187 | + _M_data->_M_decimal_point = __u.__w; | ||
2188 | + | ||
2189 | + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc); | ||
2190 | + _M_data->_M_thousands_sep = __u.__w; | ||
2191 | + | ||
2192 | + if (_M_data->_M_thousands_sep == L'\0') | ||
2193 | + _M_data->_M_grouping = ""; | ||
2194 | + else | ||
2195 | + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); | ||
2196 | + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); | ||
2197 | + } | ||
2198 | + | ||
2199 | + // NB: There is no way to extact this info from posix locales. | ||
2200 | + // _M_truename = __nl_langinfo_l(YESSTR, __cloc); | ||
2201 | + _M_data->_M_truename = L"true"; | ||
2202 | + _M_data->_M_truename_size = 4; | ||
2203 | + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); | ||
2204 | + _M_data->_M_falsename = L"false"; | ||
2205 | + _M_data->_M_falsename_size = 5; | ||
2206 | + } | ||
2207 | + | ||
2208 | + template<> | ||
2209 | + numpunct<wchar_t>::~numpunct() | ||
2210 | + { delete _M_data; } | ||
2211 | + #endif | ||
2212 | +} | ||
2213 | Index: gcc-4.5.0/libstdc++-v3/config/locale/uclibc/time_members.cc | ||
2214 | =================================================================== | ||
2215 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
2216 | +++ gcc-4.5.0/libstdc++-v3/config/locale/uclibc/time_members.cc 2010-06-25 10:42:34.913881064 -0700 | ||
2217 | @@ -0,0 +1,406 @@ | ||
2218 | +// std::time_get, std::time_put implementation, GNU version -*- C++ -*- | ||
2219 | + | ||
2220 | +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | ||
2221 | +// | ||
2222 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
2223 | +// software; you can redistribute it and/or modify it under the | ||
2224 | +// terms of the GNU General Public License as published by the | ||
2225 | +// Free Software Foundation; either version 2, or (at your option) | ||
2226 | +// any later version. | ||
2227 | + | ||
2228 | +// This library is distributed in the hope that it will be useful, | ||
2229 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2230 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2231 | +// GNU General Public License for more details. | ||
2232 | + | ||
2233 | +// You should have received a copy of the GNU General Public License along | ||
2234 | +// with this library; see the file COPYING. If not, write to the Free | ||
2235 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
2236 | +// USA. | ||
2237 | + | ||
2238 | +// As a special exception, you may use this file as part of a free software | ||
2239 | +// library without restriction. Specifically, if other files instantiate | ||
2240 | +// templates or use macros or inline functions from this file, or you compile | ||
2241 | +// this file and link it with other files to produce an executable, this | ||
2242 | +// file does not by itself cause the resulting executable to be covered by | ||
2243 | +// the GNU General Public License. This exception does not however | ||
2244 | +// invalidate any other reasons why the executable file might be covered by | ||
2245 | +// the GNU General Public License. | ||
2246 | + | ||
2247 | +// | ||
2248 | +// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions | ||
2249 | +// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions | ||
2250 | +// | ||
2251 | + | ||
2252 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
2253 | + | ||
2254 | +#include <locale> | ||
2255 | +#include <bits/c++locale_internal.h> | ||
2256 | + | ||
2257 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
2258 | +#warning tailor for stub locale support | ||
2259 | +#endif | ||
2260 | +#ifndef __UCLIBC_HAS_XLOCALE__ | ||
2261 | +#define __nl_langinfo_l(N, L) nl_langinfo((N)) | ||
2262 | +#endif | ||
2263 | + | ||
2264 | +namespace std | ||
2265 | +{ | ||
2266 | + template<> | ||
2267 | + void | ||
2268 | + __timepunct<char>:: | ||
2269 | + _M_put(char* __s, size_t __maxlen, const char* __format, | ||
2270 | + const tm* __tm) const | ||
2271 | + { | ||
2272 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
2273 | + const size_t __len = __strftime_l(__s, __maxlen, __format, __tm, | ||
2274 | + _M_c_locale_timepunct); | ||
2275 | +#else | ||
2276 | + char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
2277 | + setlocale(LC_ALL, _M_name_timepunct); | ||
2278 | + const size_t __len = strftime(__s, __maxlen, __format, __tm); | ||
2279 | + setlocale(LC_ALL, __old); | ||
2280 | + free(__old); | ||
2281 | +#endif | ||
2282 | + // Make sure __s is null terminated. | ||
2283 | + if (__len == 0) | ||
2284 | + __s[0] = '\0'; | ||
2285 | + } | ||
2286 | + | ||
2287 | + template<> | ||
2288 | + void | ||
2289 | + __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc) | ||
2290 | + { | ||
2291 | + if (!_M_data) | ||
2292 | + _M_data = new __timepunct_cache<char>; | ||
2293 | + | ||
2294 | + if (!__cloc) | ||
2295 | + { | ||
2296 | + // "C" locale | ||
2297 | + _M_c_locale_timepunct = _S_get_c_locale(); | ||
2298 | + | ||
2299 | + _M_data->_M_date_format = "%m/%d/%y"; | ||
2300 | + _M_data->_M_date_era_format = "%m/%d/%y"; | ||
2301 | + _M_data->_M_time_format = "%H:%M:%S"; | ||
2302 | + _M_data->_M_time_era_format = "%H:%M:%S"; | ||
2303 | + _M_data->_M_date_time_format = ""; | ||
2304 | + _M_data->_M_date_time_era_format = ""; | ||
2305 | + _M_data->_M_am = "AM"; | ||
2306 | + _M_data->_M_pm = "PM"; | ||
2307 | + _M_data->_M_am_pm_format = ""; | ||
2308 | + | ||
2309 | + // Day names, starting with "C"'s Sunday. | ||
2310 | + _M_data->_M_day1 = "Sunday"; | ||
2311 | + _M_data->_M_day2 = "Monday"; | ||
2312 | + _M_data->_M_day3 = "Tuesday"; | ||
2313 | + _M_data->_M_day4 = "Wednesday"; | ||
2314 | + _M_data->_M_day5 = "Thursday"; | ||
2315 | + _M_data->_M_day6 = "Friday"; | ||
2316 | + _M_data->_M_day7 = "Saturday"; | ||
2317 | + | ||
2318 | + // Abbreviated day names, starting with "C"'s Sun. | ||
2319 | + _M_data->_M_aday1 = "Sun"; | ||
2320 | + _M_data->_M_aday2 = "Mon"; | ||
2321 | + _M_data->_M_aday3 = "Tue"; | ||
2322 | + _M_data->_M_aday4 = "Wed"; | ||
2323 | + _M_data->_M_aday5 = "Thu"; | ||
2324 | + _M_data->_M_aday6 = "Fri"; | ||
2325 | + _M_data->_M_aday7 = "Sat"; | ||
2326 | + | ||
2327 | + // Month names, starting with "C"'s January. | ||
2328 | + _M_data->_M_month01 = "January"; | ||
2329 | + _M_data->_M_month02 = "February"; | ||
2330 | + _M_data->_M_month03 = "March"; | ||
2331 | + _M_data->_M_month04 = "April"; | ||
2332 | + _M_data->_M_month05 = "May"; | ||
2333 | + _M_data->_M_month06 = "June"; | ||
2334 | + _M_data->_M_month07 = "July"; | ||
2335 | + _M_data->_M_month08 = "August"; | ||
2336 | + _M_data->_M_month09 = "September"; | ||
2337 | + _M_data->_M_month10 = "October"; | ||
2338 | + _M_data->_M_month11 = "November"; | ||
2339 | + _M_data->_M_month12 = "December"; | ||
2340 | + | ||
2341 | + // Abbreviated month names, starting with "C"'s Jan. | ||
2342 | + _M_data->_M_amonth01 = "Jan"; | ||
2343 | + _M_data->_M_amonth02 = "Feb"; | ||
2344 | + _M_data->_M_amonth03 = "Mar"; | ||
2345 | + _M_data->_M_amonth04 = "Apr"; | ||
2346 | + _M_data->_M_amonth05 = "May"; | ||
2347 | + _M_data->_M_amonth06 = "Jun"; | ||
2348 | + _M_data->_M_amonth07 = "Jul"; | ||
2349 | + _M_data->_M_amonth08 = "Aug"; | ||
2350 | + _M_data->_M_amonth09 = "Sep"; | ||
2351 | + _M_data->_M_amonth10 = "Oct"; | ||
2352 | + _M_data->_M_amonth11 = "Nov"; | ||
2353 | + _M_data->_M_amonth12 = "Dec"; | ||
2354 | + } | ||
2355 | + else | ||
2356 | + { | ||
2357 | + _M_c_locale_timepunct = _S_clone_c_locale(__cloc); | ||
2358 | + | ||
2359 | + _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc); | ||
2360 | + _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc); | ||
2361 | + _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc); | ||
2362 | + _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc); | ||
2363 | + _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc); | ||
2364 | + _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, | ||
2365 | + __cloc); | ||
2366 | + _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc); | ||
2367 | + _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc); | ||
2368 | + _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc); | ||
2369 | + | ||
2370 | + // Day names, starting with "C"'s Sunday. | ||
2371 | + _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc); | ||
2372 | + _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc); | ||
2373 | + _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc); | ||
2374 | + _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc); | ||
2375 | + _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc); | ||
2376 | + _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc); | ||
2377 | + _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc); | ||
2378 | + | ||
2379 | + // Abbreviated day names, starting with "C"'s Sun. | ||
2380 | + _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc); | ||
2381 | + _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc); | ||
2382 | + _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc); | ||
2383 | + _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc); | ||
2384 | + _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc); | ||
2385 | + _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc); | ||
2386 | + _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc); | ||
2387 | + | ||
2388 | + // Month names, starting with "C"'s January. | ||
2389 | + _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc); | ||
2390 | + _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc); | ||
2391 | + _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc); | ||
2392 | + _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc); | ||
2393 | + _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc); | ||
2394 | + _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc); | ||
2395 | + _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc); | ||
2396 | + _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc); | ||
2397 | + _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc); | ||
2398 | + _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc); | ||
2399 | + _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc); | ||
2400 | + _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc); | ||
2401 | + | ||
2402 | + // Abbreviated month names, starting with "C"'s Jan. | ||
2403 | + _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc); | ||
2404 | + _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc); | ||
2405 | + _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc); | ||
2406 | + _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc); | ||
2407 | + _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc); | ||
2408 | + _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc); | ||
2409 | + _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc); | ||
2410 | + _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc); | ||
2411 | + _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc); | ||
2412 | + _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc); | ||
2413 | + _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc); | ||
2414 | + _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc); | ||
2415 | + } | ||
2416 | + } | ||
2417 | + | ||
2418 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
2419 | + template<> | ||
2420 | + void | ||
2421 | + __timepunct<wchar_t>:: | ||
2422 | + _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, | ||
2423 | + const tm* __tm) const | ||
2424 | + { | ||
2425 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
2426 | + __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct); | ||
2427 | + const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm, | ||
2428 | + _M_c_locale_timepunct); | ||
2429 | +#else | ||
2430 | + char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
2431 | + setlocale(LC_ALL, _M_name_timepunct); | ||
2432 | + const size_t __len = wcsftime(__s, __maxlen, __format, __tm); | ||
2433 | + setlocale(LC_ALL, __old); | ||
2434 | + free(__old); | ||
2435 | +#endif | ||
2436 | + // Make sure __s is null terminated. | ||
2437 | + if (__len == 0) | ||
2438 | + __s[0] = L'\0'; | ||
2439 | + } | ||
2440 | + | ||
2441 | + template<> | ||
2442 | + void | ||
2443 | + __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc) | ||
2444 | + { | ||
2445 | + if (!_M_data) | ||
2446 | + _M_data = new __timepunct_cache<wchar_t>; | ||
2447 | + | ||
2448 | +#warning wide time stuff | ||
2449 | +// if (!__cloc) | ||
2450 | + { | ||
2451 | + // "C" locale | ||
2452 | + _M_c_locale_timepunct = _S_get_c_locale(); | ||
2453 | + | ||
2454 | + _M_data->_M_date_format = L"%m/%d/%y"; | ||
2455 | + _M_data->_M_date_era_format = L"%m/%d/%y"; | ||
2456 | + _M_data->_M_time_format = L"%H:%M:%S"; | ||
2457 | + _M_data->_M_time_era_format = L"%H:%M:%S"; | ||
2458 | + _M_data->_M_date_time_format = L""; | ||
2459 | + _M_data->_M_date_time_era_format = L""; | ||
2460 | + _M_data->_M_am = L"AM"; | ||
2461 | + _M_data->_M_pm = L"PM"; | ||
2462 | + _M_data->_M_am_pm_format = L""; | ||
2463 | + | ||
2464 | + // Day names, starting with "C"'s Sunday. | ||
2465 | + _M_data->_M_day1 = L"Sunday"; | ||
2466 | + _M_data->_M_day2 = L"Monday"; | ||
2467 | + _M_data->_M_day3 = L"Tuesday"; | ||
2468 | + _M_data->_M_day4 = L"Wednesday"; | ||
2469 | + _M_data->_M_day5 = L"Thursday"; | ||
2470 | + _M_data->_M_day6 = L"Friday"; | ||
2471 | + _M_data->_M_day7 = L"Saturday"; | ||
2472 | + | ||
2473 | + // Abbreviated day names, starting with "C"'s Sun. | ||
2474 | + _M_data->_M_aday1 = L"Sun"; | ||
2475 | + _M_data->_M_aday2 = L"Mon"; | ||
2476 | + _M_data->_M_aday3 = L"Tue"; | ||
2477 | + _M_data->_M_aday4 = L"Wed"; | ||
2478 | + _M_data->_M_aday5 = L"Thu"; | ||
2479 | + _M_data->_M_aday6 = L"Fri"; | ||
2480 | + _M_data->_M_aday7 = L"Sat"; | ||
2481 | + | ||
2482 | + // Month names, starting with "C"'s January. | ||
2483 | + _M_data->_M_month01 = L"January"; | ||
2484 | + _M_data->_M_month02 = L"February"; | ||
2485 | + _M_data->_M_month03 = L"March"; | ||
2486 | + _M_data->_M_month04 = L"April"; | ||
2487 | + _M_data->_M_month05 = L"May"; | ||
2488 | + _M_data->_M_month06 = L"June"; | ||
2489 | + _M_data->_M_month07 = L"July"; | ||
2490 | + _M_data->_M_month08 = L"August"; | ||
2491 | + _M_data->_M_month09 = L"September"; | ||
2492 | + _M_data->_M_month10 = L"October"; | ||
2493 | + _M_data->_M_month11 = L"November"; | ||
2494 | + _M_data->_M_month12 = L"December"; | ||
2495 | + | ||
2496 | + // Abbreviated month names, starting with "C"'s Jan. | ||
2497 | + _M_data->_M_amonth01 = L"Jan"; | ||
2498 | + _M_data->_M_amonth02 = L"Feb"; | ||
2499 | + _M_data->_M_amonth03 = L"Mar"; | ||
2500 | + _M_data->_M_amonth04 = L"Apr"; | ||
2501 | + _M_data->_M_amonth05 = L"May"; | ||
2502 | + _M_data->_M_amonth06 = L"Jun"; | ||
2503 | + _M_data->_M_amonth07 = L"Jul"; | ||
2504 | + _M_data->_M_amonth08 = L"Aug"; | ||
2505 | + _M_data->_M_amonth09 = L"Sep"; | ||
2506 | + _M_data->_M_amonth10 = L"Oct"; | ||
2507 | + _M_data->_M_amonth11 = L"Nov"; | ||
2508 | + _M_data->_M_amonth12 = L"Dec"; | ||
2509 | + } | ||
2510 | +#if 0 | ||
2511 | + else | ||
2512 | + { | ||
2513 | + _M_c_locale_timepunct = _S_clone_c_locale(__cloc); | ||
2514 | + | ||
2515 | + union { char *__s; wchar_t *__w; } __u; | ||
2516 | + | ||
2517 | + __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc); | ||
2518 | + _M_data->_M_date_format = __u.__w; | ||
2519 | + __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc); | ||
2520 | + _M_data->_M_date_era_format = __u.__w; | ||
2521 | + __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc); | ||
2522 | + _M_data->_M_time_format = __u.__w; | ||
2523 | + __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc); | ||
2524 | + _M_data->_M_time_era_format = __u.__w; | ||
2525 | + __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc); | ||
2526 | + _M_data->_M_date_time_format = __u.__w; | ||
2527 | + __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc); | ||
2528 | + _M_data->_M_date_time_era_format = __u.__w; | ||
2529 | + __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc); | ||
2530 | + _M_data->_M_am = __u.__w; | ||
2531 | + __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc); | ||
2532 | + _M_data->_M_pm = __u.__w; | ||
2533 | + __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc); | ||
2534 | + _M_data->_M_am_pm_format = __u.__w; | ||
2535 | + | ||
2536 | + // Day names, starting with "C"'s Sunday. | ||
2537 | + __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc); | ||
2538 | + _M_data->_M_day1 = __u.__w; | ||
2539 | + __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc); | ||
2540 | + _M_data->_M_day2 = __u.__w; | ||
2541 | + __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc); | ||
2542 | + _M_data->_M_day3 = __u.__w; | ||
2543 | + __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc); | ||
2544 | + _M_data->_M_day4 = __u.__w; | ||
2545 | + __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc); | ||
2546 | + _M_data->_M_day5 = __u.__w; | ||
2547 | + __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc); | ||
2548 | + _M_data->_M_day6 = __u.__w; | ||
2549 | + __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc); | ||
2550 | + _M_data->_M_day7 = __u.__w; | ||
2551 | + | ||
2552 | + // Abbreviated day names, starting with "C"'s Sun. | ||
2553 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc); | ||
2554 | + _M_data->_M_aday1 = __u.__w; | ||
2555 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc); | ||
2556 | + _M_data->_M_aday2 = __u.__w; | ||
2557 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc); | ||
2558 | + _M_data->_M_aday3 = __u.__w; | ||
2559 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc); | ||
2560 | + _M_data->_M_aday4 = __u.__w; | ||
2561 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc); | ||
2562 | + _M_data->_M_aday5 = __u.__w; | ||
2563 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc); | ||
2564 | + _M_data->_M_aday6 = __u.__w; | ||
2565 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc); | ||
2566 | + _M_data->_M_aday7 = __u.__w; | ||
2567 | + | ||
2568 | + // Month names, starting with "C"'s January. | ||
2569 | + __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc); | ||
2570 | + _M_data->_M_month01 = __u.__w; | ||
2571 | + __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc); | ||
2572 | + _M_data->_M_month02 = __u.__w; | ||
2573 | + __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc); | ||
2574 | + _M_data->_M_month03 = __u.__w; | ||
2575 | + __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc); | ||
2576 | + _M_data->_M_month04 = __u.__w; | ||
2577 | + __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc); | ||
2578 | + _M_data->_M_month05 = __u.__w; | ||
2579 | + __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc); | ||
2580 | + _M_data->_M_month06 = __u.__w; | ||
2581 | + __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc); | ||
2582 | + _M_data->_M_month07 = __u.__w; | ||
2583 | + __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc); | ||
2584 | + _M_data->_M_month08 = __u.__w; | ||
2585 | + __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc); | ||
2586 | + _M_data->_M_month09 = __u.__w; | ||
2587 | + __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc); | ||
2588 | + _M_data->_M_month10 = __u.__w; | ||
2589 | + __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc); | ||
2590 | + _M_data->_M_month11 = __u.__w; | ||
2591 | + __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc); | ||
2592 | + _M_data->_M_month12 = __u.__w; | ||
2593 | + | ||
2594 | + // Abbreviated month names, starting with "C"'s Jan. | ||
2595 | + __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc); | ||
2596 | + _M_data->_M_amonth01 = __u.__w; | ||
2597 | + __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc); | ||
2598 | + _M_data->_M_amonth02 = __u.__w; | ||
2599 | + __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc); | ||
2600 | + _M_data->_M_amonth03 = __u.__w; | ||
2601 | + __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc); | ||
2602 | + _M_data->_M_amonth04 = __u.__w; | ||
2603 | + __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc); | ||
2604 | + _M_data->_M_amonth05 = __u.__w; | ||
2605 | + __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc); | ||
2606 | + _M_data->_M_amonth06 = __u.__w; | ||
2607 | + __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc); | ||
2608 | + _M_data->_M_amonth07 = __u.__w; | ||
2609 | + __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc); | ||
2610 | + _M_data->_M_amonth08 = __u.__w; | ||
2611 | + __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc); | ||
2612 | + _M_data->_M_amonth09 = __u.__w; | ||
2613 | + __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc); | ||
2614 | + _M_data->_M_amonth10 = __u.__w; | ||
2615 | + __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc); | ||
2616 | + _M_data->_M_amonth11 = __u.__w; | ||
2617 | + __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc); | ||
2618 | + _M_data->_M_amonth12 = __u.__w; | ||
2619 | + } | ||
2620 | +#endif // 0 | ||
2621 | + } | ||
2622 | +#endif | ||
2623 | +} | ||
2624 | Index: gcc-4.5.0/libstdc++-v3/config/locale/uclibc/time_members.h | ||
2625 | =================================================================== | ||
2626 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
2627 | +++ gcc-4.5.0/libstdc++-v3/config/locale/uclibc/time_members.h 2010-06-25 10:42:34.913881064 -0700 | ||
2628 | @@ -0,0 +1,68 @@ | ||
2629 | +// std::time_get, std::time_put implementation, GNU version -*- C++ -*- | ||
2630 | + | ||
2631 | +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | ||
2632 | +// | ||
2633 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
2634 | +// software; you can redistribute it and/or modify it under the | ||
2635 | +// terms of the GNU General Public License as published by the | ||
2636 | +// Free Software Foundation; either version 2, or (at your option) | ||
2637 | +// any later version. | ||
2638 | + | ||
2639 | +// This library is distributed in the hope that it will be useful, | ||
2640 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2641 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2642 | +// GNU General Public License for more details. | ||
2643 | + | ||
2644 | +// You should have received a copy of the GNU General Public License along | ||
2645 | +// with this library; see the file COPYING. If not, write to the Free | ||
2646 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
2647 | +// USA. | ||
2648 | + | ||
2649 | +// As a special exception, you may use this file as part of a free software | ||
2650 | +// library without restriction. Specifically, if other files instantiate | ||
2651 | +// templates or use macros or inline functions from this file, or you compile | ||
2652 | +// this file and link it with other files to produce an executable, this | ||
2653 | +// file does not by itself cause the resulting executable to be covered by | ||
2654 | +// the GNU General Public License. This exception does not however | ||
2655 | +// invalidate any other reasons why the executable file might be covered by | ||
2656 | +// the GNU General Public License. | ||
2657 | + | ||
2658 | +// | ||
2659 | +// ISO C++ 14882: 22.2.5.1.2 - time_get functions | ||
2660 | +// ISO C++ 14882: 22.2.5.3.2 - time_put functions | ||
2661 | +// | ||
2662 | + | ||
2663 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
2664 | + | ||
2665 | + template<typename _CharT> | ||
2666 | + __timepunct<_CharT>::__timepunct(size_t __refs) | ||
2667 | + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), | ||
2668 | + _M_name_timepunct(_S_get_c_name()) | ||
2669 | + { _M_initialize_timepunct(); } | ||
2670 | + | ||
2671 | + template<typename _CharT> | ||
2672 | + __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) | ||
2673 | + : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), | ||
2674 | + _M_name_timepunct(_S_get_c_name()) | ||
2675 | + { _M_initialize_timepunct(); } | ||
2676 | + | ||
2677 | + template<typename _CharT> | ||
2678 | + __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, | ||
2679 | + size_t __refs) | ||
2680 | + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), | ||
2681 | + _M_name_timepunct(__s) | ||
2682 | + { | ||
2683 | + char* __tmp = new char[std::strlen(__s) + 1]; | ||
2684 | + std::strcpy(__tmp, __s); | ||
2685 | + _M_name_timepunct = __tmp; | ||
2686 | + _M_initialize_timepunct(__cloc); | ||
2687 | + } | ||
2688 | + | ||
2689 | + template<typename _CharT> | ||
2690 | + __timepunct<_CharT>::~__timepunct() | ||
2691 | + { | ||
2692 | + if (_M_name_timepunct != _S_get_c_name()) | ||
2693 | + delete [] _M_name_timepunct; | ||
2694 | + delete _M_data; | ||
2695 | + _S_destroy_c_locale(_M_c_locale_timepunct); | ||
2696 | + } | ||
2697 | Index: gcc-4.5.0/libstdc++-v3/configure | ||
2698 | =================================================================== | ||
2699 | --- gcc-4.5.0.orig/libstdc++-v3/configure 2010-04-05 18:27:44.000000000 -0700 | ||
2700 | +++ gcc-4.5.0/libstdc++-v3/configure 2010-06-25 10:48:10.124633072 -0700 | ||
2701 | @@ -15577,7 +15577,7 @@ | ||
2702 | if test "${enable_clocale+set}" = set; then : | ||
2703 | enableval=$enable_clocale; | ||
2704 | case "$enableval" in | ||
2705 | - generic|gnu|ieee_1003.1-2001|yes|no|auto) ;; | ||
2706 | + generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;; | ||
2707 | *) as_fn_error "Unknown argument to enable/disable clocale" "$LINENO" 5 ;; | ||
2708 | esac | ||
2709 | |||
2710 | @@ -15609,6 +15609,9 @@ | ||
2711 | # Default to "generic". | ||
2712 | if test $enable_clocale_flag = auto; then | ||
2713 | case ${target_os} in | ||
2714 | + *-uclibc*) | ||
2715 | + enable_clocale_flag=uclibc | ||
2716 | + ;; | ||
2717 | linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) | ||
2718 | enable_clocale_flag=gnu | ||
2719 | ;; | ||
2720 | @@ -15885,6 +15888,76 @@ | ||
2721 | CTIME_CC=config/locale/generic/time_members.cc | ||
2722 | CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h | ||
2723 | ;; | ||
2724 | + uclibc) | ||
2725 | + echo "$as_me:$LINENO: result: uclibc" >&5 | ||
2726 | +echo "${ECHO_T}uclibc" >&6 | ||
2727 | + | ||
2728 | + # Declare intention to use gettext, and add support for specific | ||
2729 | + # languages. | ||
2730 | + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT | ||
2731 | + ALL_LINGUAS="de fr" | ||
2732 | + | ||
2733 | + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. | ||
2734 | + # Extract the first word of "msgfmt", so it can be a program name with args. | ||
2735 | +set dummy msgfmt; ac_word=$2 | ||
2736 | +echo "$as_me:$LINENO: checking for $ac_word" >&5 | ||
2737 | +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 | ||
2738 | +if test "${ac_cv_prog_check_msgfmt+set}" = set; then | ||
2739 | + echo $ECHO_N "(cached) $ECHO_C" >&6 | ||
2740 | +else | ||
2741 | + if test -n "$check_msgfmt"; then | ||
2742 | + ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test. | ||
2743 | +else | ||
2744 | +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | ||
2745 | +for as_dir in $PATH | ||
2746 | +do | ||
2747 | + IFS=$as_save_IFS | ||
2748 | + test -z "$as_dir" && as_dir=. | ||
2749 | + for ac_exec_ext in '' $ac_executable_extensions; do | ||
2750 | + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | ||
2751 | + ac_cv_prog_check_msgfmt="yes" | ||
2752 | + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 | ||
2753 | + break 2 | ||
2754 | + fi | ||
2755 | +done | ||
2756 | +done | ||
2757 | + | ||
2758 | + test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no" | ||
2759 | +fi | ||
2760 | +fi | ||
2761 | +check_msgfmt=$ac_cv_prog_check_msgfmt | ||
2762 | +if test -n "$check_msgfmt"; then | ||
2763 | + echo "$as_me:$LINENO: result: $check_msgfmt" >&5 | ||
2764 | +echo "${ECHO_T}$check_msgfmt" >&6 | ||
2765 | +else | ||
2766 | + echo "$as_me:$LINENO: result: no" >&5 | ||
2767 | +echo "${ECHO_T}no" >&6 | ||
2768 | +fi | ||
2769 | + | ||
2770 | + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then | ||
2771 | + USE_NLS=yes | ||
2772 | + fi | ||
2773 | + # Export the build objects. | ||
2774 | + for ling in $ALL_LINGUAS; do \ | ||
2775 | + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ | ||
2776 | + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ | ||
2777 | + done | ||
2778 | + | ||
2779 | + | ||
2780 | + | ||
2781 | + CLOCALE_H=config/locale/uclibc/c_locale.h | ||
2782 | + CLOCALE_CC=config/locale/uclibc/c_locale.cc | ||
2783 | + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc | ||
2784 | + CCOLLATE_CC=config/locale/uclibc/collate_members.cc | ||
2785 | + CCTYPE_CC=config/locale/uclibc/ctype_members.cc | ||
2786 | + CMESSAGES_H=config/locale/uclibc/messages_members.h | ||
2787 | + CMESSAGES_CC=config/locale/uclibc/messages_members.cc | ||
2788 | + CMONEY_CC=config/locale/uclibc/monetary_members.cc | ||
2789 | + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc | ||
2790 | + CTIME_H=config/locale/uclibc/time_members.h | ||
2791 | + CTIME_CC=config/locale/uclibc/time_members.cc | ||
2792 | + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h | ||
2793 | + ;; | ||
2794 | esac | ||
2795 | |||
2796 | # This is where the testsuite looks for locale catalogs, using the | ||
2797 | @@ -16940,6 +17013,7 @@ | ||
2798 | |||
2799 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||
2800 | /* end confdefs.h. */ | ||
2801 | +#line 17016 "configure" | ||
2802 | #include <wctype.h> | ||
2803 | int | ||
2804 | main () | ||
2805 | @@ -58165,7 +58239,6 @@ | ||
2806 | fi | ||
2807 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||
2808 | /* end confdefs.h. */ | ||
2809 | - | ||
2810 | int | ||
2811 | main () | ||
2812 | { | ||
2813 | Index: gcc-4.5.0/libstdc++-v3/include/c_compatibility/wchar.h | ||
2814 | =================================================================== | ||
2815 | --- gcc-4.5.0.orig/libstdc++-v3/include/c_compatibility/wchar.h 2009-04-09 08:00:19.000000000 -0700 | ||
2816 | +++ gcc-4.5.0/libstdc++-v3/include/c_compatibility/wchar.h 2010-06-25 10:42:34.949880937 -0700 | ||
2817 | @@ -101,7 +101,9 @@ | ||
2818 | using std::wmemcpy; | ||
2819 | using std::wmemmove; | ||
2820 | using std::wmemset; | ||
2821 | +#if _GLIBCXX_HAVE_WCSFTIME | ||
2822 | using std::wcsftime; | ||
2823 | +#endif | ||
2824 | |||
2825 | #if _GLIBCXX_USE_C99 | ||
2826 | using std::wcstold; | ||
2827 | Index: gcc-4.5.0/libstdc++-v3/include/c_std/cwchar | ||
2828 | =================================================================== | ||
2829 | --- gcc-4.5.0.orig/libstdc++-v3/include/c_std/cwchar 2010-02-04 10:20:34.000000000 -0800 | ||
2830 | +++ gcc-4.5.0/libstdc++-v3/include/c_std/cwchar 2010-06-25 10:42:34.949880937 -0700 | ||
2831 | @@ -177,7 +177,9 @@ | ||
2832 | using ::wcscoll; | ||
2833 | using ::wcscpy; | ||
2834 | using ::wcscspn; | ||
2835 | +#if _GLIBCXX_HAVE_WCSFTIME | ||
2836 | using ::wcsftime; | ||
2837 | +#endif | ||
2838 | using ::wcslen; | ||
2839 | using ::wcsncat; | ||
2840 | using ::wcsncmp; | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/203-uclibc-locale-no__x.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/203-uclibc-locale-no__x.patch new file mode 100644 index 0000000000..f39e65220c --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/203-uclibc-locale-no__x.patch | |||
@@ -0,0 +1,233 @@ | |||
1 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h | ||
2 | =================================================================== | ||
3 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-08-16 01:29:20.000000000 -0700 | ||
4 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-08-16 01:33:23.000000000 -0700 | ||
5 | @@ -60,4 +60,49 @@ | ||
6 | extern "C" __typeof(wctype_l) __wctype_l; | ||
7 | #endif | ||
8 | |||
9 | +# define __nl_langinfo_l nl_langinfo_l | ||
10 | +# define __strcoll_l strcoll_l | ||
11 | +# define __strftime_l strftime_l | ||
12 | +# define __strtod_l strtod_l | ||
13 | +# define __strtof_l strtof_l | ||
14 | +# define __strtold_l strtold_l | ||
15 | +# define __strxfrm_l strxfrm_l | ||
16 | +# define __newlocale newlocale | ||
17 | +# define __freelocale freelocale | ||
18 | +# define __duplocale duplocale | ||
19 | +# define __uselocale uselocale | ||
20 | + | ||
21 | +# ifdef _GLIBCXX_USE_WCHAR_T | ||
22 | +# define __iswctype_l iswctype_l | ||
23 | +# define __towlower_l towlower_l | ||
24 | +# define __towupper_l towupper_l | ||
25 | +# define __wcscoll_l wcscoll_l | ||
26 | +# define __wcsftime_l wcsftime_l | ||
27 | +# define __wcsxfrm_l wcsxfrm_l | ||
28 | +# define __wctype_l wctype_l | ||
29 | +# endif | ||
30 | + | ||
31 | +#else | ||
32 | +# define __nl_langinfo_l(N, L) nl_langinfo((N)) | ||
33 | +# define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) | ||
34 | +# define __strtod_l(S, E, L) strtod((S), (E)) | ||
35 | +# define __strtof_l(S, E, L) strtof((S), (E)) | ||
36 | +# define __strtold_l(S, E, L) strtold((S), (E)) | ||
37 | +# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) | ||
38 | +# warning should dummy __newlocale check for C|POSIX ? | ||
39 | +# define __newlocale(a, b, c) NULL | ||
40 | +# define __freelocale(a) ((void)0) | ||
41 | +# define __duplocale(a) __c_locale() | ||
42 | +//# define __uselocale ? | ||
43 | +// | ||
44 | +# ifdef _GLIBCXX_USE_WCHAR_T | ||
45 | +# define __iswctype_l(C, M, L) iswctype((C), (M)) | ||
46 | +# define __towlower_l(C, L) towlower((C)) | ||
47 | +# define __towupper_l(C, L) towupper((C)) | ||
48 | +# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) | ||
49 | +//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T)) | ||
50 | +# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) | ||
51 | +# define __wctype_l(S, L) wctype((S)) | ||
52 | +# endif | ||
53 | + | ||
54 | #endif // GLIBC 2.3 and later | ||
55 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc | ||
56 | =================================================================== | ||
57 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-08-16 01:29:20.000000000 -0700 | ||
58 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-08-16 01:33:00.000000000 -0700 | ||
59 | @@ -39,20 +39,6 @@ | ||
60 | #include <langinfo.h> | ||
61 | #include <bits/c++locale_internal.h> | ||
62 | |||
63 | -#ifndef __UCLIBC_HAS_XLOCALE__ | ||
64 | -#define __strtol_l(S, E, B, L) strtol((S), (E), (B)) | ||
65 | -#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B)) | ||
66 | -#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B)) | ||
67 | -#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B)) | ||
68 | -#define __strtof_l(S, E, L) strtof((S), (E)) | ||
69 | -#define __strtod_l(S, E, L) strtod((S), (E)) | ||
70 | -#define __strtold_l(S, E, L) strtold((S), (E)) | ||
71 | -#warning should dummy __newlocale check for C|POSIX ? | ||
72 | -#define __newlocale(a, b, c) NULL | ||
73 | -#define __freelocale(a) ((void)0) | ||
74 | -#define __duplocale(a) __c_locale() | ||
75 | -#endif | ||
76 | - | ||
77 | namespace std | ||
78 | { | ||
79 | template<> | ||
80 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc | ||
81 | =================================================================== | ||
82 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-08-16 01:29:20.000000000 -0700 | ||
83 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-08-16 01:30:31.000000000 -0700 | ||
84 | @@ -36,13 +36,6 @@ | ||
85 | #include <locale> | ||
86 | #include <bits/c++locale_internal.h> | ||
87 | |||
88 | -#ifndef __UCLIBC_HAS_XLOCALE__ | ||
89 | -#define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) | ||
90 | -#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) | ||
91 | -#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) | ||
92 | -#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) | ||
93 | -#endif | ||
94 | - | ||
95 | namespace std | ||
96 | { | ||
97 | // These are basically extensions to char_traits, and perhaps should | ||
98 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc | ||
99 | =================================================================== | ||
100 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-08-16 01:29:20.000000000 -0700 | ||
101 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-08-16 01:30:31.000000000 -0700 | ||
102 | @@ -43,10 +43,6 @@ | ||
103 | #warning tailor for stub locale support | ||
104 | #endif | ||
105 | |||
106 | -#ifndef __UCLIBC_HAS_XLOCALE__ | ||
107 | -#define __nl_langinfo_l(N, L) nl_langinfo((N)) | ||
108 | -#endif | ||
109 | - | ||
110 | namespace std | ||
111 | { | ||
112 | // Construct and return valid pattern consisting of some combination of: | ||
113 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc | ||
114 | =================================================================== | ||
115 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-08-16 01:29:20.000000000 -0700 | ||
116 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-08-16 01:30:31.000000000 -0700 | ||
117 | @@ -41,9 +41,6 @@ | ||
118 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
119 | #warning tailor for stub locale support | ||
120 | #endif | ||
121 | -#ifndef __UCLIBC_HAS_XLOCALE__ | ||
122 | -#define __nl_langinfo_l(N, L) nl_langinfo((N)) | ||
123 | -#endif | ||
124 | |||
125 | namespace std | ||
126 | { | ||
127 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc | ||
128 | =================================================================== | ||
129 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-08-16 01:29:20.000000000 -0700 | ||
130 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-08-16 01:30:31.000000000 -0700 | ||
131 | @@ -40,9 +40,6 @@ | ||
132 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
133 | #warning tailor for stub locale support | ||
134 | #endif | ||
135 | -#ifndef __UCLIBC_HAS_XLOCALE__ | ||
136 | -#define __nl_langinfo_l(N, L) nl_langinfo((N)) | ||
137 | -#endif | ||
138 | |||
139 | namespace std | ||
140 | { | ||
141 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc | ||
142 | =================================================================== | ||
143 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-08-16 01:29:20.000000000 -0700 | ||
144 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-08-16 01:30:31.000000000 -0700 | ||
145 | @@ -38,13 +38,6 @@ | ||
146 | #undef _LIBC | ||
147 | #include <bits/c++locale_internal.h> | ||
148 | |||
149 | -#ifndef __UCLIBC_HAS_XLOCALE__ | ||
150 | -#define __wctype_l(S, L) wctype((S)) | ||
151 | -#define __towupper_l(C, L) towupper((C)) | ||
152 | -#define __towlower_l(C, L) towlower((C)) | ||
153 | -#define __iswctype_l(C, M, L) iswctype((C), (M)) | ||
154 | -#endif | ||
155 | - | ||
156 | namespace std | ||
157 | { | ||
158 | // NB: The other ctype<char> specializations are in src/locale.cc and | ||
159 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc | ||
160 | =================================================================== | ||
161 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-08-16 01:27:18.000000000 -0700 | ||
162 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-08-16 01:30:31.000000000 -0700 | ||
163 | @@ -39,13 +39,10 @@ | ||
164 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
165 | #warning fix gettext stuff | ||
166 | #endif | ||
167 | -#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ | ||
168 | -extern "C" char *__dcgettext(const char *domainname, | ||
169 | - const char *msgid, int category); | ||
170 | #undef gettext | ||
171 | -#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES) | ||
172 | +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ | ||
173 | +#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES) | ||
174 | #else | ||
175 | -#undef gettext | ||
176 | #define gettext(msgid) (msgid) | ||
177 | #endif | ||
178 | |||
179 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h | ||
180 | =================================================================== | ||
181 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-08-16 01:29:20.000000000 -0700 | ||
182 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-08-16 01:31:43.000000000 -0700 | ||
183 | @@ -36,15 +36,11 @@ | ||
184 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
185 | #warning fix prototypes for *textdomain funcs | ||
186 | #endif | ||
187 | -#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ | ||
188 | -extern "C" char *__textdomain(const char *domainname); | ||
189 | -extern "C" char *__bindtextdomain(const char *domainname, | ||
190 | - const char *dirname); | ||
191 | -#else | ||
192 | -#undef __textdomain | ||
193 | -#undef __bindtextdomain | ||
194 | -#define __textdomain(D) ((void)0) | ||
195 | -#define __bindtextdomain(D,P) ((void)0) | ||
196 | +#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__ | ||
197 | +#undef textdomain | ||
198 | +#undef bindtextdomain | ||
199 | +#define textdomain(D) ((void)0) | ||
200 | +#define bindtextdomain(D,P) ((void)0) | ||
201 | #endif | ||
202 | |||
203 | // Non-virtual member functions. | ||
204 | @@ -70,7 +66,7 @@ | ||
205 | messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, | ||
206 | const char* __dir) const | ||
207 | { | ||
208 | - __bindtextdomain(__s.c_str(), __dir); | ||
209 | + bindtextdomain(__s.c_str(), __dir); | ||
210 | return this->do_open(__s, __loc); | ||
211 | } | ||
212 | |||
213 | @@ -90,7 +86,7 @@ | ||
214 | { | ||
215 | // No error checking is done, assume the catalog exists and can | ||
216 | // be used. | ||
217 | - __textdomain(__s.c_str()); | ||
218 | + textdomain(__s.c_str()); | ||
219 | return 0; | ||
220 | } | ||
221 | |||
222 | Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h | ||
223 | =================================================================== | ||
224 | --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-08-16 01:29:20.000000000 -0700 | ||
225 | +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-08-16 01:30:31.000000000 -0700 | ||
226 | @@ -68,6 +68,7 @@ | ||
227 | { | ||
228 | extern "C" __typeof(uselocale) __uselocale; | ||
229 | } | ||
230 | +#define __uselocale uselocale | ||
231 | #endif | ||
232 | |||
233 | namespace std | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/204-uclibc-locale-wchar_fix.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/204-uclibc-locale-wchar_fix.patch new file mode 100644 index 0000000000..160ab35bb3 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/204-uclibc-locale-wchar_fix.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | --- gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc.uclibc200_wchar~ 2006-03-10 15:32:37 +0100 | ||
2 | +++ gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2006-03-10 15:37:27 +0100 | ||
3 | @@ -401,7 +401,7 @@ | ||
4 | # ifdef __UCLIBC_HAS_XLOCALE__ | ||
5 | _M_data->_M_decimal_point = __cloc->decimal_point_wc; | ||
6 | _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; | ||
7 | -# else | ||
8 | +# elif defined __UCLIBC_HAS_LOCALE__ | ||
9 | _M_data->_M_decimal_point = __global_locale->decimal_point_wc; | ||
10 | _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; | ||
11 | # endif | ||
12 | @@ -556,7 +556,7 @@ | ||
13 | # ifdef __UCLIBC_HAS_XLOCALE__ | ||
14 | _M_data->_M_decimal_point = __cloc->decimal_point_wc; | ||
15 | _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; | ||
16 | -# else | ||
17 | +# elif defined __UCLIBC_HAS_LOCALE__ | ||
18 | _M_data->_M_decimal_point = __global_locale->decimal_point_wc; | ||
19 | _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; | ||
20 | # endif | ||
21 | --- gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc.uclibc200_wchar~ 2006-03-10 15:32:37 +0100 | ||
22 | +++ gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2006-03-10 15:37:27 +0100 | ||
23 | @@ -127,12 +127,25 @@ | ||
24 | { | ||
25 | // Named locale. | ||
26 | // NB: In the GNU model wchar_t is always 32 bit wide. | ||
27 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
28 | +#warning fix this... should be numeric | ||
29 | +#endif | ||
30 | +#ifdef __UCLIBC__ | ||
31 | +# ifdef __UCLIBC_HAS_XLOCALE__ | ||
32 | + _M_data->_M_decimal_point = __cloc->decimal_point_wc; | ||
33 | + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; | ||
34 | +# elif defined __UCLIBC_HAS_LOCALE__ | ||
35 | + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; | ||
36 | + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; | ||
37 | +# endif | ||
38 | +#else | ||
39 | union { char *__s; wchar_t __w; } __u; | ||
40 | __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc); | ||
41 | _M_data->_M_decimal_point = __u.__w; | ||
42 | |||
43 | __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc); | ||
44 | _M_data->_M_thousands_sep = __u.__w; | ||
45 | +#endif | ||
46 | |||
47 | if (_M_data->_M_thousands_sep == L'\0') | ||
48 | _M_data->_M_grouping = ""; | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/205-uclibc-locale-update.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/205-uclibc-locale-update.patch new file mode 100644 index 0000000000..48eaa1d442 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/205-uclibc-locale-update.patch | |||
@@ -0,0 +1,519 @@ | |||
1 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc | ||
2 | =================================================================== | ||
3 | --- gcc-4.3.2.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-09-17 22:35:28.000000000 -0700 | ||
4 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-09-17 22:35:29.000000000 -0700 | ||
5 | @@ -39,23 +39,20 @@ | ||
6 | #include <langinfo.h> | ||
7 | #include <bits/c++locale_internal.h> | ||
8 | |||
9 | -namespace std | ||
10 | -{ | ||
11 | +_GLIBCXX_BEGIN_NAMESPACE(std) | ||
12 | + | ||
13 | template<> | ||
14 | void | ||
15 | __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, | ||
16 | const __c_locale& __cloc) | ||
17 | { | ||
18 | - if (!(__err & ios_base::failbit)) | ||
19 | - { | ||
20 | - char* __sanity; | ||
21 | - errno = 0; | ||
22 | - float __f = __strtof_l(__s, &__sanity, __cloc); | ||
23 | - if (__sanity != __s && errno != ERANGE) | ||
24 | - __v = __f; | ||
25 | - else | ||
26 | - __err |= ios_base::failbit; | ||
27 | - } | ||
28 | + char* __sanity; | ||
29 | + errno = 0; | ||
30 | + float __f = __strtof_l(__s, &__sanity, __cloc); | ||
31 | + if (__sanity != __s && errno != ERANGE) | ||
32 | + __v = __f; | ||
33 | + else | ||
34 | + __err |= ios_base::failbit; | ||
35 | } | ||
36 | |||
37 | template<> | ||
38 | @@ -63,16 +60,13 @@ | ||
39 | __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, | ||
40 | const __c_locale& __cloc) | ||
41 | { | ||
42 | - if (!(__err & ios_base::failbit)) | ||
43 | - { | ||
44 | - char* __sanity; | ||
45 | - errno = 0; | ||
46 | - double __d = __strtod_l(__s, &__sanity, __cloc); | ||
47 | - if (__sanity != __s && errno != ERANGE) | ||
48 | - __v = __d; | ||
49 | - else | ||
50 | - __err |= ios_base::failbit; | ||
51 | - } | ||
52 | + char* __sanity; | ||
53 | + errno = 0; | ||
54 | + double __d = __strtod_l(__s, &__sanity, __cloc); | ||
55 | + if (__sanity != __s && errno != ERANGE) | ||
56 | + __v = __d; | ||
57 | + else | ||
58 | + __err |= ios_base::failbit; | ||
59 | } | ||
60 | |||
61 | template<> | ||
62 | @@ -80,16 +74,13 @@ | ||
63 | __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err, | ||
64 | const __c_locale& __cloc) | ||
65 | { | ||
66 | - if (!(__err & ios_base::failbit)) | ||
67 | - { | ||
68 | - char* __sanity; | ||
69 | - errno = 0; | ||
70 | - long double __ld = __strtold_l(__s, &__sanity, __cloc); | ||
71 | - if (__sanity != __s && errno != ERANGE) | ||
72 | - __v = __ld; | ||
73 | - else | ||
74 | - __err |= ios_base::failbit; | ||
75 | - } | ||
76 | + char* __sanity; | ||
77 | + errno = 0; | ||
78 | + long double __ld = __strtold_l(__s, &__sanity, __cloc); | ||
79 | + if (__sanity != __s && errno != ERANGE) | ||
80 | + __v = __ld; | ||
81 | + else | ||
82 | + __err |= ios_base::failbit; | ||
83 | } | ||
84 | |||
85 | void | ||
86 | @@ -110,17 +101,18 @@ | ||
87 | void | ||
88 | locale::facet::_S_destroy_c_locale(__c_locale& __cloc) | ||
89 | { | ||
90 | - if (_S_get_c_locale() != __cloc) | ||
91 | + if (__cloc && _S_get_c_locale() != __cloc) | ||
92 | __freelocale(__cloc); | ||
93 | } | ||
94 | |||
95 | __c_locale | ||
96 | locale::facet::_S_clone_c_locale(__c_locale& __cloc) | ||
97 | { return __duplocale(__cloc); } | ||
98 | -} // namespace std | ||
99 | |||
100 | -namespace __gnu_cxx | ||
101 | -{ | ||
102 | +_GLIBCXX_END_NAMESPACE | ||
103 | + | ||
104 | +_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) | ||
105 | + | ||
106 | const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] = | ||
107 | { | ||
108 | "LC_CTYPE", | ||
109 | @@ -138,9 +130,11 @@ | ||
110 | "LC_IDENTIFICATION" | ||
111 | #endif | ||
112 | }; | ||
113 | -} | ||
114 | |||
115 | -namespace std | ||
116 | -{ | ||
117 | +_GLIBCXX_END_NAMESPACE | ||
118 | + | ||
119 | +_GLIBCXX_BEGIN_NAMESPACE(std) | ||
120 | + | ||
121 | const char* const* const locale::_S_categories = __gnu_cxx::category_names; | ||
122 | -} // namespace std | ||
123 | + | ||
124 | +_GLIBCXX_END_NAMESPACE | ||
125 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc | ||
126 | =================================================================== | ||
127 | --- gcc-4.3.2.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-09-17 22:35:28.000000000 -0700 | ||
128 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-09-17 23:09:49.000000000 -0700 | ||
129 | @@ -33,16 +33,20 @@ | ||
130 | |||
131 | // Written by Benjamin Kosnik <bkoz@redhat.com> | ||
132 | |||
133 | +#include <features.h> | ||
134 | +#ifdef __UCLIBC_HAS_LOCALE__ | ||
135 | #define _LIBC | ||
136 | #include <locale> | ||
137 | #undef _LIBC | ||
138 | +#else | ||
139 | +#include <locale> | ||
140 | +#endif | ||
141 | #include <bits/c++locale_internal.h> | ||
142 | |||
143 | -namespace std | ||
144 | -{ | ||
145 | +_GLIBCXX_BEGIN_NAMESPACE(std) | ||
146 | + | ||
147 | // NB: The other ctype<char> specializations are in src/locale.cc and | ||
148 | // various /config/os/* files. | ||
149 | - template<> | ||
150 | ctype_byname<char>::ctype_byname(const char* __s, size_t __refs) | ||
151 | : ctype<char>(0, false, __refs) | ||
152 | { | ||
153 | @@ -57,6 +61,8 @@ | ||
154 | #endif | ||
155 | } | ||
156 | } | ||
157 | + ctype_byname<char>::~ctype_byname() | ||
158 | + { } | ||
159 | |||
160 | #ifdef _GLIBCXX_USE_WCHAR_T | ||
161 | ctype<wchar_t>::__wmask_type | ||
162 | @@ -138,17 +144,33 @@ | ||
163 | ctype<wchar_t>:: | ||
164 | do_is(mask __m, wchar_t __c) const | ||
165 | { | ||
166 | - // Highest bitmask in ctype_base == 10, but extra in "C" | ||
167 | - // library for blank. | ||
168 | + // The case of __m == ctype_base::space is particularly important, | ||
169 | + // due to its use in many istream functions. Therefore we deal with | ||
170 | + // it first, exploiting the knowledge that on GNU systems _M_bit[5] | ||
171 | + // is the mask corresponding to ctype_base::space. NB: an encoding | ||
172 | + // change would not affect correctness! | ||
173 | + | ||
174 | bool __ret = false; | ||
175 | - const size_t __bitmasksize = 11; | ||
176 | - for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) | ||
177 | - if (__m & _M_bit[__bitcur] | ||
178 | - && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) | ||
179 | - { | ||
180 | - __ret = true; | ||
181 | - break; | ||
182 | - } | ||
183 | + if (__m == _M_bit[5]) | ||
184 | + __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype); | ||
185 | + else | ||
186 | + { | ||
187 | + // Highest bitmask in ctype_base == 10, but extra in "C" | ||
188 | + // library for blank. | ||
189 | + const size_t __bitmasksize = 11; | ||
190 | + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) | ||
191 | + if (__m & _M_bit[__bitcur]) | ||
192 | + { | ||
193 | + if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) | ||
194 | + { | ||
195 | + __ret = true; | ||
196 | + break; | ||
197 | + } | ||
198 | + else if (__m == _M_bit[__bitcur]) | ||
199 | + break; | ||
200 | + } | ||
201 | + } | ||
202 | + | ||
203 | return __ret; | ||
204 | } | ||
205 | |||
206 | @@ -290,4 +312,5 @@ | ||
207 | #endif | ||
208 | } | ||
209 | #endif // _GLIBCXX_USE_WCHAR_T | ||
210 | -} | ||
211 | + | ||
212 | +_GLIBCXX_END_NAMESPACE | ||
213 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h | ||
214 | =================================================================== | ||
215 | --- gcc-4.3.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-09-17 22:35:28.000000000 -0700 | ||
216 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-09-17 23:13:34.000000000 -0700 | ||
217 | @@ -53,12 +53,16 @@ | ||
218 | template<typename _CharT> | ||
219 | messages<_CharT>::messages(__c_locale __cloc, const char* __s, | ||
220 | size_t __refs) | ||
221 | - : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)), | ||
222 | - _M_name_messages(__s) | ||
223 | + : facet(__refs), _M_c_locale_messages(NULL), | ||
224 | + _M_name_messages(NULL) | ||
225 | { | ||
226 | - char* __tmp = new char[std::strlen(__s) + 1]; | ||
227 | - std::strcpy(__tmp, __s); | ||
228 | + const size_t __len = std::strlen(__s) + 1; | ||
229 | + char* __tmp = new char[__len]; | ||
230 | + std::memcpy(__tmp, __s, __len); | ||
231 | _M_name_messages = __tmp; | ||
232 | + | ||
233 | + // Last to avoid leaking memory if new throws. | ||
234 | + _M_c_locale_messages = _S_clone_c_locale(__cloc); | ||
235 | } | ||
236 | |||
237 | template<typename _CharT> | ||
238 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc | ||
239 | =================================================================== | ||
240 | --- gcc-4.3.2.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-09-17 22:35:28.000000000 -0700 | ||
241 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-09-17 22:35:29.000000000 -0700 | ||
242 | @@ -33,9 +33,14 @@ | ||
243 | |||
244 | // Written by Benjamin Kosnik <bkoz@redhat.com> | ||
245 | |||
246 | +#include <features.h> | ||
247 | +#ifdef __UCLIBC_HAS_LOCALE__ | ||
248 | #define _LIBC | ||
249 | #include <locale> | ||
250 | #undef _LIBC | ||
251 | +#else | ||
252 | +#include <locale> | ||
253 | +#endif | ||
254 | #include <bits/c++locale_internal.h> | ||
255 | |||
256 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
257 | @@ -206,7 +211,7 @@ | ||
258 | } | ||
259 | break; | ||
260 | default: | ||
261 | - ; | ||
262 | + __ret = pattern(); | ||
263 | } | ||
264 | return __ret; | ||
265 | } | ||
266 | @@ -390,7 +395,9 @@ | ||
267 | __c_locale __old = __uselocale(__cloc); | ||
268 | #else | ||
269 | // Switch to named locale so that mbsrtowcs will work. | ||
270 | - char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
271 | + char* __old = setlocale(LC_ALL, NULL); | ||
272 | + const size_t __llen = strlen(__old) + 1; | ||
273 | + char* __sav = new char[__llen]; | ||
274 | setlocale(LC_ALL, __name); | ||
275 | #endif | ||
276 | |||
277 | @@ -477,8 +484,8 @@ | ||
278 | #ifdef __UCLIBC_HAS_XLOCALE__ | ||
279 | __uselocale(__old); | ||
280 | #else | ||
281 | - setlocale(LC_ALL, __old); | ||
282 | - free(__old); | ||
283 | + setlocale(LC_ALL, __sav); | ||
284 | + delete [] __sav; | ||
285 | #endif | ||
286 | __throw_exception_again; | ||
287 | } | ||
288 | @@ -498,8 +505,8 @@ | ||
289 | #ifdef __UCLIBC_HAS_XLOCALE__ | ||
290 | __uselocale(__old); | ||
291 | #else | ||
292 | - setlocale(LC_ALL, __old); | ||
293 | - free(__old); | ||
294 | + setlocale(LC_ALL, __sav); | ||
295 | + delete [] __sav; | ||
296 | #endif | ||
297 | } | ||
298 | } | ||
299 | @@ -545,8 +552,11 @@ | ||
300 | __c_locale __old = __uselocale(__cloc); | ||
301 | #else | ||
302 | // Switch to named locale so that mbsrtowcs will work. | ||
303 | - char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
304 | - setlocale(LC_ALL, __name); | ||
305 | + char* __old = setlocale(LC_ALL, NULL); | ||
306 | + const size_t __llen = strlen(__old) + 1; | ||
307 | + char* __sav = new char[__llen]; | ||
308 | + memcpy(__sav, __old, __llen); | ||
309 | + setlocale(LC_ALL, __name); | ||
310 | #endif | ||
311 | |||
312 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
313 | @@ -633,8 +643,8 @@ | ||
314 | #ifdef __UCLIBC_HAS_XLOCALE__ | ||
315 | __uselocale(__old); | ||
316 | #else | ||
317 | - setlocale(LC_ALL, __old); | ||
318 | - free(__old); | ||
319 | + setlocale(LC_ALL, __sav); | ||
320 | + delete [] __sav; | ||
321 | #endif | ||
322 | __throw_exception_again; | ||
323 | } | ||
324 | @@ -653,8 +663,8 @@ | ||
325 | #ifdef __UCLIBC_HAS_XLOCALE__ | ||
326 | __uselocale(__old); | ||
327 | #else | ||
328 | - setlocale(LC_ALL, __old); | ||
329 | - free(__old); | ||
330 | + setlocale(LC_ALL, __sav); | ||
331 | + delete [] __sav; | ||
332 | #endif | ||
333 | } | ||
334 | } | ||
335 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc | ||
336 | =================================================================== | ||
337 | --- gcc-4.3.2.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-09-17 22:35:28.000000000 -0700 | ||
338 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-09-17 22:35:29.000000000 -0700 | ||
339 | @@ -33,9 +33,14 @@ | ||
340 | |||
341 | // Written by Benjamin Kosnik <bkoz@redhat.com> | ||
342 | |||
343 | +#include <features.h> | ||
344 | +#ifdef __UCLIBC_HAS_LOCALE__ | ||
345 | #define _LIBC | ||
346 | #include <locale> | ||
347 | #undef _LIBC | ||
348 | +#else | ||
349 | +#include <locale> | ||
350 | +#endif | ||
351 | #include <bits/c++locale_internal.h> | ||
352 | |||
353 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
354 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/time_members.h | ||
355 | =================================================================== | ||
356 | --- gcc-4.3.2.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-09-17 22:35:27.000000000 -0700 | ||
357 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/time_members.h 2008-09-17 23:13:34.000000000 -0700 | ||
358 | @@ -50,12 +50,21 @@ | ||
359 | __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, | ||
360 | size_t __refs) | ||
361 | : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), | ||
362 | - _M_name_timepunct(__s) | ||
363 | + _M_name_timepunct(NULL) | ||
364 | { | ||
365 | - char* __tmp = new char[std::strlen(__s) + 1]; | ||
366 | - std::strcpy(__tmp, __s); | ||
367 | + const size_t __len = std::strlen(__s) + 1; | ||
368 | + char* __tmp = new char[__len]; | ||
369 | + std::memcpy(__tmp, __s, __len); | ||
370 | _M_name_timepunct = __tmp; | ||
371 | - _M_initialize_timepunct(__cloc); | ||
372 | + | ||
373 | + try | ||
374 | + { _M_initialize_timepunct(__cloc); } | ||
375 | + catch(...) | ||
376 | + { | ||
377 | + delete [] _M_name_timepunct; | ||
378 | + __throw_exception_again; | ||
379 | + } | ||
380 | + | ||
381 | } | ||
382 | |||
383 | template<typename _CharT> | ||
384 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h | ||
385 | =================================================================== | ||
386 | --- gcc-4.3.2.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-09-17 22:35:28.000000000 -0700 | ||
387 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-09-17 22:35:29.000000000 -0700 | ||
388 | @@ -39,21 +39,23 @@ | ||
389 | #pragma GCC system_header | ||
390 | |||
391 | #include <cstring> // get std::strlen | ||
392 | -#include <cstdio> // get std::snprintf or std::sprintf | ||
393 | +#include <cstdio> // get std::vsnprintf or std::vsprintf | ||
394 | #include <clocale> | ||
395 | #include <langinfo.h> // For codecvt | ||
396 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
397 | #warning fix this | ||
398 | #endif | ||
399 | -#ifdef __UCLIBC_HAS_LOCALE__ | ||
400 | +#ifdef _GLIBCXX_USE_ICONV | ||
401 | #include <iconv.h> // For codecvt using iconv, iconv_t | ||
402 | #endif | ||
403 | -#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ | ||
404 | -#include <libintl.h> // For messages | ||
405 | +#ifdef HAVE_LIBINTL_H | ||
406 | +#include <libintl.h> // For messages | ||
407 | #endif | ||
408 | +#include <cstdarg> | ||
409 | |||
410 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
411 | #warning what is _GLIBCXX_C_LOCALE_GNU for | ||
412 | +// psm: used in os/gnu-linux/ctype_noninline.h | ||
413 | #endif | ||
414 | #define _GLIBCXX_C_LOCALE_GNU 1 | ||
415 | |||
416 | @@ -78,23 +80,25 @@ | ||
417 | #else | ||
418 | typedef int* __c_locale; | ||
419 | #endif | ||
420 | - | ||
421 | - // Convert numeric value of type _Tv to string and return length of | ||
422 | - // string. If snprintf is available use it, otherwise fall back to | ||
423 | - // the unsafe sprintf which, in general, can be dangerous and should | ||
424 | + // Convert numeric value of type double to string and return length of | ||
425 | + // string. If vsnprintf is available use it, otherwise fall back to | ||
426 | + // the unsafe vsprintf which, in general, can be dangerous and should | ||
427 | // be avoided. | ||
428 | - template<typename _Tv> | ||
429 | - int | ||
430 | - __convert_from_v(char* __out, | ||
431 | - const int __size __attribute__ ((__unused__)), | ||
432 | - const char* __fmt, | ||
433 | -#ifdef __UCLIBC_HAS_XCLOCALE__ | ||
434 | - _Tv __v, const __c_locale& __cloc, int __prec) | ||
435 | + inline int | ||
436 | + __convert_from_v(const __c_locale& | ||
437 | +#ifndef __UCLIBC_HAS_XCLOCALE__ | ||
438 | + __cloc __attribute__ ((__unused__)) | ||
439 | +#endif | ||
440 | + , | ||
441 | + char* __out, | ||
442 | + const int __size, | ||
443 | + const char* __fmt, ...) | ||
444 | { | ||
445 | + va_list __args; | ||
446 | +#ifdef __UCLIBC_HAS_XCLOCALE__ | ||
447 | + | ||
448 | __c_locale __old = __gnu_cxx::__uselocale(__cloc); | ||
449 | #else | ||
450 | - _Tv __v, const __c_locale&, int __prec) | ||
451 | - { | ||
452 | # ifdef __UCLIBC_HAS_LOCALE__ | ||
453 | char* __old = std::setlocale(LC_ALL, NULL); | ||
454 | char* __sav = new char[std::strlen(__old) + 1]; | ||
455 | @@ -103,7 +107,9 @@ | ||
456 | # endif | ||
457 | #endif | ||
458 | |||
459 | - const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); | ||
460 | + va_start(__args, __fmt); | ||
461 | + const int __ret = std::vsnprintf(__out, __size, __fmt, __args); | ||
462 | + va_end(__args); | ||
463 | |||
464 | #ifdef __UCLIBC_HAS_XCLOCALE__ | ||
465 | __gnu_cxx::__uselocale(__old); | ||
466 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc | ||
467 | =================================================================== | ||
468 | --- gcc-4.3.2.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-09-17 22:35:28.000000000 -0700 | ||
469 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-09-17 22:35:29.000000000 -0700 | ||
470 | @@ -53,11 +53,14 @@ | ||
471 | const size_t __len = __strftime_l(__s, __maxlen, __format, __tm, | ||
472 | _M_c_locale_timepunct); | ||
473 | #else | ||
474 | - char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
475 | + char* __old = setlocale(LC_ALL, NULL); | ||
476 | + const size_t __llen = strlen(__old) + 1; | ||
477 | + char* __sav = new char[__llen]; | ||
478 | + memcpy(__sav, __old, __llen); | ||
479 | setlocale(LC_ALL, _M_name_timepunct); | ||
480 | const size_t __len = strftime(__s, __maxlen, __format, __tm); | ||
481 | - setlocale(LC_ALL, __old); | ||
482 | - free(__old); | ||
483 | + setlocale(LC_ALL, __sav); | ||
484 | + delete [] __sav; | ||
485 | #endif | ||
486 | // Make sure __s is null terminated. | ||
487 | if (__len == 0) | ||
488 | @@ -207,11 +210,14 @@ | ||
489 | const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm, | ||
490 | _M_c_locale_timepunct); | ||
491 | #else | ||
492 | - char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
493 | + char* __old = setlocale(LC_ALL, NULL); | ||
494 | + const size_t __llen = strlen(__old) + 1; | ||
495 | + char* __sav = new char[__llen]; | ||
496 | + memcpy(__sav, __old, __llen); | ||
497 | setlocale(LC_ALL, _M_name_timepunct); | ||
498 | const size_t __len = wcsftime(__s, __maxlen, __format, __tm); | ||
499 | - setlocale(LC_ALL, __old); | ||
500 | - free(__old); | ||
501 | + setlocale(LC_ALL, __sav); | ||
502 | + delete [] __sav; | ||
503 | #endif | ||
504 | // Make sure __s is null terminated. | ||
505 | if (__len == 0) | ||
506 | Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h | ||
507 | =================================================================== | ||
508 | --- gcc-4.3.2.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-09-17 22:35:28.000000000 -0700 | ||
509 | +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-09-17 22:35:29.000000000 -0700 | ||
510 | @@ -31,6 +31,9 @@ | ||
511 | |||
512 | #include <bits/c++config.h> | ||
513 | #include <clocale> | ||
514 | +#include <cstdlib> | ||
515 | +#include <cstring> | ||
516 | +#include <cstddef> | ||
517 | |||
518 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
519 | #warning clean this up | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/301-missing-execinfo_h.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/301-missing-execinfo_h.patch new file mode 100644 index 0000000000..aaa5cee8c8 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/301-missing-execinfo_h.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | Index: gcc-4.5.0/boehm-gc/include/gc.h | ||
2 | =================================================================== | ||
3 | --- gcc-4.5.0.orig/boehm-gc/include/gc.h 2007-04-23 14:10:09.000000000 -0700 | ||
4 | +++ gcc-4.5.0/boehm-gc/include/gc.h 2010-06-25 10:49:12.768883509 -0700 | ||
5 | @@ -503,7 +503,7 @@ | ||
6 | #if defined(__linux__) || defined(__GLIBC__) | ||
7 | # include <features.h> | ||
8 | # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \ | ||
9 | - && !defined(__ia64__) | ||
10 | + && !defined(__ia64__) && !defined(__UCLIBC__) | ||
11 | # ifndef GC_HAVE_BUILTIN_BACKTRACE | ||
12 | # define GC_HAVE_BUILTIN_BACKTRACE | ||
13 | # endif | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/302-c99-snprintf.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/302-c99-snprintf.patch new file mode 100644 index 0000000000..12be2da79c --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/302-c99-snprintf.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | Index: gcc-4.5.0/libstdc++-v3/include/c_std/cstdio | ||
2 | =================================================================== | ||
3 | --- gcc-4.5.0.orig/libstdc++-v3/include/c_std/cstdio 2010-02-04 10:20:34.000000000 -0800 | ||
4 | +++ gcc-4.5.0/libstdc++-v3/include/c_std/cstdio 2010-06-25 10:51:12.712631679 -0700 | ||
5 | @@ -139,7 +139,7 @@ | ||
6 | |||
7 | _GLIBCXX_END_NAMESPACE | ||
8 | |||
9 | -#if _GLIBCXX_USE_C99 | ||
10 | +#if _GLIBCXX_USE_C99 || defined(__UCLIBC__) | ||
11 | |||
12 | #undef snprintf | ||
13 | #undef vfscanf | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/303-c99-complex-ugly-hack.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/303-c99-complex-ugly-hack.patch new file mode 100644 index 0000000000..56aa78cdd2 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/303-c99-complex-ugly-hack.patch | |||
@@ -0,0 +1,14 @@ | |||
1 | Index: gcc-4.5.0/libstdc++-v3/configure | ||
2 | =================================================================== | ||
3 | --- gcc-4.5.0.orig/libstdc++-v3/configure 2010-06-25 10:48:37.488384191 -0700 | ||
4 | +++ gcc-4.5.0/libstdc++-v3/configure 2010-06-25 10:51:23.804380413 -0700 | ||
5 | @@ -18262,6 +18262,9 @@ | ||
6 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||
7 | /* end confdefs.h. */ | ||
8 | #include <complex.h> | ||
9 | +#ifdef __UCLIBC__ | ||
10 | +#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs | ||
11 | +#endif | ||
12 | int | ||
13 | main () | ||
14 | { | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/304-index_macro.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/304-index_macro.patch new file mode 100644 index 0000000000..bbb6563513 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/304-index_macro.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | Index: gcc-4.5.0/libstdc++-v3/include/ext/rope | ||
2 | =================================================================== | ||
3 | --- gcc-4.5.0.orig/libstdc++-v3/include/ext/rope 2009-04-09 08:00:19.000000000 -0700 | ||
4 | +++ gcc-4.5.0/libstdc++-v3/include/ext/rope 2010-06-25 10:51:33.613383077 -0700 | ||
5 | @@ -54,6 +54,9 @@ | ||
6 | #include <bits/gthr.h> | ||
7 | #include <tr1/functional> | ||
8 | |||
9 | +/* cope w/ index defined as macro, SuSv3 proposal */ | ||
10 | +#undef index | ||
11 | + | ||
12 | # ifdef __GC | ||
13 | # define __GC_CONST const | ||
14 | # else | ||
15 | Index: gcc-4.5.0/libstdc++-v3/include/ext/ropeimpl.h | ||
16 | =================================================================== | ||
17 | --- gcc-4.5.0.orig/libstdc++-v3/include/ext/ropeimpl.h 2009-04-09 08:00:19.000000000 -0700 | ||
18 | +++ gcc-4.5.0/libstdc++-v3/include/ext/ropeimpl.h 2010-06-25 10:51:33.621381669 -0700 | ||
19 | @@ -49,6 +49,9 @@ | ||
20 | #include <ext/memory> // For uninitialized_copy_n | ||
21 | #include <ext/numeric> // For power | ||
22 | |||
23 | +/* cope w/ index defined as macro, SuSv3 proposal */ | ||
24 | +#undef index | ||
25 | + | ||
26 | _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) | ||
27 | |||
28 | using std::size_t; | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/305-libmudflap-susv3-legacy.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/305-libmudflap-susv3-legacy.patch new file mode 100644 index 0000000000..f890acb813 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/305-libmudflap-susv3-legacy.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | Index: gcc-4.5.0/libmudflap/mf-hooks2.c | ||
2 | =================================================================== | ||
3 | --- gcc-4.5.0.orig/libmudflap/mf-hooks2.c 2009-04-09 08:00:19.000000000 -0700 | ||
4 | +++ gcc-4.5.0/libmudflap/mf-hooks2.c 2010-06-25 10:52:13.937636901 -0700 | ||
5 | @@ -421,7 +421,7 @@ | ||
6 | { | ||
7 | TRACE ("%s\n", __PRETTY_FUNCTION__); | ||
8 | MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region"); | ||
9 | - bzero (s, n); | ||
10 | + memset (s, 0, n); | ||
11 | } | ||
12 | |||
13 | |||
14 | @@ -431,7 +431,7 @@ | ||
15 | TRACE ("%s\n", __PRETTY_FUNCTION__); | ||
16 | MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src"); | ||
17 | MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest"); | ||
18 | - bcopy (src, dest, n); | ||
19 | + memmove (dest, src, n); | ||
20 | } | ||
21 | |||
22 | |||
23 | @@ -441,7 +441,7 @@ | ||
24 | TRACE ("%s\n", __PRETTY_FUNCTION__); | ||
25 | MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg"); | ||
26 | MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg"); | ||
27 | - return bcmp (s1, s2, n); | ||
28 | + return n == 0 ? 0 : memcmp (s1, s2, n); | ||
29 | } | ||
30 | |||
31 | |||
32 | @@ -450,7 +450,7 @@ | ||
33 | size_t n = strlen (s); | ||
34 | TRACE ("%s\n", __PRETTY_FUNCTION__); | ||
35 | MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region"); | ||
36 | - return index (s, c); | ||
37 | + return strchr (s, c); | ||
38 | } | ||
39 | |||
40 | |||
41 | @@ -459,7 +459,7 @@ | ||
42 | size_t n = strlen (s); | ||
43 | TRACE ("%s\n", __PRETTY_FUNCTION__); | ||
44 | MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region"); | ||
45 | - return rindex (s, c); | ||
46 | + return strrchr (s, c); | ||
47 | } | ||
48 | |||
49 | /* XXX: stpcpy, memccpy */ | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/306-libstdc++-namespace.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/306-libstdc++-namespace.patch new file mode 100644 index 0000000000..75c7401373 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/306-libstdc++-namespace.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | Index: gcc-4.5.0/libstdc++-v3/config/locale/uclibc/messages_members.h | ||
2 | =================================================================== | ||
3 | --- gcc-4.5.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2010-06-25 10:49:07.024632961 -0700 | ||
4 | +++ gcc-4.5.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2010-06-25 10:52:33.980632645 -0700 | ||
5 | @@ -32,7 +32,8 @@ | ||
6 | // | ||
7 | |||
8 | // Written by Benjamin Kosnik <bkoz@redhat.com> | ||
9 | - | ||
10 | +namespace std | ||
11 | +{ | ||
12 | #ifdef __UCLIBC_MJN3_ONLY__ | ||
13 | #warning fix prototypes for *textdomain funcs | ||
14 | #endif | ||
15 | @@ -116,3 +117,4 @@ | ||
16 | this->_S_create_c_locale(this->_M_c_locale_messages, __s); | ||
17 | } | ||
18 | } | ||
19 | +} | ||
20 | Index: gcc-4.5.0/libstdc++-v3/config/locale/uclibc/time_members.h | ||
21 | =================================================================== | ||
22 | --- gcc-4.5.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2010-06-25 10:49:07.024632961 -0700 | ||
23 | +++ gcc-4.5.0/libstdc++-v3/config/locale/uclibc/time_members.h 2010-06-25 10:52:33.980632645 -0700 | ||
24 | @@ -33,7 +33,8 @@ | ||
25 | // | ||
26 | |||
27 | // Written by Benjamin Kosnik <bkoz@redhat.com> | ||
28 | - | ||
29 | +namespace std | ||
30 | +{ | ||
31 | template<typename _CharT> | ||
32 | __timepunct<_CharT>::__timepunct(size_t __refs) | ||
33 | : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), | ||
34 | @@ -75,3 +76,4 @@ | ||
35 | delete _M_data; | ||
36 | _S_destroy_c_locale(_M_c_locale_timepunct); | ||
37 | } | ||
38 | +} | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/307-locale_facets.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/307-locale_facets.patch new file mode 100644 index 0000000000..774fcfa2ca --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/307-locale_facets.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | This patch fixes a bug into ostream::operator<<(double) due to the wrong size | ||
2 | passed into the __convert_from_v method. The wrong size is then passed to | ||
3 | std::snprintf function, that, on uClibc, doens't handle sized 0 buffer. | ||
4 | |||
5 | Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com> | ||
6 | |||
7 | Index: gcc-4.3.1/libstdc++-v3/include/bits/locale_facets.tcc | ||
8 | =================================================================== | ||
9 | --- gcc-4.3.1.orig/libstdc++-v3/include/bits/locale_facets.tcc 2007-11-26 17:59:41.000000000 -0800 | ||
10 | +++ gcc-4.3.1/libstdc++-v3/include/bits/locale_facets.tcc 2008-08-16 02:14:48.000000000 -0700 | ||
11 | @@ -1004,7 +1004,7 @@ | ||
12 | const int __cs_size = __fixed ? __max_exp + __prec + 4 | ||
13 | : __max_digits * 2 + __prec; | ||
14 | char* __cs = static_cast<char*>(__builtin_alloca(__cs_size)); | ||
15 | - __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, __fbuf, | ||
16 | + __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size, __fbuf, | ||
17 | __prec, __v); | ||
18 | #endif | ||
19 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/602-sdk-libstdc++-includes.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/602-sdk-libstdc++-includes.patch new file mode 100644 index 0000000000..23fce7544d --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/602-sdk-libstdc++-includes.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | --- gcc-4.1.0/libstdc++-v3/fragment.am 2005-03-21 11:40:14.000000000 -0600 | ||
2 | +++ gcc-4.1.0-patched/libstdc++-v3/fragment.am 2005-04-25 20:14:39.856251785 -0500 | ||
3 | @@ -21,5 +21,5 @@ | ||
4 | $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once | ||
5 | |||
6 | # -I/-D flags to pass when compiling. | ||
7 | -AM_CPPFLAGS = $(GLIBCXX_INCLUDES) | ||
8 | +AM_CPPFLAGS = $(GLIBCXX_INCLUDES) -I$(toplevel_srcdir)/include | ||
9 | |||
10 | --- gcc-4.1.0/libstdc++-v3/libmath/Makefile.am 2005-03-21 11:40:18.000000000 -0600 | ||
11 | +++ gcc-4.1.0-patched/libstdc++-v3/libmath/Makefile.am 2005-04-25 20:14:39.682280735 -0500 | ||
12 | @@ -35,7 +35,7 @@ | ||
13 | |||
14 | libmath_la_SOURCES = stubs.c | ||
15 | |||
16 | -AM_CPPFLAGS = $(CANADIAN_INCLUDES) | ||
17 | +AM_CPPFLAGS = $(CANADIAN_INCLUDES) -I$(toplevel_srcdir)/include | ||
18 | |||
19 | # Only compiling "C" sources in this directory. | ||
20 | LIBTOOL = @LIBTOOL@ --tag CC | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/64bithack.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/64bithack.patch new file mode 100644 index 0000000000..067676ab63 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/64bithack.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | By default gcc places 64 bit libs in a lib64 directory. This makes it use | ||
2 | "lib" instead. | ||
3 | |||
4 | RP 25/7/10 | ||
5 | |||
6 | Index: gcc-4.5.0/gcc/config/i386/t-linux64 | ||
7 | =================================================================== | ||
8 | --- gcc-4.5.0.orig/gcc/config/i386/t-linux64 2010-08-10 15:47:42.000000000 +0100 | ||
9 | +++ gcc-4.5.0/gcc/config/i386/t-linux64 2010-08-10 15:47:47.000000000 +0100 | ||
10 | @@ -24,8 +24,8 @@ | ||
11 | # MULTILIB_OSDIRNAMES according to what is found on the target. | ||
12 | |||
13 | MULTILIB_OPTIONS = m64/m32 | ||
14 | -MULTILIB_DIRNAMES = 64 32 | ||
15 | -MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) | ||
16 | +MULTILIB_DIRNAMES = . 32 | ||
17 | +MULTILIB_OSDIRNAMES = . $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) | ||
18 | |||
19 | LIBGCC = stmp-multilib | ||
20 | INSTALL_LIBGCC = install-multilib | ||
21 | Index: gcc-4.5.0/gcc/config/i386/linux64.h | ||
22 | =================================================================== | ||
23 | --- gcc-4.5.0.orig/gcc/config/i386/linux64.h 2010-08-10 15:49:06.000000000 +0100 | ||
24 | +++ gcc-4.5.0/gcc/config/i386/linux64.h 2010-08-10 15:49:16.000000000 +0100 | ||
25 | @@ -59,7 +59,7 @@ | ||
26 | done. */ | ||
27 | |||
28 | #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" | ||
29 | -#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" | ||
30 | +#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-linux-x86-64.so.2" | ||
31 | |||
32 | #if TARGET_64BIT_DEFAULT | ||
33 | #define SPEC_32 "m32" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/740-sh-pr24836.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/740-sh-pr24836.patch new file mode 100644 index 0000000000..d84889259d --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/740-sh-pr24836.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348 | ||
2 | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24836 | ||
3 | |||
4 | Index: gcc-4.5.0/gcc/configure.ac | ||
5 | =================================================================== | ||
6 | --- gcc-4.5.0.orig/gcc/configure.ac 2010-03-25 22:40:32.000000000 -0700 | ||
7 | +++ gcc-4.5.0/gcc/configure.ac 2010-06-25 11:02:48.489057877 -0700 | ||
8 | @@ -2784,7 +2784,7 @@ | ||
9 | tls_first_minor=14 | ||
10 | tls_as_opt="-m64 -Aesame --fatal-warnings" | ||
11 | ;; | ||
12 | - sh-*-* | sh[34]-*-*) | ||
13 | + sh-*-* | sh[34]*-*-*) | ||
14 | conftest_s=' | ||
15 | .section ".tdata","awT",@progbits | ||
16 | foo: .long 25 | ||
17 | Index: gcc-4.5.0/gcc/configure | ||
18 | =================================================================== | ||
19 | --- gcc-4.5.0.orig/gcc/configure 2010-03-25 22:40:32.000000000 -0700 | ||
20 | +++ gcc-4.5.0/gcc/configure 2010-06-25 11:02:48.508381845 -0700 | ||
21 | @@ -22156,7 +22156,7 @@ | ||
22 | tls_first_minor=14 | ||
23 | tls_as_opt="-m64 -Aesame --fatal-warnings" | ||
24 | ;; | ||
25 | - sh-*-* | sh[34]-*-*) | ||
26 | + sh-*-* | sh[34]*-*-*) | ||
27 | conftest_s=' | ||
28 | .section ".tdata","awT",@progbits | ||
29 | foo: .long 25 | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/800-arm-bigendian.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/800-arm-bigendian.patch new file mode 100644 index 0000000000..77d02c3abd --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/800-arm-bigendian.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | By Lennert Buytenhek <buytenh@wantstofly.org> | ||
2 | Adds support for arm*b-linux* big-endian ARM targets | ||
3 | |||
4 | See http://gcc.gnu.org/PR16350 | ||
5 | |||
6 | Index: gcc-4.5.0/gcc/config/arm/linux-elf.h | ||
7 | =================================================================== | ||
8 | --- gcc-4.5.0.orig/gcc/config/arm/linux-elf.h 2009-11-05 06:47:45.000000000 -0800 | ||
9 | +++ gcc-4.5.0/gcc/config/arm/linux-elf.h 2010-06-25 11:03:06.997132728 -0700 | ||
10 | @@ -51,7 +51,7 @@ | ||
11 | |||
12 | #undef MULTILIB_DEFAULTS | ||
13 | #define MULTILIB_DEFAULTS \ | ||
14 | - { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" } | ||
15 | + { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" } | ||
16 | |||
17 | /* Now we define the strings used to build the spec file. */ | ||
18 | #undef LIB_SPEC | ||
19 | Index: gcc-4.5.0/gcc/config.gcc | ||
20 | =================================================================== | ||
21 | --- gcc-4.5.0.orig/gcc/config.gcc 2010-06-25 10:40:33.321880880 -0700 | ||
22 | +++ gcc-4.5.0/gcc/config.gcc 2010-06-25 11:03:07.013133525 -0700 | ||
23 | @@ -734,6 +734,11 @@ | ||
24 | esac | ||
25 | tmake_file="${tmake_file} t-linux arm/t-arm" | ||
26 | case ${target} in | ||
27 | + arm*b-*) | ||
28 | + tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" | ||
29 | + ;; | ||
30 | + esac | ||
31 | + case ${target} in | ||
32 | arm*-*-linux-*eabi) | ||
33 | tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h" | ||
34 | tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/904-flatten-switch-stmt-00.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/904-flatten-switch-stmt-00.patch new file mode 100644 index 0000000000..c4641dc63e --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/904-flatten-switch-stmt-00.patch | |||
@@ -0,0 +1,74 @@ | |||
1 | Hi, | ||
2 | |||
3 | The attached patch makes sure that we create smaller object code for | ||
4 | simple switch statements. We just make sure to flatten the switch | ||
5 | statement into an if-else chain, basically. | ||
6 | |||
7 | This fixes a size-regression as compared to gcc-3.4, as can be seen | ||
8 | below. | ||
9 | |||
10 | 2007-04-15 Bernhard Fischer <..> | ||
11 | |||
12 | * stmt.c (expand_case): Do not create a complex binary tree when | ||
13 | optimizing for size but rather use the simple ordered list. | ||
14 | (emit_case_nodes): do not emit jumps to the default_label when | ||
15 | optimizing for size. | ||
16 | |||
17 | Not regtested so far. | ||
18 | Comments? | ||
19 | |||
20 | Attached is the test switch.c mentioned below. | ||
21 | |||
22 | $ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do | ||
23 | gcc-$i -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done | ||
24 | $ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do | ||
25 | gcc-$i -UCHAIN -Os -o switch-$i.o -c switch.c ;done | ||
26 | |||
27 | $ size switch-*.o | ||
28 | text data bss dec hex filename | ||
29 | 169 0 0 169 a9 switch-2.95.o | ||
30 | 115 0 0 115 73 switch-3.3.o | ||
31 | 103 0 0 103 67 switch-3.4.o | ||
32 | 124 0 0 124 7c switch-4.0.o | ||
33 | 124 0 0 124 7c switch-4.1.o | ||
34 | 124 0 0 124 7c switch-4.2.orig-HEAD.o | ||
35 | 95 0 0 95 5f switch-4.3-HEAD.o | ||
36 | 124 0 0 124 7c switch-4.3.orig-HEAD.o | ||
37 | 166 0 0 166 a6 switch-CHAIN-2.95.o | ||
38 | 111 0 0 111 6f switch-CHAIN-3.3.o | ||
39 | 95 0 0 95 5f switch-CHAIN-3.4.o | ||
40 | 95 0 0 95 5f switch-CHAIN-4.0.o | ||
41 | 95 0 0 95 5f switch-CHAIN-4.1.o | ||
42 | 95 0 0 95 5f switch-CHAIN-4.2.orig-HEAD.o | ||
43 | 95 0 0 95 5f switch-CHAIN-4.3-HEAD.o | ||
44 | 95 0 0 95 5f switch-CHAIN-4.3.orig-HEAD.o | ||
45 | |||
46 | |||
47 | Content-Type: text/x-diff; charset=us-ascii | ||
48 | Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff" | ||
49 | |||
50 | Index: gcc-4.5.0/gcc/stmt.c | ||
51 | =================================================================== | ||
52 | --- gcc-4.5.0.orig/gcc/stmt.c 2010-02-19 01:53:51.000000000 -0800 | ||
53 | +++ gcc-4.5.0/gcc/stmt.c 2010-06-25 11:05:31.816881094 -0700 | ||
54 | @@ -2440,7 +2440,11 @@ | ||
55 | default code is emitted. */ | ||
56 | |||
57 | use_cost_table = estimate_case_costs (case_list); | ||
58 | - balance_case_nodes (&case_list, NULL); | ||
59 | + /* When optimizing for size, we want a straight list to avoid | ||
60 | + jumps as much as possible. This basically creates an if-else | ||
61 | + chain. */ | ||
62 | + if (!optimize_size) | ||
63 | + balance_case_nodes (&case_list, NULL); | ||
64 | emit_case_nodes (index, case_list, default_label, index_type); | ||
65 | if (default_label) | ||
66 | emit_jump (default_label); | ||
67 | @@ -3008,6 +3012,7 @@ | ||
68 | { | ||
69 | if (!node_has_low_bound (node, index_type)) | ||
70 | { | ||
71 | + if (!optimize_size) /* don't jl to the .default_label. */ | ||
72 | emit_cmp_and_jump_insns (index, | ||
73 | convert_modes | ||
74 | (mode, imode, | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/arm-bswapsi2.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/arm-bswapsi2.patch new file mode 100644 index 0000000000..7ac61a6d63 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/arm-bswapsi2.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | Index: gcc-4.5/gcc/config/arm/arm.md | ||
2 | =================================================================== | ||
3 | --- gcc-4.5.orig/gcc/config/arm/arm.md 2010-06-17 09:13:07.000000000 -0700 | ||
4 | +++ gcc-4.5/gcc/config/arm/arm.md 2010-06-22 08:08:45.397212002 -0700 | ||
5 | @@ -11267,7 +11267,7 @@ | ||
6 | (define_expand "bswapsi2" | ||
7 | [(set (match_operand:SI 0 "s_register_operand" "=r") | ||
8 | (bswap:SI (match_operand:SI 1 "s_register_operand" "r")))] | ||
9 | -"TARGET_EITHER" | ||
10 | +"TARGET_EITHER && (arm_arch6 && !optimize_size)" | ||
11 | " | ||
12 | if (!arm_arch6) | ||
13 | { | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/arm-nolibfloat.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/arm-nolibfloat.patch new file mode 100644 index 0000000000..99f2b20d50 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/arm-nolibfloat.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | # Dimitry Andric <dimitry@andric.com>, 2004-05-01 | ||
2 | # | ||
3 | # * Removed the extra -lfloat option from LIBGCC_SPEC, since it isn't needed | ||
4 | # anymore. (The required functions are now in libgcc.) | ||
5 | # | ||
6 | # Fixes errors like | ||
7 | # arm-softfloat-linux-gnu/3.4.0/../../../../arm-softfloat-linux-gnu/bin/ld: cannot find -lfloat | ||
8 | # collect2: ld returned 1 exit status | ||
9 | # make[2]: *** [arm-softfloat-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/iconvdata/ISO8859-1.so] Error 1 | ||
10 | # when building glibc-2.3.3 with gcc-3.4.0 for arm-softfloat | ||
11 | |||
12 | Index: gcc-4.5.0/gcc/config/arm/linux-elf.h | ||
13 | =================================================================== | ||
14 | --- gcc-4.5.0.orig/gcc/config/arm/linux-elf.h 2010-06-25 11:04:49.572437901 -0700 | ||
15 | +++ gcc-4.5.0/gcc/config/arm/linux-elf.h 2010-06-25 11:06:12.273162283 -0700 | ||
16 | @@ -60,7 +60,7 @@ | ||
17 | %{shared:-lc} \ | ||
18 | %{!shared:%{profile:-lc_p}%{!profile:-lc}}" | ||
19 | |||
20 | -#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc" | ||
21 | +#define LIBGCC_SPEC "-lgcc" | ||
22 | |||
23 | #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" | ||
24 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/arm-softfloat.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/arm-softfloat.patch new file mode 100644 index 0000000000..181d4fbf5a --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/arm-softfloat.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | Index: gcc-4.5.0/gcc/config/arm/t-linux | ||
2 | =================================================================== | ||
3 | --- gcc-4.5.0.orig/gcc/config/arm/t-linux 2009-04-21 12:03:23.000000000 -0700 | ||
4 | +++ gcc-4.5.0/gcc/config/arm/t-linux 2010-06-25 11:11:06.836381365 -0700 | ||
5 | @@ -23,7 +23,10 @@ | ||
6 | |||
7 | LIB1ASMSRC = arm/lib1funcs.asm | ||
8 | LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ | ||
9 | - _arm_addsubdf3 _arm_addsubsf3 | ||
10 | + _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \ | ||
11 | + _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ | ||
12 | + _fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundisf _floatundidf | ||
13 | +# _arm_addsubdf3 _arm_addsubsf3 | ||
14 | |||
15 | # MULTILIB_OPTIONS = mhard-float/msoft-float | ||
16 | # MULTILIB_DIRNAMES = hard-float soft-float | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/arm-unbreak-eabi-armv4t.dpatch b/meta/recipes-devtools/gcc/gcc-4.5.0/arm-unbreak-eabi-armv4t.dpatch new file mode 100644 index 0000000000..7bb8887068 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/arm-unbreak-eabi-armv4t.dpatch | |||
@@ -0,0 +1,36 @@ | |||
1 | #! /bin/sh -e | ||
2 | |||
3 | # DP: Fix armv4t build on ARM | ||
4 | |||
5 | dir= | ||
6 | if [ $# -eq 3 -a "$2" = '-d' ]; then | ||
7 | pdir="-d $3" | ||
8 | dir="$3/" | ||
9 | elif [ $# -ne 1 ]; then | ||
10 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
11 | exit 1 | ||
12 | fi | ||
13 | case "$1" in | ||
14 | -patch) | ||
15 | patch $pdir -f --no-backup-if-mismatch -p1 < $0 | ||
16 | ;; | ||
17 | -unpatch) | ||
18 | patch $pdir -f --no-backup-if-mismatch -R -p1 < $0 | ||
19 | ;; | ||
20 | *) | ||
21 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
22 | exit 1 | ||
23 | esac | ||
24 | exit 0 | ||
25 | |||
26 | --- src/gcc/config/arm/linux-eabi.h.orig 2007-11-24 12:37:38.000000000 +0000 | ||
27 | +++ src/gcc/config/arm/linux-eabi.h 2007-11-24 12:39:41.000000000 +0000 | ||
28 | @@ -44,7 +44,7 @@ | ||
29 | The ARM10TDMI core is the default for armv5t, so set | ||
30 | SUBTARGET_CPU_DEFAULT to achieve this. */ | ||
31 | #undef SUBTARGET_CPU_DEFAULT | ||
32 | -#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi | ||
33 | +#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi | ||
34 | |||
35 | /* TARGET_BIG_ENDIAN_DEFAULT is set in | ||
36 | config.gcc for big endian configurations. */ | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/cache-amnesia.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/cache-amnesia.patch new file mode 100644 index 0000000000..b889f9b6ca --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/cache-amnesia.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | --- | ||
2 | gcc/configure | 2 +- | ||
3 | gcc/configure.ac | 2 +- | ||
4 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
5 | |||
6 | Index: gcc-4.5+svnr155514/gcc/configure | ||
7 | =================================================================== | ||
8 | --- gcc-4.5+svnr155514.orig/gcc/configure 2009-12-29 22:00:40.000000000 -0800 | ||
9 | +++ gcc-4.5+svnr155514/gcc/configure 2009-12-29 23:52:43.381592113 -0800 | ||
10 | @@ -10467,7 +10467,7 @@ else | ||
11 | saved_CFLAGS="${CFLAGS}" | ||
12 | CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ | ||
13 | LDFLAGS="${LDFLAGS_FOR_BUILD}" \ | ||
14 | - ${realsrcdir}/configure \ | ||
15 | + CONFIG_SITE= ${realsrcdir}/configure --cache-file=./other.cache \ | ||
16 | --enable-languages=${enable_languages-all} \ | ||
17 | --target=$target_alias --host=$build_alias --build=$build_alias | ||
18 | CFLAGS="${saved_CFLAGS}" | ||
19 | Index: gcc-4.5+svnr155514/gcc/configure.ac | ||
20 | =================================================================== | ||
21 | --- gcc-4.5+svnr155514.orig/gcc/configure.ac 2009-12-29 22:00:40.000000000 -0800 | ||
22 | +++ gcc-4.5+svnr155514/gcc/configure.ac 2009-12-29 23:51:54.589091778 -0800 | ||
23 | @@ -1458,7 +1458,7 @@ else | ||
24 | saved_CFLAGS="${CFLAGS}" | ||
25 | CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ | ||
26 | LDFLAGS="${LDFLAGS_FOR_BUILD}" \ | ||
27 | - ${realsrcdir}/configure \ | ||
28 | + CONFIG_SITE= ${realsrcdir}/configure --cache-file=./other.cache \ | ||
29 | --enable-languages=${enable_languages-all} \ | ||
30 | --target=$target_alias --host=$build_alias --build=$build_alias | ||
31 | CFLAGS="${saved_CFLAGS}" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-c++-builtin-redecl.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-c++-builtin-redecl.patch new file mode 100644 index 0000000000..a149eae98e --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-c++-builtin-redecl.patch | |||
@@ -0,0 +1,114 @@ | |||
1 | 2007-10-02 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | * decl.c (duplicate_decls): When redeclaring a builtin function, | ||
4 | keep the merged decl builtin whenever types match, even if new | ||
5 | decl defines a function. | ||
6 | |||
7 | * gcc.dg/builtins-65.c: New test. | ||
8 | * g++.dg/ext/builtin10.C: New test. | ||
9 | |||
10 | Index: gcc/cp/decl.c | ||
11 | =================================================================== | ||
12 | --- gcc/cp/decl.c.orig 2010-04-01 11:48:46.000000000 -0700 | ||
13 | +++ gcc/cp/decl.c 2010-06-25 10:10:54.749131719 -0700 | ||
14 | @@ -2021,23 +2021,21 @@ | ||
15 | DECL_ARGUMENTS (olddecl) = DECL_ARGUMENTS (newdecl); | ||
16 | DECL_RESULT (olddecl) = DECL_RESULT (newdecl); | ||
17 | } | ||
18 | + /* If redeclaring a builtin function, it stays built in. */ | ||
19 | + if (types_match && DECL_BUILT_IN (olddecl)) | ||
20 | + { | ||
21 | + DECL_BUILT_IN_CLASS (newdecl) = DECL_BUILT_IN_CLASS (olddecl); | ||
22 | + DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl); | ||
23 | + /* If we're keeping the built-in definition, keep the rtl, | ||
24 | + regardless of declaration matches. */ | ||
25 | + COPY_DECL_RTL (olddecl, newdecl); | ||
26 | + } | ||
27 | if (new_defines_function) | ||
28 | /* If defining a function declared with other language | ||
29 | linkage, use the previously declared language linkage. */ | ||
30 | SET_DECL_LANGUAGE (newdecl, DECL_LANGUAGE (olddecl)); | ||
31 | else if (types_match) | ||
32 | { | ||
33 | - /* If redeclaring a builtin function, and not a definition, | ||
34 | - it stays built in. */ | ||
35 | - if (DECL_BUILT_IN (olddecl)) | ||
36 | - { | ||
37 | - DECL_BUILT_IN_CLASS (newdecl) = DECL_BUILT_IN_CLASS (olddecl); | ||
38 | - DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl); | ||
39 | - /* If we're keeping the built-in definition, keep the rtl, | ||
40 | - regardless of declaration matches. */ | ||
41 | - COPY_DECL_RTL (olddecl, newdecl); | ||
42 | - } | ||
43 | - | ||
44 | DECL_RESULT (newdecl) = DECL_RESULT (olddecl); | ||
45 | /* Don't clear out the arguments if we're just redeclaring a | ||
46 | function. */ | ||
47 | Index: gcc/testsuite/gcc.dg/builtins-65.c | ||
48 | =================================================================== | ||
49 | --- gcc/testsuite/gcc.dg/builtins-65.c.orig 2009-06-26 02:02:04.000000000 -0700 | ||
50 | +++ gcc/testsuite/gcc.dg/builtins-65.c 2010-06-25 10:10:54.784464429 -0700 | ||
51 | @@ -1,3 +1,28 @@ | ||
52 | +/* { dg-do compile } */ | ||
53 | +/* { dg-options "-O2" } */ | ||
54 | + | ||
55 | +typedef __SIZE_TYPE__ size_t; | ||
56 | +extern void __chk_fail (void); | ||
57 | +extern int snprintf (char *, size_t, const char *, ...); | ||
58 | +extern inline __attribute__((gnu_inline, always_inline)) int snprintf (char *a, size_t b, const char *fmt, ...) | ||
59 | +{ | ||
60 | + if (__builtin_object_size (a, 0) != -1UL && __builtin_object_size (a, 0) < b) | ||
61 | + __chk_fail (); | ||
62 | + return __builtin_snprintf (a, b, fmt, __builtin_va_arg_pack ()); | ||
63 | +} | ||
64 | +extern int snprintf (char *, size_t, const char *, ...) __asm ("mysnprintf"); | ||
65 | + | ||
66 | +char buf[10]; | ||
67 | + | ||
68 | +int | ||
69 | +main (void) | ||
70 | +{ | ||
71 | + snprintf (buf, 10, "%d%d\n", 10, 10); | ||
72 | + return 0; | ||
73 | +} | ||
74 | + | ||
75 | +/* { dg-final { scan-assembler "mysnprintf" } } */ | ||
76 | +/* { dg-final { scan-assembler-not "__chk_fail" } } */ | ||
77 | /* { dg-do link } */ | ||
78 | /* { dg-options "-O2 -ffast-math" } */ | ||
79 | /* { dg-require-effective-target c99_runtime } */ | ||
80 | Index: gcc/testsuite/g++.dg/ext/builtin10.C | ||
81 | =================================================================== | ||
82 | --- gcc/testsuite/g++.dg/ext/builtin10.C.orig 2009-02-02 03:27:50.000000000 -0800 | ||
83 | +++ gcc/testsuite/g++.dg/ext/builtin10.C 2010-06-25 10:10:54.816467202 -0700 | ||
84 | @@ -1,3 +1,30 @@ | ||
85 | +// { dg-do compile } | ||
86 | +// { dg-options "-O2" } | ||
87 | + | ||
88 | +typedef __SIZE_TYPE__ size_t; | ||
89 | +extern "C" { | ||
90 | +extern void __chk_fail (void); | ||
91 | +extern int snprintf (char *, size_t, const char *, ...); | ||
92 | +extern inline __attribute__((gnu_inline, always_inline)) int snprintf (char *a, size_t b, const char *fmt, ...) | ||
93 | +{ | ||
94 | + if (__builtin_object_size (a, 0) != -1UL && __builtin_object_size (a, 0) < b) | ||
95 | + __chk_fail (); | ||
96 | + return __builtin_snprintf (a, b, fmt, __builtin_va_arg_pack ()); | ||
97 | +} | ||
98 | +extern int snprintf (char *, size_t, const char *, ...) __asm ("mysnprintf"); | ||
99 | +} | ||
100 | + | ||
101 | +char buf[10]; | ||
102 | + | ||
103 | +int | ||
104 | +main (void) | ||
105 | +{ | ||
106 | + snprintf (buf, 10, "%d%d\n", 10, 10); | ||
107 | + return 0; | ||
108 | +} | ||
109 | + | ||
110 | +// { dg-final { scan-assembler "mysnprintf" } } | ||
111 | +// { dg-final { scan-assembler-not "__chk_fail" } } | ||
112 | // { dg-do compile { target correct_iso_cpp_string_wchar_protos } } | ||
113 | // { dg-options "-O2 -fdump-tree-optimized" } | ||
114 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-cpp-pragma.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-cpp-pragma.patch new file mode 100644 index 0000000000..00d37bd7ce --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-cpp-pragma.patch | |||
@@ -0,0 +1,284 @@ | |||
1 | 2008-02-26 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | * c-ppoutput.c (scan_translation_unit): Handle CPP_PRAGMA | ||
4 | and CPP_PRAGMA_EOL. | ||
5 | * c-pragma.c (pragma_ns_name): New typedef. | ||
6 | (registered_pp_pragmas): New variable. | ||
7 | (c_pp_lookup_pragma): New function. | ||
8 | (c_register_pragma_1): If flag_preprocess_only, do nothing | ||
9 | for non-expanded pragmas, for expanded ones push pragma's | ||
10 | namespace and name into registered_pp_pragmas vector. | ||
11 | (c_invoke_pragma_handler): Register OpenMP pragmas even when | ||
12 | flag_preprocess_only, don't register GCC pch_preprocess | ||
13 | pragma if flag_preprocess_only. | ||
14 | * c-opts.c (c_common_init): Call init_pragma even if | ||
15 | flag_preprocess_only. | ||
16 | * c-pragma.c (c_pp_lookup_pragma): New prototype. | ||
17 | * config/darwin.h (DARWIN_REGISTER_TARGET_PRAGMAS): Don't call | ||
18 | cpp_register_pragma if flag_preprocess_only. | ||
19 | |||
20 | * gcc.dg/gomp/preprocess-1.c: New test. | ||
21 | |||
22 | --- gcc/c-ppoutput.c.jj 2008-01-26 18:01:16.000000000 +0100 | ||
23 | +++ gcc/c-ppoutput.c 2008-02-26 22:54:57.000000000 +0100 | ||
24 | @@ -1,6 +1,6 @@ | ||
25 | /* Preprocess only, using cpplib. | ||
26 | - Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007 | ||
27 | - Free Software Foundation, Inc. | ||
28 | + Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007, | ||
29 | + 2008 Free Software Foundation, Inc. | ||
30 | Written by Per Bothner, 1994-95. | ||
31 | |||
32 | This program is free software; you can redistribute it and/or modify it | ||
33 | @@ -177,7 +177,24 @@ scan_translation_unit (cpp_reader *pfile | ||
34 | avoid_paste = false; | ||
35 | print.source = NULL; | ||
36 | print.prev = token; | ||
37 | - cpp_output_token (token, print.outf); | ||
38 | + if (token->type == CPP_PRAGMA) | ||
39 | + { | ||
40 | + const char *space; | ||
41 | + const char *name; | ||
42 | + | ||
43 | + maybe_print_line (token->src_loc); | ||
44 | + fputs ("#pragma ", print.outf); | ||
45 | + c_pp_lookup_pragma (token->val.pragma, &space, &name); | ||
46 | + if (space) | ||
47 | + fprintf (print.outf, "%s %s", space, name); | ||
48 | + else | ||
49 | + fprintf (print.outf, "%s", name); | ||
50 | + print.printed = 1; | ||
51 | + } | ||
52 | + else if (token->type == CPP_PRAGMA_EOL) | ||
53 | + maybe_print_line (token->src_loc); | ||
54 | + else | ||
55 | + cpp_output_token (token, print.outf); | ||
56 | |||
57 | if (token->type == CPP_COMMENT) | ||
58 | account_for_newlines (token->val.str.text, token->val.str.len); | ||
59 | --- gcc/c-pragma.c.jj 2008-02-15 18:43:03.000000000 +0100 | ||
60 | +++ gcc/c-pragma.c 2008-02-26 22:59:44.000000000 +0100 | ||
61 | @@ -1,6 +1,6 @@ | ||
62 | /* Handle #pragma, system V.4 style. Supports #pragma weak and #pragma pack. | ||
63 | Copyright (C) 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, | ||
64 | - 2006, 2007 Free Software Foundation, Inc. | ||
65 | + 2006, 2007, 2008 Free Software Foundation, Inc. | ||
66 | |||
67 | This file is part of GCC. | ||
68 | |||
69 | @@ -872,6 +872,61 @@ DEF_VEC_ALLOC_O (pragma_handler, heap); | ||
70 | |||
71 | static VEC(pragma_handler, heap) *registered_pragmas; | ||
72 | |||
73 | +typedef struct | ||
74 | +{ | ||
75 | + const char *space; | ||
76 | + const char *name; | ||
77 | +} pragma_ns_name; | ||
78 | + | ||
79 | +DEF_VEC_O (pragma_ns_name); | ||
80 | +DEF_VEC_ALLOC_O (pragma_ns_name, heap); | ||
81 | + | ||
82 | +static VEC(pragma_ns_name, heap) *registered_pp_pragmas; | ||
83 | + | ||
84 | +struct omp_pragma_def { const char *name; unsigned int id; }; | ||
85 | +static const struct omp_pragma_def omp_pragmas[] = { | ||
86 | + { "atomic", PRAGMA_OMP_ATOMIC }, | ||
87 | + { "barrier", PRAGMA_OMP_BARRIER }, | ||
88 | + { "critical", PRAGMA_OMP_CRITICAL }, | ||
89 | + { "flush", PRAGMA_OMP_FLUSH }, | ||
90 | + { "for", PRAGMA_OMP_FOR }, | ||
91 | + { "master", PRAGMA_OMP_MASTER }, | ||
92 | + { "ordered", PRAGMA_OMP_ORDERED }, | ||
93 | + { "parallel", PRAGMA_OMP_PARALLEL }, | ||
94 | + { "section", PRAGMA_OMP_SECTION }, | ||
95 | + { "sections", PRAGMA_OMP_SECTIONS }, | ||
96 | + { "single", PRAGMA_OMP_SINGLE }, | ||
97 | + { "threadprivate", PRAGMA_OMP_THREADPRIVATE } | ||
98 | +}; | ||
99 | + | ||
100 | +void | ||
101 | +c_pp_lookup_pragma (unsigned int id, const char **space, const char **name) | ||
102 | +{ | ||
103 | + const int n_omp_pragmas = sizeof (omp_pragmas) / sizeof (*omp_pragmas); | ||
104 | + int i; | ||
105 | + | ||
106 | + for (i = 0; i < n_omp_pragmas; ++i) | ||
107 | + if (omp_pragmas[i].id == id) | ||
108 | + { | ||
109 | + *space = "omp"; | ||
110 | + *name = omp_pragmas[i].name; | ||
111 | + return; | ||
112 | + } | ||
113 | + | ||
114 | + if (id >= PRAGMA_FIRST_EXTERNAL | ||
115 | + && (id < PRAGMA_FIRST_EXTERNAL | ||
116 | + + VEC_length (pragma_ns_name, registered_pp_pragmas))) | ||
117 | + { | ||
118 | + *space = VEC_index (pragma_ns_name, registered_pp_pragmas, | ||
119 | + id - PRAGMA_FIRST_EXTERNAL)->space; | ||
120 | + *name = VEC_index (pragma_ns_name, registered_pp_pragmas, | ||
121 | + id - PRAGMA_FIRST_EXTERNAL)->name; | ||
122 | + return; | ||
123 | + } | ||
124 | + | ||
125 | + gcc_unreachable (); | ||
126 | +} | ||
127 | + | ||
128 | /* Front-end wrappers for pragma registration to avoid dragging | ||
129 | cpplib.h in almost everywhere. */ | ||
130 | |||
131 | @@ -881,13 +936,29 @@ c_register_pragma_1 (const char *space, | ||
132 | { | ||
133 | unsigned id; | ||
134 | |||
135 | - VEC_safe_push (pragma_handler, heap, registered_pragmas, &handler); | ||
136 | - id = VEC_length (pragma_handler, registered_pragmas); | ||
137 | - id += PRAGMA_FIRST_EXTERNAL - 1; | ||
138 | - | ||
139 | - /* The C++ front end allocates 6 bits in cp_token; the C front end | ||
140 | - allocates 7 bits in c_token. At present this is sufficient. */ | ||
141 | - gcc_assert (id < 64); | ||
142 | + if (flag_preprocess_only) | ||
143 | + { | ||
144 | + pragma_ns_name ns_name; | ||
145 | + | ||
146 | + if (!allow_expansion) | ||
147 | + return; | ||
148 | + | ||
149 | + ns_name.space = space; | ||
150 | + ns_name.name = name; | ||
151 | + VEC_safe_push (pragma_ns_name, heap, registered_pp_pragmas, &ns_name); | ||
152 | + id = VEC_length (pragma_ns_name, registered_pp_pragmas); | ||
153 | + id += PRAGMA_FIRST_EXTERNAL - 1; | ||
154 | + } | ||
155 | + else | ||
156 | + { | ||
157 | + VEC_safe_push (pragma_handler, heap, registered_pragmas, &handler); | ||
158 | + id = VEC_length (pragma_handler, registered_pragmas); | ||
159 | + id += PRAGMA_FIRST_EXTERNAL - 1; | ||
160 | + | ||
161 | + /* The C++ front end allocates 6 bits in cp_token; the C front end | ||
162 | + allocates 7 bits in c_token. At present this is sufficient. */ | ||
163 | + gcc_assert (id < 64); | ||
164 | + } | ||
165 | |||
166 | cpp_register_deferred_pragma (parse_in, space, name, id, | ||
167 | allow_expansion, false); | ||
168 | @@ -921,24 +992,8 @@ c_invoke_pragma_handler (unsigned int id | ||
169 | void | ||
170 | init_pragma (void) | ||
171 | { | ||
172 | - if (flag_openmp && !flag_preprocess_only) | ||
173 | + if (flag_openmp) | ||
174 | { | ||
175 | - struct omp_pragma_def { const char *name; unsigned int id; }; | ||
176 | - static const struct omp_pragma_def omp_pragmas[] = { | ||
177 | - { "atomic", PRAGMA_OMP_ATOMIC }, | ||
178 | - { "barrier", PRAGMA_OMP_BARRIER }, | ||
179 | - { "critical", PRAGMA_OMP_CRITICAL }, | ||
180 | - { "flush", PRAGMA_OMP_FLUSH }, | ||
181 | - { "for", PRAGMA_OMP_FOR }, | ||
182 | - { "master", PRAGMA_OMP_MASTER }, | ||
183 | - { "ordered", PRAGMA_OMP_ORDERED }, | ||
184 | - { "parallel", PRAGMA_OMP_PARALLEL }, | ||
185 | - { "section", PRAGMA_OMP_SECTION }, | ||
186 | - { "sections", PRAGMA_OMP_SECTIONS }, | ||
187 | - { "single", PRAGMA_OMP_SINGLE }, | ||
188 | - { "threadprivate", PRAGMA_OMP_THREADPRIVATE } | ||
189 | - }; | ||
190 | - | ||
191 | const int n_omp_pragmas = sizeof (omp_pragmas) / sizeof (*omp_pragmas); | ||
192 | int i; | ||
193 | |||
194 | @@ -947,8 +1002,9 @@ init_pragma (void) | ||
195 | omp_pragmas[i].id, true, true); | ||
196 | } | ||
197 | |||
198 | - cpp_register_deferred_pragma (parse_in, "GCC", "pch_preprocess", | ||
199 | - PRAGMA_GCC_PCH_PREPROCESS, false, false); | ||
200 | + if (!flag_preprocess_only) | ||
201 | + cpp_register_deferred_pragma (parse_in, "GCC", "pch_preprocess", | ||
202 | + PRAGMA_GCC_PCH_PREPROCESS, false, false); | ||
203 | |||
204 | #ifdef HANDLE_PRAGMA_PACK | ||
205 | #ifdef HANDLE_PRAGMA_PACK_WITH_EXPANSION | ||
206 | --- gcc/c-opts.c.jj 2008-02-26 22:53:23.000000000 +0100 | ||
207 | +++ gcc/c-opts.c 2008-02-26 22:54:57.000000000 +0100 | ||
208 | @@ -1,5 +1,5 @@ | ||
209 | /* C/ObjC/C++ command line option handling. | ||
210 | - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 | ||
211 | + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 | ||
212 | Free Software Foundation, Inc. | ||
213 | Contributed by Neil Booth. | ||
214 | |||
215 | @@ -1239,6 +1239,9 @@ c_common_init (void) | ||
216 | if (version_flag) | ||
217 | c_common_print_pch_checksum (stderr); | ||
218 | |||
219 | + /* Has to wait until now so that cpplib has its hash table. */ | ||
220 | + init_pragma (); | ||
221 | + | ||
222 | if (flag_preprocess_only) | ||
223 | { | ||
224 | finish_options (); | ||
225 | @@ -1246,9 +1249,6 @@ c_common_init (void) | ||
226 | return false; | ||
227 | } | ||
228 | |||
229 | - /* Has to wait until now so that cpplib has its hash table. */ | ||
230 | - init_pragma (); | ||
231 | - | ||
232 | return true; | ||
233 | } | ||
234 | |||
235 | --- gcc/c-pragma.h.jj 2008-01-26 18:01:16.000000000 +0100 | ||
236 | +++ gcc/c-pragma.h 2008-02-26 22:54:57.000000000 +0100 | ||
237 | @@ -1,6 +1,6 @@ | ||
238 | /* Pragma related interfaces. | ||
239 | Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, | ||
240 | - 2007 Free Software Foundation, Inc. | ||
241 | + 2007, 2008 Free Software Foundation, Inc. | ||
242 | |||
243 | This file is part of GCC. | ||
244 | |||
245 | @@ -124,4 +124,6 @@ extern enum cpp_ttype pragma_lex (tree * | ||
246 | extern enum cpp_ttype c_lex_with_flags (tree *, location_t *, unsigned char *, | ||
247 | int); | ||
248 | |||
249 | +extern void c_pp_lookup_pragma (unsigned int, const char **, const char **); | ||
250 | + | ||
251 | #endif /* GCC_C_PRAGMA_H */ | ||
252 | --- gcc/config/darwin.h.jj 2008-02-11 14:48:12.000000000 +0100 | ||
253 | +++ gcc/config/darwin.h 2008-02-26 22:54:57.000000000 +0100 | ||
254 | @@ -892,8 +892,9 @@ enum machopic_addr_class { | ||
255 | |||
256 | #define DARWIN_REGISTER_TARGET_PRAGMAS() \ | ||
257 | do { \ | ||
258 | - cpp_register_pragma (parse_in, NULL, "mark", \ | ||
259 | - darwin_pragma_ignore, false); \ | ||
260 | + if (!flag_preprocess_only) \ | ||
261 | + cpp_register_pragma (parse_in, NULL, "mark", \ | ||
262 | + darwin_pragma_ignore, false); \ | ||
263 | c_register_pragma (0, "options", darwin_pragma_options); \ | ||
264 | c_register_pragma (0, "segment", darwin_pragma_ignore); \ | ||
265 | c_register_pragma (0, "unused", darwin_pragma_unused); \ | ||
266 | --- gcc/testsuite/gcc.dg/gomp/preprocess-1.c.jj 2008-02-26 22:54:57.000000000 +0100 | ||
267 | +++ gcc/testsuite/gcc.dg/gomp/preprocess-1.c 2008-02-26 22:54:57.000000000 +0100 | ||
268 | @@ -0,0 +1,16 @@ | ||
269 | +/* { dg-do preprocess } */ | ||
270 | + | ||
271 | +void foo (void) | ||
272 | +{ | ||
273 | + int i1, j1, k1; | ||
274 | +#define p parallel | ||
275 | +#define P(x) private (x##1) | ||
276 | +#define S(x) shared (x##1) | ||
277 | +#define F(x) firstprivate (x##1) | ||
278 | +#pragma omp p P(i) \ | ||
279 | + S(j) \ | ||
280 | + F(k) | ||
281 | + ; | ||
282 | +} | ||
283 | + | ||
284 | +/* { dg-final { scan-file preprocess-1.i "(^|\n)#pragma omp parallel private \\(i1\\) shared \\(j1\\) firstprivate \\(k1\\)($|\n)" } } */ | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-i386-libgomp.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-i386-libgomp.patch new file mode 100644 index 0000000000..a588db28e8 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-i386-libgomp.patch | |||
@@ -0,0 +1,65 @@ | |||
1 | Build i386.rpm libgomp and libsupc++.a(guard.o) as i486+, pre-i486 | ||
2 | hardware isn't supported because NPTL doesn't support it anyway. | ||
3 | |||
4 | Index: libgomp/configure.tgt | ||
5 | =================================================================== | ||
6 | --- libgomp/configure.tgt.orig 2010-01-28 13:47:59.000000000 -0800 | ||
7 | +++ libgomp/configure.tgt 2010-06-25 10:32:26.706135558 -0700 | ||
8 | @@ -48,14 +48,14 @@ | ||
9 | ;; | ||
10 | |||
11 | # Note that bare i386 is not included here. We need cmpxchg. | ||
12 | - i[456]86-*-linux*) | ||
13 | + i[3456]86-*-linux*) | ||
14 | config_path="linux/x86 linux posix" | ||
15 | case " ${CC} ${CFLAGS} " in | ||
16 | *" -m64 "*) | ||
17 | ;; | ||
18 | *) | ||
19 | if test -z "$with_arch"; then | ||
20 | - XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}" | ||
21 | + XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" | ||
22 | fi | ||
23 | esac | ||
24 | ;; | ||
25 | @@ -67,7 +67,7 @@ | ||
26 | config_path="linux/x86 linux posix" | ||
27 | case " ${CC} ${CFLAGS} " in | ||
28 | *" -m32 "*) | ||
29 | - XCFLAGS="${XCFLAGS} -march=i486 -mtune=i686" | ||
30 | + XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" | ||
31 | ;; | ||
32 | esac | ||
33 | ;; | ||
34 | Index: libstdc++-v3/libsupc++/guard.cc | ||
35 | =================================================================== | ||
36 | --- libstdc++-v3/libsupc++/guard.cc.orig 2009-11-09 14:09:30.000000000 -0800 | ||
37 | +++ libstdc++-v3/libsupc++/guard.cc 2010-06-25 10:32:26.710135964 -0700 | ||
38 | @@ -30,6 +30,27 @@ | ||
39 | #include <new> | ||
40 | #include <ext/atomicity.h> | ||
41 | #include <ext/concurrence.h> | ||
42 | +#if defined __i386__ && !defined _GLIBCXX_ATOMIC_BUILTINS | ||
43 | +# define _GLIBCXX_ATOMIC_BUILTINS 1 | ||
44 | +# define __sync_val_compare_and_swap(a, b, c) \ | ||
45 | + ({ \ | ||
46 | + typedef char sltast[sizeof (*a) == sizeof (int) ? 1 : -1]; \ | ||
47 | + int sltas; \ | ||
48 | + __asm __volatile ("lock; cmpxchgl %3, (%1)" \ | ||
49 | + : "=a" (sltas) \ | ||
50 | + : "r" (a), "0" (b), "r" (c) : "memory"); \ | ||
51 | + sltas; \ | ||
52 | + }) | ||
53 | +# define __sync_lock_test_and_set(a, b) \ | ||
54 | + ({ \ | ||
55 | + typedef char sltast[sizeof (*a) == sizeof (int) ? 1 : -1]; \ | ||
56 | + int sltas; \ | ||
57 | + __asm __volatile ("xchgl (%1), %0" \ | ||
58 | + : "=r" (sltas) \ | ||
59 | + : "r" (a), "0" (b) : "memory"); \ | ||
60 | + sltas; \ | ||
61 | + }) | ||
62 | +#endif | ||
63 | #if defined(__GTHREADS) && defined(__GTHREAD_HAS_COND) \ | ||
64 | && defined(_GLIBCXX_ATOMIC_BUILTINS_4) && defined(_GLIBCXX_HAVE_LINUX_FUTEX) | ||
65 | # include <climits> | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-ia64-libunwind.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-ia64-libunwind.patch new file mode 100644 index 0000000000..cad13d1228 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-ia64-libunwind.patch | |||
@@ -0,0 +1,550 @@ | |||
1 | 2004-11-27 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | * config.gcc (ia64*-*-linux*): If native and libelf is installed, | ||
4 | use ia64/t-glibc-no-libunwind instead of the other t-*unwind* | ||
5 | fragments. | ||
6 | * config/ia64/t-glibc-no-libunwind: New file. | ||
7 | * config/ia64/change-symver.c: New file. | ||
8 | * config/ia64/unwind-ia64.c: If USE_SYMVER_GLOBAL and SHARED, | ||
9 | define _Unwind_* to __symverglobal_Unwind_*. | ||
10 | (alias): Undefine. | ||
11 | (symverglobal): Define. Use it on _Unwind_*. | ||
12 | * config/ia64/mkmap-symver-multi.awk: New file. | ||
13 | * config/ia64/libgcc-ia64-no-libunwind.ver: New file. | ||
14 | |||
15 | Index: gcc/config.gcc | ||
16 | =================================================================== | ||
17 | --- gcc/config.gcc.orig 2010-04-07 03:34:00.000000000 -0700 | ||
18 | +++ gcc/config.gcc 2010-06-25 10:15:25.133131055 -0700 | ||
19 | @@ -1457,9 +1457,16 @@ | ||
20 | ;; | ||
21 | ia64*-*-linux*) | ||
22 | tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h glibc-stdint.h ia64/sysv4.h ia64/linux.h" | ||
23 | - tmake_file="${tmake_file} ia64/t-ia64 t-libunwind ia64/t-glibc" | ||
24 | - if test x$with_system_libunwind != xyes ; then | ||
25 | - tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind" | ||
26 | + tmake_file="${tmake_file} ia64/t-ia64" | ||
27 | + if test x${target} = x${host} && test x${target} = x${build} \ | ||
28 | + && grep gelf_getverdef /usr/include/gelf.h > /dev/null 2>&1 \ | ||
29 | + && test -f /usr/lib/libelf.so; then | ||
30 | + tmake_file="${tmake_file} ia64/t-glibc-no-libunwind" | ||
31 | + else | ||
32 | + tmake_file="${tmake_file} t-libunwind ia64/t-glibc" | ||
33 | + if test x$with_system_libunwind != xyes ; then | ||
34 | + tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind" | ||
35 | + fi | ||
36 | fi | ||
37 | target_cpu_default="MASK_GNU_AS|MASK_GNU_LD" | ||
38 | extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o" | ||
39 | Index: gcc/config/ia64/t-glibc-no-libunwind | ||
40 | =================================================================== | ||
41 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
42 | +++ gcc/config/ia64/t-glibc-no-libunwind 2010-06-25 10:14:32.521880765 -0700 | ||
43 | @@ -0,0 +1,30 @@ | ||
44 | +# Don't use system libunwind library on IA-64 GLIBC based system, | ||
45 | +# but make _Unwind_* symbols unversioned, so that created programs | ||
46 | +# are usable even when libgcc_s uses libunwind. | ||
47 | +LIB2ADDEH += $(srcdir)/config/ia64/fde-glibc.c | ||
48 | +SHLIB_MAPFILES += $(srcdir)/config/ia64/libgcc-ia64-no-libunwind.ver | ||
49 | +SHLIB_MKMAP = $(srcdir)/config/ia64/mkmap-symver-multi.awk | ||
50 | + | ||
51 | +SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \ | ||
52 | + -Wl,--soname=$(SHLIB_SONAME) \ | ||
53 | + -Wl,--version-script=$(SHLIB_MAP) \ | ||
54 | + -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ $(SHLIB_OBJS) -lc && \ | ||
55 | + rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \ | ||
56 | + if [ -f $(SHLIB_DIR)/$(SHLIB_SONAME) ]; then \ | ||
57 | + mv -f $(SHLIB_DIR)/$(SHLIB_SONAME) \ | ||
58 | + $(SHLIB_DIR)/$(SHLIB_SONAME).backup; \ | ||
59 | + else true; fi && \ | ||
60 | + gcc -O2 -o $(SHLIB_DIR)/$(SHLIB_SONAME).tweak \ | ||
61 | + $$(gcc_srcdir)/config/ia64/change-symver.c -lelf && \ | ||
62 | + $(SHLIB_DIR)/$(SHLIB_SONAME).tweak $(SHLIB_DIR)/$(SHLIB_SONAME).tmp \ | ||
63 | + GCC_3.4.2 _GLOBAL_ \ | ||
64 | + _Unwind_GetGR _Unwind_RaiseException _Unwind_GetRegionStart _Unwind_SetIP \ | ||
65 | + _Unwind_GetIP _Unwind_GetLanguageSpecificData _Unwind_Resume \ | ||
66 | + _Unwind_DeleteException _Unwind_SetGR _Unwind_ForcedUnwind \ | ||
67 | + _Unwind_Backtrace _Unwind_FindEnclosingFunction _Unwind_GetCFA \ | ||
68 | + _Unwind_Resume_or_Rethrow _Unwind_GetBSP && \ | ||
69 | + rm -f $(SHLIB_DIR)/$(SHLIB_SONAME).tweak && \ | ||
70 | + mv $(SHLIB_DIR)/$(SHLIB_SONAME).tmp $(SHLIB_DIR)/$(SHLIB_SONAME) && \ | ||
71 | + $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK) | ||
72 | + | ||
73 | +TARGET_LIBGCC2_CFLAGS += -DUSE_SYMVER_GLOBAL | ||
74 | Index: gcc/config/ia64/change-symver.c | ||
75 | =================================================================== | ||
76 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
77 | +++ gcc/config/ia64/change-symver.c 2010-06-25 10:14:32.521880765 -0700 | ||
78 | @@ -0,0 +1,211 @@ | ||
79 | +#define _GNU_SOURCE 1 | ||
80 | +#define _FILE_OFFSET_BITS 64 | ||
81 | +#include <endian.h> | ||
82 | +#include <errno.h> | ||
83 | +#include <error.h> | ||
84 | +#include <fcntl.h> | ||
85 | +#include <fnmatch.h> | ||
86 | +#include <gelf.h> | ||
87 | +#include <stdlib.h> | ||
88 | +#include <string.h> | ||
89 | +#include <unistd.h> | ||
90 | + | ||
91 | +int | ||
92 | +compute_veridx (const char *name, Elf *elf, Elf_Data *verd, GElf_Shdr *verd_shdr) | ||
93 | +{ | ||
94 | + if (strcmp (name, "_GLOBAL_") == 0) | ||
95 | + return 1; | ||
96 | + | ||
97 | + int cnt; | ||
98 | + size_t offset = 0; | ||
99 | + for (cnt = verd_shdr->sh_info; --cnt >= 0; ) | ||
100 | + { | ||
101 | + GElf_Verdef defmem; | ||
102 | + GElf_Verdef *def; | ||
103 | + GElf_Verdaux auxmem; | ||
104 | + GElf_Verdaux *aux; | ||
105 | + unsigned int auxoffset; | ||
106 | + | ||
107 | + /* Get the data at the next offset. */ | ||
108 | + def = gelf_getverdef (verd, offset, &defmem); | ||
109 | + if (def == NULL) | ||
110 | + break; | ||
111 | + | ||
112 | + auxoffset = offset + def->vd_aux; | ||
113 | + aux = gelf_getverdaux (verd, auxoffset, &auxmem); | ||
114 | + if (aux == NULL) | ||
115 | + break; | ||
116 | + | ||
117 | + if (strcmp (name, elf_strptr (elf, verd_shdr->sh_link, | ||
118 | + aux->vda_name)) == 0) | ||
119 | + return def->vd_ndx; | ||
120 | + | ||
121 | + /* Find the next offset. */ | ||
122 | + offset += def->vd_next; | ||
123 | + } | ||
124 | + | ||
125 | + return -1; | ||
126 | +} | ||
127 | + | ||
128 | +int | ||
129 | +main (int argc, char **argv) | ||
130 | +{ | ||
131 | + if (argc < 4) | ||
132 | + error (1, 0, "Usage: change_symver library from_symver to_symver symbol...\nExample: change_symver libfoo.so FOO_1.0 *global* bar baz"); | ||
133 | + | ||
134 | + const char *fname = argv[1]; | ||
135 | + | ||
136 | + /* Open the file. */ | ||
137 | + int fd; | ||
138 | + fd = open (fname, O_RDWR); | ||
139 | + if (fd == -1) | ||
140 | + error (1, errno, fname); | ||
141 | + | ||
142 | + elf_version (EV_CURRENT); | ||
143 | + | ||
144 | + /* Now get the ELF descriptor. */ | ||
145 | + Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL); | ||
146 | + if (elf == NULL || elf_kind (elf) != ELF_K_ELF) | ||
147 | + error (1, 0, "Couldn't open %s: %s", fname, elf_errmsg (-1)); | ||
148 | + | ||
149 | + size_t shstrndx; | ||
150 | + /* Get the section header string table index. */ | ||
151 | + if (elf_getshstrndx (elf, &shstrndx) < 0) | ||
152 | + error (1, 0, "cannot get shstrndx from %s", fname); | ||
153 | + | ||
154 | + GElf_Ehdr ehdr_mem; | ||
155 | + GElf_Ehdr *ehdr; | ||
156 | + | ||
157 | + /* We need the ELF header in a few places. */ | ||
158 | + ehdr = gelf_getehdr (elf, &ehdr_mem); | ||
159 | + if (ehdr == NULL) | ||
160 | + error (1, 0, "couldn't get ELF headers %s: %s", fname, elf_errmsg (-1)); | ||
161 | + | ||
162 | + Elf_Scn *scn = NULL; | ||
163 | + GElf_Shdr shdr_mem, verd_shdr, ver_shdr, dynsym_shdr; | ||
164 | + Elf_Data *ver = NULL, *verd = NULL, *dynsym = NULL; | ||
165 | + | ||
166 | + while ((scn = elf_nextscn (elf, scn)) != NULL) | ||
167 | + { | ||
168 | + GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); | ||
169 | + | ||
170 | + if (shdr == NULL) | ||
171 | + error (1, 0, "couldn't get shdr from %s", fname); | ||
172 | + | ||
173 | + if ((shdr->sh_flags & SHF_ALLOC) != 0) | ||
174 | + { | ||
175 | + const char *name = elf_strptr (elf, shstrndx, shdr->sh_name); | ||
176 | + Elf_Data **p; | ||
177 | + | ||
178 | + if (strcmp (name, ".gnu.version") == 0) | ||
179 | + { | ||
180 | + p = &ver; | ||
181 | + ver_shdr = *shdr; | ||
182 | + } | ||
183 | + else if (strcmp (name, ".gnu.version_d") == 0) | ||
184 | + { | ||
185 | + p = &verd; | ||
186 | + verd_shdr = *shdr; | ||
187 | + } | ||
188 | + else if (strcmp (name, ".dynsym") == 0) | ||
189 | + { | ||
190 | + p = &dynsym; | ||
191 | + dynsym_shdr = *shdr; | ||
192 | + } | ||
193 | + else | ||
194 | + continue; | ||
195 | + | ||
196 | + if (*p != NULL) | ||
197 | + error (1, 0, "Two %s sections in %s", name, fname); | ||
198 | + *p = elf_getdata (scn, NULL); | ||
199 | + if (*p == NULL || elf_getdata (scn, *p) != NULL) | ||
200 | + error (1, 0, "No data or non-contiguous data in %s section in %s", | ||
201 | + name, fname); | ||
202 | + } | ||
203 | + } | ||
204 | + | ||
205 | + if (ver == NULL || verd == NULL || dynsym == NULL) | ||
206 | + error (1, 0, "Couldn't find one of the needed sections in %s", fname); | ||
207 | + | ||
208 | + int from_idx = compute_veridx (argv[2], elf, verd, &verd_shdr); | ||
209 | + if (from_idx == -1) | ||
210 | + error (1, 0, "Could not find symbol version %s in %s", argv[2], fname); | ||
211 | + | ||
212 | + int to_idx = compute_veridx (argv[3], elf, verd, &verd_shdr); | ||
213 | + if (to_idx == -1) | ||
214 | + error (1, 0, "Could not find symbol version %s in %s", argv[3], fname); | ||
215 | + | ||
216 | + if (dynsym_shdr.sh_entsize != gelf_fsize (elf, ELF_T_SYM, 1, ehdr->e_version) | ||
217 | + || dynsym_shdr.sh_size % dynsym_shdr.sh_entsize | ||
218 | + || ver_shdr.sh_entsize != 2 | ||
219 | + || (ver_shdr.sh_size & 1) | ||
220 | + || dynsym_shdr.sh_size / dynsym_shdr.sh_entsize != ver_shdr.sh_size / 2) | ||
221 | + error (1, 0, "Unexpected sh_size or sh_entsize in %s", fname); | ||
222 | + | ||
223 | + size_t nentries = ver_shdr.sh_size / 2; | ||
224 | + size_t cnt; | ||
225 | + GElf_Versym array[nentries]; | ||
226 | + for (cnt = 0; cnt < nentries; ++cnt) | ||
227 | + { | ||
228 | + GElf_Versym vsymmem; | ||
229 | + GElf_Versym *vsym; | ||
230 | + | ||
231 | + vsym = gelf_getversym (ver, cnt, &vsymmem); | ||
232 | + if (vsym == NULL) | ||
233 | + error (1, 0, "gelt_getversym failed in %s: %s", fname, elf_errmsg (-1)); | ||
234 | + | ||
235 | + array[cnt] = *vsym; | ||
236 | + if (*vsym != from_idx) | ||
237 | + continue; | ||
238 | + | ||
239 | + GElf_Sym sym_mem; | ||
240 | + GElf_Sym *sym; | ||
241 | + sym = gelf_getsym (dynsym, cnt, &sym_mem); | ||
242 | + if (sym == NULL) | ||
243 | + error (1, 0, "gelt_getsym failed in %s: %s", fname, elf_errmsg (-1)); | ||
244 | + | ||
245 | + const char *name = elf_strptr (elf, dynsym_shdr.sh_link, sym->st_name); | ||
246 | + | ||
247 | + int argn; | ||
248 | + for (argn = 4; argn < argc; ++argn) | ||
249 | + if (fnmatch (argv[argn], name, 0) == 0) | ||
250 | + { | ||
251 | + array[cnt] = to_idx; | ||
252 | + break; | ||
253 | + } | ||
254 | + } | ||
255 | + | ||
256 | + if (sizeof (array[0]) != 2) | ||
257 | + abort (); | ||
258 | + | ||
259 | +#if __BYTE_ORDER == __LITTLE_ENDIAN | ||
260 | + if (ehdr->e_ident[EI_DATA] == ELFDATA2LSB) | ||
261 | + ; | ||
262 | + else if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) | ||
263 | +#elif __BYTE_ORDER == __BIG_ENDIAN | ||
264 | + if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) | ||
265 | + ; | ||
266 | + else if (ehdr->e_ident[EI_DATA] == ELFDATA2LSB) | ||
267 | +#else | ||
268 | +# error Unsupported endianity | ||
269 | +#endif | ||
270 | + { | ||
271 | + for (cnt = 0; cnt < nentries; ++cnt) | ||
272 | + array[cnt] = ((array[cnt] & 0xff) << 8) | ((array[cnt] & 0xff00) >> 8); | ||
273 | + } | ||
274 | + else | ||
275 | + error (1, 0, "Unknown EI_DATA %d in %s", ehdr->e_ident[EI_DATA], fname); | ||
276 | + | ||
277 | + if (elf_end (elf) != 0) | ||
278 | + error (1, 0, "couldn't close %s: %s", fname, elf_errmsg (-1)); | ||
279 | + | ||
280 | + if (lseek (fd, ver_shdr.sh_offset, SEEK_SET) != (off_t) ver_shdr.sh_offset) | ||
281 | + error (1, 0, "failed to seek to %zd in %s", (size_t) ver_shdr.sh_offset, | ||
282 | + fname); | ||
283 | + | ||
284 | + if (write (fd, array, 2 * nentries) != (ssize_t) (2 * nentries)) | ||
285 | + error (1, 0, "failed to write .gnu.version section into %s", fname); | ||
286 | + | ||
287 | + close (fd); | ||
288 | + return 0; | ||
289 | +} | ||
290 | Index: gcc/config/ia64/unwind-ia64.c | ||
291 | =================================================================== | ||
292 | --- gcc/config/ia64/unwind-ia64.c.orig 2009-09-07 08:41:52.000000000 -0700 | ||
293 | +++ gcc/config/ia64/unwind-ia64.c 2010-06-25 10:14:32.521880765 -0700 | ||
294 | @@ -48,6 +48,51 @@ | ||
295 | #define MD_UNW_COMPATIBLE_PERSONALITY_P(HEADER) 1 | ||
296 | #endif | ||
297 | |||
298 | +#if defined (USE_SYMVER_GLOBAL) && defined (SHARED) | ||
299 | +extern _Unwind_Reason_Code __symverglobal_Unwind_Backtrace | ||
300 | + (_Unwind_Trace_Fn, void *); | ||
301 | +extern void __symverglobal_Unwind_DeleteException | ||
302 | + (struct _Unwind_Exception *); | ||
303 | +extern void * __symverglobal_Unwind_FindEnclosingFunction (void *); | ||
304 | +extern _Unwind_Reason_Code __symverglobal_Unwind_ForcedUnwind | ||
305 | + (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); | ||
306 | +extern _Unwind_Word __symverglobal_Unwind_GetCFA | ||
307 | + (struct _Unwind_Context *); | ||
308 | +extern _Unwind_Word __symverglobal_Unwind_GetBSP | ||
309 | + (struct _Unwind_Context *); | ||
310 | +extern _Unwind_Word __symverglobal_Unwind_GetGR | ||
311 | + (struct _Unwind_Context *, int ); | ||
312 | +extern _Unwind_Ptr __symverglobal_Unwind_GetIP (struct _Unwind_Context *); | ||
313 | +extern void *__symverglobal_Unwind_GetLanguageSpecificData | ||
314 | + (struct _Unwind_Context *); | ||
315 | +extern _Unwind_Ptr __symverglobal_Unwind_GetRegionStart | ||
316 | + (struct _Unwind_Context *); | ||
317 | +extern _Unwind_Reason_Code __symverglobal_Unwind_RaiseException | ||
318 | + (struct _Unwind_Exception *); | ||
319 | +extern void __symverglobal_Unwind_Resume (struct _Unwind_Exception *); | ||
320 | +extern _Unwind_Reason_Code __symverglobal_Unwind_Resume_or_Rethrow | ||
321 | + (struct _Unwind_Exception *); | ||
322 | +extern void __symverglobal_Unwind_SetGR | ||
323 | + (struct _Unwind_Context *, int, _Unwind_Word); | ||
324 | +extern void __symverglobal_Unwind_SetIP | ||
325 | + (struct _Unwind_Context *, _Unwind_Ptr); | ||
326 | +#define _Unwind_Backtrace __symverglobal_Unwind_Backtrace | ||
327 | +#define _Unwind_DeleteException __symverglobal_Unwind_DeleteException | ||
328 | +#define _Unwind_FindEnclosingFunction __symverglobal_Unwind_FindEnclosingFunction | ||
329 | +#define _Unwind_ForcedUnwind __symverglobal_Unwind_ForcedUnwind | ||
330 | +#define _Unwind_GetBSP __symverglobal_Unwind_GetBSP | ||
331 | +#define _Unwind_GetCFA __symverglobal_Unwind_GetCFA | ||
332 | +#define _Unwind_GetGR __symverglobal_Unwind_GetGR | ||
333 | +#define _Unwind_GetIP __symverglobal_Unwind_GetIP | ||
334 | +#define _Unwind_GetLanguageSpecificData __symverglobal_Unwind_GetLanguageSpecificData | ||
335 | +#define _Unwind_GetRegionStart __symverglobal_Unwind_GetRegionStart | ||
336 | +#define _Unwind_RaiseException __symverglobal_Unwind_RaiseException | ||
337 | +#define _Unwind_Resume __symverglobal_Unwind_Resume | ||
338 | +#define _Unwind_Resume_or_Rethrow __symverglobal_Unwind_Resume_or_Rethrow | ||
339 | +#define _Unwind_SetGR __symverglobal_Unwind_SetGR | ||
340 | +#define _Unwind_SetIP __symverglobal_Unwind_SetIP | ||
341 | +#endif | ||
342 | + | ||
343 | enum unw_application_register | ||
344 | { | ||
345 | UNW_AR_BSP, | ||
346 | @@ -2457,4 +2502,44 @@ | ||
347 | alias (_Unwind_SetIP); | ||
348 | #endif | ||
349 | |||
350 | +#if defined (USE_SYMVER_GLOBAL) && defined (SHARED) | ||
351 | +#undef alias | ||
352 | +#define symverglobal(name, version) \ | ||
353 | +__typeof (__symverglobal##name) __symverlocal##name \ | ||
354 | + __attribute__ ((alias ("__symverglobal" #name))); \ | ||
355 | +__asm__ (".symver __symverglobal" #name"," #name "@@GCC_3.4.2");\ | ||
356 | +__asm__ (".symver __symverlocal" #name"," #name "@" #version) | ||
357 | + | ||
358 | +#undef _Unwind_Backtrace | ||
359 | +#undef _Unwind_DeleteException | ||
360 | +#undef _Unwind_FindEnclosingFunction | ||
361 | +#undef _Unwind_ForcedUnwind | ||
362 | +#undef _Unwind_GetBSP | ||
363 | +#undef _Unwind_GetCFA | ||
364 | +#undef _Unwind_GetGR | ||
365 | +#undef _Unwind_GetIP | ||
366 | +#undef _Unwind_GetLanguageSpecificData | ||
367 | +#undef _Unwind_GetRegionStart | ||
368 | +#undef _Unwind_RaiseException | ||
369 | +#undef _Unwind_Resume | ||
370 | +#undef _Unwind_Resume_or_Rethrow | ||
371 | +#undef _Unwind_SetGR | ||
372 | +#undef _Unwind_SetIP | ||
373 | +symverglobal (_Unwind_Backtrace, GCC_3.3); | ||
374 | +symverglobal (_Unwind_DeleteException, GCC_3.0); | ||
375 | +symverglobal (_Unwind_FindEnclosingFunction, GCC_3.3); | ||
376 | +symverglobal (_Unwind_ForcedUnwind, GCC_3.0); | ||
377 | +symverglobal (_Unwind_GetBSP, GCC_3.3.2); | ||
378 | +symverglobal (_Unwind_GetCFA, GCC_3.3); | ||
379 | +symverglobal (_Unwind_GetGR, GCC_3.0); | ||
380 | +symverglobal (_Unwind_GetIP, GCC_3.0); | ||
381 | +symverglobal (_Unwind_GetLanguageSpecificData, GCC_3.0); | ||
382 | +symverglobal (_Unwind_GetRegionStart, GCC_3.0); | ||
383 | +symverglobal (_Unwind_RaiseException, GCC_3.0); | ||
384 | +symverglobal (_Unwind_Resume, GCC_3.0); | ||
385 | +symverglobal (_Unwind_Resume_or_Rethrow, GCC_3.3); | ||
386 | +symverglobal (_Unwind_SetGR, GCC_3.0); | ||
387 | +symverglobal (_Unwind_SetIP, GCC_3.0); | ||
388 | +#endif | ||
389 | + | ||
390 | #endif | ||
391 | Index: gcc/config/ia64/mkmap-symver-multi.awk | ||
392 | =================================================================== | ||
393 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
394 | +++ gcc/config/ia64/mkmap-symver-multi.awk 2010-06-25 10:14:32.521880765 -0700 | ||
395 | @@ -0,0 +1,133 @@ | ||
396 | +# Generate an ELF symbol version map a-la Solaris and GNU ld. | ||
397 | +# Contributed by Richard Henderson <rth@cygnus.com> | ||
398 | +# | ||
399 | +# This file is part of GCC. | ||
400 | +# | ||
401 | +# GCC is free software; you can redistribute it and/or modify it under | ||
402 | +# the terms of the GNU General Public License as published by the Free | ||
403 | +# Software Foundation; either version 2, or (at your option) any later | ||
404 | +# version. | ||
405 | +# | ||
406 | +# GCC is distributed in the hope that it will be useful, but WITHOUT | ||
407 | +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
408 | +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public | ||
409 | +# License for more details. | ||
410 | +# | ||
411 | +# You should have received a copy of the GNU General Public License | ||
412 | +# along with GCC; see the file COPYING. If not, write to the Free | ||
413 | +# Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA | ||
414 | +# 02110-1301, USA. | ||
415 | + | ||
416 | +BEGIN { | ||
417 | + state = "nm"; | ||
418 | + sawsymbol = 0; | ||
419 | +} | ||
420 | + | ||
421 | +# Remove comment and blank lines. | ||
422 | +/^ *#/ || /^ *$/ { | ||
423 | + next; | ||
424 | +} | ||
425 | + | ||
426 | +# We begin with nm input. Collect the set of symbols that are present | ||
427 | +# so that we can not emit them into the final version script -- Solaris | ||
428 | +# complains at us if we do. | ||
429 | + | ||
430 | +state == "nm" && /^%%/ { | ||
431 | + state = "ver"; | ||
432 | + next; | ||
433 | +} | ||
434 | + | ||
435 | +state == "nm" && ($1 == "U" || $2 == "U") { | ||
436 | + next; | ||
437 | +} | ||
438 | + | ||
439 | +state == "nm" && NF == 3 { | ||
440 | + if ($3 ~ /^[^@]*@GCC_[0-9.]*$/) { | ||
441 | + def[$3] = 1 | ||
442 | + tl=$3 | ||
443 | + sub(/^.*@/,"",tl) | ||
444 | + ver[$3] = tl | ||
445 | + } else { | ||
446 | + sub(/@@?GCC_[0-9.]*$/,"",$3) | ||
447 | + def[$3] = 1; | ||
448 | + } | ||
449 | + sawsymbol = 1; | ||
450 | + next; | ||
451 | +} | ||
452 | + | ||
453 | +state == "nm" { | ||
454 | + next; | ||
455 | +} | ||
456 | + | ||
457 | +# Now we process a simplified variant of the Solaris symbol version | ||
458 | +# script. We have one symbol per line, no semicolons, simple markers | ||
459 | +# for beginning and ending each section, and %inherit markers for | ||
460 | +# describing version inheritence. A symbol may appear in more than | ||
461 | +# one symbol version, and the last seen takes effect. | ||
462 | + | ||
463 | +NF == 3 && $1 == "%inherit" { | ||
464 | + inherit[$2] = $3; | ||
465 | + next; | ||
466 | +} | ||
467 | + | ||
468 | +NF == 2 && $2 == "{" { | ||
469 | + libs[$1] = 1; | ||
470 | + thislib = $1; | ||
471 | + next; | ||
472 | +} | ||
473 | + | ||
474 | +$1 == "}" { | ||
475 | + thislib = ""; | ||
476 | + next; | ||
477 | +} | ||
478 | + | ||
479 | +{ | ||
480 | + ver[$1] = thislib; | ||
481 | + next; | ||
482 | +} | ||
483 | + | ||
484 | +END { | ||
485 | + if (!sawsymbol) | ||
486 | + { | ||
487 | + print "No symbols seen -- broken or mis-installed nm?" | "cat 1>&2"; | ||
488 | + exit 1; | ||
489 | + } | ||
490 | + for (l in libs) | ||
491 | + output(l); | ||
492 | +} | ||
493 | + | ||
494 | +function output(lib) { | ||
495 | + if (done[lib]) | ||
496 | + return; | ||
497 | + done[lib] = 1; | ||
498 | + if (inherit[lib]) | ||
499 | + output(inherit[lib]); | ||
500 | + | ||
501 | + empty=1 | ||
502 | + for (sym in ver) | ||
503 | + if ((ver[sym] == lib) && (sym in def)) | ||
504 | + { | ||
505 | + if (empty) | ||
506 | + { | ||
507 | + printf("%s {\n", lib); | ||
508 | + printf(" global:\n"); | ||
509 | + empty = 0; | ||
510 | + } | ||
511 | + symp = sym; | ||
512 | + sub(/@GCC_[0-9.]*$/,"",symp); | ||
513 | + printf("\t%s;\n", symp); | ||
514 | + if (dotsyms) | ||
515 | + printf("\t.%s;\n", symp); | ||
516 | + } | ||
517 | + | ||
518 | + if (empty) | ||
519 | + { | ||
520 | + for (l in libs) | ||
521 | + if (inherit[l] == lib) | ||
522 | + inherit[l] = inherit[lib]; | ||
523 | + } | ||
524 | + else if (inherit[lib]) | ||
525 | + printf("} %s;\n", inherit[lib]); | ||
526 | + else | ||
527 | + printf ("\n local:\n\t*;\n};\n"); | ||
528 | +} | ||
529 | Index: gcc/config/ia64/libgcc-ia64-no-libunwind.ver | ||
530 | =================================================================== | ||
531 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
532 | +++ gcc/config/ia64/libgcc-ia64-no-libunwind.ver 2010-06-25 10:14:32.525880902 -0700 | ||
533 | @@ -0,0 +1,17 @@ | ||
534 | +GCC_3.4.2 { | ||
535 | + _Unwind_GetGR | ||
536 | + _Unwind_RaiseException | ||
537 | + _Unwind_GetRegionStart | ||
538 | + _Unwind_SetIP | ||
539 | + _Unwind_GetIP | ||
540 | + _Unwind_GetLanguageSpecificData | ||
541 | + _Unwind_Resume | ||
542 | + _Unwind_DeleteException | ||
543 | + _Unwind_SetGR | ||
544 | + _Unwind_ForcedUnwind | ||
545 | + _Unwind_Backtrace | ||
546 | + _Unwind_FindEnclosingFunction | ||
547 | + _Unwind_GetCFA | ||
548 | + _Unwind_Resume_or_Rethrow | ||
549 | + _Unwind_GetBSP | ||
550 | +} | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-java-debug-iface-type.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-java-debug-iface-type.patch new file mode 100644 index 0000000000..de14a50018 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-java-debug-iface-type.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | 2008-01-25 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | * lang.c (java_classify_record): Revert 2007-12-20 change. | ||
4 | |||
5 | Index: gcc/java/lang.c | ||
6 | =================================================================== | ||
7 | --- gcc/java/lang.c.orig 2010-01-20 00:17:00.000000000 -0800 | ||
8 | +++ gcc/java/lang.c 2010-06-25 10:28:46.569383189 -0700 | ||
9 | @@ -881,9 +881,7 @@ | ||
10 | if (! CLASS_P (type)) | ||
11 | return RECORD_IS_STRUCT; | ||
12 | |||
13 | - /* ??? GDB does not support DW_TAG_interface_type as of December, | ||
14 | - 2007. Re-enable this at a later time. */ | ||
15 | - if (0 && CLASS_INTERFACE (TYPE_NAME (type))) | ||
16 | + if (CLASS_INTERFACE (TYPE_NAME (type))) | ||
17 | return RECORD_IS_INTERFACE; | ||
18 | |||
19 | return RECORD_IS_CLASS; | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-java-nomulti.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-java-nomulti.patch new file mode 100644 index 0000000000..3cb10f3c23 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-java-nomulti.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | Index: libjava/configure.ac | ||
2 | =================================================================== | ||
3 | --- libjava/configure.ac.orig 2010-03-21 12:41:37.000000000 -0700 | ||
4 | +++ libjava/configure.ac 2010-06-25 10:17:47.489886278 -0700 | ||
5 | @@ -139,6 +139,13 @@ | ||
6 | [allow rebuilding of .class and .h files])) | ||
7 | AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes) | ||
8 | |||
9 | +AC_ARG_ENABLE(libjava-multilib, | ||
10 | + AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib])) | ||
11 | +if test "$enable_libjava_multilib" = no; then | ||
12 | + multilib=no | ||
13 | + ac_configure_args="$ac_configure_args --disable-multilib" | ||
14 | +fi | ||
15 | + | ||
16 | # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX. | ||
17 | GCC_NO_EXECUTABLES | ||
18 | |||
19 | Index: libjava/configure | ||
20 | =================================================================== | ||
21 | --- libjava/configure.orig 2010-04-02 11:18:06.000000000 -0700 | ||
22 | +++ libjava/configure 2010-06-25 10:17:47.516381209 -0700 | ||
23 | @@ -1609,6 +1609,8 @@ | ||
24 | default=yes | ||
25 | --enable-java-maintainer-mode | ||
26 | allow rebuilding of .class and .h files | ||
27 | + --enable-libjava-multilib | ||
28 | + build libjava as multilib | ||
29 | --disable-dependency-tracking speeds up one-time build | ||
30 | --enable-dependency-tracking do not reject slow dependency extractors | ||
31 | --enable-maintainer-mode enable make rules and dependencies not useful | ||
32 | @@ -3346,6 +3348,16 @@ | ||
33 | fi | ||
34 | |||
35 | |||
36 | +# Check whether --enable-libjava-multilib was given. | ||
37 | +if test "${enable_libjava_multilib+set}" = set; then | ||
38 | + enableval=$enable_libjava_multilib; | ||
39 | +fi | ||
40 | + | ||
41 | +if test "$enable_libjava_multilib" = no; then | ||
42 | + multilib=no | ||
43 | + ac_configure_args="$ac_configure_args --disable-multilib" | ||
44 | +fi | ||
45 | + | ||
46 | # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX. | ||
47 | |||
48 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-libgomp-speedup.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-libgomp-speedup.patch new file mode 100644 index 0000000000..da85e556ec --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-libgomp-speedup.patch | |||
@@ -0,0 +1,2797 @@ | |||
1 | 2008-03-28 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | * config/linux/sparc/futex.h (atomic_write_barrier): Fix membar | ||
4 | argument. | ||
5 | |||
6 | 2008-03-27 Jakub Jelinek <jakub@redhat.com> | ||
7 | |||
8 | * libgomp.h (struct gomp_team_state): Remove single_count field | ||
9 | ifndef HAVE_SYNC_BUILTINS. | ||
10 | (struct gomp_team): Likewise. Add work_share_list_free_lock | ||
11 | ifndef HAVE_SYNC_BUILTINS. | ||
12 | * team.c (gomp_new_team): If HAVE_SYNC_BUILTINS is not defined, | ||
13 | don't initialize single_count, but instead initialize | ||
14 | work_share_list_free_lock. | ||
15 | (free_team): Destroy work_share_list_free_lock ifndef | ||
16 | HAVE_SYNC_BUILTINS. | ||
17 | (gomp_team_start): Don't initialize ts.single_count ifndef | ||
18 | HAVE_SYNC_BUILTINS. | ||
19 | * work.c (alloc_work_share, free_work_share): Use | ||
20 | work_share_list_free_lock instead of atomic chaining ifndef | ||
21 | HAVE_SYNC_BUILTINS. | ||
22 | |||
23 | 2008-03-26 Jakub Jelinek <jakub@redhat.com> | ||
24 | |||
25 | * loop.c (gomp_loop_init): Fix GFS_DYNAMIC ws->mode setting. | ||
26 | * testsuite/libgomp.c/loop-4.c: New test. | ||
27 | |||
28 | * libgomp.h (struct gomp_team_state): Add single_count field. | ||
29 | (struct gomp_team): Likewise. | ||
30 | * team.c (gomp_new_team): Clear single_count. | ||
31 | (gomp_team_start): Likewise. | ||
32 | * single.c (GOMP_single_start): Rewritten if HAVE_SYNC_BUILTINS. | ||
33 | |||
34 | 2008-03-25 Jakub Jelinek <jakub@redhat.com> | ||
35 | |||
36 | * team.c (gomp_thread_start): Don't clear ts.static_trip here. | ||
37 | * loop.c (gomp_loop_static_start, gomp_loop_dynamic_start): Clear | ||
38 | ts.static_trip here. | ||
39 | * work.c (gomp_work_share_start): Don't clear ts.static_trip here. | ||
40 | |||
41 | 2008-03-21 Jakub Jelinek <jakub@redhat.com> | ||
42 | |||
43 | * libgomp.h: Include ptrlock.h. | ||
44 | (struct gomp_work_share): Reshuffle fields. Add next_alloc, | ||
45 | next_ws, next_free and inline_ordered_team_ids fields, change | ||
46 | ordered_team_ids into pointer from flexible array member. | ||
47 | (struct gomp_team_state): Add last_work_share field, remove | ||
48 | work_share_generation. | ||
49 | (struct gomp_team): Remove work_share_lock, generation_mask, | ||
50 | oldest_live_gen, num_live_gen and init_work_shares fields, add | ||
51 | work work_share_list_alloc, work_share_list_free and work_share_chunk | ||
52 | fields. Change work_shares from pointer to pointers into an array. | ||
53 | (gomp_new_team): New prototype. | ||
54 | (gomp_team_start): Change type of last argument. | ||
55 | (gomp_new_work_share): Removed. | ||
56 | (gomp_init_work_share, gomp_fini_work_share): New prototypes. | ||
57 | (gomp_work_share_init_done): New static inline. | ||
58 | * team.c (gomp_thread_start): Clear ts.last_work_share, don't clear | ||
59 | ts.work_share_generation. | ||
60 | (new_team): Removed. | ||
61 | (gomp_new_team): New function. | ||
62 | (free_team): Free gomp_work_share blocks chained through next_alloc, | ||
63 | instead of freeing work_shares and destroying work_share_lock. | ||
64 | (gomp_team_start): Change last argument from ws to team, don't create | ||
65 | new team, set ts.work_share to &team->work_shares[0] and clear | ||
66 | ts.last_work_share. Don't clear ts.work_share_generation. | ||
67 | (gomp_team_end): Call gomp_fini_work_share. | ||
68 | * work.c (gomp_new_work_share): Removed. | ||
69 | (alloc_work_share, gomp_init_work_share, gomp_fini_work_share): New | ||
70 | functions. | ||
71 | (free_work_share): Add team argument. Call gomp_fini_work_share | ||
72 | and then either free ws if orphaned, or put it into | ||
73 | work_share_list_free list of the current team. | ||
74 | (gomp_work_share_start, gomp_work_share_end, | ||
75 | gomp_work_share_end_nowait): Rewritten. | ||
76 | * sections.c (GOMP_sections_start): Call gomp_work_share_init_done | ||
77 | after gomp_sections_init. If HAVE_SYNC_BUILTINS, call | ||
78 | gomp_iter_dynamic_next instead of the _locked variant and don't take | ||
79 | lock around it, otherwise acquire it before calling | ||
80 | gomp_iter_dynamic_next_locked. | ||
81 | (GOMP_sections_next): If HAVE_SYNC_BUILTINS, call | ||
82 | gomp_iter_dynamic_next instead of the _locked variant and don't take | ||
83 | lock around it. | ||
84 | (GOMP_parallel_sections_start): Call gomp_new_team instead of | ||
85 | gomp_new_work_share. Call gomp_sections_init on &team->work_shares[0]. | ||
86 | Adjust gomp_team_start caller. | ||
87 | * loop.c (gomp_loop_static_start, gomp_loop_ordered_static_start): Call | ||
88 | gomp_work_share_init_done after gomp_loop_init. Don't unlock ws->lock. | ||
89 | (gomp_loop_dynamic_start, gomp_loop_guided_start): Call | ||
90 | gomp_work_share_init_done after gomp_loop_init. If HAVE_SYNC_BUILTINS, | ||
91 | don't unlock ws->lock, otherwise lock it. | ||
92 | (gomp_loop_ordered_dynamic_start, gomp_loop_ordered_guided_start): Call | ||
93 | gomp_work_share_init_done after gomp_loop_init. Lock ws->lock. | ||
94 | (gomp_parallel_loop_start): Call gomp_new_team instead of | ||
95 | gomp_new_work_share. Call gomp_loop_init on &team->work_shares[0]. | ||
96 | Adjust gomp_team_start caller. | ||
97 | * single.c (GOMP_single_start, GOMP_single_copy_start): Call | ||
98 | gomp_work_share_init_done if gomp_work_share_start returned true. | ||
99 | Don't unlock ws->lock. | ||
100 | * parallel.c (GOMP_parallel_start): Call gomp_new_team and pass that | ||
101 | as last argument to gomp_team_start. | ||
102 | * config/linux/ptrlock.c: New file. | ||
103 | * config/linux/ptrlock.h: New file. | ||
104 | * config/posix/ptrlock.c: New file. | ||
105 | * config/posix/ptrlock.h: New file. | ||
106 | * Makefile.am (libgomp_la_SOURCES): Add ptrlock.c. | ||
107 | * Makefile.in: Regenerated. | ||
108 | * testsuite/Makefile.in: Regenerated. | ||
109 | |||
110 | 2008-03-19 Jakub Jelinek <jakub@redhat.com> | ||
111 | |||
112 | * libgomp.h (gomp_active_wait_policy): Remove decl. | ||
113 | (gomp_throttled_spin_count_var, gomp_available_cpus, | ||
114 | gomp_managed_threads): New extern decls. | ||
115 | * team.c (gomp_team_start, gomp_team_end): If number of threads | ||
116 | changed, adjust atomically gomp_managed_threads. | ||
117 | * env.c (gomp_active_wait_policy, gomp_block_time_var): Remove. | ||
118 | (gomp_throttled_spin_count_var, gomp_available_cpus, | ||
119 | gomp_managed_threads): New variables. | ||
120 | (parse_millis): Removed. | ||
121 | (parse_spincount): New function. | ||
122 | (parse_wait_policy): Return -1/0/1 instead of setting | ||
123 | gomp_active_wait_policy. | ||
124 | (initialize_env): Call gomp_init_num_threads unconditionally. | ||
125 | Initialize gomp_available_cpus. Call parse_spincount instead | ||
126 | of parse_millis, initialize gomp_{,throttled_}spin_count_var | ||
127 | depending on presence and value of OMP_WAIT_POLICY and | ||
128 | GOMP_SPINCOUNT env vars. | ||
129 | * config/linux/wait.h (do_wait): Use gomp_throttled_spin_count_var | ||
130 | instead of gomp_spin_count_var if gomp_managed_threads > | ||
131 | gomp_available_cpus. | ||
132 | |||
133 | * config/linux/wait.h: Include errno.h. | ||
134 | (FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Define. | ||
135 | (gomp_futex_wake, gomp_futex_wait): New extern decls. | ||
136 | * config/linux/mutex.c (gomp_futex_wake, gomp_futex_wait): New | ||
137 | variables. | ||
138 | * config/linux/powerpc/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove. | ||
139 | (sys_futex0): Return error code. | ||
140 | (futex_wake, futex_wait): If ENOSYS was returned, clear | ||
141 | FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry. | ||
142 | * config/linux/alpha/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove. | ||
143 | (futex_wake, futex_wait): If ENOSYS was returned, clear | ||
144 | FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry. | ||
145 | * config/linux/x86/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove. | ||
146 | (sys_futex0): Return error code. | ||
147 | (futex_wake, futex_wait): If ENOSYS was returned, clear | ||
148 | FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry. | ||
149 | * config/linux/s390/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove. | ||
150 | (sys_futex0): Return error code. | ||
151 | (futex_wake, futex_wait): If ENOSYS was returned, clear | ||
152 | FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry. | ||
153 | * config/linux/ia64/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove. | ||
154 | (sys_futex0): Return error code. | ||
155 | (futex_wake, futex_wait): If ENOSYS was returned, clear | ||
156 | FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry. | ||
157 | * config/linux/sparc/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove. | ||
158 | (sys_futex0): Return error code. | ||
159 | (futex_wake, futex_wait): If ENOSYS was returned, clear | ||
160 | FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry. | ||
161 | |||
162 | 2008-03-18 Jakub Jelinek <jakub@redhat.com> | ||
163 | |||
164 | * libgomp.h (struct gomp_work_share): Add mode field. Put lock and | ||
165 | next into a different cache line from most of the write-once fields. | ||
166 | * loop.c: Include limits.h. | ||
167 | (gomp_loop_init): For GFS_DYNAMIC, multiply ws->chunk_size by incr. | ||
168 | If adding ws->chunk_size nthreads + 1 times after end won't | ||
169 | overflow, set ws->mode to 1. | ||
170 | * iter.c (gomp_iter_dynamic_next_locked): Don't multiply | ||
171 | ws->chunk_size by incr. | ||
172 | (gomp_iter_dynamic_next): Likewise. If ws->mode, use more efficient | ||
173 | code. | ||
174 | * work.c: Include stddef.h. | ||
175 | (gomp_new_work_share): Use offsetof rather than sizeof. | ||
176 | |||
177 | 2008-03-17 Jakub Jelinek <jakub@redhat.com> | ||
178 | |||
179 | * libgomp.h (struct gomp_team): Change ordered_release field | ||
180 | into gomp_sem_t ** from flexible array member. Add implicit_task | ||
181 | and initial_work_shares fields. | ||
182 | (gomp_new_task): Removed. | ||
183 | (gomp_init_task): New prototype. | ||
184 | * team.c (new_team): Allocate implicit_task for each thread | ||
185 | and initial work_shares together with gomp_team allocation. | ||
186 | (free_team): Only free work_shares if it is not init_work_shares. | ||
187 | (gomp_team_start): Use gomp_init_task instead of gomp_new_task, | ||
188 | set thr->task to the corresponding implicit_task array entry. | ||
189 | * task.c (gomp_new_task): Removed. | ||
190 | (gomp_init_task): New function. | ||
191 | (gomp_end_task): Don't free the task. | ||
192 | (GOMP_task): Allocate struct gomp_task on the stack, call | ||
193 | gomp_init_task rather than gomp_new_task. | ||
194 | * work.c (gomp_work_share_start): If work_shares == | ||
195 | init_work_shares, gomp_malloc + memcpy rather than gomp_realloc. | ||
196 | |||
197 | 2008-03-15 Jakub Jelinek <jakub@redhat.com> | ||
198 | Ulrich Drepper <drepper@redhat.com> | ||
199 | |||
200 | * config/linux/bar.h (gomp_barrier_state_t): Rewritten. | ||
201 | (gomp_barrier_state_t): Change to unsigned int. | ||
202 | (gomp_barrier_init, gomp_barrier_reinit, gomp_barrier_destroy, | ||
203 | gomp_barrier_wait_start, gomp_barrier_last_thread): Rewritten. | ||
204 | (gomp_barrier_wait_last): Prototype rather than inline. | ||
205 | * config/linux/bar.c (gomp_barrier_wait_end): Rewritten. | ||
206 | (gomp_barrier_wait_last): New function. | ||
207 | |||
208 | 2008-03-15 Jakub Jelinek <jakub@redhat.com> | ||
209 | |||
210 | * team.c (gomp_thread_start): Use gomp_barrier_wait_last instead | ||
211 | of gomp_barrier_wait. | ||
212 | * env.c (gomp_block_time_var, gomp_spin_count_var): New variables. | ||
213 | (parse_millis): New function. | ||
214 | (initialize_env): Handle GOMP_BLOCKTIME env var. | ||
215 | * libgomp.h (struct gomp_team): Move close to the end of the struct. | ||
216 | (gomp_spin_count_var): New extern var decl. | ||
217 | * work.c (gomp_work_share_end): Use gomp_barrier_state_t bstate | ||
218 | var instead of bool last, call gomp_barrier_last_thread to check | ||
219 | for last thread, pass bstate to gomp_barrier_wait_end. | ||
220 | * config/linux/wait.h: New file. | ||
221 | * config/linux/mutex.c: Include wait.h instead of libgomp.h and | ||
222 | futex.h. | ||
223 | (gomp_mutex_lock_slow): Call do_wait instead of futex_wait. | ||
224 | * config/linux/bar.c: Include wait.h instead of libgomp.h and | ||
225 | futex.h. | ||
226 | (gomp_barrier_wait_end): Change second argument to | ||
227 | gomp_barrier_state_t. Call do_wait instead of futex_wait. | ||
228 | * config/linux/sem.c: Include wait.h instead of libgomp.h and | ||
229 | futex.h. | ||
230 | (gomp_sem_wait_slow): Call do_wait instead of futex_wait. | ||
231 | * config/linux/lock.c: Include wait.h instead of libgomp.h and | ||
232 | futex.h. | ||
233 | (gomp_set_nest_lock_25): Call do_wait instead of futex_wait. | ||
234 | * config/linux/affinity.c: Assume HAVE_SYNC_BUILTINS. | ||
235 | * config/linux/bar.h (gomp_barrier_state_t): New typedef. | ||
236 | (gomp_barrier_wait_end): Change second argument to | ||
237 | gomp_barrier_state_t. | ||
238 | (gomp_barrier_wait_start): Return gomp_barrier_state_t. | ||
239 | (gomp_barrier_last_thread, gomp_barrier_wait_last): New static | ||
240 | inlines. | ||
241 | * config/linux/powerpc/futex.h (cpu_relax, atomic_write_barrier): New | ||
242 | static inlines. | ||
243 | * config/linux/alpha/futex.h (cpu_relax, atomic_write_barrier): | ||
244 | Likewise. | ||
245 | * config/linux/x86/futex.h (cpu_relax, atomic_write_barrier): | ||
246 | Likewise. | ||
247 | * config/linux/s390/futex.h (cpu_relax, atomic_write_barrier): | ||
248 | Likewise. | ||
249 | * config/linux/ia64/futex.h (cpu_relax, atomic_write_barrier): | ||
250 | Likewise. | ||
251 | * config/linux/sparc/futex.h (cpu_relax, atomic_write_barrier): | ||
252 | Likewise. | ||
253 | * config/posix/bar.c (gomp_barrier_wait_end): Change second argument | ||
254 | to gomp_barrier_state_t. | ||
255 | * config/posix/bar.h (gomp_barrier_state_t): New typedef. | ||
256 | (gomp_barrier_wait_end): Change second argument to | ||
257 | gomp_barrier_state_t. | ||
258 | (gomp_barrier_wait_start): Return gomp_barrier_state_t. | ||
259 | (gomp_barrier_last_thread, gomp_barrier_wait_last): New static | ||
260 | inlines. | ||
261 | |||
262 | --- libgomp/parallel.c.jj 2007-12-07 14:41:01.000000000 +0100 | ||
263 | +++ libgomp/parallel.c 2008-03-26 15:32:06.000000000 +0100 | ||
264 | @@ -68,7 +68,7 @@ void | ||
265 | GOMP_parallel_start (void (*fn) (void *), void *data, unsigned num_threads) | ||
266 | { | ||
267 | num_threads = gomp_resolve_num_threads (num_threads); | ||
268 | - gomp_team_start (fn, data, num_threads, NULL); | ||
269 | + gomp_team_start (fn, data, num_threads, gomp_new_team (num_threads)); | ||
270 | } | ||
271 | |||
272 | void | ||
273 | --- libgomp/sections.c.jj 2007-12-07 14:41:01.000000000 +0100 | ||
274 | +++ libgomp/sections.c 2008-03-26 15:33:06.000000000 +0100 | ||
275 | @@ -59,14 +59,24 @@ GOMP_sections_start (unsigned count) | ||
276 | long s, e, ret; | ||
277 | |||
278 | if (gomp_work_share_start (false)) | ||
279 | - gomp_sections_init (thr->ts.work_share, count); | ||
280 | + { | ||
281 | + gomp_sections_init (thr->ts.work_share, count); | ||
282 | + gomp_work_share_init_done (); | ||
283 | + } | ||
284 | |||
285 | +#ifdef HAVE_SYNC_BUILTINS | ||
286 | + if (gomp_iter_dynamic_next (&s, &e)) | ||
287 | + ret = s; | ||
288 | + else | ||
289 | + ret = 0; | ||
290 | +#else | ||
291 | + gomp_mutex_lock (&thr->ts.work_share->lock); | ||
292 | if (gomp_iter_dynamic_next_locked (&s, &e)) | ||
293 | ret = s; | ||
294 | else | ||
295 | ret = 0; | ||
296 | - | ||
297 | gomp_mutex_unlock (&thr->ts.work_share->lock); | ||
298 | +#endif | ||
299 | |||
300 | return ret; | ||
301 | } | ||
302 | @@ -83,15 +93,23 @@ GOMP_sections_start (unsigned count) | ||
303 | unsigned | ||
304 | GOMP_sections_next (void) | ||
305 | { | ||
306 | - struct gomp_thread *thr = gomp_thread (); | ||
307 | long s, e, ret; | ||
308 | |||
309 | +#ifdef HAVE_SYNC_BUILTINS | ||
310 | + if (gomp_iter_dynamic_next (&s, &e)) | ||
311 | + ret = s; | ||
312 | + else | ||
313 | + ret = 0; | ||
314 | +#else | ||
315 | + struct gomp_thread *thr = gomp_thread (); | ||
316 | + | ||
317 | gomp_mutex_lock (&thr->ts.work_share->lock); | ||
318 | if (gomp_iter_dynamic_next_locked (&s, &e)) | ||
319 | ret = s; | ||
320 | else | ||
321 | ret = 0; | ||
322 | gomp_mutex_unlock (&thr->ts.work_share->lock); | ||
323 | +#endif | ||
324 | |||
325 | return ret; | ||
326 | } | ||
327 | @@ -103,15 +121,15 @@ void | ||
328 | GOMP_parallel_sections_start (void (*fn) (void *), void *data, | ||
329 | unsigned num_threads, unsigned count) | ||
330 | { | ||
331 | - struct gomp_work_share *ws; | ||
332 | + struct gomp_team *team; | ||
333 | |||
334 | num_threads = gomp_resolve_num_threads (num_threads); | ||
335 | if (gomp_dyn_var && num_threads > count) | ||
336 | num_threads = count; | ||
337 | |||
338 | - ws = gomp_new_work_share (false, num_threads); | ||
339 | - gomp_sections_init (ws, count); | ||
340 | - gomp_team_start (fn, data, num_threads, ws); | ||
341 | + team = gomp_new_team (num_threads); | ||
342 | + gomp_sections_init (&team->work_shares[0], count); | ||
343 | + gomp_team_start (fn, data, num_threads, team); | ||
344 | } | ||
345 | |||
346 | /* The GOMP_section_end* routines are called after the thread is told | ||
347 | --- libgomp/env.c.jj 2007-12-07 14:41:01.000000000 +0100 | ||
348 | +++ libgomp/env.c 2008-03-26 16:40:26.000000000 +0100 | ||
349 | @@ -44,6 +44,11 @@ enum gomp_schedule_type gomp_run_sched_v | ||
350 | unsigned long gomp_run_sched_chunk = 1; | ||
351 | unsigned short *gomp_cpu_affinity; | ||
352 | size_t gomp_cpu_affinity_len; | ||
353 | +#ifndef HAVE_SYNC_BUILTINS | ||
354 | +gomp_mutex_t gomp_remaining_threads_lock; | ||
355 | +#endif | ||
356 | +unsigned long gomp_available_cpus = 1, gomp_managed_threads = 1; | ||
357 | +unsigned long long gomp_spin_count_var, gomp_throttled_spin_count_var; | ||
358 | |||
359 | /* Parse the OMP_SCHEDULE environment variable. */ | ||
360 | |||
361 | @@ -147,6 +152,79 @@ parse_unsigned_long (const char *name, u | ||
362 | return false; | ||
363 | } | ||
364 | |||
365 | +/* Parse the GOMP_SPINCOUNT environment varible. Return true if one was | ||
366 | + present and it was successfully parsed. */ | ||
367 | + | ||
368 | +static bool | ||
369 | +parse_spincount (const char *name, unsigned long long *pvalue) | ||
370 | +{ | ||
371 | + char *env, *end; | ||
372 | + unsigned long long value, mult = 1; | ||
373 | + | ||
374 | + env = getenv (name); | ||
375 | + if (env == NULL) | ||
376 | + return false; | ||
377 | + | ||
378 | + while (isspace ((unsigned char) *env)) | ||
379 | + ++env; | ||
380 | + if (*env == '\0') | ||
381 | + goto invalid; | ||
382 | + | ||
383 | + if (strncasecmp (env, "infinite", 8) == 0 | ||
384 | + || strncasecmp (env, "infinity", 8) == 0) | ||
385 | + { | ||
386 | + value = ~0ULL; | ||
387 | + end = env + 8; | ||
388 | + goto check_tail; | ||
389 | + } | ||
390 | + | ||
391 | + errno = 0; | ||
392 | + value = strtoull (env, &end, 10); | ||
393 | + if (errno) | ||
394 | + goto invalid; | ||
395 | + | ||
396 | + while (isspace ((unsigned char) *end)) | ||
397 | + ++end; | ||
398 | + if (*end != '\0') | ||
399 | + { | ||
400 | + switch (tolower (*end)) | ||
401 | + { | ||
402 | + case 'k': | ||
403 | + mult = 1000LL; | ||
404 | + break; | ||
405 | + case 'm': | ||
406 | + mult = 1000LL * 1000LL; | ||
407 | + break; | ||
408 | + case 'g': | ||
409 | + mult = 1000LL * 1000LL * 1000LL; | ||
410 | + break; | ||
411 | + case 't': | ||
412 | + mult = 1000LL * 1000LL * 1000LL * 1000LL; | ||
413 | + break; | ||
414 | + default: | ||
415 | + goto invalid; | ||
416 | + } | ||
417 | + ++end; | ||
418 | + check_tail: | ||
419 | + while (isspace ((unsigned char) *end)) | ||
420 | + ++end; | ||
421 | + if (*end != '\0') | ||
422 | + goto invalid; | ||
423 | + } | ||
424 | + | ||
425 | + if (value > ~0ULL / mult) | ||
426 | + value = ~0ULL; | ||
427 | + else | ||
428 | + value *= mult; | ||
429 | + | ||
430 | + *pvalue = value; | ||
431 | + return true; | ||
432 | + | ||
433 | + invalid: | ||
434 | + gomp_error ("Invalid value for environment variable %s", name); | ||
435 | + return false; | ||
436 | +} | ||
437 | + | ||
438 | /* Parse a boolean value for environment variable NAME and store the | ||
439 | result in VALUE. */ | ||
440 | |||
441 | @@ -281,10 +359,25 @@ initialize_env (void) | ||
442 | parse_schedule (); | ||
443 | parse_boolean ("OMP_DYNAMIC", &gomp_dyn_var); | ||
444 | parse_boolean ("OMP_NESTED", &gomp_nest_var); | ||
445 | + gomp_init_num_threads (); | ||
446 | + gomp_available_cpus = gomp_nthreads_var; | ||
447 | if (!parse_unsigned_long ("OMP_NUM_THREADS", &gomp_nthreads_var)) | ||
448 | - gomp_init_num_threads (); | ||
449 | + gomp_nthreads_var = gomp_available_cpus; | ||
450 | if (parse_affinity ()) | ||
451 | gomp_init_affinity (); | ||
452 | + if (!parse_spincount ("GOMP_SPINCOUNT", &gomp_spin_count_var)) | ||
453 | + { | ||
454 | + /* Using a rough estimation of 100000 spins per msec, | ||
455 | + use 200 msec blocking. | ||
456 | + Depending on the CPU speed, this can be e.g. 5 times longer | ||
457 | + or 5 times shorter. */ | ||
458 | + gomp_spin_count_var = 20000000LL; | ||
459 | + } | ||
460 | + /* gomp_throttled_spin_count_var is used when there are more libgomp | ||
461 | + managed threads than available CPUs. Use very short spinning. */ | ||
462 | + gomp_throttled_spin_count_var = 100LL; | ||
463 | + if (gomp_throttled_spin_count_var > gomp_spin_count_var) | ||
464 | + gomp_throttled_spin_count_var = gomp_spin_count_var; | ||
465 | |||
466 | /* Not strictly environment related, but ordering constructors is tricky. */ | ||
467 | pthread_attr_init (&gomp_thread_attr); | ||
468 | --- libgomp/libgomp.h.jj 2007-12-07 14:41:01.000000000 +0100 | ||
469 | +++ libgomp/libgomp.h 2008-03-27 12:21:51.000000000 +0100 | ||
470 | @@ -50,6 +50,7 @@ | ||
471 | #include "sem.h" | ||
472 | #include "mutex.h" | ||
473 | #include "bar.h" | ||
474 | +#include "ptrlock.h" | ||
475 | |||
476 | |||
477 | /* This structure contains the data to control one work-sharing construct, | ||
478 | @@ -70,6 +71,8 @@ struct gomp_work_share | ||
479 | If this is a SECTIONS construct, this value will always be DYNAMIC. */ | ||
480 | enum gomp_schedule_type sched; | ||
481 | |||
482 | + int mode; | ||
483 | + | ||
484 | /* This is the chunk_size argument to the SCHEDULE clause. */ | ||
485 | long chunk_size; | ||
486 | |||
487 | @@ -81,17 +84,38 @@ struct gomp_work_share | ||
488 | is always 1. */ | ||
489 | long incr; | ||
490 | |||
491 | - /* This lock protects the update of the following members. */ | ||
492 | - gomp_mutex_t lock; | ||
493 | + /* This is a circular queue that details which threads will be allowed | ||
494 | + into the ordered region and in which order. When a thread allocates | ||
495 | + iterations on which it is going to work, it also registers itself at | ||
496 | + the end of the array. When a thread reaches the ordered region, it | ||
497 | + checks to see if it is the one at the head of the queue. If not, it | ||
498 | + blocks on its RELEASE semaphore. */ | ||
499 | + unsigned *ordered_team_ids; | ||
500 | |||
501 | - union { | ||
502 | - /* This is the next iteration value to be allocated. In the case of | ||
503 | - GFS_STATIC loops, this the iteration start point and never changes. */ | ||
504 | - long next; | ||
505 | + /* This is the number of threads that have registered themselves in | ||
506 | + the circular queue ordered_team_ids. */ | ||
507 | + unsigned ordered_num_used; | ||
508 | |||
509 | - /* This is the returned data structure for SINGLE COPYPRIVATE. */ | ||
510 | - void *copyprivate; | ||
511 | - }; | ||
512 | + /* This is the team_id of the currently acknowledged owner of the ordered | ||
513 | + section, or -1u if the ordered section has not been acknowledged by | ||
514 | + any thread. This is distinguished from the thread that is *allowed* | ||
515 | + to take the section next. */ | ||
516 | + unsigned ordered_owner; | ||
517 | + | ||
518 | + /* This is the index into the circular queue ordered_team_ids of the | ||
519 | + current thread that's allowed into the ordered reason. */ | ||
520 | + unsigned ordered_cur; | ||
521 | + | ||
522 | + /* This is a chain of allocated gomp_work_share blocks, valid only | ||
523 | + in the first gomp_work_share struct in the block. */ | ||
524 | + struct gomp_work_share *next_alloc; | ||
525 | + | ||
526 | + /* The above fields are written once during workshare initialization, | ||
527 | + or related to ordered worksharing. Make sure the following fields | ||
528 | + are in a different cache line. */ | ||
529 | + | ||
530 | + /* This lock protects the update of the following members. */ | ||
531 | + gomp_mutex_t lock __attribute__((aligned (64))); | ||
532 | |||
533 | /* This is the count of the number of threads that have exited the work | ||
534 | share construct. If the construct was marked nowait, they have moved on | ||
535 | @@ -99,27 +123,28 @@ struct gomp_work_share | ||
536 | of the team to exit the work share construct must deallocate it. */ | ||
537 | unsigned threads_completed; | ||
538 | |||
539 | - /* This is the index into the circular queue ordered_team_ids of the | ||
540 | - current thread that's allowed into the ordered reason. */ | ||
541 | - unsigned ordered_cur; | ||
542 | + union { | ||
543 | + /* This is the next iteration value to be allocated. In the case of | ||
544 | + GFS_STATIC loops, this the iteration start point and never changes. */ | ||
545 | + long next; | ||
546 | |||
547 | - /* This is the number of threads that have registered themselves in | ||
548 | - the circular queue ordered_team_ids. */ | ||
549 | - unsigned ordered_num_used; | ||
550 | + /* This is the returned data structure for SINGLE COPYPRIVATE. */ | ||
551 | + void *copyprivate; | ||
552 | + }; | ||
553 | |||
554 | - /* This is the team_id of the currently acknoledged owner of the ordered | ||
555 | - section, or -1u if the ordered section has not been acknowledged by | ||
556 | - any thread. This is distinguished from the thread that is *allowed* | ||
557 | - to take the section next. */ | ||
558 | - unsigned ordered_owner; | ||
559 | + union { | ||
560 | + /* Link to gomp_work_share struct for next work sharing construct | ||
561 | + encountered after this one. */ | ||
562 | + gomp_ptrlock_t next_ws; | ||
563 | + | ||
564 | + /* gomp_work_share structs are chained in the free work share cache | ||
565 | + through this. */ | ||
566 | + struct gomp_work_share *next_free; | ||
567 | + }; | ||
568 | |||
569 | - /* This is a circular queue that details which threads will be allowed | ||
570 | - into the ordered region and in which order. When a thread allocates | ||
571 | - iterations on which it is going to work, it also registers itself at | ||
572 | - the end of the array. When a thread reaches the ordered region, it | ||
573 | - checks to see if it is the one at the head of the queue. If not, it | ||
574 | - blocks on its RELEASE semaphore. */ | ||
575 | - unsigned ordered_team_ids[]; | ||
576 | + /* If only few threads are in the team, ordered_team_ids can point | ||
577 | + to this array which fills the padding at the end of this struct. */ | ||
578 | + unsigned inline_ordered_team_ids[0]; | ||
579 | }; | ||
580 | |||
581 | /* This structure contains all of the thread-local data associated with | ||
582 | @@ -133,21 +158,24 @@ struct gomp_team_state | ||
583 | |||
584 | /* This is the work share construct which this thread is currently | ||
585 | processing. Recall that with NOWAIT, not all threads may be | ||
586 | - processing the same construct. This value is NULL when there | ||
587 | - is no construct being processed. */ | ||
588 | + processing the same construct. */ | ||
589 | struct gomp_work_share *work_share; | ||
590 | |||
591 | + /* This is the previous work share construct or NULL if there wasn't any. | ||
592 | + When all threads are done with the current work sharing construct, | ||
593 | + the previous one can be freed. The current one can't, as its | ||
594 | + next_ws field is used. */ | ||
595 | + struct gomp_work_share *last_work_share; | ||
596 | + | ||
597 | /* This is the ID of this thread within the team. This value is | ||
598 | guaranteed to be between 0 and N-1, where N is the number of | ||
599 | threads in the team. */ | ||
600 | unsigned team_id; | ||
601 | |||
602 | - /* The work share "generation" is a number that increases by one for | ||
603 | - each work share construct encountered in the dynamic flow of the | ||
604 | - program. It is used to find the control data for the work share | ||
605 | - when encountering it for the first time. This particular number | ||
606 | - reflects the generation of the work_share member of this struct. */ | ||
607 | - unsigned work_share_generation; | ||
608 | +#ifdef HAVE_SYNC_BUILTINS | ||
609 | + /* Number of single stmts encountered. */ | ||
610 | + unsigned long single_count; | ||
611 | +#endif | ||
612 | |||
613 | /* For GFS_RUNTIME loops that resolved to GFS_STATIC, this is the | ||
614 | trip number through the loop. So first time a particular loop | ||
615 | @@ -163,41 +191,53 @@ struct gomp_team_state | ||
616 | |||
617 | struct gomp_team | ||
618 | { | ||
619 | - /* This lock protects access to the following work shares data structures. */ | ||
620 | - gomp_mutex_t work_share_lock; | ||
621 | - | ||
622 | - /* This is a dynamically sized array containing pointers to the control | ||
623 | - structs for all "live" work share constructs. Here "live" means that | ||
624 | - the construct has been encountered by at least one thread, and not | ||
625 | - completed by all threads. */ | ||
626 | - struct gomp_work_share **work_shares; | ||
627 | - | ||
628 | - /* The work_shares array is indexed by "generation & generation_mask". | ||
629 | - The mask will be 2**N - 1, where 2**N is the size of the array. */ | ||
630 | - unsigned generation_mask; | ||
631 | - | ||
632 | - /* These two values define the bounds of the elements of the work_shares | ||
633 | - array that are currently in use. */ | ||
634 | - unsigned oldest_live_gen; | ||
635 | - unsigned num_live_gen; | ||
636 | - | ||
637 | /* This is the number of threads in the current team. */ | ||
638 | unsigned nthreads; | ||
639 | |||
640 | + /* This is number of gomp_work_share structs that have been allocated | ||
641 | + as a block last time. */ | ||
642 | + unsigned work_share_chunk; | ||
643 | + | ||
644 | /* This is the saved team state that applied to a master thread before | ||
645 | the current thread was created. */ | ||
646 | struct gomp_team_state prev_ts; | ||
647 | |||
648 | - /* This barrier is used for most synchronization of the team. */ | ||
649 | - gomp_barrier_t barrier; | ||
650 | - | ||
651 | /* This semaphore should be used by the master thread instead of its | ||
652 | "native" semaphore in the thread structure. Required for nested | ||
653 | parallels, as the master is a member of two teams. */ | ||
654 | gomp_sem_t master_release; | ||
655 | |||
656 | - /* This array contains pointers to the release semaphore of the threads | ||
657 | - in the team. */ | ||
658 | + /* List of gomp_work_share structs chained through next_free fields. | ||
659 | + This is populated and taken off only by the first thread in the | ||
660 | + team encountering a new work sharing construct, in a critical | ||
661 | + section. */ | ||
662 | + struct gomp_work_share *work_share_list_alloc; | ||
663 | + | ||
664 | + /* List of gomp_work_share structs freed by free_work_share. New | ||
665 | + entries are atomically added to the start of the list, and | ||
666 | + alloc_work_share can safely only move all but the first entry | ||
667 | + to work_share_list alloc, as free_work_share can happen concurrently | ||
668 | + with alloc_work_share. */ | ||
669 | + struct gomp_work_share *work_share_list_free; | ||
670 | + | ||
671 | +#ifdef HAVE_SYNC_BUILTINS | ||
672 | + /* Number of simple single regions encountered by threads in this | ||
673 | + team. */ | ||
674 | + unsigned long single_count; | ||
675 | +#else | ||
676 | + /* Mutex protecting addition of workshares to work_share_list_free. */ | ||
677 | + gomp_mutex_t work_share_list_free_lock; | ||
678 | +#endif | ||
679 | + | ||
680 | + /* This barrier is used for most synchronization of the team. */ | ||
681 | + gomp_barrier_t barrier; | ||
682 | + | ||
683 | + /* Initial work shares, to avoid allocating any gomp_work_share | ||
684 | + structs in the common case. */ | ||
685 | + struct gomp_work_share work_shares[8]; | ||
686 | + | ||
687 | + /* This is an array with pointers to the release semaphore | ||
688 | + of the threads in the team. */ | ||
689 | gomp_sem_t *ordered_release[]; | ||
690 | }; | ||
691 | |||
692 | @@ -242,6 +282,11 @@ extern bool gomp_dyn_var; | ||
693 | extern bool gomp_nest_var; | ||
694 | extern enum gomp_schedule_type gomp_run_sched_var; | ||
695 | extern unsigned long gomp_run_sched_chunk; | ||
696 | +#ifndef HAVE_SYNC_BUILTINS | ||
697 | +extern gomp_mutex_t gomp_remaining_threads_lock; | ||
698 | +#endif | ||
699 | +extern unsigned long long gomp_spin_count_var, gomp_throttled_spin_count_var; | ||
700 | +extern unsigned long gomp_available_cpus, gomp_managed_threads; | ||
701 | |||
702 | /* The attributes to be used during thread creation. */ | ||
703 | extern pthread_attr_t gomp_thread_attr; | ||
704 | @@ -306,17 +351,27 @@ extern unsigned gomp_dynamic_max_threads | ||
705 | |||
706 | /* team.c */ | ||
707 | |||
708 | +extern struct gomp_team *gomp_new_team (unsigned); | ||
709 | extern void gomp_team_start (void (*) (void *), void *, unsigned, | ||
710 | - struct gomp_work_share *); | ||
711 | + struct gomp_team *); | ||
712 | extern void gomp_team_end (void); | ||
713 | |||
714 | /* work.c */ | ||
715 | |||
716 | -extern struct gomp_work_share * gomp_new_work_share (bool, unsigned); | ||
717 | +extern void gomp_init_work_share (struct gomp_work_share *, bool, unsigned); | ||
718 | +extern void gomp_fini_work_share (struct gomp_work_share *); | ||
719 | extern bool gomp_work_share_start (bool); | ||
720 | extern void gomp_work_share_end (void); | ||
721 | extern void gomp_work_share_end_nowait (void); | ||
722 | |||
723 | +static inline void | ||
724 | +gomp_work_share_init_done (void) | ||
725 | +{ | ||
726 | + struct gomp_thread *thr = gomp_thread (); | ||
727 | + if (__builtin_expect (thr->ts.last_work_share != NULL, 1)) | ||
728 | + gomp_ptrlock_set (&thr->ts.last_work_share->next_ws, thr->ts.work_share); | ||
729 | +} | ||
730 | + | ||
731 | #ifdef HAVE_ATTRIBUTE_VISIBILITY | ||
732 | # pragma GCC visibility pop | ||
733 | #endif | ||
734 | --- libgomp/iter.c.jj 2008-03-26 14:48:34.000000000 +0100 | ||
735 | +++ libgomp/iter.c 2008-03-26 15:11:23.000000000 +0100 | ||
736 | @@ -1,4 +1,4 @@ | ||
737 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
738 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
739 | Contributed by Richard Henderson <rth@redhat.com>. | ||
740 | |||
741 | This file is part of the GNU OpenMP Library (libgomp). | ||
742 | @@ -154,7 +154,7 @@ gomp_iter_dynamic_next_locked (long *pst | ||
743 | if (start == ws->end) | ||
744 | return false; | ||
745 | |||
746 | - chunk = ws->chunk_size * ws->incr; | ||
747 | + chunk = ws->chunk_size; | ||
748 | left = ws->end - start; | ||
749 | if (ws->incr < 0) | ||
750 | { | ||
751 | @@ -186,11 +186,38 @@ gomp_iter_dynamic_next (long *pstart, lo | ||
752 | struct gomp_work_share *ws = thr->ts.work_share; | ||
753 | long start, end, nend, chunk, incr; | ||
754 | |||
755 | - start = ws->next; | ||
756 | end = ws->end; | ||
757 | incr = ws->incr; | ||
758 | - chunk = ws->chunk_size * incr; | ||
759 | + chunk = ws->chunk_size; | ||
760 | + | ||
761 | + if (__builtin_expect (ws->mode, 1)) | ||
762 | + { | ||
763 | + long tmp = __sync_fetch_and_add (&ws->next, chunk); | ||
764 | + if (incr > 0) | ||
765 | + { | ||
766 | + if (tmp >= end) | ||
767 | + return false; | ||
768 | + nend = tmp + chunk; | ||
769 | + if (nend > end) | ||
770 | + nend = end; | ||
771 | + *pstart = tmp; | ||
772 | + *pend = nend; | ||
773 | + return true; | ||
774 | + } | ||
775 | + else | ||
776 | + { | ||
777 | + if (tmp <= end) | ||
778 | + return false; | ||
779 | + nend = tmp + chunk; | ||
780 | + if (nend < end) | ||
781 | + nend = end; | ||
782 | + *pstart = tmp; | ||
783 | + *pend = nend; | ||
784 | + return true; | ||
785 | + } | ||
786 | + } | ||
787 | |||
788 | + start = ws->next; | ||
789 | while (1) | ||
790 | { | ||
791 | long left = end - start; | ||
792 | --- libgomp/work.c.jj 2007-12-07 14:41:01.000000000 +0100 | ||
793 | +++ libgomp/work.c 2008-03-27 12:21:51.000000000 +0100 | ||
794 | @@ -1,4 +1,4 @@ | ||
795 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
796 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
797 | Contributed by Richard Henderson <rth@redhat.com>. | ||
798 | |||
799 | This file is part of the GNU OpenMP Library (libgomp). | ||
800 | @@ -29,39 +29,138 @@ | ||
801 | of threads. */ | ||
802 | |||
803 | #include "libgomp.h" | ||
804 | +#include <stddef.h> | ||
805 | #include <stdlib.h> | ||
806 | #include <string.h> | ||
807 | |||
808 | |||
809 | -/* Create a new work share structure. */ | ||
810 | +/* Allocate a new work share structure, preferably from current team's | ||
811 | + free gomp_work_share cache. */ | ||
812 | |||
813 | -struct gomp_work_share * | ||
814 | -gomp_new_work_share (bool ordered, unsigned nthreads) | ||
815 | +static struct gomp_work_share * | ||
816 | +alloc_work_share (struct gomp_team *team) | ||
817 | { | ||
818 | struct gomp_work_share *ws; | ||
819 | - size_t size; | ||
820 | + unsigned int i; | ||
821 | |||
822 | - size = sizeof (*ws); | ||
823 | - if (ordered) | ||
824 | - size += nthreads * sizeof (ws->ordered_team_ids[0]); | ||
825 | + /* This is called in a critical section. */ | ||
826 | + if (team->work_share_list_alloc != NULL) | ||
827 | + { | ||
828 | + ws = team->work_share_list_alloc; | ||
829 | + team->work_share_list_alloc = ws->next_free; | ||
830 | + return ws; | ||
831 | + } | ||
832 | |||
833 | - ws = gomp_malloc_cleared (size); | ||
834 | - gomp_mutex_init (&ws->lock); | ||
835 | - ws->ordered_owner = -1; | ||
836 | +#ifdef HAVE_SYNC_BUILTINS | ||
837 | + ws = team->work_share_list_free; | ||
838 | + /* We need atomic read from work_share_list_free, | ||
839 | + as free_work_share can be called concurrently. */ | ||
840 | + __asm ("" : "+r" (ws)); | ||
841 | + | ||
842 | + if (ws && ws->next_free) | ||
843 | + { | ||
844 | + struct gomp_work_share *next = ws->next_free; | ||
845 | + ws->next_free = NULL; | ||
846 | + team->work_share_list_alloc = next->next_free; | ||
847 | + return next; | ||
848 | + } | ||
849 | +#else | ||
850 | + gomp_mutex_lock (&team->work_share_list_free_lock); | ||
851 | + ws = team->work_share_list_free; | ||
852 | + if (ws) | ||
853 | + { | ||
854 | + team->work_share_list_alloc = ws->next_free; | ||
855 | + team->work_share_list_free = NULL; | ||
856 | + gomp_mutex_unlock (&team->work_share_list_free_lock); | ||
857 | + return ws; | ||
858 | + } | ||
859 | + gomp_mutex_unlock (&team->work_share_list_free_lock); | ||
860 | +#endif | ||
861 | |||
862 | + team->work_share_chunk *= 2; | ||
863 | + ws = gomp_malloc (team->work_share_chunk * sizeof (struct gomp_work_share)); | ||
864 | + ws->next_alloc = team->work_shares[0].next_alloc; | ||
865 | + team->work_shares[0].next_alloc = ws; | ||
866 | + team->work_share_list_alloc = &ws[1]; | ||
867 | + for (i = 1; i < team->work_share_chunk - 1; i++) | ||
868 | + ws[i].next_free = &ws[i + 1]; | ||
869 | + ws[i].next_free = NULL; | ||
870 | return ws; | ||
871 | } | ||
872 | |||
873 | +/* Initialize an already allocated struct gomp_work_share. | ||
874 | + This shouldn't touch the next_alloc field. */ | ||
875 | + | ||
876 | +void | ||
877 | +gomp_init_work_share (struct gomp_work_share *ws, bool ordered, | ||
878 | + unsigned nthreads) | ||
879 | +{ | ||
880 | + gomp_mutex_init (&ws->lock); | ||
881 | + if (__builtin_expect (ordered, 0)) | ||
882 | + { | ||
883 | +#define INLINE_ORDERED_TEAM_IDS_CNT \ | ||
884 | + ((sizeof (struct gomp_work_share) \ | ||
885 | + - offsetof (struct gomp_work_share, inline_ordered_team_ids)) \ | ||
886 | + / sizeof (((struct gomp_work_share *) 0)->inline_ordered_team_ids[0])) | ||
887 | + | ||
888 | + if (nthreads > INLINE_ORDERED_TEAM_IDS_CNT) | ||
889 | + ws->ordered_team_ids | ||
890 | + = gomp_malloc (nthreads * sizeof (*ws->ordered_team_ids)); | ||
891 | + else | ||
892 | + ws->ordered_team_ids = ws->inline_ordered_team_ids; | ||
893 | + memset (ws->ordered_team_ids, '\0', | ||
894 | + nthreads * sizeof (*ws->ordered_team_ids)); | ||
895 | + ws->ordered_num_used = 0; | ||
896 | + ws->ordered_owner = -1; | ||
897 | + ws->ordered_cur = 0; | ||
898 | + } | ||
899 | + else | ||
900 | + ws->ordered_team_ids = NULL; | ||
901 | + gomp_ptrlock_init (&ws->next_ws, NULL); | ||
902 | + ws->threads_completed = 0; | ||
903 | +} | ||
904 | |||
905 | -/* Free a work share structure. */ | ||
906 | +/* Do any needed destruction of gomp_work_share fields before it | ||
907 | + is put back into free gomp_work_share cache or freed. */ | ||
908 | |||
909 | -static void | ||
910 | -free_work_share (struct gomp_work_share *ws) | ||
911 | +void | ||
912 | +gomp_fini_work_share (struct gomp_work_share *ws) | ||
913 | { | ||
914 | gomp_mutex_destroy (&ws->lock); | ||
915 | - free (ws); | ||
916 | + if (ws->ordered_team_ids != ws->inline_ordered_team_ids) | ||
917 | + free (ws->ordered_team_ids); | ||
918 | + gomp_ptrlock_destroy (&ws->next_ws); | ||
919 | } | ||
920 | |||
921 | +/* Free a work share struct, if not orphaned, put it into current | ||
922 | + team's free gomp_work_share cache. */ | ||
923 | + | ||
924 | +static inline void | ||
925 | +free_work_share (struct gomp_team *team, struct gomp_work_share *ws) | ||
926 | +{ | ||
927 | + gomp_fini_work_share (ws); | ||
928 | + if (__builtin_expect (team == NULL, 0)) | ||
929 | + free (ws); | ||
930 | + else | ||
931 | + { | ||
932 | + struct gomp_work_share *next_ws; | ||
933 | +#ifdef HAVE_SYNC_BUILTINS | ||
934 | + do | ||
935 | + { | ||
936 | + next_ws = team->work_share_list_free; | ||
937 | + ws->next_free = next_ws; | ||
938 | + } | ||
939 | + while (!__sync_bool_compare_and_swap (&team->work_share_list_free, | ||
940 | + next_ws, ws)); | ||
941 | +#else | ||
942 | + gomp_mutex_lock (&team->work_share_list_free_lock); | ||
943 | + next_ws = team->work_share_list_free; | ||
944 | + ws->next_free = next_ws; | ||
945 | + team->work_share_list_free = ws; | ||
946 | + gomp_mutex_unlock (&team->work_share_list_free_lock); | ||
947 | +#endif | ||
948 | + } | ||
949 | +} | ||
950 | |||
951 | /* The current thread is ready to begin the next work sharing construct. | ||
952 | In all cases, thr->ts.work_share is updated to point to the new | ||
953 | @@ -74,71 +173,34 @@ gomp_work_share_start (bool ordered) | ||
954 | struct gomp_thread *thr = gomp_thread (); | ||
955 | struct gomp_team *team = thr->ts.team; | ||
956 | struct gomp_work_share *ws; | ||
957 | - unsigned ws_index, ws_gen; | ||
958 | |||
959 | /* Work sharing constructs can be orphaned. */ | ||
960 | if (team == NULL) | ||
961 | { | ||
962 | - ws = gomp_new_work_share (ordered, 1); | ||
963 | + ws = gomp_malloc (sizeof (*ws)); | ||
964 | + gomp_init_work_share (ws, ordered, 1); | ||
965 | thr->ts.work_share = ws; | ||
966 | - thr->ts.static_trip = 0; | ||
967 | - gomp_mutex_lock (&ws->lock); | ||
968 | - return true; | ||
969 | + return ws; | ||
970 | } | ||
971 | |||
972 | - gomp_mutex_lock (&team->work_share_lock); | ||
973 | - | ||
974 | - /* This thread is beginning its next generation. */ | ||
975 | - ws_gen = ++thr->ts.work_share_generation; | ||
976 | - | ||
977 | - /* If this next generation is not newer than any other generation in | ||
978 | - the team, then simply reference the existing construct. */ | ||
979 | - if (ws_gen - team->oldest_live_gen < team->num_live_gen) | ||
980 | + ws = thr->ts.work_share; | ||
981 | + thr->ts.last_work_share = ws; | ||
982 | + ws = gomp_ptrlock_get (&ws->next_ws); | ||
983 | + if (ws == NULL) | ||
984 | { | ||
985 | - ws_index = ws_gen & team->generation_mask; | ||
986 | - ws = team->work_shares[ws_index]; | ||
987 | + /* This thread encountered a new ws first. */ | ||
988 | + struct gomp_work_share *ws = alloc_work_share (team); | ||
989 | + gomp_init_work_share (ws, ordered, team->nthreads); | ||
990 | thr->ts.work_share = ws; | ||
991 | - thr->ts.static_trip = 0; | ||
992 | - | ||
993 | - gomp_mutex_lock (&ws->lock); | ||
994 | - gomp_mutex_unlock (&team->work_share_lock); | ||
995 | - | ||
996 | - return false; | ||
997 | + return true; | ||
998 | } | ||
999 | - | ||
1000 | - /* Resize the work shares queue if we've run out of space. */ | ||
1001 | - if (team->num_live_gen++ == team->generation_mask) | ||
1002 | + else | ||
1003 | { | ||
1004 | - team->work_shares = gomp_realloc (team->work_shares, | ||
1005 | - 2 * team->num_live_gen | ||
1006 | - * sizeof (*team->work_shares)); | ||
1007 | - | ||
1008 | - /* Unless oldest_live_gen is zero, the sequence of live elements | ||
1009 | - wraps around the end of the array. If we do nothing, we break | ||
1010 | - lookup of the existing elements. Fix that by unwrapping the | ||
1011 | - data from the front to the end. */ | ||
1012 | - if (team->oldest_live_gen > 0) | ||
1013 | - memcpy (team->work_shares + team->num_live_gen, | ||
1014 | - team->work_shares, | ||
1015 | - (team->oldest_live_gen & team->generation_mask) | ||
1016 | - * sizeof (*team->work_shares)); | ||
1017 | - | ||
1018 | - team->generation_mask = team->generation_mask * 2 + 1; | ||
1019 | - } | ||
1020 | - | ||
1021 | - ws_index = ws_gen & team->generation_mask; | ||
1022 | - ws = gomp_new_work_share (ordered, team->nthreads); | ||
1023 | - thr->ts.work_share = ws; | ||
1024 | - thr->ts.static_trip = 0; | ||
1025 | - team->work_shares[ws_index] = ws; | ||
1026 | - | ||
1027 | - gomp_mutex_lock (&ws->lock); | ||
1028 | - gomp_mutex_unlock (&team->work_share_lock); | ||
1029 | - | ||
1030 | - return true; | ||
1031 | + thr->ts.work_share = ws; | ||
1032 | + return false; | ||
1033 | + } | ||
1034 | } | ||
1035 | |||
1036 | - | ||
1037 | /* The current thread is done with its current work sharing construct. | ||
1038 | This version does imply a barrier at the end of the work-share. */ | ||
1039 | |||
1040 | @@ -147,36 +209,28 @@ gomp_work_share_end (void) | ||
1041 | { | ||
1042 | struct gomp_thread *thr = gomp_thread (); | ||
1043 | struct gomp_team *team = thr->ts.team; | ||
1044 | - struct gomp_work_share *ws = thr->ts.work_share; | ||
1045 | - bool last; | ||
1046 | - | ||
1047 | - thr->ts.work_share = NULL; | ||
1048 | + gomp_barrier_state_t bstate; | ||
1049 | |||
1050 | /* Work sharing constructs can be orphaned. */ | ||
1051 | if (team == NULL) | ||
1052 | { | ||
1053 | - free_work_share (ws); | ||
1054 | + free_work_share (NULL, thr->ts.work_share); | ||
1055 | + thr->ts.work_share = NULL; | ||
1056 | return; | ||
1057 | } | ||
1058 | |||
1059 | - last = gomp_barrier_wait_start (&team->barrier); | ||
1060 | + bstate = gomp_barrier_wait_start (&team->barrier); | ||
1061 | |||
1062 | - if (last) | ||
1063 | + if (gomp_barrier_last_thread (bstate)) | ||
1064 | { | ||
1065 | - unsigned ws_index; | ||
1066 | - | ||
1067 | - ws_index = thr->ts.work_share_generation & team->generation_mask; | ||
1068 | - team->work_shares[ws_index] = NULL; | ||
1069 | - team->oldest_live_gen++; | ||
1070 | - team->num_live_gen = 0; | ||
1071 | - | ||
1072 | - free_work_share (ws); | ||
1073 | + if (__builtin_expect (thr->ts.last_work_share != NULL, 1)) | ||
1074 | + free_work_share (team, thr->ts.last_work_share); | ||
1075 | } | ||
1076 | |||
1077 | - gomp_barrier_wait_end (&team->barrier, last); | ||
1078 | + gomp_barrier_wait_end (&team->barrier, bstate); | ||
1079 | + thr->ts.last_work_share = NULL; | ||
1080 | } | ||
1081 | |||
1082 | - | ||
1083 | /* The current thread is done with its current work sharing construct. | ||
1084 | This version does NOT imply a barrier at the end of the work-share. */ | ||
1085 | |||
1086 | @@ -188,15 +242,17 @@ gomp_work_share_end_nowait (void) | ||
1087 | struct gomp_work_share *ws = thr->ts.work_share; | ||
1088 | unsigned completed; | ||
1089 | |||
1090 | - thr->ts.work_share = NULL; | ||
1091 | - | ||
1092 | /* Work sharing constructs can be orphaned. */ | ||
1093 | if (team == NULL) | ||
1094 | { | ||
1095 | - free_work_share (ws); | ||
1096 | + free_work_share (NULL, ws); | ||
1097 | + thr->ts.work_share = NULL; | ||
1098 | return; | ||
1099 | } | ||
1100 | |||
1101 | + if (__builtin_expect (thr->ts.last_work_share == NULL, 0)) | ||
1102 | + return; | ||
1103 | + | ||
1104 | #ifdef HAVE_SYNC_BUILTINS | ||
1105 | completed = __sync_add_and_fetch (&ws->threads_completed, 1); | ||
1106 | #else | ||
1107 | @@ -206,18 +262,6 @@ gomp_work_share_end_nowait (void) | ||
1108 | #endif | ||
1109 | |||
1110 | if (completed == team->nthreads) | ||
1111 | - { | ||
1112 | - unsigned ws_index; | ||
1113 | - | ||
1114 | - gomp_mutex_lock (&team->work_share_lock); | ||
1115 | - | ||
1116 | - ws_index = thr->ts.work_share_generation & team->generation_mask; | ||
1117 | - team->work_shares[ws_index] = NULL; | ||
1118 | - team->oldest_live_gen++; | ||
1119 | - team->num_live_gen--; | ||
1120 | - | ||
1121 | - gomp_mutex_unlock (&team->work_share_lock); | ||
1122 | - | ||
1123 | - free_work_share (ws); | ||
1124 | - } | ||
1125 | + free_work_share (team, thr->ts.last_work_share); | ||
1126 | + thr->ts.last_work_share = NULL; | ||
1127 | } | ||
1128 | --- libgomp/single.c.jj 2007-12-07 14:41:01.000000000 +0100 | ||
1129 | +++ libgomp/single.c 2008-03-26 15:11:32.000000000 +0100 | ||
1130 | @@ -1,4 +1,4 @@ | ||
1131 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
1132 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
1133 | Contributed by Richard Henderson <rth@redhat.com>. | ||
1134 | |||
1135 | This file is part of the GNU OpenMP Library (libgomp). | ||
1136 | @@ -37,10 +37,24 @@ | ||
1137 | bool | ||
1138 | GOMP_single_start (void) | ||
1139 | { | ||
1140 | +#ifdef HAVE_SYNC_BUILTINS | ||
1141 | + struct gomp_thread *thr = gomp_thread (); | ||
1142 | + struct gomp_team *team = thr->ts.team; | ||
1143 | + unsigned long single_count; | ||
1144 | + | ||
1145 | + if (__builtin_expect (team == NULL, 0)) | ||
1146 | + return true; | ||
1147 | + | ||
1148 | + single_count = thr->ts.single_count++; | ||
1149 | + return __sync_bool_compare_and_swap (&team->single_count, single_count, | ||
1150 | + single_count + 1L); | ||
1151 | +#else | ||
1152 | bool ret = gomp_work_share_start (false); | ||
1153 | - gomp_mutex_unlock (&gomp_thread ()->ts.work_share->lock); | ||
1154 | + if (ret) | ||
1155 | + gomp_work_share_init_done (); | ||
1156 | gomp_work_share_end_nowait (); | ||
1157 | return ret; | ||
1158 | +#endif | ||
1159 | } | ||
1160 | |||
1161 | /* This routine is called when first encountering a SINGLE construct that | ||
1162 | @@ -57,10 +71,12 @@ GOMP_single_copy_start (void) | ||
1163 | void *ret; | ||
1164 | |||
1165 | first = gomp_work_share_start (false); | ||
1166 | - gomp_mutex_unlock (&thr->ts.work_share->lock); | ||
1167 | |||
1168 | if (first) | ||
1169 | - ret = NULL; | ||
1170 | + { | ||
1171 | + gomp_work_share_init_done (); | ||
1172 | + ret = NULL; | ||
1173 | + } | ||
1174 | else | ||
1175 | { | ||
1176 | gomp_barrier_wait (&thr->ts.team->barrier); | ||
1177 | --- libgomp/loop.c.jj 2007-12-07 14:41:01.000000000 +0100 | ||
1178 | +++ libgomp/loop.c 2008-03-26 18:47:04.000000000 +0100 | ||
1179 | @@ -27,8 +27,9 @@ | ||
1180 | |||
1181 | /* This file handles the LOOP (FOR/DO) construct. */ | ||
1182 | |||
1183 | -#include "libgomp.h" | ||
1184 | +#include <limits.h> | ||
1185 | #include <stdlib.h> | ||
1186 | +#include "libgomp.h" | ||
1187 | |||
1188 | |||
1189 | /* Initialize the given work share construct from the given arguments. */ | ||
1190 | @@ -44,6 +45,39 @@ gomp_loop_init (struct gomp_work_share * | ||
1191 | ? start : end; | ||
1192 | ws->incr = incr; | ||
1193 | ws->next = start; | ||
1194 | + if (sched == GFS_DYNAMIC) | ||
1195 | + { | ||
1196 | + ws->chunk_size *= incr; | ||
1197 | + | ||
1198 | +#ifdef HAVE_SYNC_BUILTINS | ||
1199 | + { | ||
1200 | + /* For dynamic scheduling prepare things to make each iteration | ||
1201 | + faster. */ | ||
1202 | + struct gomp_thread *thr = gomp_thread (); | ||
1203 | + struct gomp_team *team = thr->ts.team; | ||
1204 | + long nthreads = team ? team->nthreads : 1; | ||
1205 | + | ||
1206 | + if (__builtin_expect (incr > 0, 1)) | ||
1207 | + { | ||
1208 | + /* Cheap overflow protection. */ | ||
1209 | + if (__builtin_expect ((nthreads | ws->chunk_size) | ||
1210 | + >= 1UL << (sizeof (long) | ||
1211 | + * __CHAR_BIT__ / 2 - 1), 0)) | ||
1212 | + ws->mode = 0; | ||
1213 | + else | ||
1214 | + ws->mode = ws->end < (LONG_MAX | ||
1215 | + - (nthreads + 1) * ws->chunk_size); | ||
1216 | + } | ||
1217 | + /* Cheap overflow protection. */ | ||
1218 | + else if (__builtin_expect ((nthreads | -ws->chunk_size) | ||
1219 | + >= 1UL << (sizeof (long) | ||
1220 | + * __CHAR_BIT__ / 2 - 1), 0)) | ||
1221 | + ws->mode = 0; | ||
1222 | + else | ||
1223 | + ws->mode = ws->end > (nthreads + 1) * -ws->chunk_size - LONG_MAX; | ||
1224 | + } | ||
1225 | +#endif | ||
1226 | + } | ||
1227 | } | ||
1228 | |||
1229 | /* The *_start routines are called when first encountering a loop construct | ||
1230 | @@ -68,10 +102,13 @@ gomp_loop_static_start (long start, long | ||
1231 | { | ||
1232 | struct gomp_thread *thr = gomp_thread (); | ||
1233 | |||
1234 | + thr->ts.static_trip = 0; | ||
1235 | if (gomp_work_share_start (false)) | ||
1236 | - gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1237 | - GFS_STATIC, chunk_size); | ||
1238 | - gomp_mutex_unlock (&thr->ts.work_share->lock); | ||
1239 | + { | ||
1240 | + gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1241 | + GFS_STATIC, chunk_size); | ||
1242 | + gomp_work_share_init_done (); | ||
1243 | + } | ||
1244 | |||
1245 | return !gomp_iter_static_next (istart, iend); | ||
1246 | } | ||
1247 | @@ -84,13 +121,16 @@ gomp_loop_dynamic_start (long start, lon | ||
1248 | bool ret; | ||
1249 | |||
1250 | if (gomp_work_share_start (false)) | ||
1251 | - gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1252 | - GFS_DYNAMIC, chunk_size); | ||
1253 | + { | ||
1254 | + gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1255 | + GFS_DYNAMIC, chunk_size); | ||
1256 | + gomp_work_share_init_done (); | ||
1257 | + } | ||
1258 | |||
1259 | #ifdef HAVE_SYNC_BUILTINS | ||
1260 | - gomp_mutex_unlock (&thr->ts.work_share->lock); | ||
1261 | ret = gomp_iter_dynamic_next (istart, iend); | ||
1262 | #else | ||
1263 | + gomp_mutex_lock (&thr->ts.work_share->lock); | ||
1264 | ret = gomp_iter_dynamic_next_locked (istart, iend); | ||
1265 | gomp_mutex_unlock (&thr->ts.work_share->lock); | ||
1266 | #endif | ||
1267 | @@ -106,13 +146,16 @@ gomp_loop_guided_start (long start, long | ||
1268 | bool ret; | ||
1269 | |||
1270 | if (gomp_work_share_start (false)) | ||
1271 | - gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1272 | - GFS_GUIDED, chunk_size); | ||
1273 | + { | ||
1274 | + gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1275 | + GFS_GUIDED, chunk_size); | ||
1276 | + gomp_work_share_init_done (); | ||
1277 | + } | ||
1278 | |||
1279 | #ifdef HAVE_SYNC_BUILTINS | ||
1280 | - gomp_mutex_unlock (&thr->ts.work_share->lock); | ||
1281 | ret = gomp_iter_guided_next (istart, iend); | ||
1282 | #else | ||
1283 | + gomp_mutex_lock (&thr->ts.work_share->lock); | ||
1284 | ret = gomp_iter_guided_next_locked (istart, iend); | ||
1285 | gomp_mutex_unlock (&thr->ts.work_share->lock); | ||
1286 | #endif | ||
1287 | @@ -149,13 +192,14 @@ gomp_loop_ordered_static_start (long sta | ||
1288 | { | ||
1289 | struct gomp_thread *thr = gomp_thread (); | ||
1290 | |||
1291 | + thr->ts.static_trip = 0; | ||
1292 | if (gomp_work_share_start (true)) | ||
1293 | { | ||
1294 | gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1295 | GFS_STATIC, chunk_size); | ||
1296 | gomp_ordered_static_init (); | ||
1297 | + gomp_work_share_init_done (); | ||
1298 | } | ||
1299 | - gomp_mutex_unlock (&thr->ts.work_share->lock); | ||
1300 | |||
1301 | return !gomp_iter_static_next (istart, iend); | ||
1302 | } | ||
1303 | @@ -168,8 +212,14 @@ gomp_loop_ordered_dynamic_start (long st | ||
1304 | bool ret; | ||
1305 | |||
1306 | if (gomp_work_share_start (true)) | ||
1307 | - gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1308 | - GFS_DYNAMIC, chunk_size); | ||
1309 | + { | ||
1310 | + gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1311 | + GFS_DYNAMIC, chunk_size); | ||
1312 | + gomp_mutex_lock (&thr->ts.work_share->lock); | ||
1313 | + gomp_work_share_init_done (); | ||
1314 | + } | ||
1315 | + else | ||
1316 | + gomp_mutex_lock (&thr->ts.work_share->lock); | ||
1317 | |||
1318 | ret = gomp_iter_dynamic_next_locked (istart, iend); | ||
1319 | if (ret) | ||
1320 | @@ -187,8 +237,14 @@ gomp_loop_ordered_guided_start (long sta | ||
1321 | bool ret; | ||
1322 | |||
1323 | if (gomp_work_share_start (true)) | ||
1324 | - gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1325 | - GFS_GUIDED, chunk_size); | ||
1326 | + { | ||
1327 | + gomp_loop_init (thr->ts.work_share, start, end, incr, | ||
1328 | + GFS_GUIDED, chunk_size); | ||
1329 | + gomp_mutex_lock (&thr->ts.work_share->lock); | ||
1330 | + gomp_work_share_init_done (); | ||
1331 | + } | ||
1332 | + else | ||
1333 | + gomp_mutex_lock (&thr->ts.work_share->lock); | ||
1334 | |||
1335 | ret = gomp_iter_guided_next_locked (istart, iend); | ||
1336 | if (ret) | ||
1337 | @@ -375,12 +431,12 @@ gomp_parallel_loop_start (void (*fn) (vo | ||
1338 | long incr, enum gomp_schedule_type sched, | ||
1339 | long chunk_size) | ||
1340 | { | ||
1341 | - struct gomp_work_share *ws; | ||
1342 | + struct gomp_team *team; | ||
1343 | |||
1344 | num_threads = gomp_resolve_num_threads (num_threads); | ||
1345 | - ws = gomp_new_work_share (false, num_threads); | ||
1346 | - gomp_loop_init (ws, start, end, incr, sched, chunk_size); | ||
1347 | - gomp_team_start (fn, data, num_threads, ws); | ||
1348 | + team = gomp_new_team (num_threads); | ||
1349 | + gomp_loop_init (&team->work_shares[0], start, end, incr, sched, chunk_size); | ||
1350 | + gomp_team_start (fn, data, num_threads, team); | ||
1351 | } | ||
1352 | |||
1353 | void | ||
1354 | --- libgomp/Makefile.in.jj 2008-01-10 20:53:47.000000000 +0100 | ||
1355 | +++ libgomp/Makefile.in 2008-03-26 18:51:01.000000000 +0100 | ||
1356 | @@ -83,7 +83,7 @@ libgomp_la_LIBADD = | ||
1357 | am_libgomp_la_OBJECTS = alloc.lo barrier.lo critical.lo env.lo \ | ||
1358 | error.lo iter.lo loop.lo ordered.lo parallel.lo sections.lo \ | ||
1359 | single.lo team.lo work.lo lock.lo mutex.lo proc.lo sem.lo \ | ||
1360 | - bar.lo time.lo fortran.lo affinity.lo | ||
1361 | + bar.lo ptrlock.lo time.lo fortran.lo affinity.lo | ||
1362 | libgomp_la_OBJECTS = $(am_libgomp_la_OBJECTS) | ||
1363 | DEFAULT_INCLUDES = -I. -I$(srcdir) -I. | ||
1364 | depcomp = $(SHELL) $(top_srcdir)/../depcomp | ||
1365 | @@ -292,7 +292,7 @@ libgomp_version_info = -version-info $(l | ||
1366 | libgomp_la_LDFLAGS = $(libgomp_version_info) $(libgomp_version_script) | ||
1367 | libgomp_la_SOURCES = alloc.c barrier.c critical.c env.c error.c iter.c \ | ||
1368 | loop.c ordered.c parallel.c sections.c single.c team.c work.c \ | ||
1369 | - lock.c mutex.c proc.c sem.c bar.c time.c fortran.c affinity.c | ||
1370 | + lock.c mutex.c proc.c sem.c bar.c ptrlock.c time.c fortran.c affinity.c | ||
1371 | |||
1372 | nodist_noinst_HEADERS = libgomp_f.h | ||
1373 | nodist_libsubinclude_HEADERS = omp.h | ||
1374 | @@ -434,6 +434,7 @@ distclean-compile: | ||
1375 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ordered.Plo@am__quote@ | ||
1376 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parallel.Plo@am__quote@ | ||
1377 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proc.Plo@am__quote@ | ||
1378 | +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptrlock.Plo@am__quote@ | ||
1379 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sections.Plo@am__quote@ | ||
1380 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sem.Plo@am__quote@ | ||
1381 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/single.Plo@am__quote@ | ||
1382 | --- libgomp/testsuite/libgomp.c/loop-4.c.jj 2008-03-26 18:47:04.000000000 +0100 | ||
1383 | +++ libgomp/testsuite/libgomp.c/loop-4.c 2008-03-26 18:47:04.000000000 +0100 | ||
1384 | @@ -0,0 +1,28 @@ | ||
1385 | +/* { dg-do run } */ | ||
1386 | + | ||
1387 | +extern void abort (void); | ||
1388 | + | ||
1389 | +int | ||
1390 | +main (void) | ||
1391 | +{ | ||
1392 | + int e = 0; | ||
1393 | +#pragma omp parallel num_threads (4) reduction(+:e) | ||
1394 | + { | ||
1395 | + long i; | ||
1396 | + #pragma omp for schedule(dynamic,1) | ||
1397 | + for (i = __LONG_MAX__ - 30001; i <= __LONG_MAX__ - 10001; i += 10000) | ||
1398 | + if (i != __LONG_MAX__ - 30001 | ||
1399 | + && i != __LONG_MAX__ - 20001 | ||
1400 | + && i != __LONG_MAX__ - 10001) | ||
1401 | + e = 1; | ||
1402 | + #pragma omp for schedule(dynamic,1) | ||
1403 | + for (i = -__LONG_MAX__ + 30000; i >= -__LONG_MAX__ + 10000; i -= 10000) | ||
1404 | + if (i != -__LONG_MAX__ + 30000 | ||
1405 | + && i != -__LONG_MAX__ + 20000 | ||
1406 | + && i != -__LONG_MAX__ + 10000) | ||
1407 | + e = 1; | ||
1408 | + } | ||
1409 | + if (e) | ||
1410 | + abort (); | ||
1411 | + return 0; | ||
1412 | +} | ||
1413 | --- libgomp/Makefile.am.jj 2007-12-07 14:41:01.000000000 +0100 | ||
1414 | +++ libgomp/Makefile.am 2008-03-26 15:15:19.000000000 +0100 | ||
1415 | @@ -31,7 +31,7 @@ libgomp_la_LDFLAGS = $(libgomp_version_i | ||
1416 | |||
1417 | libgomp_la_SOURCES = alloc.c barrier.c critical.c env.c error.c iter.c \ | ||
1418 | loop.c ordered.c parallel.c sections.c single.c team.c work.c \ | ||
1419 | - lock.c mutex.c proc.c sem.c bar.c time.c fortran.c affinity.c | ||
1420 | + lock.c mutex.c proc.c sem.c bar.c ptrlock.c time.c fortran.c affinity.c | ||
1421 | |||
1422 | nodist_noinst_HEADERS = libgomp_f.h | ||
1423 | nodist_libsubinclude_HEADERS = omp.h | ||
1424 | --- libgomp/team.c.jj 2007-12-07 14:41:01.000000000 +0100 | ||
1425 | +++ libgomp/team.c 2008-03-27 12:22:26.000000000 +0100 | ||
1426 | @@ -94,7 +94,7 @@ gomp_thread_start (void *xdata) | ||
1427 | { | ||
1428 | gomp_barrier_wait (&thr->ts.team->barrier); | ||
1429 | local_fn (local_data); | ||
1430 | - gomp_barrier_wait (&thr->ts.team->barrier); | ||
1431 | + gomp_barrier_wait_last (&thr->ts.team->barrier); | ||
1432 | } | ||
1433 | else | ||
1434 | { | ||
1435 | @@ -114,11 +114,10 @@ gomp_thread_start (void *xdata) | ||
1436 | thr->data = NULL; | ||
1437 | thr->ts.team = NULL; | ||
1438 | thr->ts.work_share = NULL; | ||
1439 | + thr->ts.last_work_share = NULL; | ||
1440 | thr->ts.team_id = 0; | ||
1441 | - thr->ts.work_share_generation = 0; | ||
1442 | - thr->ts.static_trip = 0; | ||
1443 | |||
1444 | - gomp_barrier_wait (&team->barrier); | ||
1445 | + gomp_barrier_wait_last (&team->barrier); | ||
1446 | gomp_barrier_wait (&gomp_threads_dock); | ||
1447 | |||
1448 | local_fn = thr->fn; | ||
1449 | @@ -133,21 +132,29 @@ gomp_thread_start (void *xdata) | ||
1450 | |||
1451 | /* Create a new team data structure. */ | ||
1452 | |||
1453 | -static struct gomp_team * | ||
1454 | -new_team (unsigned nthreads, struct gomp_work_share *work_share) | ||
1455 | +struct gomp_team * | ||
1456 | +gomp_new_team (unsigned nthreads) | ||
1457 | { | ||
1458 | struct gomp_team *team; | ||
1459 | size_t size; | ||
1460 | + int i; | ||
1461 | |||
1462 | size = sizeof (*team) + nthreads * sizeof (team->ordered_release[0]); | ||
1463 | team = gomp_malloc (size); | ||
1464 | - gomp_mutex_init (&team->work_share_lock); | ||
1465 | |||
1466 | - team->work_shares = gomp_malloc (4 * sizeof (struct gomp_work_share *)); | ||
1467 | - team->generation_mask = 3; | ||
1468 | - team->oldest_live_gen = work_share == NULL; | ||
1469 | - team->num_live_gen = work_share != NULL; | ||
1470 | - team->work_shares[0] = work_share; | ||
1471 | + team->work_share_chunk = 8; | ||
1472 | +#ifdef HAVE_SYNC_BUILTINS | ||
1473 | + team->single_count = 0; | ||
1474 | +#else | ||
1475 | + gomp_mutex_init (&team->work_share_list_free_lock); | ||
1476 | +#endif | ||
1477 | + gomp_init_work_share (&team->work_shares[0], false, nthreads); | ||
1478 | + team->work_shares[0].next_alloc = NULL; | ||
1479 | + team->work_share_list_free = NULL; | ||
1480 | + team->work_share_list_alloc = &team->work_shares[1]; | ||
1481 | + for (i = 1; i < 7; i++) | ||
1482 | + team->work_shares[i].next_free = &team->work_shares[i + 1]; | ||
1483 | + team->work_shares[i].next_free = NULL; | ||
1484 | |||
1485 | team->nthreads = nthreads; | ||
1486 | gomp_barrier_init (&team->barrier, nthreads); | ||
1487 | @@ -164,10 +171,22 @@ new_team (unsigned nthreads, struct gomp | ||
1488 | static void | ||
1489 | free_team (struct gomp_team *team) | ||
1490 | { | ||
1491 | - free (team->work_shares); | ||
1492 | - gomp_mutex_destroy (&team->work_share_lock); | ||
1493 | + if (__builtin_expect (team->work_shares[0].next_alloc != NULL, 0)) | ||
1494 | + { | ||
1495 | + struct gomp_work_share *ws = team->work_shares[0].next_alloc; | ||
1496 | + do | ||
1497 | + { | ||
1498 | + struct gomp_work_share *next_ws = ws->next_alloc; | ||
1499 | + free (ws); | ||
1500 | + ws = next_ws; | ||
1501 | + } | ||
1502 | + while (ws != NULL); | ||
1503 | + } | ||
1504 | gomp_barrier_destroy (&team->barrier); | ||
1505 | gomp_sem_destroy (&team->master_release); | ||
1506 | +#ifndef HAVE_SYNC_BUILTINS | ||
1507 | + gomp_mutex_destroy (&team->work_share_list_free_lock); | ||
1508 | +#endif | ||
1509 | free (team); | ||
1510 | } | ||
1511 | |||
1512 | @@ -176,11 +195,10 @@ free_team (struct gomp_team *team) | ||
1513 | |||
1514 | void | ||
1515 | gomp_team_start (void (*fn) (void *), void *data, unsigned nthreads, | ||
1516 | - struct gomp_work_share *work_share) | ||
1517 | + struct gomp_team *team) | ||
1518 | { | ||
1519 | struct gomp_thread_start_data *start_data; | ||
1520 | struct gomp_thread *thr, *nthr; | ||
1521 | - struct gomp_team *team; | ||
1522 | bool nested; | ||
1523 | unsigned i, n, old_threads_used = 0; | ||
1524 | pthread_attr_t thread_attr, *attr; | ||
1525 | @@ -188,17 +206,18 @@ gomp_team_start (void (*fn) (void *), vo | ||
1526 | thr = gomp_thread (); | ||
1527 | nested = thr->ts.team != NULL; | ||
1528 | |||
1529 | - team = new_team (nthreads, work_share); | ||
1530 | - | ||
1531 | /* Always save the previous state, even if this isn't a nested team. | ||
1532 | In particular, we should save any work share state from an outer | ||
1533 | orphaned work share construct. */ | ||
1534 | team->prev_ts = thr->ts; | ||
1535 | |||
1536 | thr->ts.team = team; | ||
1537 | - thr->ts.work_share = work_share; | ||
1538 | thr->ts.team_id = 0; | ||
1539 | - thr->ts.work_share_generation = 0; | ||
1540 | + thr->ts.work_share = &team->work_shares[0]; | ||
1541 | + thr->ts.last_work_share = NULL; | ||
1542 | +#ifdef HAVE_SYNC_BUILTINS | ||
1543 | + thr->ts.single_count = 0; | ||
1544 | +#endif | ||
1545 | thr->ts.static_trip = 0; | ||
1546 | |||
1547 | if (nthreads == 1) | ||
1548 | @@ -241,9 +260,12 @@ gomp_team_start (void (*fn) (void *), vo | ||
1549 | { | ||
1550 | nthr = gomp_threads[i]; | ||
1551 | nthr->ts.team = team; | ||
1552 | - nthr->ts.work_share = work_share; | ||
1553 | + nthr->ts.work_share = &team->work_shares[0]; | ||
1554 | + nthr->ts.last_work_share = NULL; | ||
1555 | nthr->ts.team_id = i; | ||
1556 | - nthr->ts.work_share_generation = 0; | ||
1557 | +#ifdef HAVE_SYNC_BUILTINS | ||
1558 | + nthr->ts.single_count = 0; | ||
1559 | +#endif | ||
1560 | nthr->ts.static_trip = 0; | ||
1561 | nthr->fn = fn; | ||
1562 | nthr->data = data; | ||
1563 | @@ -266,8 +288,24 @@ gomp_team_start (void (*fn) (void *), vo | ||
1564 | } | ||
1565 | } | ||
1566 | |||
1567 | + if (__builtin_expect (nthreads > old_threads_used, 0)) | ||
1568 | + { | ||
1569 | + long diff = (long) nthreads - (long) old_threads_used; | ||
1570 | + | ||
1571 | + if (old_threads_used == 0) | ||
1572 | + --diff; | ||
1573 | + | ||
1574 | +#ifdef HAVE_SYNC_BUILTINS | ||
1575 | + __sync_fetch_and_add (&gomp_managed_threads, diff); | ||
1576 | +#else | ||
1577 | + gomp_mutex_lock (&gomp_remaining_threads_lock); | ||
1578 | + gomp_managed_threads += diff; | ||
1579 | + gomp_mutex_unlock (&gomp_remaining_threads_lock); | ||
1580 | +#endif | ||
1581 | + } | ||
1582 | + | ||
1583 | attr = &gomp_thread_attr; | ||
1584 | - if (gomp_cpu_affinity != NULL) | ||
1585 | + if (__builtin_expect (gomp_cpu_affinity != NULL, 0)) | ||
1586 | { | ||
1587 | size_t stacksize; | ||
1588 | pthread_attr_init (&thread_attr); | ||
1589 | @@ -287,9 +325,12 @@ gomp_team_start (void (*fn) (void *), vo | ||
1590 | int err; | ||
1591 | |||
1592 | start_data->ts.team = team; | ||
1593 | - start_data->ts.work_share = work_share; | ||
1594 | + start_data->ts.work_share = &team->work_shares[0]; | ||
1595 | + start_data->ts.last_work_share = NULL; | ||
1596 | start_data->ts.team_id = i; | ||
1597 | - start_data->ts.work_share_generation = 0; | ||
1598 | +#ifdef HAVE_SYNC_BUILTINS | ||
1599 | + start_data->ts.single_count = 0; | ||
1600 | +#endif | ||
1601 | start_data->ts.static_trip = 0; | ||
1602 | start_data->fn = fn; | ||
1603 | start_data->fn_data = data; | ||
1604 | @@ -303,7 +344,7 @@ gomp_team_start (void (*fn) (void *), vo | ||
1605 | gomp_fatal ("Thread creation failed: %s", strerror (err)); | ||
1606 | } | ||
1607 | |||
1608 | - if (gomp_cpu_affinity != NULL) | ||
1609 | + if (__builtin_expect (gomp_cpu_affinity != NULL, 0)) | ||
1610 | pthread_attr_destroy (&thread_attr); | ||
1611 | |||
1612 | do_release: | ||
1613 | @@ -313,8 +354,20 @@ gomp_team_start (void (*fn) (void *), vo | ||
1614 | that should arrive back at the end of this team. The extra | ||
1615 | threads should be exiting. Note that we arrange for this test | ||
1616 | to never be true for nested teams. */ | ||
1617 | - if (nthreads < old_threads_used) | ||
1618 | - gomp_barrier_reinit (&gomp_threads_dock, nthreads); | ||
1619 | + if (__builtin_expect (nthreads < old_threads_used, 0)) | ||
1620 | + { | ||
1621 | + long diff = (long) nthreads - (long) old_threads_used; | ||
1622 | + | ||
1623 | + gomp_barrier_reinit (&gomp_threads_dock, nthreads); | ||
1624 | + | ||
1625 | +#ifdef HAVE_SYNC_BUILTINS | ||
1626 | + __sync_fetch_and_add (&gomp_managed_threads, diff); | ||
1627 | +#else | ||
1628 | + gomp_mutex_lock (&gomp_remaining_threads_lock); | ||
1629 | + gomp_managed_threads += diff; | ||
1630 | + gomp_mutex_unlock (&gomp_remaining_threads_lock); | ||
1631 | +#endif | ||
1632 | + } | ||
1633 | } | ||
1634 | |||
1635 | |||
1636 | @@ -329,8 +382,21 @@ gomp_team_end (void) | ||
1637 | |||
1638 | gomp_barrier_wait (&team->barrier); | ||
1639 | |||
1640 | + gomp_fini_work_share (thr->ts.work_share); | ||
1641 | + | ||
1642 | thr->ts = team->prev_ts; | ||
1643 | |||
1644 | + if (__builtin_expect (thr->ts.team != NULL, 0)) | ||
1645 | + { | ||
1646 | +#ifdef HAVE_SYNC_BUILTINS | ||
1647 | + __sync_fetch_and_add (&gomp_managed_threads, 1L - team->nthreads); | ||
1648 | +#else | ||
1649 | + gomp_mutex_lock (&gomp_remaining_threads_lock); | ||
1650 | + gomp_managed_threads -= team->nthreads - 1L; | ||
1651 | + gomp_mutex_unlock (&gomp_remaining_threads_lock); | ||
1652 | +#endif | ||
1653 | + } | ||
1654 | + | ||
1655 | free_team (team); | ||
1656 | } | ||
1657 | |||
1658 | --- libgomp/config/posix/bar.h.jj 2007-12-07 14:41:01.000000000 +0100 | ||
1659 | +++ libgomp/config/posix/bar.h 2008-03-26 15:11:32.000000000 +0100 | ||
1660 | @@ -1,4 +1,4 @@ | ||
1661 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
1662 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
1663 | Contributed by Richard Henderson <rth@redhat.com>. | ||
1664 | |||
1665 | This file is part of the GNU OpenMP Library (libgomp). | ||
1666 | @@ -46,18 +46,32 @@ typedef struct | ||
1667 | unsigned total; | ||
1668 | unsigned arrived; | ||
1669 | } gomp_barrier_t; | ||
1670 | +typedef bool gomp_barrier_state_t; | ||
1671 | |||
1672 | extern void gomp_barrier_init (gomp_barrier_t *, unsigned); | ||
1673 | extern void gomp_barrier_reinit (gomp_barrier_t *, unsigned); | ||
1674 | extern void gomp_barrier_destroy (gomp_barrier_t *); | ||
1675 | |||
1676 | extern void gomp_barrier_wait (gomp_barrier_t *); | ||
1677 | -extern void gomp_barrier_wait_end (gomp_barrier_t *, bool); | ||
1678 | +extern void gomp_barrier_wait_end (gomp_barrier_t *, gomp_barrier_state_t); | ||
1679 | |||
1680 | -static inline bool gomp_barrier_wait_start (gomp_barrier_t *bar) | ||
1681 | +static inline gomp_barrier_state_t | ||
1682 | +gomp_barrier_wait_start (gomp_barrier_t *bar) | ||
1683 | { | ||
1684 | gomp_mutex_lock (&bar->mutex1); | ||
1685 | return ++bar->arrived == bar->total; | ||
1686 | } | ||
1687 | |||
1688 | +static inline bool | ||
1689 | +gomp_barrier_last_thread (gomp_barrier_state_t state) | ||
1690 | +{ | ||
1691 | + return state; | ||
1692 | +} | ||
1693 | + | ||
1694 | +static inline void | ||
1695 | +gomp_barrier_wait_last (gomp_barrier_t *bar) | ||
1696 | +{ | ||
1697 | + gomp_barrier_wait (bar); | ||
1698 | +} | ||
1699 | + | ||
1700 | #endif /* GOMP_BARRIER_H */ | ||
1701 | --- libgomp/config/posix/ptrlock.h.jj 2008-03-26 15:11:32.000000000 +0100 | ||
1702 | +++ libgomp/config/posix/ptrlock.h 2008-03-26 15:11:32.000000000 +0100 | ||
1703 | @@ -0,0 +1,69 @@ | ||
1704 | +/* Copyright (C) 2008 Free Software Foundation, Inc. | ||
1705 | + Contributed by Jakub Jelinek <jakub@redhat.com>. | ||
1706 | + | ||
1707 | + This file is part of the GNU OpenMP Library (libgomp). | ||
1708 | + | ||
1709 | + Libgomp is free software; you can redistribute it and/or modify it | ||
1710 | + under the terms of the GNU Lesser General Public License as published by | ||
1711 | + the Free Software Foundation; either version 2.1 of the License, or | ||
1712 | + (at your option) any later version. | ||
1713 | + | ||
1714 | + Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY | ||
1715 | + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
1716 | + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for | ||
1717 | + more details. | ||
1718 | + | ||
1719 | + You should have received a copy of the GNU Lesser General Public License | ||
1720 | + along with libgomp; see the file COPYING.LIB. If not, write to the | ||
1721 | + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
1722 | + MA 02110-1301, USA. */ | ||
1723 | + | ||
1724 | +/* As a special exception, if you link this library with other files, some | ||
1725 | + of which are compiled with GCC, to produce an executable, this library | ||
1726 | + does not by itself cause the resulting executable to be covered by the | ||
1727 | + GNU General Public License. This exception does not however invalidate | ||
1728 | + any other reasons why the executable file might be covered by the GNU | ||
1729 | + General Public License. */ | ||
1730 | + | ||
1731 | +/* This is a Linux specific implementation of a mutex synchronization | ||
1732 | + mechanism for libgomp. This type is private to the library. This | ||
1733 | + implementation uses atomic instructions and the futex syscall. */ | ||
1734 | + | ||
1735 | +#ifndef GOMP_PTRLOCK_H | ||
1736 | +#define GOMP_PTRLOCK_H 1 | ||
1737 | + | ||
1738 | +typedef struct { void *ptr; gomp_mutex_t lock; } gomp_ptrlock_t; | ||
1739 | + | ||
1740 | +static inline void gomp_ptrlock_init (gomp_ptrlock_t *ptrlock, void *ptr) | ||
1741 | +{ | ||
1742 | + ptrlock->ptr = ptr; | ||
1743 | + gomp_mutex_init (&ptrlock->lock); | ||
1744 | +} | ||
1745 | + | ||
1746 | +static inline void *gomp_ptrlock_get (gomp_ptrlock_t *ptrlock) | ||
1747 | +{ | ||
1748 | + if (ptrlock->ptr != NULL) | ||
1749 | + return ptrlock->ptr; | ||
1750 | + | ||
1751 | + gomp_mutex_lock (&ptrlock->lock); | ||
1752 | + if (ptrlock->ptr != NULL) | ||
1753 | + { | ||
1754 | + gomp_mutex_unlock (&ptrlock->lock); | ||
1755 | + return ptrlock->ptr; | ||
1756 | + } | ||
1757 | + | ||
1758 | + return NULL; | ||
1759 | +} | ||
1760 | + | ||
1761 | +static inline void gomp_ptrlock_set (gomp_ptrlock_t *ptrlock, void *ptr) | ||
1762 | +{ | ||
1763 | + ptrlock->ptr = ptr; | ||
1764 | + gomp_mutex_unlock (&ptrlock->lock); | ||
1765 | +} | ||
1766 | + | ||
1767 | +static inline void gomp_ptrlock_destroy (gomp_ptrlock_t *ptrlock) | ||
1768 | +{ | ||
1769 | + gomp_mutex_destroy (&ptrlock->lock); | ||
1770 | +} | ||
1771 | + | ||
1772 | +#endif /* GOMP_PTRLOCK_H */ | ||
1773 | --- libgomp/config/posix/ptrlock.c.jj 2008-03-26 15:11:32.000000000 +0100 | ||
1774 | +++ libgomp/config/posix/ptrlock.c 2008-03-26 15:11:32.000000000 +0100 | ||
1775 | @@ -0,0 +1 @@ | ||
1776 | +/* Everything is in the header. */ | ||
1777 | --- libgomp/config/posix/bar.c.jj 2007-12-07 14:41:01.000000000 +0100 | ||
1778 | +++ libgomp/config/posix/bar.c 2008-03-26 15:11:32.000000000 +0100 | ||
1779 | @@ -1,4 +1,4 @@ | ||
1780 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
1781 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
1782 | Contributed by Richard Henderson <rth@redhat.com>. | ||
1783 | |||
1784 | This file is part of the GNU OpenMP Library (libgomp). | ||
1785 | @@ -70,7 +70,7 @@ gomp_barrier_reinit (gomp_barrier_t *bar | ||
1786 | } | ||
1787 | |||
1788 | void | ||
1789 | -gomp_barrier_wait_end (gomp_barrier_t *bar, bool last) | ||
1790 | +gomp_barrier_wait_end (gomp_barrier_t *bar, gomp_barrier_state_t last) | ||
1791 | { | ||
1792 | unsigned int n; | ||
1793 | |||
1794 | --- libgomp/config/linux/alpha/futex.h.jj 2007-12-07 14:41:00.000000000 +0100 | ||
1795 | +++ libgomp/config/linux/alpha/futex.h 2008-03-26 15:11:32.000000000 +0100 | ||
1796 | @@ -1,4 +1,4 @@ | ||
1797 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
1798 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
1799 | Contributed by Richard Henderson <rth@redhat.com>. | ||
1800 | |||
1801 | This file is part of the GNU OpenMP Library (libgomp). | ||
1802 | @@ -30,8 +30,6 @@ | ||
1803 | #ifndef SYS_futex | ||
1804 | #define SYS_futex 394 | ||
1805 | #endif | ||
1806 | -#define FUTEX_WAIT 0 | ||
1807 | -#define FUTEX_WAKE 1 | ||
1808 | |||
1809 | |||
1810 | static inline void | ||
1811 | @@ -45,7 +43,7 @@ futex_wait (int *addr, int val) | ||
1812 | |||
1813 | sc_0 = SYS_futex; | ||
1814 | sc_16 = (long) addr; | ||
1815 | - sc_17 = FUTEX_WAIT; | ||
1816 | + sc_17 = gomp_futex_wait; | ||
1817 | sc_18 = val; | ||
1818 | sc_19 = 0; | ||
1819 | __asm volatile ("callsys" | ||
1820 | @@ -53,6 +51,20 @@ futex_wait (int *addr, int val) | ||
1821 | : "0"(sc_0), "r" (sc_16), "r"(sc_17), "r"(sc_18), "1"(sc_19) | ||
1822 | : "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", | ||
1823 | "$22", "$23", "$24", "$25", "$27", "$28", "memory"); | ||
1824 | + if (__builtin_expect (sc_19, 0) && sc_0 == ENOSYS) | ||
1825 | + { | ||
1826 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
1827 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
1828 | + sc_0 = SYS_futex; | ||
1829 | + sc_17 &= ~FUTEX_PRIVATE_FLAG; | ||
1830 | + sc_19 = 0; | ||
1831 | + __asm volatile ("callsys" | ||
1832 | + : "=r" (sc_0), "=r"(sc_19) | ||
1833 | + : "0"(sc_0), "r" (sc_16), "r"(sc_17), "r"(sc_18), | ||
1834 | + "1"(sc_19) | ||
1835 | + : "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", | ||
1836 | + "$22", "$23", "$24", "$25", "$27", "$28", "memory"); | ||
1837 | + } | ||
1838 | } | ||
1839 | |||
1840 | static inline void | ||
1841 | @@ -66,11 +78,35 @@ futex_wake (int *addr, int count) | ||
1842 | |||
1843 | sc_0 = SYS_futex; | ||
1844 | sc_16 = (long) addr; | ||
1845 | - sc_17 = FUTEX_WAKE; | ||
1846 | + sc_17 = gomp_futex_wake; | ||
1847 | sc_18 = count; | ||
1848 | __asm volatile ("callsys" | ||
1849 | : "=r" (sc_0), "=r"(sc_19) | ||
1850 | : "0"(sc_0), "r" (sc_16), "r"(sc_17), "r"(sc_18) | ||
1851 | : "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", | ||
1852 | "$22", "$23", "$24", "$25", "$27", "$28", "memory"); | ||
1853 | + if (__builtin_expect (sc_19, 0) && sc_0 == ENOSYS) | ||
1854 | + { | ||
1855 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
1856 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
1857 | + sc_0 = SYS_futex; | ||
1858 | + sc_17 &= ~FUTEX_PRIVATE_FLAG; | ||
1859 | + __asm volatile ("callsys" | ||
1860 | + : "=r" (sc_0), "=r"(sc_19) | ||
1861 | + : "0"(sc_0), "r" (sc_16), "r"(sc_17), "r"(sc_18) | ||
1862 | + : "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", | ||
1863 | + "$22", "$23", "$24", "$25", "$27", "$28", "memory"); | ||
1864 | + } | ||
1865 | +} | ||
1866 | + | ||
1867 | +static inline void | ||
1868 | +cpu_relax (void) | ||
1869 | +{ | ||
1870 | + __asm volatile ("" : : : "memory"); | ||
1871 | +} | ||
1872 | + | ||
1873 | +static inline void | ||
1874 | +atomic_write_barrier (void) | ||
1875 | +{ | ||
1876 | + __asm volatile ("wmb" : : : "memory"); | ||
1877 | } | ||
1878 | --- libgomp/config/linux/affinity.c.jj 2007-12-07 14:41:00.000000000 +0100 | ||
1879 | +++ libgomp/config/linux/affinity.c 2008-03-26 15:11:32.000000000 +0100 | ||
1880 | @@ -1,4 +1,4 @@ | ||
1881 | -/* Copyright (C) 2006, 2007 Free Software Foundation, Inc. | ||
1882 | +/* Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. | ||
1883 | Contributed by Jakub Jelinek <jakub@redhat.com>. | ||
1884 | |||
1885 | This file is part of the GNU OpenMP Library (libgomp). | ||
1886 | @@ -38,9 +38,6 @@ | ||
1887 | #ifdef HAVE_PTHREAD_AFFINITY_NP | ||
1888 | |||
1889 | static unsigned int affinity_counter; | ||
1890 | -#ifndef HAVE_SYNC_BUILTINS | ||
1891 | -static gomp_mutex_t affinity_lock; | ||
1892 | -#endif | ||
1893 | |||
1894 | void | ||
1895 | gomp_init_affinity (void) | ||
1896 | @@ -76,9 +73,6 @@ gomp_init_affinity (void) | ||
1897 | CPU_SET (gomp_cpu_affinity[0], &cpuset); | ||
1898 | pthread_setaffinity_np (pthread_self (), sizeof (cpuset), &cpuset); | ||
1899 | affinity_counter = 1; | ||
1900 | -#ifndef HAVE_SYNC_BUILTINS | ||
1901 | - gomp_mutex_init (&affinity_lock); | ||
1902 | -#endif | ||
1903 | } | ||
1904 | |||
1905 | void | ||
1906 | @@ -87,13 +81,7 @@ gomp_init_thread_affinity (pthread_attr_ | ||
1907 | unsigned int cpu; | ||
1908 | cpu_set_t cpuset; | ||
1909 | |||
1910 | -#ifdef HAVE_SYNC_BUILTINS | ||
1911 | cpu = __sync_fetch_and_add (&affinity_counter, 1); | ||
1912 | -#else | ||
1913 | - gomp_mutex_lock (&affinity_lock); | ||
1914 | - cpu = affinity_counter++; | ||
1915 | - gomp_mutex_unlock (&affinity_lock); | ||
1916 | -#endif | ||
1917 | cpu %= gomp_cpu_affinity_len; | ||
1918 | CPU_ZERO (&cpuset); | ||
1919 | CPU_SET (gomp_cpu_affinity[cpu], &cpuset); | ||
1920 | --- libgomp/config/linux/bar.h.jj 2007-12-07 14:41:00.000000000 +0100 | ||
1921 | +++ libgomp/config/linux/bar.h 2008-03-26 15:11:32.000000000 +0100 | ||
1922 | @@ -1,4 +1,4 @@ | ||
1923 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
1924 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
1925 | Contributed by Richard Henderson <rth@redhat.com>. | ||
1926 | |||
1927 | This file is part of the GNU OpenMP Library (libgomp). | ||
1928 | @@ -36,40 +36,49 @@ | ||
1929 | |||
1930 | typedef struct | ||
1931 | { | ||
1932 | - gomp_mutex_t mutex; | ||
1933 | - unsigned total; | ||
1934 | - unsigned arrived; | ||
1935 | - int generation; | ||
1936 | + /* Make sure total/generation is in a mostly read cacheline, while | ||
1937 | + awaited in a separate cacheline. */ | ||
1938 | + unsigned total __attribute__((aligned (64))); | ||
1939 | + unsigned generation; | ||
1940 | + unsigned awaited __attribute__((aligned (64))); | ||
1941 | } gomp_barrier_t; | ||
1942 | +typedef unsigned int gomp_barrier_state_t; | ||
1943 | |||
1944 | static inline void gomp_barrier_init (gomp_barrier_t *bar, unsigned count) | ||
1945 | { | ||
1946 | - gomp_mutex_init (&bar->mutex); | ||
1947 | bar->total = count; | ||
1948 | - bar->arrived = 0; | ||
1949 | + bar->awaited = count; | ||
1950 | bar->generation = 0; | ||
1951 | } | ||
1952 | |||
1953 | static inline void gomp_barrier_reinit (gomp_barrier_t *bar, unsigned count) | ||
1954 | { | ||
1955 | - gomp_mutex_lock (&bar->mutex); | ||
1956 | + __sync_fetch_and_add (&bar->awaited, count - bar->total); | ||
1957 | bar->total = count; | ||
1958 | - gomp_mutex_unlock (&bar->mutex); | ||
1959 | } | ||
1960 | |||
1961 | static inline void gomp_barrier_destroy (gomp_barrier_t *bar) | ||
1962 | { | ||
1963 | - /* Before destroying, make sure all threads have left the barrier. */ | ||
1964 | - gomp_mutex_lock (&bar->mutex); | ||
1965 | } | ||
1966 | |||
1967 | extern void gomp_barrier_wait (gomp_barrier_t *); | ||
1968 | -extern void gomp_barrier_wait_end (gomp_barrier_t *, bool); | ||
1969 | +extern void gomp_barrier_wait_last (gomp_barrier_t *); | ||
1970 | +extern void gomp_barrier_wait_end (gomp_barrier_t *, gomp_barrier_state_t); | ||
1971 | |||
1972 | -static inline bool gomp_barrier_wait_start (gomp_barrier_t *bar) | ||
1973 | +static inline gomp_barrier_state_t | ||
1974 | +gomp_barrier_wait_start (gomp_barrier_t *bar) | ||
1975 | { | ||
1976 | - gomp_mutex_lock (&bar->mutex); | ||
1977 | - return ++bar->arrived == bar->total; | ||
1978 | + unsigned int ret = bar->generation; | ||
1979 | + /* Do we need any barrier here or is __sync_add_and_fetch acting | ||
1980 | + as the needed LoadLoad barrier already? */ | ||
1981 | + ret += __sync_add_and_fetch (&bar->awaited, -1) == 0; | ||
1982 | + return ret; | ||
1983 | +} | ||
1984 | + | ||
1985 | +static inline bool | ||
1986 | +gomp_barrier_last_thread (gomp_barrier_state_t state) | ||
1987 | +{ | ||
1988 | + return state & 1; | ||
1989 | } | ||
1990 | |||
1991 | #endif /* GOMP_BARRIER_H */ | ||
1992 | --- libgomp/config/linux/ptrlock.h.jj 2008-03-26 15:11:32.000000000 +0100 | ||
1993 | +++ libgomp/config/linux/ptrlock.h 2008-03-26 15:11:32.000000000 +0100 | ||
1994 | @@ -0,0 +1,65 @@ | ||
1995 | +/* Copyright (C) 2008 Free Software Foundation, Inc. | ||
1996 | + Contributed by Jakub Jelinek <jakub@redhat.com>. | ||
1997 | + | ||
1998 | + This file is part of the GNU OpenMP Library (libgomp). | ||
1999 | + | ||
2000 | + Libgomp is free software; you can redistribute it and/or modify it | ||
2001 | + under the terms of the GNU Lesser General Public License as published by | ||
2002 | + the Free Software Foundation; either version 2.1 of the License, or | ||
2003 | + (at your option) any later version. | ||
2004 | + | ||
2005 | + Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY | ||
2006 | + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
2007 | + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for | ||
2008 | + more details. | ||
2009 | + | ||
2010 | + You should have received a copy of the GNU Lesser General Public License | ||
2011 | + along with libgomp; see the file COPYING.LIB. If not, write to the | ||
2012 | + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
2013 | + MA 02110-1301, USA. */ | ||
2014 | + | ||
2015 | +/* As a special exception, if you link this library with other files, some | ||
2016 | + of which are compiled with GCC, to produce an executable, this library | ||
2017 | + does not by itself cause the resulting executable to be covered by the | ||
2018 | + GNU General Public License. This exception does not however invalidate | ||
2019 | + any other reasons why the executable file might be covered by the GNU | ||
2020 | + General Public License. */ | ||
2021 | + | ||
2022 | +/* This is a Linux specific implementation of a mutex synchronization | ||
2023 | + mechanism for libgomp. This type is private to the library. This | ||
2024 | + implementation uses atomic instructions and the futex syscall. */ | ||
2025 | + | ||
2026 | +#ifndef GOMP_PTRLOCK_H | ||
2027 | +#define GOMP_PTRLOCK_H 1 | ||
2028 | + | ||
2029 | +typedef void *gomp_ptrlock_t; | ||
2030 | + | ||
2031 | +static inline void gomp_ptrlock_init (gomp_ptrlock_t *ptrlock, void *ptr) | ||
2032 | +{ | ||
2033 | + *ptrlock = ptr; | ||
2034 | +} | ||
2035 | + | ||
2036 | +extern void *gomp_ptrlock_get_slow (gomp_ptrlock_t *ptrlock); | ||
2037 | +static inline void *gomp_ptrlock_get (gomp_ptrlock_t *ptrlock) | ||
2038 | +{ | ||
2039 | + if ((uintptr_t) *ptrlock > 2) | ||
2040 | + return *ptrlock; | ||
2041 | + | ||
2042 | + if (__sync_bool_compare_and_swap (ptrlock, NULL, (uintptr_t) 1)) | ||
2043 | + return NULL; | ||
2044 | + | ||
2045 | + return gomp_ptrlock_get_slow (ptrlock); | ||
2046 | +} | ||
2047 | + | ||
2048 | +extern void gomp_ptrlock_set_slow (gomp_ptrlock_t *ptrlock, void *ptr); | ||
2049 | +static inline void gomp_ptrlock_set (gomp_ptrlock_t *ptrlock, void *ptr) | ||
2050 | +{ | ||
2051 | + if (!__sync_bool_compare_and_swap (ptrlock, (uintptr_t) 1, ptr)) | ||
2052 | + gomp_ptrlock_set_slow (ptrlock, ptr); | ||
2053 | +} | ||
2054 | + | ||
2055 | +static inline void gomp_ptrlock_destroy (gomp_ptrlock_t *ptrlock) | ||
2056 | +{ | ||
2057 | +} | ||
2058 | + | ||
2059 | +#endif /* GOMP_PTRLOCK_H */ | ||
2060 | --- libgomp/config/linux/lock.c.jj 2007-12-07 14:41:00.000000000 +0100 | ||
2061 | +++ libgomp/config/linux/lock.c 2008-03-26 15:11:32.000000000 +0100 | ||
2062 | @@ -29,11 +29,10 @@ | ||
2063 | primitives. This implementation uses atomic instructions and the futex | ||
2064 | syscall. */ | ||
2065 | |||
2066 | -#include "libgomp.h" | ||
2067 | #include <string.h> | ||
2068 | #include <unistd.h> | ||
2069 | #include <sys/syscall.h> | ||
2070 | -#include "futex.h" | ||
2071 | +#include "wait.h" | ||
2072 | |||
2073 | |||
2074 | /* The internal gomp_mutex_t and the external non-recursive omp_lock_t | ||
2075 | @@ -137,7 +136,7 @@ omp_set_nest_lock (omp_nest_lock_t *lock | ||
2076 | return; | ||
2077 | } | ||
2078 | |||
2079 | - futex_wait (&lock->owner, otid); | ||
2080 | + do_wait (&lock->owner, otid); | ||
2081 | } | ||
2082 | } | ||
2083 | |||
2084 | --- libgomp/config/linux/ptrlock.c.jj 2008-03-26 15:11:32.000000000 +0100 | ||
2085 | +++ libgomp/config/linux/ptrlock.c 2008-03-26 15:11:32.000000000 +0100 | ||
2086 | @@ -0,0 +1,70 @@ | ||
2087 | +/* Copyright (C) 2008 Free Software Foundation, Inc. | ||
2088 | + Contributed by Jakub Jelinek <jakub@redhat.com>. | ||
2089 | + | ||
2090 | + This file is part of the GNU OpenMP Library (libgomp). | ||
2091 | + | ||
2092 | + Libgomp is free software; you can redistribute it and/or modify it | ||
2093 | + under the terms of the GNU Lesser General Public License as published by | ||
2094 | + the Free Software Foundation; either version 2.1 of the License, or | ||
2095 | + (at your option) any later version. | ||
2096 | + | ||
2097 | + Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY | ||
2098 | + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
2099 | + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for | ||
2100 | + more details. | ||
2101 | + | ||
2102 | + You should have received a copy of the GNU Lesser General Public License | ||
2103 | + along with libgomp; see the file COPYING.LIB. If not, write to the | ||
2104 | + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
2105 | + MA 02110-1301, USA. */ | ||
2106 | + | ||
2107 | +/* As a special exception, if you link this library with other files, some | ||
2108 | + of which are compiled with GCC, to produce an executable, this library | ||
2109 | + does not by itself cause the resulting executable to be covered by the | ||
2110 | + GNU General Public License. This exception does not however invalidate | ||
2111 | + any other reasons why the executable file might be covered by the GNU | ||
2112 | + General Public License. */ | ||
2113 | + | ||
2114 | +/* This is a Linux specific implementation of a mutex synchronization | ||
2115 | + mechanism for libgomp. This type is private to the library. This | ||
2116 | + implementation uses atomic instructions and the futex syscall. */ | ||
2117 | + | ||
2118 | +#include <endian.h> | ||
2119 | +#include <limits.h> | ||
2120 | +#include "wait.h" | ||
2121 | + | ||
2122 | +void * | ||
2123 | +gomp_ptrlock_get_slow (gomp_ptrlock_t *ptrlock) | ||
2124 | +{ | ||
2125 | + int *intptr; | ||
2126 | + __sync_bool_compare_and_swap (ptrlock, 1, 2); | ||
2127 | + | ||
2128 | + /* futex works on ints, not pointers. | ||
2129 | + But a valid work share pointer will be at least | ||
2130 | + 8 byte aligned, so it is safe to assume the low | ||
2131 | + 32-bits of the pointer won't contain values 1 or 2. */ | ||
2132 | + __asm volatile ("" : "=r" (intptr) : "0" (ptrlock)); | ||
2133 | +#if __BYTE_ORDER == __BIG_ENDIAN | ||
2134 | + if (sizeof (*ptrlock) > sizeof (int)) | ||
2135 | + intptr += (sizeof (*ptrlock) / sizeof (int)) - 1; | ||
2136 | +#endif | ||
2137 | + do | ||
2138 | + do_wait (intptr, 2); | ||
2139 | + while (*intptr == 2); | ||
2140 | + __asm volatile ("" : : : "memory"); | ||
2141 | + return *ptrlock; | ||
2142 | +} | ||
2143 | + | ||
2144 | +void | ||
2145 | +gomp_ptrlock_set_slow (gomp_ptrlock_t *ptrlock, void *ptr) | ||
2146 | +{ | ||
2147 | + int *intptr; | ||
2148 | + | ||
2149 | + *ptrlock = ptr; | ||
2150 | + __asm volatile ("" : "=r" (intptr) : "0" (ptrlock)); | ||
2151 | +#if __BYTE_ORDER == __BIG_ENDIAN | ||
2152 | + if (sizeof (*ptrlock) > sizeof (int)) | ||
2153 | + intptr += (sizeof (*ptrlock) / sizeof (int)) - 1; | ||
2154 | +#endif | ||
2155 | + futex_wake (intptr, INT_MAX); | ||
2156 | +} | ||
2157 | --- libgomp/config/linux/x86/futex.h.jj 2007-12-07 14:41:00.000000000 +0100 | ||
2158 | +++ libgomp/config/linux/x86/futex.h 2008-03-26 15:11:32.000000000 +0100 | ||
2159 | @@ -1,4 +1,4 @@ | ||
2160 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
2161 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
2162 | Contributed by Richard Henderson <rth@redhat.com>. | ||
2163 | |||
2164 | This file is part of the GNU OpenMP Library (libgomp). | ||
2165 | @@ -27,9 +27,6 @@ | ||
2166 | |||
2167 | /* Provide target-specific access to the futex system call. */ | ||
2168 | |||
2169 | -#define FUTEX_WAIT 0 | ||
2170 | -#define FUTEX_WAKE 1 | ||
2171 | - | ||
2172 | #ifdef __LP64__ | ||
2173 | # ifndef SYS_futex | ||
2174 | # define SYS_futex 202 | ||
2175 | @@ -38,14 +35,26 @@ | ||
2176 | static inline void | ||
2177 | futex_wait (int *addr, int val) | ||
2178 | { | ||
2179 | - register long r10 __asm__("%r10") = 0; | ||
2180 | + register long r10 __asm__("%r10"); | ||
2181 | long res; | ||
2182 | |||
2183 | + r10 = 0; | ||
2184 | __asm volatile ("syscall" | ||
2185 | : "=a" (res) | ||
2186 | - : "0"(SYS_futex), "D" (addr), "S"(FUTEX_WAIT), | ||
2187 | - "d"(val), "r"(r10) | ||
2188 | + : "0" (SYS_futex), "D" (addr), "S" (gomp_futex_wait), | ||
2189 | + "d" (val), "r" (r10) | ||
2190 | : "r11", "rcx", "memory"); | ||
2191 | + if (__builtin_expect (res == -ENOSYS, 0)) | ||
2192 | + { | ||
2193 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2194 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2195 | + r10 = 0; | ||
2196 | + __asm volatile ("syscall" | ||
2197 | + : "=a" (res) | ||
2198 | + : "0" (SYS_futex), "D" (addr), "S" (gomp_futex_wait), | ||
2199 | + "d" (val), "r" (r10) | ||
2200 | + : "r11", "rcx", "memory"); | ||
2201 | + } | ||
2202 | } | ||
2203 | |||
2204 | static inline void | ||
2205 | @@ -55,8 +64,19 @@ futex_wake (int *addr, int count) | ||
2206 | |||
2207 | __asm volatile ("syscall" | ||
2208 | : "=a" (res) | ||
2209 | - : "0"(SYS_futex), "D" (addr), "S"(FUTEX_WAKE), "d"(count) | ||
2210 | + : "0" (SYS_futex), "D" (addr), "S" (gomp_futex_wake), | ||
2211 | + "d" (count) | ||
2212 | : "r11", "rcx", "memory"); | ||
2213 | + if (__builtin_expect (res == -ENOSYS, 0)) | ||
2214 | + { | ||
2215 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2216 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2217 | + __asm volatile ("syscall" | ||
2218 | + : "=a" (res) | ||
2219 | + : "0" (SYS_futex), "D" (addr), "S" (gomp_futex_wake), | ||
2220 | + "d" (count) | ||
2221 | + : "r11", "rcx", "memory"); | ||
2222 | + } | ||
2223 | } | ||
2224 | #else | ||
2225 | # ifndef SYS_futex | ||
2226 | @@ -65,7 +85,7 @@ futex_wake (int *addr, int count) | ||
2227 | |||
2228 | # ifdef __PIC__ | ||
2229 | |||
2230 | -static inline void | ||
2231 | +static inline long | ||
2232 | sys_futex0 (int *addr, int op, int val) | ||
2233 | { | ||
2234 | long res; | ||
2235 | @@ -77,11 +97,12 @@ sys_futex0 (int *addr, int op, int val) | ||
2236 | : "0"(SYS_futex), "r" (addr), "c"(op), | ||
2237 | "d"(val), "S"(0) | ||
2238 | : "memory"); | ||
2239 | + return res; | ||
2240 | } | ||
2241 | |||
2242 | # else | ||
2243 | |||
2244 | -static inline void | ||
2245 | +static inline long | ||
2246 | sys_futex0 (int *addr, int op, int val) | ||
2247 | { | ||
2248 | long res; | ||
2249 | @@ -91,6 +112,7 @@ sys_futex0 (int *addr, int op, int val) | ||
2250 | : "0"(SYS_futex), "b" (addr), "c"(op), | ||
2251 | "d"(val), "S"(0) | ||
2252 | : "memory"); | ||
2253 | + return res; | ||
2254 | } | ||
2255 | |||
2256 | # endif /* __PIC__ */ | ||
2257 | @@ -98,13 +120,37 @@ sys_futex0 (int *addr, int op, int val) | ||
2258 | static inline void | ||
2259 | futex_wait (int *addr, int val) | ||
2260 | { | ||
2261 | - sys_futex0 (addr, FUTEX_WAIT, val); | ||
2262 | + long res = sys_futex0 (addr, gomp_futex_wait, val); | ||
2263 | + if (__builtin_expect (res == -ENOSYS, 0)) | ||
2264 | + { | ||
2265 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2266 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2267 | + sys_futex0 (addr, gomp_futex_wait, val); | ||
2268 | + } | ||
2269 | } | ||
2270 | |||
2271 | static inline void | ||
2272 | futex_wake (int *addr, int count) | ||
2273 | { | ||
2274 | - sys_futex0 (addr, FUTEX_WAKE, count); | ||
2275 | + long res = sys_futex0 (addr, gomp_futex_wake, count); | ||
2276 | + if (__builtin_expect (res == -ENOSYS, 0)) | ||
2277 | + { | ||
2278 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2279 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2280 | + sys_futex0 (addr, gomp_futex_wake, count); | ||
2281 | + } | ||
2282 | } | ||
2283 | |||
2284 | #endif /* __LP64__ */ | ||
2285 | + | ||
2286 | +static inline void | ||
2287 | +cpu_relax (void) | ||
2288 | +{ | ||
2289 | + __asm volatile ("rep; nop" : : : "memory"); | ||
2290 | +} | ||
2291 | + | ||
2292 | +static inline void | ||
2293 | +atomic_write_barrier (void) | ||
2294 | +{ | ||
2295 | + __sync_synchronize (); | ||
2296 | +} | ||
2297 | --- libgomp/config/linux/wait.h.jj 2008-03-26 15:11:32.000000000 +0100 | ||
2298 | +++ libgomp/config/linux/wait.h 2008-03-26 15:11:32.000000000 +0100 | ||
2299 | @@ -0,0 +1,68 @@ | ||
2300 | +/* Copyright (C) 2008 Free Software Foundation, Inc. | ||
2301 | + Contributed by Jakub Jelinek <jakub@redhat.com>. | ||
2302 | + | ||
2303 | + This file is part of the GNU OpenMP Library (libgomp). | ||
2304 | + | ||
2305 | + Libgomp is free software; you can redistribute it and/or modify it | ||
2306 | + under the terms of the GNU Lesser General Public License as published by | ||
2307 | + the Free Software Foundation; either version 2.1 of the License, or | ||
2308 | + (at your option) any later version. | ||
2309 | + | ||
2310 | + Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY | ||
2311 | + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
2312 | + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for | ||
2313 | + more details. | ||
2314 | + | ||
2315 | + You should have received a copy of the GNU Lesser General Public License | ||
2316 | + along with libgomp; see the file COPYING.LIB. If not, write to the | ||
2317 | + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
2318 | + MA 02110-1301, USA. */ | ||
2319 | + | ||
2320 | +/* As a special exception, if you link this library with other files, some | ||
2321 | + of which are compiled with GCC, to produce an executable, this library | ||
2322 | + does not by itself cause the resulting executable to be covered by the | ||
2323 | + GNU General Public License. This exception does not however invalidate | ||
2324 | + any other reasons why the executable file might be covered by the GNU | ||
2325 | + General Public License. */ | ||
2326 | + | ||
2327 | +/* This is a Linux specific implementation of a mutex synchronization | ||
2328 | + mechanism for libgomp. This type is private to the library. This | ||
2329 | + implementation uses atomic instructions and the futex syscall. */ | ||
2330 | + | ||
2331 | +#ifndef GOMP_WAIT_H | ||
2332 | +#define GOMP_WAIT_H 1 | ||
2333 | + | ||
2334 | +#include "libgomp.h" | ||
2335 | +#include <errno.h> | ||
2336 | + | ||
2337 | +#define FUTEX_WAIT 0 | ||
2338 | +#define FUTEX_WAKE 1 | ||
2339 | +#define FUTEX_PRIVATE_FLAG 128L | ||
2340 | + | ||
2341 | +#ifdef HAVE_ATTRIBUTE_VISIBILITY | ||
2342 | +# pragma GCC visibility push(hidden) | ||
2343 | +#endif | ||
2344 | + | ||
2345 | +extern long int gomp_futex_wait, gomp_futex_wake; | ||
2346 | + | ||
2347 | +#include "futex.h" | ||
2348 | + | ||
2349 | +static inline void do_wait (int *addr, int val) | ||
2350 | +{ | ||
2351 | + unsigned long long i, count = gomp_spin_count_var; | ||
2352 | + | ||
2353 | + if (__builtin_expect (gomp_managed_threads > gomp_available_cpus, 0)) | ||
2354 | + count = gomp_throttled_spin_count_var; | ||
2355 | + for (i = 0; i < count; i++) | ||
2356 | + if (__builtin_expect (*addr != val, 0)) | ||
2357 | + return; | ||
2358 | + else | ||
2359 | + cpu_relax (); | ||
2360 | + futex_wait (addr, val); | ||
2361 | +} | ||
2362 | + | ||
2363 | +#ifdef HAVE_ATTRIBUTE_VISIBILITY | ||
2364 | +# pragma GCC visibility pop | ||
2365 | +#endif | ||
2366 | + | ||
2367 | +#endif /* GOMP_WAIT_H */ | ||
2368 | --- libgomp/config/linux/sparc/futex.h.jj 2007-12-07 14:41:00.000000000 +0100 | ||
2369 | +++ libgomp/config/linux/sparc/futex.h 2008-03-26 15:11:32.000000000 +0100 | ||
2370 | @@ -1,4 +1,4 @@ | ||
2371 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
2372 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
2373 | Contributed by Jakub Jelinek <jakub@redhat.com>. | ||
2374 | |||
2375 | This file is part of the GNU OpenMP Library (libgomp). | ||
2376 | @@ -28,10 +28,8 @@ | ||
2377 | /* Provide target-specific access to the futex system call. */ | ||
2378 | |||
2379 | #include <sys/syscall.h> | ||
2380 | -#define FUTEX_WAIT 0 | ||
2381 | -#define FUTEX_WAKE 1 | ||
2382 | |||
2383 | -static inline void | ||
2384 | +static inline long | ||
2385 | sys_futex0 (int *addr, int op, int val) | ||
2386 | { | ||
2387 | register long int g1 __asm__ ("g1"); | ||
2388 | @@ -47,9 +45,9 @@ sys_futex0 (int *addr, int op, int val) | ||
2389 | o3 = 0; | ||
2390 | |||
2391 | #ifdef __arch64__ | ||
2392 | -# define SYSCALL_STRING "ta\t0x6d" | ||
2393 | +# define SYSCALL_STRING "ta\t0x6d; bcs,a,pt %%xcc, 1f; sub %%g0, %%o0, %%o0; 1:" | ||
2394 | #else | ||
2395 | -# define SYSCALL_STRING "ta\t0x10" | ||
2396 | +# define SYSCALL_STRING "ta\t0x10; bcs,a 1f; sub %%g0, %%o0, %%o0; 1:" | ||
2397 | #endif | ||
2398 | |||
2399 | __asm volatile (SYSCALL_STRING | ||
2400 | @@ -65,16 +63,49 @@ sys_futex0 (int *addr, int op, int val) | ||
2401 | "f48", "f50", "f52", "f54", "f56", "f58", "f60", "f62", | ||
2402 | #endif | ||
2403 | "cc", "memory"); | ||
2404 | + return o0; | ||
2405 | } | ||
2406 | |||
2407 | static inline void | ||
2408 | futex_wait (int *addr, int val) | ||
2409 | { | ||
2410 | - sys_futex0 (addr, FUTEX_WAIT, val); | ||
2411 | + long err = sys_futex0 (addr, gomp_futex_wait, val); | ||
2412 | + if (__builtin_expect (err == ENOSYS, 0)) | ||
2413 | + { | ||
2414 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2415 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2416 | + sys_futex0 (addr, gomp_futex_wait, val); | ||
2417 | + } | ||
2418 | } | ||
2419 | |||
2420 | static inline void | ||
2421 | futex_wake (int *addr, int count) | ||
2422 | { | ||
2423 | - sys_futex0 (addr, FUTEX_WAKE, count); | ||
2424 | + long err = sys_futex0 (addr, gomp_futex_wake, count); | ||
2425 | + if (__builtin_expect (err == ENOSYS, 0)) | ||
2426 | + { | ||
2427 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2428 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2429 | + sys_futex0 (addr, gomp_futex_wake, count); | ||
2430 | + } | ||
2431 | +} | ||
2432 | + | ||
2433 | +static inline void | ||
2434 | +cpu_relax (void) | ||
2435 | +{ | ||
2436 | +#if defined __arch64__ || defined __sparc_v9__ | ||
2437 | + __asm volatile ("membar #LoadLoad" : : : "memory"); | ||
2438 | +#else | ||
2439 | + __asm volatile ("" : : : "memory"); | ||
2440 | +#endif | ||
2441 | +} | ||
2442 | + | ||
2443 | +static inline void | ||
2444 | +atomic_write_barrier (void) | ||
2445 | +{ | ||
2446 | +#if defined __arch64__ || defined __sparc_v9__ | ||
2447 | + __asm volatile ("membar #StoreStore" : : : "memory"); | ||
2448 | +#else | ||
2449 | + __sync_synchronize (); | ||
2450 | +#endif | ||
2451 | } | ||
2452 | --- libgomp/config/linux/ia64/futex.h.jj 2007-12-07 14:41:00.000000000 +0100 | ||
2453 | +++ libgomp/config/linux/ia64/futex.h 2008-03-26 15:11:32.000000000 +0100 | ||
2454 | @@ -1,4 +1,4 @@ | ||
2455 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
2456 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
2457 | Contributed by Richard Henderson <rth@redhat.com>. | ||
2458 | |||
2459 | This file is part of the GNU OpenMP Library (libgomp). | ||
2460 | @@ -29,23 +29,24 @@ | ||
2461 | |||
2462 | #include <sys/syscall.h> | ||
2463 | |||
2464 | -#define FUTEX_WAIT 0 | ||
2465 | -#define FUTEX_WAKE 1 | ||
2466 | |||
2467 | |||
2468 | -static inline void | ||
2469 | -sys_futex0(int *addr, int op, int val) | ||
2470 | +static inline long | ||
2471 | +sys_futex0(int *addr, long op, int val) | ||
2472 | { | ||
2473 | register long out0 asm ("out0") = (long) addr; | ||
2474 | register long out1 asm ("out1") = op; | ||
2475 | register long out2 asm ("out2") = val; | ||
2476 | register long out3 asm ("out3") = 0; | ||
2477 | + register long r8 asm ("r8"); | ||
2478 | + register long r10 asm ("r10"); | ||
2479 | register long r15 asm ("r15") = SYS_futex; | ||
2480 | |||
2481 | __asm __volatile ("break 0x100000" | ||
2482 | - : "=r"(r15), "=r"(out0), "=r"(out1), "=r"(out2), "=r"(out3) | ||
2483 | + : "=r"(r15), "=r"(out0), "=r"(out1), "=r"(out2), "=r"(out3), | ||
2484 | + "=r"(r8), "=r"(r10) | ||
2485 | : "r"(r15), "r"(out0), "r"(out1), "r"(out2), "r"(out3) | ||
2486 | - : "memory", "r8", "r10", "out4", "out5", "out6", "out7", | ||
2487 | + : "memory", "out4", "out5", "out6", "out7", | ||
2488 | /* Non-stacked integer registers, minus r8, r10, r15. */ | ||
2489 | "r2", "r3", "r9", "r11", "r12", "r13", "r14", "r16", "r17", "r18", | ||
2490 | "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", | ||
2491 | @@ -56,16 +57,41 @@ sys_futex0(int *addr, int op, int val) | ||
2492 | "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", | ||
2493 | /* Branch registers. */ | ||
2494 | "b6"); | ||
2495 | + return r8 & r10; | ||
2496 | } | ||
2497 | |||
2498 | static inline void | ||
2499 | futex_wait (int *addr, int val) | ||
2500 | { | ||
2501 | - sys_futex0 (addr, FUTEX_WAIT, val); | ||
2502 | + long err = sys_futex0 (addr, gomp_futex_wait, val); | ||
2503 | + if (__builtin_expect (err == ENOSYS, 0)) | ||
2504 | + { | ||
2505 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2506 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2507 | + sys_futex0 (addr, gomp_futex_wait, val); | ||
2508 | + } | ||
2509 | } | ||
2510 | |||
2511 | static inline void | ||
2512 | futex_wake (int *addr, int count) | ||
2513 | { | ||
2514 | - sys_futex0 (addr, FUTEX_WAKE, count); | ||
2515 | + long err = sys_futex0 (addr, gomp_futex_wake, count); | ||
2516 | + if (__builtin_expect (err == ENOSYS, 0)) | ||
2517 | + { | ||
2518 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2519 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2520 | + sys_futex0 (addr, gomp_futex_wake, count); | ||
2521 | + } | ||
2522 | +} | ||
2523 | + | ||
2524 | +static inline void | ||
2525 | +cpu_relax (void) | ||
2526 | +{ | ||
2527 | + __asm volatile ("hint @pause" : : : "memory"); | ||
2528 | +} | ||
2529 | + | ||
2530 | +static inline void | ||
2531 | +atomic_write_barrier (void) | ||
2532 | +{ | ||
2533 | + __sync_synchronize (); | ||
2534 | } | ||
2535 | --- libgomp/config/linux/s390/futex.h.jj 2007-12-07 14:41:00.000000000 +0100 | ||
2536 | +++ libgomp/config/linux/s390/futex.h 2008-03-26 15:11:32.000000000 +0100 | ||
2537 | @@ -1,4 +1,4 @@ | ||
2538 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
2539 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
2540 | Contributed by Jakub Jelinek <jakub@redhat.com>. | ||
2541 | |||
2542 | This file is part of the GNU OpenMP Library (libgomp). | ||
2543 | @@ -28,10 +28,8 @@ | ||
2544 | /* Provide target-specific access to the futex system call. */ | ||
2545 | |||
2546 | #include <sys/syscall.h> | ||
2547 | -#define FUTEX_WAIT 0 | ||
2548 | -#define FUTEX_WAKE 1 | ||
2549 | |||
2550 | -static inline void | ||
2551 | +static inline long | ||
2552 | sys_futex0 (int *addr, int op, int val) | ||
2553 | { | ||
2554 | register long int gpr2 __asm__ ("2"); | ||
2555 | @@ -49,16 +47,41 @@ sys_futex0 (int *addr, int op, int val) | ||
2556 | : "i" (SYS_futex), | ||
2557 | "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5) | ||
2558 | : "memory"); | ||
2559 | + return gpr2; | ||
2560 | } | ||
2561 | |||
2562 | static inline void | ||
2563 | futex_wait (int *addr, int val) | ||
2564 | { | ||
2565 | - sys_futex0 (addr, FUTEX_WAIT, val); | ||
2566 | + long err = sys_futex0 (addr, gomp_futex_wait, val); | ||
2567 | + if (__builtin_expect (err == -ENOSYS, 0)) | ||
2568 | + { | ||
2569 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2570 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2571 | + sys_futex0 (addr, gomp_futex_wait, val); | ||
2572 | + } | ||
2573 | } | ||
2574 | |||
2575 | static inline void | ||
2576 | futex_wake (int *addr, int count) | ||
2577 | { | ||
2578 | - sys_futex0 (addr, FUTEX_WAKE, count); | ||
2579 | + long err = sys_futex0 (addr, gomp_futex_wake, count); | ||
2580 | + if (__builtin_expect (err == -ENOSYS, 0)) | ||
2581 | + { | ||
2582 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2583 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2584 | + sys_futex0 (addr, gomp_futex_wake, count); | ||
2585 | + } | ||
2586 | +} | ||
2587 | + | ||
2588 | +static inline void | ||
2589 | +cpu_relax (void) | ||
2590 | +{ | ||
2591 | + __asm volatile ("" : : : "memory"); | ||
2592 | +} | ||
2593 | + | ||
2594 | +static inline void | ||
2595 | +atomic_write_barrier (void) | ||
2596 | +{ | ||
2597 | + __sync_synchronize (); | ||
2598 | } | ||
2599 | --- libgomp/config/linux/mutex.c.jj 2007-12-07 14:41:00.000000000 +0100 | ||
2600 | +++ libgomp/config/linux/mutex.c 2008-03-26 15:11:32.000000000 +0100 | ||
2601 | @@ -1,4 +1,4 @@ | ||
2602 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
2603 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
2604 | Contributed by Richard Henderson <rth@redhat.com>. | ||
2605 | |||
2606 | This file is part of the GNU OpenMP Library (libgomp). | ||
2607 | @@ -29,9 +29,10 @@ | ||
2608 | mechanism for libgomp. This type is private to the library. This | ||
2609 | implementation uses atomic instructions and the futex syscall. */ | ||
2610 | |||
2611 | -#include "libgomp.h" | ||
2612 | -#include "futex.h" | ||
2613 | +#include "wait.h" | ||
2614 | |||
2615 | +long int gomp_futex_wake = FUTEX_WAKE | FUTEX_PRIVATE_FLAG; | ||
2616 | +long int gomp_futex_wait = FUTEX_WAIT | FUTEX_PRIVATE_FLAG; | ||
2617 | |||
2618 | void | ||
2619 | gomp_mutex_lock_slow (gomp_mutex_t *mutex) | ||
2620 | @@ -40,7 +41,7 @@ gomp_mutex_lock_slow (gomp_mutex_t *mute | ||
2621 | { | ||
2622 | int oldval = __sync_val_compare_and_swap (mutex, 1, 2); | ||
2623 | if (oldval != 0) | ||
2624 | - futex_wait (mutex, 2); | ||
2625 | + do_wait (mutex, 2); | ||
2626 | } | ||
2627 | while (!__sync_bool_compare_and_swap (mutex, 0, 2)); | ||
2628 | } | ||
2629 | --- libgomp/config/linux/sem.c.jj 2007-12-07 14:41:00.000000000 +0100 | ||
2630 | +++ libgomp/config/linux/sem.c 2008-03-26 15:11:32.000000000 +0100 | ||
2631 | @@ -1,4 +1,4 @@ | ||
2632 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
2633 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
2634 | Contributed by Richard Henderson <rth@redhat.com>. | ||
2635 | |||
2636 | This file is part of the GNU OpenMP Library (libgomp). | ||
2637 | @@ -29,8 +29,7 @@ | ||
2638 | mechanism for libgomp. This type is private to the library. This | ||
2639 | implementation uses atomic instructions and the futex syscall. */ | ||
2640 | |||
2641 | -#include "libgomp.h" | ||
2642 | -#include "futex.h" | ||
2643 | +#include "wait.h" | ||
2644 | |||
2645 | |||
2646 | void | ||
2647 | @@ -44,7 +43,7 @@ gomp_sem_wait_slow (gomp_sem_t *sem) | ||
2648 | if (__sync_bool_compare_and_swap (sem, val, val - 1)) | ||
2649 | return; | ||
2650 | } | ||
2651 | - futex_wait (sem, -1); | ||
2652 | + do_wait (sem, -1); | ||
2653 | } | ||
2654 | } | ||
2655 | |||
2656 | --- libgomp/config/linux/powerpc/futex.h.jj 2007-12-07 14:41:00.000000000 +0100 | ||
2657 | +++ libgomp/config/linux/powerpc/futex.h 2008-03-26 15:11:32.000000000 +0100 | ||
2658 | @@ -1,4 +1,4 @@ | ||
2659 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
2660 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
2661 | Contributed by Richard Henderson <rth@redhat.com>. | ||
2662 | |||
2663 | This file is part of the GNU OpenMP Library (libgomp). | ||
2664 | @@ -28,10 +28,8 @@ | ||
2665 | /* Provide target-specific access to the futex system call. */ | ||
2666 | |||
2667 | #include <sys/syscall.h> | ||
2668 | -#define FUTEX_WAIT 0 | ||
2669 | -#define FUTEX_WAKE 1 | ||
2670 | |||
2671 | -static inline void | ||
2672 | +static inline long | ||
2673 | sys_futex0 (int *addr, int op, int val) | ||
2674 | { | ||
2675 | register long int r0 __asm__ ("r0"); | ||
2676 | @@ -50,21 +48,48 @@ sys_futex0 (int *addr, int op, int val) | ||
2677 | doesn't. It doesn't much matter for us. In the interest of unity, | ||
2678 | go ahead and clobber it always. */ | ||
2679 | |||
2680 | - __asm volatile ("sc" | ||
2681 | + __asm volatile ("sc; mfcr %0" | ||
2682 | : "=r"(r0), "=r"(r3), "=r"(r4), "=r"(r5), "=r"(r6) | ||
2683 | : "r"(r0), "r"(r3), "r"(r4), "r"(r5), "r"(r6) | ||
2684 | : "r7", "r8", "r9", "r10", "r11", "r12", | ||
2685 | "cr0", "ctr", "memory"); | ||
2686 | + if (__builtin_expect (r0 & (1 << 28), 0)) | ||
2687 | + return r3; | ||
2688 | + return 0; | ||
2689 | } | ||
2690 | |||
2691 | static inline void | ||
2692 | futex_wait (int *addr, int val) | ||
2693 | { | ||
2694 | - sys_futex0 (addr, FUTEX_WAIT, val); | ||
2695 | + long err = sys_futex0 (addr, gomp_futex_wait, val); | ||
2696 | + if (__builtin_expect (err == ENOSYS, 0)) | ||
2697 | + { | ||
2698 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2699 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2700 | + sys_futex0 (addr, gomp_futex_wait, val); | ||
2701 | + } | ||
2702 | } | ||
2703 | |||
2704 | static inline void | ||
2705 | futex_wake (int *addr, int count) | ||
2706 | { | ||
2707 | - sys_futex0 (addr, FUTEX_WAKE, count); | ||
2708 | + long err = sys_futex0 (addr, gomp_futex_wake, count); | ||
2709 | + if (__builtin_expect (err == ENOSYS, 0)) | ||
2710 | + { | ||
2711 | + gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; | ||
2712 | + gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; | ||
2713 | + sys_futex0 (addr, gomp_futex_wake, count); | ||
2714 | + } | ||
2715 | +} | ||
2716 | + | ||
2717 | +static inline void | ||
2718 | +cpu_relax (void) | ||
2719 | +{ | ||
2720 | + __asm volatile ("" : : : "memory"); | ||
2721 | +} | ||
2722 | + | ||
2723 | +static inline void | ||
2724 | +atomic_write_barrier (void) | ||
2725 | +{ | ||
2726 | + __asm volatile ("eieio" : : : "memory"); | ||
2727 | } | ||
2728 | --- libgomp/config/linux/bar.c.jj 2007-12-07 14:41:00.000000000 +0100 | ||
2729 | +++ libgomp/config/linux/bar.c 2008-03-26 15:11:32.000000000 +0100 | ||
2730 | @@ -1,4 +1,4 @@ | ||
2731 | -/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
2732 | +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc. | ||
2733 | Contributed by Richard Henderson <rth@redhat.com>. | ||
2734 | |||
2735 | This file is part of the GNU OpenMP Library (libgomp). | ||
2736 | @@ -29,32 +29,29 @@ | ||
2737 | mechanism for libgomp. This type is private to the library. This | ||
2738 | implementation uses atomic instructions and the futex syscall. */ | ||
2739 | |||
2740 | -#include "libgomp.h" | ||
2741 | -#include "futex.h" | ||
2742 | #include <limits.h> | ||
2743 | +#include "wait.h" | ||
2744 | |||
2745 | |||
2746 | void | ||
2747 | -gomp_barrier_wait_end (gomp_barrier_t *bar, bool last) | ||
2748 | +gomp_barrier_wait_end (gomp_barrier_t *bar, gomp_barrier_state_t state) | ||
2749 | { | ||
2750 | - if (last) | ||
2751 | + if (__builtin_expect ((state & 1) != 0, 0)) | ||
2752 | { | ||
2753 | - bar->generation++; | ||
2754 | - futex_wake (&bar->generation, INT_MAX); | ||
2755 | + /* Next time we'll be awaiting TOTAL threads again. */ | ||
2756 | + bar->awaited = bar->total; | ||
2757 | + atomic_write_barrier (); | ||
2758 | + bar->generation += 2; | ||
2759 | + futex_wake ((int *) &bar->generation, INT_MAX); | ||
2760 | } | ||
2761 | else | ||
2762 | { | ||
2763 | - unsigned int generation = bar->generation; | ||
2764 | - | ||
2765 | - gomp_mutex_unlock (&bar->mutex); | ||
2766 | + unsigned int generation = state; | ||
2767 | |||
2768 | do | ||
2769 | - futex_wait (&bar->generation, generation); | ||
2770 | + do_wait ((int *) &bar->generation, generation); | ||
2771 | while (bar->generation == generation); | ||
2772 | } | ||
2773 | - | ||
2774 | - if (__sync_add_and_fetch (&bar->arrived, -1) == 0) | ||
2775 | - gomp_mutex_unlock (&bar->mutex); | ||
2776 | } | ||
2777 | |||
2778 | void | ||
2779 | @@ -62,3 +59,18 @@ gomp_barrier_wait (gomp_barrier_t *barri | ||
2780 | { | ||
2781 | gomp_barrier_wait_end (barrier, gomp_barrier_wait_start (barrier)); | ||
2782 | } | ||
2783 | + | ||
2784 | +/* Like gomp_barrier_wait, except that if the encountering thread | ||
2785 | + is not the last one to hit the barrier, it returns immediately. | ||
2786 | + The intended usage is that a thread which intends to gomp_barrier_destroy | ||
2787 | + this barrier calls gomp_barrier_wait, while all other threads | ||
2788 | + call gomp_barrier_wait_last. When gomp_barrier_wait returns, | ||
2789 | + the barrier can be safely destroyed. */ | ||
2790 | + | ||
2791 | +void | ||
2792 | +gomp_barrier_wait_last (gomp_barrier_t *barrier) | ||
2793 | +{ | ||
2794 | + gomp_barrier_state_t state = gomp_barrier_wait_start (barrier); | ||
2795 | + if (state & 1) | ||
2796 | + gomp_barrier_wait_end (barrier, state); | ||
2797 | +} | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-ppc32-retaddr.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-ppc32-retaddr.patch new file mode 100644 index 0000000000..3de4158eb0 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-ppc32-retaddr.patch | |||
@@ -0,0 +1,90 @@ | |||
1 | 2005-11-28 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | * config/rs6000/rs6000.c (rs6000_return_addr): If COUNT == 0, | ||
4 | read word RETURN_ADDRESS_OFFSET bytes above arg_pointer_rtx | ||
5 | instead of doing an extran indirection from frame_pointer_rtx. | ||
6 | |||
7 | * gcc.dg/20051128-1.c: New test. | ||
8 | |||
9 | Index: gcc/config/rs6000/rs6000.c | ||
10 | =================================================================== | ||
11 | --- gcc/config/rs6000/rs6000.c.orig 2010-03-27 03:27:39.000000000 -0700 | ||
12 | +++ gcc/config/rs6000/rs6000.c 2010-06-25 10:18:04.053381930 -0700 | ||
13 | @@ -17646,17 +17646,22 @@ | ||
14 | don't try to be too clever here. */ | ||
15 | if (count != 0 || (DEFAULT_ABI != ABI_AIX && flag_pic)) | ||
16 | { | ||
17 | + rtx x; | ||
18 | cfun->machine->ra_needs_full_frame = 1; | ||
19 | |||
20 | - return | ||
21 | - gen_rtx_MEM | ||
22 | - (Pmode, | ||
23 | - memory_address | ||
24 | - (Pmode, | ||
25 | - plus_constant (copy_to_reg | ||
26 | - (gen_rtx_MEM (Pmode, | ||
27 | - memory_address (Pmode, frame))), | ||
28 | - RETURN_ADDRESS_OFFSET))); | ||
29 | + if (count == 0) | ||
30 | + { | ||
31 | + gcc_assert (frame == frame_pointer_rtx); | ||
32 | + x = arg_pointer_rtx; | ||
33 | + } | ||
34 | + else | ||
35 | + { | ||
36 | + x = memory_address (Pmode, frame); | ||
37 | + x = copy_to_reg (gen_rtx_MEM (Pmode, x)); | ||
38 | + } | ||
39 | + | ||
40 | + x = plus_constant (x, RETURN_ADDRESS_OFFSET); | ||
41 | + return gen_rtx_MEM (Pmode, memory_address (Pmode, x)); | ||
42 | } | ||
43 | |||
44 | cfun->machine->ra_need_lr = 1; | ||
45 | Index: gcc/testsuite/gcc.dg/20051128-1.c | ||
46 | =================================================================== | ||
47 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
48 | +++ gcc/testsuite/gcc.dg/20051128-1.c 2010-06-25 10:18:04.061382856 -0700 | ||
49 | @@ -0,0 +1,41 @@ | ||
50 | +/* { dg-do run } */ | ||
51 | +/* { dg-options "-O2 -fpic" } */ | ||
52 | + | ||
53 | +extern void exit (int); | ||
54 | +extern void abort (void); | ||
55 | + | ||
56 | +int b; | ||
57 | + | ||
58 | +struct A | ||
59 | +{ | ||
60 | + void *pad[147]; | ||
61 | + void *ra, *h; | ||
62 | + long o; | ||
63 | +}; | ||
64 | + | ||
65 | +void | ||
66 | +__attribute__((noinline)) | ||
67 | +foo (struct A *a, void *x) | ||
68 | +{ | ||
69 | + __builtin_memset (a, 0, sizeof (a)); | ||
70 | + if (!b) | ||
71 | + exit (0); | ||
72 | +} | ||
73 | + | ||
74 | +void | ||
75 | +__attribute__((noinline)) | ||
76 | +bar (void) | ||
77 | +{ | ||
78 | + struct A a; | ||
79 | + | ||
80 | + __builtin_unwind_init (); | ||
81 | + foo (&a, __builtin_return_address (0)); | ||
82 | +} | ||
83 | + | ||
84 | +int | ||
85 | +main (void) | ||
86 | +{ | ||
87 | + bar (); | ||
88 | + abort (); | ||
89 | + return 0; | ||
90 | +} | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-pr27898.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-pr27898.patch new file mode 100644 index 0000000000..172bb81171 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-pr27898.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | 2006-08-18 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | PR c/27898 | ||
4 | * gcc.dg/pr27898.c: New test. | ||
5 | |||
6 | --- gcc/testsuite/gcc.dg/pr27898.c.jj 2006-08-18 09:19:33.000000000 +0200 | ||
7 | +++ gcc/testsuite/gcc.dg/pr27898.c 2006-08-18 09:19:27.000000000 +0200 | ||
8 | @@ -0,0 +1,8 @@ | ||
9 | +/* PR c/27898 */ | ||
10 | +/* { dg-do compile } */ | ||
11 | +/* { dg-options "--combine" } */ | ||
12 | +/* { dg-additional-sources "pr27898.c" } */ | ||
13 | + | ||
14 | +union u { struct { int i; }; }; | ||
15 | + | ||
16 | +extern int foo (union u *); | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-pr32139.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-pr32139.patch new file mode 100644 index 0000000000..f35696703d --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-pr32139.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | 2007-06-01 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | PR tree-optimization/32139 | ||
4 | * gcc.c-torture/compile/20070531-1.c: New test. | ||
5 | |||
6 | --- gcc/testsuite/gcc.c-torture/compile/20070531-1.c.jj 2007-05-31 13:47:22.000000000 +0200 | ||
7 | +++ gcc/testsuite/gcc.c-torture/compile/20070531-1.c 2007-06-01 10:57:15.000000000 +0200 | ||
8 | @@ -0,0 +1,11 @@ | ||
9 | +/* PR tree-optimization/32139 */ | ||
10 | +int foo (void); | ||
11 | +int bar (void) __attribute__ ((const)); | ||
12 | + | ||
13 | +int | ||
14 | +test (int x) | ||
15 | +{ | ||
16 | + int a = (x == 10000 ? foo : bar) (); | ||
17 | + int b = (x == 10000 ? foo : bar) (); | ||
18 | + return a + b; | ||
19 | +} | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-pr33763.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-pr33763.patch new file mode 100644 index 0000000000..68c30650ff --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-pr33763.patch | |||
@@ -0,0 +1,159 @@ | |||
1 | 2007-11-06 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | PR tree-optimization/33763 | ||
4 | * gcc.dg/pr33763.c: New test. | ||
5 | * g++.dg/opt/inline13.C: New test. | ||
6 | |||
7 | 2007-11-06 Jan Hubicka <jh@suse.cz> | ||
8 | |||
9 | PR tree-optimization/33763 | ||
10 | * tree-inline.c (expand_call_inline): Silently ignore always_inline | ||
11 | attribute for redefined extern inline functions. | ||
12 | |||
13 | Index: gcc/tree-inline.c | ||
14 | =================================================================== | ||
15 | --- gcc/tree-inline.c.orig 2010-03-18 13:07:13.000000000 -0700 | ||
16 | +++ gcc/tree-inline.c 2010-06-25 10:18:51.230139825 -0700 | ||
17 | @@ -3545,6 +3545,12 @@ | ||
18 | goto egress; | ||
19 | |||
20 | if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) | ||
21 | + /* For extern inline functions that get redefined we always | ||
22 | + silently ignored alway_inline flag. Better behaviour would | ||
23 | + be to be able to keep both bodies and use extern inline body | ||
24 | + for inlining, but we can't do that because frontends overwrite | ||
25 | + the body. */ | ||
26 | + && !cg_edge->callee->local.redefined_extern_inline | ||
27 | /* Avoid warnings during early inline pass. */ | ||
28 | && cgraph_global_info_ready) | ||
29 | { | ||
30 | Index: gcc/testsuite/gcc.dg/pr33763.c | ||
31 | =================================================================== | ||
32 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
33 | +++ gcc/testsuite/gcc.dg/pr33763.c 2010-06-25 10:18:51.234141302 -0700 | ||
34 | @@ -0,0 +1,60 @@ | ||
35 | +/* PR tree-optimization/33763 */ | ||
36 | +/* { dg-do compile } */ | ||
37 | +/* { dg-options "-O2" } */ | ||
38 | + | ||
39 | +typedef struct | ||
40 | +{ | ||
41 | + void *a; | ||
42 | + void *b; | ||
43 | +} T; | ||
44 | +extern void *foo (const char *, const char *); | ||
45 | +extern void *bar (void *, const char *, T); | ||
46 | +extern int baz (const char *, int); | ||
47 | + | ||
48 | +extern inline __attribute__ ((always_inline, gnu_inline)) int | ||
49 | +baz (const char *x, int y) | ||
50 | +{ | ||
51 | + return 2; | ||
52 | +} | ||
53 | + | ||
54 | +int | ||
55 | +baz (const char *x, int y) | ||
56 | +{ | ||
57 | + return 1; | ||
58 | +} | ||
59 | + | ||
60 | +int xa, xb; | ||
61 | + | ||
62 | +static void * | ||
63 | +inl (const char *x, const char *y) | ||
64 | +{ | ||
65 | + T t = { &xa, &xb }; | ||
66 | + int *f = (int *) __builtin_malloc (sizeof (int)); | ||
67 | + const char *z; | ||
68 | + int o = 0; | ||
69 | + void *r = 0; | ||
70 | + | ||
71 | + for (z = y; *z; z++) | ||
72 | + { | ||
73 | + if (*z == 'r') | ||
74 | + o |= 1; | ||
75 | + if (*z == 'w') | ||
76 | + o |= 2; | ||
77 | + } | ||
78 | + if (o == 1) | ||
79 | + *f = baz (x, 0); | ||
80 | + if (o == 2) | ||
81 | + *f = baz (x, 1); | ||
82 | + if (o == 3) | ||
83 | + *f = baz (x, 2); | ||
84 | + | ||
85 | + if (o && *f > 0) | ||
86 | + r = bar (f, "w", t); | ||
87 | + return r; | ||
88 | +} | ||
89 | + | ||
90 | +void * | ||
91 | +foo (const char *x, const char *y) | ||
92 | +{ | ||
93 | + return inl (x, y); | ||
94 | +} | ||
95 | Index: gcc/testsuite/g++.dg/opt/inline13.C | ||
96 | =================================================================== | ||
97 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
98 | +++ gcc/testsuite/g++.dg/opt/inline13.C 2010-06-25 10:18:51.261052137 -0700 | ||
99 | @@ -0,0 +1,60 @@ | ||
100 | +// PR tree-optimization/33763 | ||
101 | +// { dg-do compile } | ||
102 | +// { dg-options "-O2" } | ||
103 | + | ||
104 | +typedef struct | ||
105 | +{ | ||
106 | + void *a; | ||
107 | + void *b; | ||
108 | +} T; | ||
109 | +extern void *foo (const char *, const char *); | ||
110 | +extern void *bar (void *, const char *, T); | ||
111 | +extern int baz (const char *, int); | ||
112 | + | ||
113 | +extern inline __attribute__ ((always_inline, gnu_inline)) int | ||
114 | +baz (const char *x, int y) | ||
115 | +{ | ||
116 | + return 2; | ||
117 | +} | ||
118 | + | ||
119 | +int | ||
120 | +baz (const char *x, int y) | ||
121 | +{ | ||
122 | + return 1; | ||
123 | +} | ||
124 | + | ||
125 | +int xa, xb; | ||
126 | + | ||
127 | +static void * | ||
128 | +inl (const char *x, const char *y) | ||
129 | +{ | ||
130 | + T t = { &xa, &xb }; | ||
131 | + int *f = (int *) __builtin_malloc (sizeof (int)); | ||
132 | + const char *z; | ||
133 | + int o = 0; | ||
134 | + void *r = 0; | ||
135 | + | ||
136 | + for (z = y; *z; z++) | ||
137 | + { | ||
138 | + if (*z == 'r') | ||
139 | + o |= 1; | ||
140 | + if (*z == 'w') | ||
141 | + o |= 2; | ||
142 | + } | ||
143 | + if (o == 1) | ||
144 | + *f = baz (x, 0); | ||
145 | + if (o == 2) | ||
146 | + *f = baz (x, 1); | ||
147 | + if (o == 3) | ||
148 | + *f = baz (x, 2); | ||
149 | + | ||
150 | + if (o && *f > 0) | ||
151 | + r = bar (f, "w", t); | ||
152 | + return r; | ||
153 | +} | ||
154 | + | ||
155 | +void * | ||
156 | +foo (const char *x, const char *y) | ||
157 | +{ | ||
158 | + return inl (x, y); | ||
159 | +} | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-rh251682.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-rh251682.patch new file mode 100644 index 0000000000..e96ae6f134 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-rh251682.patch | |||
@@ -0,0 +1,89 @@ | |||
1 | 2008-04-01 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | PR pch/13675 | ||
4 | * files.c (struct _cpp_file): Remove pch field. | ||
5 | (pch_open_file): Don't set file->pch, just file->pchname. | ||
6 | (should_stack_file): After pfile->cb.read_pch call | ||
7 | free pchname and clear pchname, don't close file->fd. | ||
8 | Test file->pchname instead of file->pch. Don't close fd after cb. | ||
9 | (_cpp_stack_include): Test file->pchname instead of file->pch. | ||
10 | |||
11 | * c-pch.c (c_common_read_pch): On error close (fd) resp. fclose (f). | ||
12 | |||
13 | --- libcpp/files.c.jj 2008-02-18 23:50:17.000000000 +0100 | ||
14 | +++ libcpp/files.c 2008-03-31 15:59:01.000000000 +0200 | ||
15 | @@ -106,9 +106,6 @@ struct _cpp_file | ||
16 | |||
17 | /* If BUFFER above contains the true contents of the file. */ | ||
18 | bool buffer_valid; | ||
19 | - | ||
20 | - /* File is a PCH (on return from find_include_file). */ | ||
21 | - bool pch; | ||
22 | }; | ||
23 | |||
24 | /* A singly-linked list for all searches for a given file name, with | ||
25 | @@ -322,9 +319,7 @@ pch_open_file (cpp_reader *pfile, _cpp_f | ||
26 | } | ||
27 | closedir (pchdir); | ||
28 | } | ||
29 | - if (valid) | ||
30 | - file->pch = true; | ||
31 | - else | ||
32 | + if (!valid) | ||
33 | *invalid_pch = true; | ||
34 | } | ||
35 | |||
36 | @@ -703,11 +698,12 @@ should_stack_file (cpp_reader *pfile, _c | ||
37 | return false; | ||
38 | |||
39 | /* Handle PCH files immediately; don't stack them. */ | ||
40 | - if (file->pch) | ||
41 | + if (file->pchname) | ||
42 | { | ||
43 | pfile->cb.read_pch (pfile, file->pchname, file->fd, file->path); | ||
44 | - close (file->fd); | ||
45 | file->fd = -1; | ||
46 | + free ((void *) file->pchname); | ||
47 | + file->pchname = NULL; | ||
48 | return false; | ||
49 | } | ||
50 | |||
51 | @@ -916,7 +912,7 @@ _cpp_stack_include (cpp_reader *pfile, c | ||
52 | complicates LAST_SOURCE_LINE_LOCATION. This does not apply if we | ||
53 | found a PCH file (in which case linemap_add is not called) or we | ||
54 | were included from the command-line. */ | ||
55 | - if (! file->pch && file->err_no == 0 && type != IT_CMDLINE) | ||
56 | + if (file->pchname == NULL && file->err_no == 0 && type != IT_CMDLINE) | ||
57 | pfile->line_table->highest_location--; | ||
58 | |||
59 | return _cpp_stack_file (pfile, file, type == IT_IMPORT); | ||
60 | --- gcc/c-pch.c.jj 2008-02-18 23:46:08.000000000 +0100 | ||
61 | +++ gcc/c-pch.c 2008-03-31 15:56:00.000000000 +0200 | ||
62 | @@ -372,6 +372,7 @@ c_common_read_pch (cpp_reader *pfile, co | ||
63 | if (f == NULL) | ||
64 | { | ||
65 | cpp_errno (pfile, CPP_DL_ERROR, "calling fdopen"); | ||
66 | + close (fd); | ||
67 | return; | ||
68 | } | ||
69 | |||
70 | @@ -380,6 +381,7 @@ c_common_read_pch (cpp_reader *pfile, co | ||
71 | if (fread (&h, sizeof (h), 1, f) != 1) | ||
72 | { | ||
73 | cpp_errno (pfile, CPP_DL_ERROR, "reading"); | ||
74 | + fclose (f); | ||
75 | return; | ||
76 | } | ||
77 | |||
78 | @@ -425,7 +427,10 @@ c_common_read_pch (cpp_reader *pfile, co | ||
79 | gt_pch_restore (f); | ||
80 | |||
81 | if (cpp_read_state (pfile, name, f, smd) != 0) | ||
82 | - return; | ||
83 | + { | ||
84 | + fclose (f); | ||
85 | + return; | ||
86 | + } | ||
87 | |||
88 | fclose (f); | ||
89 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-rh330771.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-rh330771.patch new file mode 100644 index 0000000000..4888ac47dd --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-rh330771.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | 2007-10-16 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | * Makefile.am (libgcj_tools_la_LIBADD): Add. | ||
4 | * Makefile.in: Regenerated. | ||
5 | |||
6 | Index: libjava/Makefile.am | ||
7 | =================================================================== | ||
8 | --- libjava/Makefile.am.orig 2010-03-21 12:41:37.000000000 -0700 | ||
9 | +++ libjava/Makefile.am 2010-06-25 10:22:11.394130458 -0700 | ||
10 | @@ -507,6 +507,8 @@ | ||
11 | libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findirect-dispatch \ | ||
12 | -fno-bootstrap-classes -fno-indirect-classes \ | ||
13 | -fsource-filename=$(here)/classpath/tools/all-classes.lst | ||
14 | +## See jv_convert_LDADD. | ||
15 | +libgcj_tools_la_LIBADD = -L$(here)/.libs libgcj.la | ||
16 | libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \ | ||
17 | -version-info `grep -v '^\#' $(srcdir)/libtool-version` \ | ||
18 | $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBJAVA_LDFLAGS_NOUNDEF) | ||
19 | Index: libjava/Makefile.in | ||
20 | =================================================================== | ||
21 | --- libjava/Makefile.in.orig 2010-04-02 11:18:06.000000000 -0700 | ||
22 | +++ libjava/Makefile.in 2010-06-25 10:27:41.841708512 -0700 | ||
23 | @@ -1190,7 +1190,7 @@ | ||
24 | -version-info `grep -v '^\#' $(srcdir)/libtool-version` \ | ||
25 | $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBJAVA_LDFLAGS_NOUNDEF) | ||
26 | |||
27 | -libgcj_tools_la_LIBADD = libgcj.la -lm | ||
28 | +libgcj_tools_la_LIBADD = -L$(here)/.libs libgcj.la -lm | ||
29 | libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec $(am__append_22) | ||
30 | libgcj_tools_la_LINK = $(LIBLINK) $(libgcj_tools_la_LDFLAGS) | ||
31 | libjvm_la_SOURCES = jni-libjvm.cc | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-rh341221.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-rh341221.patch new file mode 100644 index 0000000000..7e2801b99b --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/fedora/gcc43-rh341221.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | 2007-10-21 Jakub Jelinek <jakub@redhat.com> | ||
2 | |||
3 | * doc/Makefile.am (POD2MAN): Set date from cp-tools.texinfo | ||
4 | timestamp rather than from current date. | ||
5 | * doc/Makefile.in: Regenerated. | ||
6 | |||
7 | Index: libjava/classpath/doc/Makefile.am | ||
8 | =================================================================== | ||
9 | --- libjava/classpath/doc/Makefile.am.orig 2008-10-21 10:55:01.000000000 -0700 | ||
10 | +++ libjava/classpath/doc/Makefile.am 2010-06-25 10:28:30.237631599 -0700 | ||
11 | @@ -31,7 +31,7 @@ | ||
12 | gtnameserv.1 \ | ||
13 | gjdoc.1 | ||
14 | |||
15 | -POD2MAN = pod2man --center="GNU" --release="$(VERSION)" | ||
16 | +POD2MAN = pod2man --center="GNU" --release="$(VERSION)" --date="$(shell ls --time-style=+%F -l $(srcdir)/cp-tools.texinfo | awk '{print $$6}')" | ||
17 | TEXI2POD = perl $(srcdir)/texi2pod.pl | ||
18 | STAMP = echo timestamp > | ||
19 | |||
20 | Index: libjava/classpath/doc/Makefile.in | ||
21 | =================================================================== | ||
22 | --- libjava/classpath/doc/Makefile.in.orig 2010-04-02 11:18:06.000000000 -0700 | ||
23 | +++ libjava/classpath/doc/Makefile.in 2010-06-25 10:28:30.245635728 -0700 | ||
24 | @@ -376,7 +376,7 @@ | ||
25 | gtnameserv.1 \ | ||
26 | gjdoc.1 | ||
27 | |||
28 | -POD2MAN = pod2man --center="GNU" --release="$(VERSION)" | ||
29 | +POD2MAN = pod2man --center="GNU" --release="$(VERSION)" --date="$(shell ls --time-style=+%F -l $(srcdir)/cp-tools.texinfo | awk '{print $$6}')" | ||
30 | TEXI2POD = perl $(srcdir)/texi2pod.pl | ||
31 | STAMP = echo timestamp > | ||
32 | @GENINSRC_FALSE@STAMP_GENINSRC = | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/fortran-cross-compile-hack.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/fortran-cross-compile-hack.patch new file mode 100644 index 0000000000..348c77006f --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/fortran-cross-compile-hack.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | * Fortran would have searched for arm-angstrom-gnueabi-gfortran but would have used | ||
2 | used gfortan. For gcc_4.2.2.bb we want to use the gfortran compiler from our cross | ||
3 | directory. | ||
4 | |||
5 | Index: gcc-4.5+svnr155514/libgfortran/configure | ||
6 | =================================================================== | ||
7 | --- gcc-4.5+svnr155514.orig/libgfortran/configure 2009-12-29 22:02:01.000000000 -0800 | ||
8 | +++ gcc-4.5+svnr155514/libgfortran/configure 2009-12-30 08:12:40.889091657 -0800 | ||
9 | @@ -11655,7 +11655,7 @@ CC="$lt_save_CC" | ||
10 | |||
11 | # We need gfortran to compile parts of the library | ||
12 | #AC_PROG_FC(gfortran) | ||
13 | -FC="$GFORTRAN" | ||
14 | +#FC="$GFORTRAN" | ||
15 | ac_ext=${ac_fc_srcext-f} | ||
16 | ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' | ||
17 | ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' | ||
18 | Index: gcc-4.5+svnr155514/libgfortran/configure.ac | ||
19 | =================================================================== | ||
20 | --- gcc-4.5+svnr155514.orig/libgfortran/configure.ac 2009-12-29 22:02:01.000000000 -0800 | ||
21 | +++ gcc-4.5+svnr155514/libgfortran/configure.ac 2009-12-30 08:12:13.453094218 -0800 | ||
22 | @@ -187,7 +187,7 @@ AC_SUBST(enable_static) | ||
23 | |||
24 | # We need gfortran to compile parts of the library | ||
25 | #AC_PROG_FC(gfortran) | ||
26 | -FC="$GFORTRAN" | ||
27 | +#FC="$GFORTRAN" | ||
28 | AC_PROG_FC(gfortran) | ||
29 | |||
30 | # extra LD Flags which are required for targets | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-4.0.2-e300c2c3.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-4.0.2-e300c2c3.patch new file mode 100644 index 0000000000..d1df8b2716 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-4.0.2-e300c2c3.patch | |||
@@ -0,0 +1,319 @@ | |||
1 | Adds support for Freescale Power architecture e300c2 and e300c3 cores. | ||
2 | http://www.bitshrine.org/gpp/tc-fsl-x86lnx-e300c3-nptl-4.0.2-2.src.rpm | ||
3 | |||
4 | Leon Woestenberg <leonw@mailcan.com> | ||
5 | |||
6 | --- | ||
7 | gcc/config.gcc | 2 | ||
8 | gcc/config/rs6000/e300c2c3.md | 189 ++++++++++++++++++++++++++++++++++++++++++ | ||
9 | gcc/config/rs6000/rs6000.c | 24 +++++ | ||
10 | gcc/config/rs6000/rs6000.h | 4 | ||
11 | gcc/config/rs6000/rs6000.md | 3 | ||
12 | 5 files changed, 220 insertions(+), 2 deletions(-) | ||
13 | |||
14 | Index: gcc-4.3.1/gcc/config/rs6000/e300c2c3.md | ||
15 | =================================================================== | ||
16 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
17 | +++ gcc-4.3.1/gcc/config/rs6000/e300c2c3.md 2008-08-23 16:51:33.000000000 -0700 | ||
18 | @@ -0,0 +1,189 @@ | ||
19 | +;; Pipeline description for Motorola PowerPC e300c3 core. | ||
20 | +;; Copyright (C) 2003 Free Software Foundation, Inc. | ||
21 | +;; | ||
22 | +;; This file is part of GCC. | ||
23 | + | ||
24 | +;; GCC is free software; you can redistribute it and/or modify it | ||
25 | +;; under the terms of the GNU General Public License as published | ||
26 | +;; by the Free Software Foundation; either version 2, or (at your | ||
27 | +;; option) any later version. | ||
28 | + | ||
29 | +;; GCC is distributed in the hope that it will be useful, but WITHOUT | ||
30 | +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
31 | +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public | ||
32 | +;; License for more details. | ||
33 | + | ||
34 | +;; You should have received a copy of the GNU General Public License | ||
35 | +;; along with GCC; see the file COPYING. If not, write to the | ||
36 | +;; Free Software Foundation, 59 Temple Place - Suite 330, Boston, | ||
37 | +;; MA 02111-1307, USA. | ||
38 | + | ||
39 | +(define_automaton "ppce300c3_most,ppce300c3_long,ppce300c3_retire") | ||
40 | +(define_cpu_unit "ppce300c3_decode_0,ppce300c3_decode_1" "ppce300c3_most") | ||
41 | + | ||
42 | +;; We don't simulate general issue queue (GIC). If we have SU insn | ||
43 | +;; and then SU1 insn, they can not be issued on the same cycle | ||
44 | +;; (although SU1 insn and then SU insn can be issued) because the SU | ||
45 | +;; insn will go to SU1 from GIC0 entry. Fortunately, the first cycle | ||
46 | +;; multipass insn scheduling will find the situation and issue the SU1 | ||
47 | +;; insn and then the SU insn. | ||
48 | +(define_cpu_unit "ppce300c3_issue_0,ppce300c3_issue_1" "ppce300c3_most") | ||
49 | + | ||
50 | +;; We could describe completion buffers slots in combination with the | ||
51 | +;; retirement units and the order of completion but the result | ||
52 | +;; automaton would behave in the same way because we can not describe | ||
53 | +;; real latency time with taking in order completion into account. | ||
54 | +;; Actually we could define the real latency time by querying reserved | ||
55 | +;; automaton units but the current scheduler uses latency time before | ||
56 | +;; issuing insns and making any reservations. | ||
57 | +;; | ||
58 | +;; So our description is aimed to achieve a insn schedule in which the | ||
59 | +;; insns would not wait in the completion buffer. | ||
60 | +(define_cpu_unit "ppce300c3_retire_0,ppce300c3_retire_1" "ppce300c3_retire") | ||
61 | + | ||
62 | +;; Branch unit: | ||
63 | +(define_cpu_unit "ppce300c3_bu" "ppce300c3_most") | ||
64 | + | ||
65 | +;; IU: | ||
66 | +(define_cpu_unit "ppce300c3_iu0_stage0,ppce300c3_iu1_stage0" "ppce300c3_most") | ||
67 | + | ||
68 | +;; IU: This used to describe non-pipelined division. | ||
69 | +(define_cpu_unit "ppce300c3_mu_div" "ppce300c3_long") | ||
70 | + | ||
71 | +;; SRU: | ||
72 | +(define_cpu_unit "ppce300c3_sru_stage0" "ppce300c3_most") | ||
73 | + | ||
74 | +;; Here we simplified LSU unit description not describing the stages. | ||
75 | +(define_cpu_unit "ppce300c3_lsu" "ppce300c3_most") | ||
76 | + | ||
77 | +;; FPU: | ||
78 | +(define_cpu_unit "ppce300c3_fpu" "ppce300c3_most") | ||
79 | + | ||
80 | +;; The following units are used to make automata deterministic | ||
81 | +(define_cpu_unit "present_ppce300c3_decode_0" "ppce300c3_most") | ||
82 | +(define_cpu_unit "present_ppce300c3_issue_0" "ppce300c3_most") | ||
83 | +(define_cpu_unit "present_ppce300c3_retire_0" "ppce300c3_retire") | ||
84 | +(define_cpu_unit "present_ppce300c3_iu0_stage0" "ppce300c3_most") | ||
85 | + | ||
86 | +;; The following sets to make automata deterministic when option ndfa is used. | ||
87 | +(presence_set "present_ppce300c3_decode_0" "ppce300c3_decode_0") | ||
88 | +(presence_set "present_ppce300c3_issue_0" "ppce300c3_issue_0") | ||
89 | +(presence_set "present_ppce300c3_retire_0" "ppce300c3_retire_0") | ||
90 | +(presence_set "present_ppce300c3_iu0_stage0" "ppce300c3_iu0_stage0") | ||
91 | + | ||
92 | +;; Some useful abbreviations. | ||
93 | +(define_reservation "ppce300c3_decode" | ||
94 | + "ppce300c3_decode_0|ppce300c3_decode_1+present_ppce300c3_decode_0") | ||
95 | +(define_reservation "ppce300c3_issue" | ||
96 | + "ppce300c3_issue_0|ppce300c3_issue_1+present_ppce300c3_issue_0") | ||
97 | +(define_reservation "ppce300c3_retire" | ||
98 | + "ppce300c3_retire_0|ppce300c3_retire_1+present_ppce300c3_retire_0") | ||
99 | +(define_reservation "ppce300c3_iu_stage0" | ||
100 | + "ppce300c3_iu0_stage0|ppce300c3_iu1_stage0+present_ppce300c3_iu0_stage0") | ||
101 | + | ||
102 | +;; Compares can be executed either one of the IU or SRU | ||
103 | +(define_insn_reservation "ppce300c3_cmp" 1 | ||
104 | + (and (eq_attr "type" "cmp,compare,delayed_compare,fast_compare") | ||
105 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
106 | + "ppce300c3_decode,ppce300c3_issue+(ppce300c3_iu_stage0|ppce300c3_sru_stage0) \ | ||
107 | + +ppce300c3_retire") | ||
108 | + | ||
109 | +;; Other one cycle IU insns | ||
110 | +(define_insn_reservation "ppce300c3_iu" 1 | ||
111 | + (and (eq_attr "type" "integer,insert_word") | ||
112 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
113 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_iu_stage0+ppce300c3_retire") | ||
114 | + | ||
115 | +;; Branch. Actually this latency time is not used by the scheduler. | ||
116 | +(define_insn_reservation "ppce300c3_branch" 1 | ||
117 | + (and (eq_attr "type" "jmpreg,branch") | ||
118 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
119 | + "ppce300c3_decode,ppce300c3_bu,ppce300c3_retire") | ||
120 | + | ||
121 | +;; Multiply is non-pipelined but can be executed in any IU | ||
122 | +(define_insn_reservation "ppce300c3_multiply" 2 | ||
123 | + (and (eq_attr "type" "imul,imul2,imul3,imul_compare") | ||
124 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
125 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_iu_stage0, \ | ||
126 | + ppce300c3_iu_stage0+ppce300c3_retire") | ||
127 | + | ||
128 | +;; Divide. We use the average latency time here. We omit reserving a | ||
129 | +;; retire unit because of the result automata will be huge. | ||
130 | +(define_insn_reservation "ppce300c3_divide" 20 | ||
131 | + (and (eq_attr "type" "idiv") | ||
132 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
133 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_iu_stage0+ppce300c3_mu_div,\ | ||
134 | + ppce300c3_mu_div*19") | ||
135 | + | ||
136 | +;; CR logical | ||
137 | +(define_insn_reservation "ppce300c3_cr_logical" 1 | ||
138 | + (and (eq_attr "type" "cr_logical,delayed_cr") | ||
139 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
140 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_sru_stage0+ppce300c3_retire") | ||
141 | + | ||
142 | +;; Mfcr | ||
143 | +(define_insn_reservation "ppce300c3_mfcr" 1 | ||
144 | + (and (eq_attr "type" "mfcr") | ||
145 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
146 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_sru_stage0+ppce300c3_retire") | ||
147 | + | ||
148 | +;; Mtcrf | ||
149 | +(define_insn_reservation "ppce300c3_mtcrf" 1 | ||
150 | + (and (eq_attr "type" "mtcr") | ||
151 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
152 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_sru_stage0+ppce300c3_retire") | ||
153 | + | ||
154 | +;; Mtjmpr | ||
155 | +(define_insn_reservation "ppce300c3_mtjmpr" 1 | ||
156 | + (and (eq_attr "type" "mtjmpr,mfjmpr") | ||
157 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
158 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_sru_stage0+ppce300c3_retire") | ||
159 | + | ||
160 | +;; Float point instructions | ||
161 | +(define_insn_reservation "ppce300c3_fpcompare" 3 | ||
162 | + (and (eq_attr "type" "fpcompare") | ||
163 | + (eq_attr "cpu" "ppce300c3")) | ||
164 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,nothing,ppce300c3_retire") | ||
165 | + | ||
166 | +(define_insn_reservation "ppce300c3_fp" 3 | ||
167 | + (and (eq_attr "type" "fp") | ||
168 | + (eq_attr "cpu" "ppce300c3")) | ||
169 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,nothing,ppce300c3_retire") | ||
170 | + | ||
171 | +(define_insn_reservation "ppce300c3_dmul" 4 | ||
172 | + (and (eq_attr "type" "dmul") | ||
173 | + (eq_attr "cpu" "ppce300c3")) | ||
174 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,ppce300c3_fpu,nothing,ppce300c3_retire") | ||
175 | + | ||
176 | +; Divides are not pipelined | ||
177 | +(define_insn_reservation "ppce300c3_sdiv" 18 | ||
178 | + (and (eq_attr "type" "sdiv") | ||
179 | + (eq_attr "cpu" "ppce300c3")) | ||
180 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,ppce300c3_fpu*17") | ||
181 | + | ||
182 | +(define_insn_reservation "ppce300c3_ddiv" 33 | ||
183 | + (and (eq_attr "type" "ddiv") | ||
184 | + (eq_attr "cpu" "ppce300c3")) | ||
185 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,ppce300c3_fpu*32") | ||
186 | + | ||
187 | +;; Loads | ||
188 | +(define_insn_reservation "ppce300c3_load" 2 | ||
189 | + (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u") | ||
190 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
191 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_lsu,ppce300c3_retire") | ||
192 | + | ||
193 | +(define_insn_reservation "ppce300c3_fpload" 2 | ||
194 | + (and (eq_attr "type" "fpload,fpload_ux,fpload_u") | ||
195 | + (eq_attr "cpu" "ppce300c3")) | ||
196 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_lsu,ppce300c3_retire") | ||
197 | + | ||
198 | +;; Stores. | ||
199 | +(define_insn_reservation "ppce300c3_store" 2 | ||
200 | + (and (eq_attr "type" "store,store_ux,store_u") | ||
201 | + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3"))) | ||
202 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_lsu,ppce300c3_retire") | ||
203 | + | ||
204 | +(define_insn_reservation "ppce300c3_fpstore" 2 | ||
205 | + (and (eq_attr "type" "fpstore,fpstore_ux,fpstore_u") | ||
206 | + (eq_attr "cpu" "ppce300c3")) | ||
207 | + "ppce300c3_decode,ppce300c3_issue+ppce300c3_lsu,ppce300c3_retire") | ||
208 | Index: gcc-4.3.1/gcc/config/rs6000/rs6000.c | ||
209 | =================================================================== | ||
210 | --- gcc-4.3.1.orig/gcc/config/rs6000/rs6000.c 2008-08-23 16:49:39.000000000 -0700 | ||
211 | +++ gcc-4.3.1/gcc/config/rs6000/rs6000.c 2008-08-23 16:54:25.000000000 -0700 | ||
212 | @@ -669,6 +669,21 @@ struct processor_costs ppc8540_cost = { | ||
213 | 1, /* prefetch streams /*/ | ||
214 | }; | ||
215 | |||
216 | +/* Instruction costs on E300C2 and E300C3 cores. */ | ||
217 | +static const | ||
218 | +struct processor_costs ppce300c2c3_cost = { | ||
219 | + COSTS_N_INSNS (4), /* mulsi */ | ||
220 | + COSTS_N_INSNS (4), /* mulsi_const */ | ||
221 | + COSTS_N_INSNS (4), /* mulsi_const9 */ | ||
222 | + COSTS_N_INSNS (4), /* muldi */ | ||
223 | + COSTS_N_INSNS (19), /* divsi */ | ||
224 | + COSTS_N_INSNS (19), /* divdi */ | ||
225 | + COSTS_N_INSNS (3), /* fp */ | ||
226 | + COSTS_N_INSNS (4), /* dmul */ | ||
227 | + COSTS_N_INSNS (18), /* sdiv */ | ||
228 | + COSTS_N_INSNS (33), /* ddiv */ | ||
229 | +}; | ||
230 | + | ||
231 | /* Instruction costs on POWER4 and POWER5 processors. */ | ||
232 | static const | ||
233 | struct processor_costs power4_cost = { | ||
234 | @@ -1420,6 +1435,8 @@ rs6000_override_options (const char *def | ||
235 | {"8540", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_STRICT_ALIGN}, | ||
236 | /* 8548 has a dummy entry for now. */ | ||
237 | {"8548", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_STRICT_ALIGN}, | ||
238 | + {"e300c2", PROCESSOR_PPCE300C2, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, | ||
239 | + {"e300c3", PROCESSOR_PPCE300C3, POWERPC_BASE_MASK}, | ||
240 | {"860", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, | ||
241 | {"970", PROCESSOR_POWER4, | ||
242 | POWERPC_7400_MASK | MASK_PPC_GPOPT | MASK_MFCRF | MASK_POWERPC64}, | ||
243 | @@ -1845,6 +1862,11 @@ rs6000_override_options (const char *def | ||
244 | rs6000_cost = &ppc8540_cost; | ||
245 | break; | ||
246 | |||
247 | + case PROCESSOR_PPCE300C2: | ||
248 | + case PROCESSOR_PPCE300C3: | ||
249 | + rs6000_cost = &ppce300c2c3_cost; | ||
250 | + break; | ||
251 | + | ||
252 | case PROCESSOR_POWER4: | ||
253 | case PROCESSOR_POWER5: | ||
254 | rs6000_cost = &power4_cost; | ||
255 | @@ -18606,6 +18628,8 @@ rs6000_issue_rate (void) | ||
256 | case CPU_PPC7400: | ||
257 | case CPU_PPC8540: | ||
258 | case CPU_CELL: | ||
259 | + case CPU_PPCE300C2: | ||
260 | + case CPU_PPCE300C3: | ||
261 | return 2; | ||
262 | case CPU_RIOS2: | ||
263 | case CPU_PPC604: | ||
264 | Index: gcc-4.3.1/gcc/config/rs6000/rs6000.h | ||
265 | =================================================================== | ||
266 | --- gcc-4.3.1.orig/gcc/config/rs6000/rs6000.h 2008-01-26 09:18:35.000000000 -0800 | ||
267 | +++ gcc-4.3.1/gcc/config/rs6000/rs6000.h 2008-08-23 16:55:30.000000000 -0700 | ||
268 | @@ -117,6 +117,8 @@ | ||
269 | %{mcpu=G5: -mpower4 -maltivec} \ | ||
270 | %{mcpu=8540: -me500} \ | ||
271 | %{mcpu=8548: -me500} \ | ||
272 | +%{mcpu=e300c2: -mppc} \ | ||
273 | +%{mcpu=e300c3: -mppc -mpmr} \ | ||
274 | %{maltivec: -maltivec} \ | ||
275 | -many" | ||
276 | |||
277 | @@ -262,6 +264,8 @@ enum processor_type | ||
278 | PROCESSOR_PPC7400, | ||
279 | PROCESSOR_PPC7450, | ||
280 | PROCESSOR_PPC8540, | ||
281 | + PROCESSOR_PPCE300C2, | ||
282 | + PROCESSOR_PPCE300C3, | ||
283 | PROCESSOR_POWER4, | ||
284 | PROCESSOR_POWER5, | ||
285 | PROCESSOR_POWER6, | ||
286 | Index: gcc-4.3.1/gcc/config/rs6000/rs6000.md | ||
287 | =================================================================== | ||
288 | --- gcc-4.3.1.orig/gcc/config/rs6000/rs6000.md 2008-02-13 16:14:45.000000000 -0800 | ||
289 | +++ gcc-4.3.1/gcc/config/rs6000/rs6000.md 2008-08-23 16:57:29.000000000 -0700 | ||
290 | @@ -133,7 +133,7 @@ | ||
291 | ;; Processor type -- this attribute must exactly match the processor_type | ||
292 | ;; enumeration in rs6000.h. | ||
293 | |||
294 | -(define_attr "cpu" "rios1,rios2,rs64a,mpccore,ppc403,ppc405,ppc440,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450,ppc8540,power4,power5,power6,cell" | ||
295 | +(define_attr "cpu" "rios1,rios2,rs64a,mpccore,ppc403,ppc405,ppc440,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450,ppc8540,power4,power5,power6,cell,ppce300c2,ppce300c3" | ||
296 | (const (symbol_ref "rs6000_cpu_attr"))) | ||
297 | |||
298 | |||
299 | @@ -166,6 +166,7 @@ | ||
300 | (include "7xx.md") | ||
301 | (include "7450.md") | ||
302 | (include "8540.md") | ||
303 | +(include "e300c2c3.md") | ||
304 | (include "power4.md") | ||
305 | (include "power5.md") | ||
306 | (include "power6.md") | ||
307 | Index: gcc-4.3.1/gcc/config.gcc | ||
308 | =================================================================== | ||
309 | --- gcc-4.3.1.orig/gcc/config.gcc 2008-08-23 16:49:43.000000000 -0700 | ||
310 | +++ gcc-4.3.1/gcc/config.gcc 2008-08-23 17:03:55.000000000 -0700 | ||
311 | @@ -3144,7 +3144,7 @@ case "${target}" in | ||
312 | | rios | rios1 | rios2 | rsc | rsc1 | rs64a \ | ||
313 | | 401 | 403 | 405 | 405fp | 440 | 440fp | 505 \ | ||
314 | | 601 | 602 | 603 | 603e | ec603e | 604 \ | ||
315 | - | 604e | 620 | 630 | 740 | 750 | 7400 | 7450 \ | ||
316 | + | 604e | 620 | 630 | 740 | 750 | 7400 | 7450 | e300c[23] \ | ||
317 | | 854[08] | 801 | 821 | 823 | 860 | 970 | G3 | G4 | G5 | cell) | ||
318 | # OK | ||
319 | ;; | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch new file mode 100644 index 0000000000..f33e6c1ea6 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | --- | ||
2 | configure | 2 +- | ||
3 | configure.ac | 2 +- | ||
4 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
5 | |||
6 | Index: gcc-4.3.1/configure.ac | ||
7 | =================================================================== | ||
8 | --- gcc-4.3.1.orig/configure.ac 2008-07-21 12:29:18.000000000 -0700 | ||
9 | +++ gcc-4.3.1/configure.ac 2008-07-21 12:29:35.000000000 -0700 | ||
10 | @@ -2352,7 +2352,7 @@ fi | ||
11 | # for target_alias and gcc doesn't manage it consistently. | ||
12 | target_configargs="--cache-file=./config.cache ${target_configargs}" | ||
13 | |||
14 | -FLAGS_FOR_TARGET= | ||
15 | +FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET" | ||
16 | case " $target_configdirs " in | ||
17 | *" newlib "*) | ||
18 | case " $target_configargs " in | ||
19 | Index: gcc-4.3.1/configure | ||
20 | =================================================================== | ||
21 | --- gcc-4.3.1.orig/configure 2008-07-21 12:29:48.000000000 -0700 | ||
22 | +++ gcc-4.3.1/configure 2008-07-21 12:29:59.000000000 -0700 | ||
23 | @@ -5841,7 +5841,7 @@ fi | ||
24 | # for target_alias and gcc doesn't manage it consistently. | ||
25 | target_configargs="--cache-file=./config.cache ${target_configargs}" | ||
26 | |||
27 | -FLAGS_FOR_TARGET= | ||
28 | +FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET" | ||
29 | case " $target_configdirs " in | ||
30 | *" newlib "*) | ||
31 | case " $target_configargs " in | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch new file mode 100644 index 0000000000..af0b81ba4c --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch | |||
@@ -0,0 +1,114 @@ | |||
1 | Before committing, I noticed that PR/32161 was marked as a dup of PR/32009, but my previous patch did not fix it. | ||
2 | |||
3 | This alternative patch is better because it lets you just use CFLAGS_FOR_TARGET to set the compilation flags for libgcc. Since bootstrapped target libraries are never compiled with the native compiler, it makes little sense to use different flags for stage1 and later stages. And it also makes little sense to use a different variable than CFLAGS_FOR_TARGET. | ||
4 | |||
5 | Other changes I had to do include: | ||
6 | |||
7 | - moving the creation of default CFLAGS_FOR_TARGET from Makefile.am to configure.ac, because otherwise the BOOT_CFLAGS are substituted into CFLAGS_FOR_TARGET (which is "-O2 -g $(CFLAGS)") via $(CFLAGS). It is also cleaner this way though. | ||
8 | |||
9 | - passing the right CFLAGS to configure scripts as exported environment variables | ||
10 | |||
11 | I also stopped passing LIBCFLAGS to configure scripts since they are unused in the whole src tree. And I updated the documentation as H-P reminded me to do. | ||
12 | |||
13 | Bootstrapped/regtested i686-pc-linux-gnu, will commit to 4.4 shortly. Ok for 4.3? | ||
14 | |||
15 | Paolo | ||
16 | |||
17 | 2008-02-19 Paolo Bonzini <bonzini@gnu.org> | ||
18 | |||
19 | PR bootstrap/32009 | ||
20 | PR bootstrap/32161 | ||
21 | |||
22 | * configure.ac (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Compute here. | ||
23 | * configure: Regenerate. | ||
24 | |||
25 | * Makefile.def: Define stage_libcflags for all bootstrap stages. | ||
26 | * Makefile.tpl (BOOT_LIBCFLAGS, STAGE2_LIBCFLAGS, STAGE3_LIBCFLAGS, | ||
27 | STAGE4_LIBCFLAGS): New. | ||
28 | (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Subst from autoconf, without | ||
29 | $(SYSROOT_CFLAGS_FOR_TARGET) and $(DEBUG_PREFIX_CFLAGS_FOR_TARGET). | ||
30 | (BASE_TARGET_EXPORTS): Append them here to C{,XX}FLAGS. | ||
31 | (EXTRA_TARGET_FLAGS): Append them here to {LIB,}C{,XX}FLAGS. | ||
32 | (configure-stage[+id+]-[+prefix+][+module+]): Pass stage_libcflags | ||
33 | for target modules. Don't export LIBCFLAGS. | ||
34 | (all-stage[+id+]-[+prefix+][+module+]): Pass stage_libcflags; pass | ||
35 | $(BASE_FLAGS_TO_PASS) where [+args+] was passed, and [+args+] after | ||
36 | the overridden CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET. | ||
37 | (invocations of `all'): Replace $(TARGET_FLAGS_TO_PASS) with | ||
38 | $(EXTRA_TARGET_FLAGS), $(FLAGS_TO_PASS) with $(EXTRA_HOST_FLAGS). | ||
39 | * Makefile.in: Regenerate. | ||
40 | |||
41 | config: | ||
42 | 2008-02-19 Paolo Bonzini <bonzini@gnu.org> | ||
43 | |||
44 | PR bootstrap/32009 | ||
45 | * mh-ppc-darwin (BOOT_CFLAGS): Reenable. | ||
46 | |||
47 | gcc: | ||
48 | 2008-02-19 Paolo Bonzini <bonzini@gnu.org> | ||
49 | |||
50 | PR bootstrap/32009 | ||
51 | * doc/install.texi: Correct references to CFLAGS, replacing them | ||
52 | with BOOT_CFLAGS. Document flags used during bootstrap for | ||
53 | target libraries. | ||
54 | |||
55 | |||
56 | --- | ||
57 | Makefile.def | 25 | ||
58 | Makefile.in | 1845 ++++++++++++++++++++++++++++++------------------- | ||
59 | Makefile.tpl | 91 +- | ||
60 | config/mh-ppc-darwin | 3 | ||
61 | configure | 36 | ||
62 | configure.ac | 32 | ||
63 | gcc/Makefile.in | 2 | ||
64 | gcc/configure | 6 | ||
65 | gcc/configure.ac | 3 | ||
66 | gcc/doc/install.texi | 56 - | ||
67 | libiberty/Makefile.in | 162 ++-- | ||
68 | libiberty/configure | 46 - | ||
69 | libiberty/configure.ac | 43 - | ||
70 | 13 files changed, 1454 insertions(+), 896 deletions(-) | ||
71 | |||
72 | Index: gcc-4.5.0/configure | ||
73 | =================================================================== | ||
74 | --- gcc-4.5.0.orig/configure 2010-06-25 14:51:59.409382073 -0700 | ||
75 | +++ gcc-4.5.0/configure 2010-06-25 14:52:35.157132702 -0700 | ||
76 | @@ -7130,6 +7130,38 @@ | ||
77 | fi | ||
78 | |||
79 | |||
80 | +# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS | ||
81 | +# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS | ||
82 | +# might also be empty (or "-g", if a non-GCC C++ compiler is in the path). | ||
83 | +# We want to ensure that TARGET libraries (which we know are built with | ||
84 | +# gcc) are built with "-O2 -g", so include those options when setting | ||
85 | +# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET. | ||
86 | +if test "x$CFLAGS_FOR_TARGET" = x; then | ||
87 | + CFLAGS_FOR_TARGET=$CFLAGS | ||
88 | + case " $CFLAGS " in | ||
89 | + *" -O2 "*) ;; | ||
90 | + *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;; | ||
91 | + esac | ||
92 | + case " $CFLAGS " in | ||
93 | + *" -g "* | *" -g3 "*) ;; | ||
94 | + *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;; | ||
95 | + esac | ||
96 | +fi | ||
97 | + | ||
98 | + | ||
99 | +if test "x$CXXFLAGS_FOR_TARGET" = x; then | ||
100 | + CXXFLAGS_FOR_TARGET=$CXXFLAGS | ||
101 | + case " $CXXFLAGS " in | ||
102 | + *" -O2 "*) ;; | ||
103 | + *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS" ;; | ||
104 | + esac | ||
105 | + case " $CXXFLAGS " in | ||
106 | + *" -g "* | *" -g3 "*) ;; | ||
107 | + *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;; | ||
108 | + esac | ||
109 | +fi | ||
110 | + | ||
111 | + | ||
112 | # Handle --with-headers=XXX. If the value is not "yes", the contents of | ||
113 | # the named directory are copied to $(tooldir)/sys-include. | ||
114 | if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-4.5.0_to_svn_162697.patch.bz2 b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-4.5.0_to_svn_162697.patch.bz2 new file mode 100644 index 0000000000..d37a2c0329 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-4.5.0_to_svn_162697.patch.bz2 | |||
Binary files differ | |||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-arm-frename-registers.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-arm-frename-registers.patch new file mode 100644 index 0000000000..280b90358e --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-arm-frename-registers.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35964 | ||
2 | Index: gcc-4.3.0/gcc/regrename.c | ||
3 | =================================================================== | ||
4 | --- gcc-4.3.0.orig/gcc/regrename.c 2008-05-28 08:31:15.000000000 -0700 | ||
5 | +++ gcc-4.3.0/gcc/regrename.c 2008-05-28 08:34:00.000000000 -0700 | ||
6 | @@ -782,6 +782,10 @@ | ||
7 | || (predicated && recog_data.operand_type[i] == OP_OUT)) | ||
8 | recog_data.operand_type[i] = OP_INOUT; | ||
9 | } | ||
10 | + /* Unshare dup_loc RTL */ | ||
11 | + for (i = 0; i < recog_data.n_dups; i++) | ||
12 | + *recog_data.dup_loc[i] = copy_rtx(*recog_data.dup_loc[i]); | ||
13 | + | ||
14 | |||
15 | /* Step 1: Close chains for which we have overlapping reads. */ | ||
16 | for (i = 0; i < n_ops; i++) | ||
17 | @@ -813,7 +817,7 @@ | ||
18 | OP_IN, 0); | ||
19 | |||
20 | for (i = 0; i < recog_data.n_dups; i++) | ||
21 | - *recog_data.dup_loc[i] = copy_rtx (old_dups[i]); | ||
22 | + *recog_data.dup_loc[i] = old_dups[i]; | ||
23 | for (i = 0; i < n_ops; i++) | ||
24 | *recog_data.operand_loc[i] = old_operands[i]; | ||
25 | if (recog_data.n_dups) | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-flags-for-build.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-flags-for-build.patch new file mode 100644 index 0000000000..51892855af --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-flags-for-build.patch | |||
@@ -0,0 +1,178 @@ | |||
1 | Index: gcc-4.5/Makefile.def | ||
2 | =================================================================== | ||
3 | --- gcc-4.5.orig/Makefile.def | ||
4 | +++ gcc-4.5/Makefile.def | ||
5 | @@ -240,6 +240,7 @@ flags_to_pass = { flag= AWK ; }; | ||
6 | flags_to_pass = { flag= BISON ; }; | ||
7 | flags_to_pass = { flag= CC_FOR_BUILD ; }; | ||
8 | flags_to_pass = { flag= CFLAGS_FOR_BUILD ; }; | ||
9 | +flags_to_pass = { flag= CPPFLAGS_FOR_BUILD ; }; | ||
10 | flags_to_pass = { flag= CXX_FOR_BUILD ; }; | ||
11 | flags_to_pass = { flag= EXPECT ; }; | ||
12 | flags_to_pass = { flag= FLEX ; }; | ||
13 | Index: gcc-4.5/gcc/Makefile.in | ||
14 | =================================================================== | ||
15 | --- gcc-4.5.orig/gcc/Makefile.in | ||
16 | +++ gcc-4.5/gcc/Makefile.in | ||
17 | @@ -766,7 +766,7 @@ BUILD_LINKERFLAGS = $(BUILD_CFLAGS) | ||
18 | |||
19 | # Native linker and preprocessor flags. For x-fragment overrides. | ||
20 | BUILD_LDFLAGS=@BUILD_LDFLAGS@ | ||
21 | -BUILD_CPPFLAGS=$(ALL_CPPFLAGS) | ||
22 | +BUILD_CPPFLAGS=$(INCLUDES) @BUILD_CPPFLAGS@ $(X_CPPFLAGS) | ||
23 | |||
24 | # Actual name to use when installing a native compiler. | ||
25 | GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)') | ||
26 | Index: gcc-4.5/gcc/configure.ac | ||
27 | =================================================================== | ||
28 | --- gcc-4.5.orig/gcc/configure.ac | ||
29 | +++ gcc-4.5/gcc/configure.ac | ||
30 | @@ -1798,16 +1798,18 @@ AC_SUBST(inhibit_libc) | ||
31 | # Also, we cannot run fixincludes. | ||
32 | |||
33 | # These are the normal (build=host) settings: | ||
34 | -CC_FOR_BUILD='$(CC)' AC_SUBST(CC_FOR_BUILD) | ||
35 | -BUILD_CFLAGS='$(ALL_CFLAGS)' AC_SUBST(BUILD_CFLAGS) | ||
36 | -BUILD_LDFLAGS='$(LDFLAGS)' AC_SUBST(BUILD_LDFLAGS) | ||
37 | -STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_FIXINC) | ||
38 | +CC_FOR_BUILD='$(CC)' AC_SUBST(CC_FOR_BUILD) | ||
39 | +BUILD_CFLAGS='$(ALL_CFLAGS)' AC_SUBST(BUILD_CFLAGS) | ||
40 | +BUILD_LDFLAGS='$(LDFLAGS)' AC_SUBST(BUILD_LDFLAGS) | ||
41 | +BUILD_CPPFLAGS='$(ALL_CPPFLAGS)' AC_SUBST(BUILD_CPPFLAGS) | ||
42 | +STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_FIXINC) | ||
43 | |||
44 | # And these apply if build != host, or we are generating coverage data | ||
45 | if test x$build != x$host || test "x$coverage_flags" != x | ||
46 | then | ||
47 | BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' | ||
48 | BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)' | ||
49 | + BUILD_CPPFLAGS='$(CPPFLAGS_FOR_BUILD)' | ||
50 | fi | ||
51 | |||
52 | # Expand extra_headers to include complete path. | ||
53 | Index: gcc-4.5/Makefile.in | ||
54 | =================================================================== | ||
55 | --- gcc-4.5.orig/Makefile.in | ||
56 | +++ gcc-4.5/Makefile.in | ||
57 | @@ -333,6 +333,7 @@ AR_FOR_BUILD = @AR_FOR_BUILD@ | ||
58 | AS_FOR_BUILD = @AS_FOR_BUILD@ | ||
59 | CC_FOR_BUILD = @CC_FOR_BUILD@ | ||
60 | CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ | ||
61 | +CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ | ||
62 | CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@ | ||
63 | CXX_FOR_BUILD = @CXX_FOR_BUILD@ | ||
64 | DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@ | ||
65 | @@ -662,6 +663,7 @@ BASE_FLAGS_TO_PASS = \ | ||
66 | "BISON=$(BISON)" \ | ||
67 | "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ | ||
68 | "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ | ||
69 | + "CPPFLAGS_FOR_BUILD=$(CPPFLAGS_FOR_BUILD)" \ | ||
70 | "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \ | ||
71 | "EXPECT=$(EXPECT)" \ | ||
72 | "FLEX=$(FLEX)" \ | ||
73 | Index: gcc-4.5/gcc/configure | ||
74 | =================================================================== | ||
75 | --- gcc-4.5.orig/gcc/configure | ||
76 | +++ gcc-4.5/gcc/configure | ||
77 | @@ -707,6 +707,7 @@ SED | ||
78 | LIBTOOL | ||
79 | collect2 | ||
80 | STMP_FIXINC | ||
81 | +BUILD_CPPFLAGS | ||
82 | BUILD_LDFLAGS | ||
83 | BUILD_CFLAGS | ||
84 | CC_FOR_BUILD | ||
85 | @@ -10982,6 +10983,7 @@ fi | ||
86 | CC_FOR_BUILD='$(CC)' | ||
87 | BUILD_CFLAGS='$(ALL_CFLAGS)' | ||
88 | BUILD_LDFLAGS='$(LDFLAGS)' | ||
89 | +BUILD_CPPFLAGS='$(ALL_CPPFLAGS)' | ||
90 | STMP_FIXINC=stmp-fixinc | ||
91 | |||
92 | # And these apply if build != host, or we are generating coverage data | ||
93 | @@ -10989,6 +10991,7 @@ if test x$build != x$host || test "x$cov | ||
94 | then | ||
95 | BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' | ||
96 | BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)' | ||
97 | + BUILD_CPPFLAGS='$(CPPFLAGS_FOR_BUILD)' | ||
98 | fi | ||
99 | |||
100 | # Expand extra_headers to include complete path. | ||
101 | @@ -17108,7 +17111,7 @@ else | ||
102 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
103 | lt_status=$lt_dlunknown | ||
104 | cat > conftest.$ac_ext <<_LT_EOF | ||
105 | -#line 17111 "configure" | ||
106 | +#line 17114 "configure" | ||
107 | #include "confdefs.h" | ||
108 | |||
109 | #if HAVE_DLFCN_H | ||
110 | @@ -17214,7 +17217,7 @@ else | ||
111 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
112 | lt_status=$lt_dlunknown | ||
113 | cat > conftest.$ac_ext <<_LT_EOF | ||
114 | -#line 17217 "configure" | ||
115 | +#line 17220 "configure" | ||
116 | #include "confdefs.h" | ||
117 | |||
118 | #if HAVE_DLFCN_H | ||
119 | Index: gcc-4.5/Makefile.tpl | ||
120 | =================================================================== | ||
121 | --- gcc-4.5.orig/Makefile.tpl | ||
122 | +++ gcc-4.5/Makefile.tpl | ||
123 | @@ -336,6 +336,7 @@ AR_FOR_BUILD = @AR_FOR_BUILD@ | ||
124 | AS_FOR_BUILD = @AS_FOR_BUILD@ | ||
125 | CC_FOR_BUILD = @CC_FOR_BUILD@ | ||
126 | CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ | ||
127 | +CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ | ||
128 | CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@ | ||
129 | CXX_FOR_BUILD = @CXX_FOR_BUILD@ | ||
130 | DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@ | ||
131 | Index: gcc-4.5/configure | ||
132 | =================================================================== | ||
133 | --- gcc-4.5.orig/configure | ||
134 | +++ gcc-4.5/configure | ||
135 | @@ -651,6 +651,7 @@ GCJ_FOR_BUILD | ||
136 | DLLTOOL_FOR_BUILD | ||
137 | CXX_FOR_BUILD | ||
138 | CXXFLAGS_FOR_BUILD | ||
139 | +CPPFLAGS_FOR_BUILD | ||
140 | CFLAGS_FOR_BUILD | ||
141 | CC_FOR_BUILD | ||
142 | AS_FOR_BUILD | ||
143 | @@ -8036,6 +8037,7 @@ esac | ||
144 | # our build compiler if desired. | ||
145 | if test x"${build}" = x"${host}" ; then | ||
146 | CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}} | ||
147 | + CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-${CPPFLAGS}} | ||
148 | CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CXXFLAGS}} | ||
149 | LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}} | ||
150 | fi | ||
151 | @@ -8101,6 +8103,7 @@ done | ||
152 | |||
153 | |||
154 | |||
155 | + | ||
156 | |||
157 | |||
158 | |||
159 | Index: gcc-4.5/configure.ac | ||
160 | =================================================================== | ||
161 | --- gcc-4.5.orig/configure.ac | ||
162 | +++ gcc-4.5/configure.ac | ||
163 | @@ -3089,6 +3089,7 @@ esac | ||
164 | # our build compiler if desired. | ||
165 | if test x"${build}" = x"${host}" ; then | ||
166 | CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}} | ||
167 | + CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-${CPPFLAGS}} | ||
168 | CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CXXFLAGS}} | ||
169 | LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}} | ||
170 | fi | ||
171 | @@ -3155,6 +3156,7 @@ AC_SUBST(AR_FOR_BUILD) | ||
172 | AC_SUBST(AS_FOR_BUILD) | ||
173 | AC_SUBST(CC_FOR_BUILD) | ||
174 | AC_SUBST(CFLAGS_FOR_BUILD) | ||
175 | +AC_SUBST(CPPFLAGS_FOR_BUILD) | ||
176 | AC_SUBST(CXXFLAGS_FOR_BUILD) | ||
177 | AC_SUBST(CXX_FOR_BUILD) | ||
178 | AC_SUBST(DLLTOOL_FOR_BUILD) | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-ice-hack.dpatch b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-ice-hack.dpatch new file mode 100644 index 0000000000..84c5ef2ebd --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-ice-hack.dpatch | |||
@@ -0,0 +1,331 @@ | |||
1 | #! /bin/sh -e | ||
2 | |||
3 | # DP: Retry the build on an ice, save the calling options and preprocessed | ||
4 | # DP: source when the ice is reproducible. | ||
5 | |||
6 | dir= | ||
7 | if [ $# -eq 3 -a "$2" = '-d' ]; then | ||
8 | pdir="-d $3" | ||
9 | dir="$3/" | ||
10 | elif [ $# -ne 1 ]; then | ||
11 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
12 | exit 1 | ||
13 | fi | ||
14 | case "$1" in | ||
15 | -patch) | ||
16 | patch $pdir -f --no-backup-if-mismatch -p0 < $0 | ||
17 | ;; | ||
18 | -unpatch) | ||
19 | patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 | ||
20 | ;; | ||
21 | *) | ||
22 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
23 | exit 1 | ||
24 | esac | ||
25 | exit 0 | ||
26 | |||
27 | 2004-01-23 Jakub Jelinek <jakub@redhat.com> | ||
28 | |||
29 | * system.h (ICE_EXIT_CODE): Define. | ||
30 | * gcc.c (execute): Don't free first string early, but at the end | ||
31 | of the function. Call retry_ice if compiler exited with | ||
32 | ICE_EXIT_CODE. | ||
33 | (retry_ice): New function. | ||
34 | * diagnostic.c (diagnostic_count_diagnostic, | ||
35 | diagnostic_action_after_output, error_recursion): Exit with | ||
36 | ICE_EXIT_CODE instead of FATAL_EXIT_CODE. | ||
37 | |||
38 | --- gcc/diagnostic.c.orig 2007-09-30 10:48:13.000000000 +0000 | ||
39 | +++ gcc/diagnostic.c 2007-09-30 10:49:57.000000000 +0000 | ||
40 | @@ -244,7 +244,7 @@ | ||
41 | fnotice (stderr, "Please submit a full bug report,\n" | ||
42 | "with preprocessed source if appropriate.\n" | ||
43 | "See %s for instructions.\n", bug_report_url); | ||
44 | - exit (ICE_EXIT_CODE); | ||
45 | + exit (FATAL_EXIT_CODE); | ||
46 | |||
47 | case DK_FATAL: | ||
48 | if (context->abort_on_error) | ||
49 | --- gcc/gcc.c.orig 2007-09-30 10:48:13.000000000 +0000 | ||
50 | +++ gcc/gcc.c 2007-09-30 10:48:39.000000000 +0000 | ||
51 | @@ -357,6 +357,9 @@ | ||
52 | #if defined(HAVE_TARGET_OBJECT_SUFFIX) || defined(HAVE_TARGET_EXECUTABLE_SUFFIX) | ||
53 | static const char *convert_filename (const char *, int, int); | ||
54 | #endif | ||
55 | +#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS)) | ||
56 | +static void retry_ice (const char *prog, const char **argv); | ||
57 | +#endif | ||
58 | |||
59 | static const char *getenv_spec_function (int, const char **); | ||
60 | static const char *if_exists_spec_function (int, const char **); | ||
61 | @@ -2999,7 +3002,7 @@ | ||
62 | } | ||
63 | } | ||
64 | |||
65 | - if (string != commands[i].prog) | ||
66 | + if (i && string != commands[i].prog) | ||
67 | free (CONST_CAST (char *, string)); | ||
68 | } | ||
69 | |||
70 | @@ -3056,6 +3059,16 @@ | ||
71 | else if (WIFEXITED (status) | ||
72 | && WEXITSTATUS (status) >= MIN_FATAL_STATUS) | ||
73 | { | ||
74 | +#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS)) | ||
75 | + /* For ICEs in cc1, cc1obj, cc1plus see if it is | ||
76 | + reproducible or not. */ | ||
77 | + char *p; | ||
78 | + if (WEXITSTATUS (status) == ICE_EXIT_CODE | ||
79 | + && i == 0 | ||
80 | + && (p = strrchr (commands[0].argv[0], DIR_SEPARATOR)) | ||
81 | + && ! strncmp (p + 1, "cc1", 3)) | ||
82 | + retry_ice (commands[0].prog, commands[0].argv); | ||
83 | +#endif | ||
84 | if (WEXITSTATUS (status) > greatest_status) | ||
85 | greatest_status = WEXITSTATUS (status); | ||
86 | ret_code = -1; | ||
87 | @@ -3076,6 +3089,9 @@ | ||
88 | } | ||
89 | } | ||
90 | |||
91 | + if (commands[0].argv[0] != commands[0].prog) | ||
92 | + free ((PTR) commands[0].argv[0]); | ||
93 | + | ||
94 | return ret_code; | ||
95 | } | ||
96 | } | ||
97 | @@ -6016,6 +6032,224 @@ | ||
98 | switches[switchnum].validated = 1; | ||
99 | } | ||
100 | |||
101 | +#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS)) | ||
102 | +#define RETRY_ICE_ATTEMPTS 2 | ||
103 | + | ||
104 | +static void | ||
105 | +retry_ice (const char *prog, const char **argv) | ||
106 | +{ | ||
107 | + int nargs, out_arg = -1, quiet = 0, attempt; | ||
108 | + int pid, retries, sleep_interval; | ||
109 | + const char **new_argv; | ||
110 | + char *temp_filenames[RETRY_ICE_ATTEMPTS * 2 + 2]; | ||
111 | + | ||
112 | + if (input_filename == NULL || ! strcmp (input_filename, "-")) | ||
113 | + return; | ||
114 | + | ||
115 | + for (nargs = 0; argv[nargs] != NULL; ++nargs) | ||
116 | + /* Only retry compiler ICEs, not preprocessor ones. */ | ||
117 | + if (! strcmp (argv[nargs], "-E")) | ||
118 | + return; | ||
119 | + else if (argv[nargs][0] == '-' && argv[nargs][1] == 'o') | ||
120 | + { | ||
121 | + if (out_arg == -1) | ||
122 | + out_arg = nargs; | ||
123 | + else | ||
124 | + return; | ||
125 | + } | ||
126 | + /* If the compiler is going to output any time information, | ||
127 | + it might vary between invocations. */ | ||
128 | + else if (! strcmp (argv[nargs], "-quiet")) | ||
129 | + quiet = 1; | ||
130 | + else if (! strcmp (argv[nargs], "-ftime-report")) | ||
131 | + return; | ||
132 | + | ||
133 | + if (out_arg == -1 || !quiet) | ||
134 | + return; | ||
135 | + | ||
136 | + memset (temp_filenames, '\0', sizeof (temp_filenames)); | ||
137 | + new_argv = alloca ((nargs + 3) * sizeof (const char *)); | ||
138 | + memcpy (new_argv, argv, (nargs + 1) * sizeof (const char *)); | ||
139 | + new_argv[nargs++] = "-frandom-seed=0"; | ||
140 | + new_argv[nargs] = NULL; | ||
141 | + if (new_argv[out_arg][2] == '\0') | ||
142 | + new_argv[out_arg + 1] = "-"; | ||
143 | + else | ||
144 | + new_argv[out_arg] = "-o-"; | ||
145 | + | ||
146 | + for (attempt = 0; attempt < RETRY_ICE_ATTEMPTS + 1; ++attempt) | ||
147 | + { | ||
148 | + int fd = -1; | ||
149 | + int status; | ||
150 | + | ||
151 | + temp_filenames[attempt * 2] = make_temp_file (".out"); | ||
152 | + temp_filenames[attempt * 2 + 1] = make_temp_file (".err"); | ||
153 | + | ||
154 | + if (attempt == RETRY_ICE_ATTEMPTS) | ||
155 | + { | ||
156 | + int i; | ||
157 | + int fd1, fd2; | ||
158 | + struct stat st1, st2; | ||
159 | + size_t n, len; | ||
160 | + char *buf; | ||
161 | + | ||
162 | + buf = xmalloc (8192); | ||
163 | + | ||
164 | + for (i = 0; i < 2; ++i) | ||
165 | + { | ||
166 | + fd1 = open (temp_filenames[i], O_RDONLY); | ||
167 | + fd2 = open (temp_filenames[2 + i], O_RDONLY); | ||
168 | + | ||
169 | + if (fd1 < 0 || fd2 < 0) | ||
170 | + { | ||
171 | + i = -1; | ||
172 | + close (fd1); | ||
173 | + close (fd2); | ||
174 | + break; | ||
175 | + } | ||
176 | + | ||
177 | + if (fstat (fd1, &st1) < 0 || fstat (fd2, &st2) < 0) | ||
178 | + { | ||
179 | + i = -1; | ||
180 | + close (fd1); | ||
181 | + close (fd2); | ||
182 | + break; | ||
183 | + } | ||
184 | + | ||
185 | + if (st1.st_size != st2.st_size) | ||
186 | + { | ||
187 | + close (fd1); | ||
188 | + close (fd2); | ||
189 | + break; | ||
190 | + } | ||
191 | + | ||
192 | + len = 0; | ||
193 | + for (n = st1.st_size; n; n -= len) | ||
194 | + { | ||
195 | + len = n; | ||
196 | + if (len > 4096) | ||
197 | + len = 4096; | ||
198 | + | ||
199 | + if (read (fd1, buf, len) != (int) len | ||
200 | + || read (fd2, buf + 4096, len) != (int) len) | ||
201 | + { | ||
202 | + i = -1; | ||
203 | + break; | ||
204 | + } | ||
205 | + | ||
206 | + if (memcmp (buf, buf + 4096, len) != 0) | ||
207 | + break; | ||
208 | + } | ||
209 | + | ||
210 | + close (fd1); | ||
211 | + close (fd2); | ||
212 | + | ||
213 | + if (n) | ||
214 | + break; | ||
215 | + } | ||
216 | + | ||
217 | + free (buf); | ||
218 | + if (i == -1) | ||
219 | + break; | ||
220 | + | ||
221 | + if (i != 2) | ||
222 | + { | ||
223 | + notice ("The bug is not reproducible, so it is likely a hardware or OS problem.\n"); | ||
224 | + break; | ||
225 | + } | ||
226 | + | ||
227 | + fd = open (temp_filenames[attempt * 2], O_RDWR); | ||
228 | + if (fd < 0) | ||
229 | + break; | ||
230 | + write (fd, "//", 2); | ||
231 | + for (i = 0; i < nargs; i++) | ||
232 | + { | ||
233 | + write (fd, " ", 1); | ||
234 | + write (fd, new_argv[i], strlen (new_argv[i])); | ||
235 | + } | ||
236 | + write (fd, "\n", 1); | ||
237 | + new_argv[nargs] = "-E"; | ||
238 | + new_argv[nargs + 1] = NULL; | ||
239 | + } | ||
240 | + | ||
241 | + /* Fork a subprocess; wait and retry if it fails. */ | ||
242 | + sleep_interval = 1; | ||
243 | + pid = -1; | ||
244 | + for (retries = 0; retries < 4; retries++) | ||
245 | + { | ||
246 | + pid = fork (); | ||
247 | + if (pid >= 0) | ||
248 | + break; | ||
249 | + sleep (sleep_interval); | ||
250 | + sleep_interval *= 2; | ||
251 | + } | ||
252 | + | ||
253 | + if (pid < 0) | ||
254 | + break; | ||
255 | + else if (pid == 0) | ||
256 | + { | ||
257 | + if (attempt != RETRY_ICE_ATTEMPTS) | ||
258 | + fd = open (temp_filenames[attempt * 2], O_RDWR); | ||
259 | + if (fd < 0) | ||
260 | + exit (-1); | ||
261 | + if (fd != 1) | ||
262 | + { | ||
263 | + close (1); | ||
264 | + dup (fd); | ||
265 | + close (fd); | ||
266 | + } | ||
267 | + | ||
268 | + fd = open (temp_filenames[attempt * 2 + 1], O_RDWR); | ||
269 | + if (fd < 0) | ||
270 | + exit (-1); | ||
271 | + if (fd != 2) | ||
272 | + { | ||
273 | + close (2); | ||
274 | + dup (fd); | ||
275 | + close (fd); | ||
276 | + } | ||
277 | + | ||
278 | + if (prog == new_argv[0]) | ||
279 | + execvp (prog, (char *const *) new_argv); | ||
280 | + else | ||
281 | + execv (new_argv[0], (char *const *) new_argv); | ||
282 | + exit (-1); | ||
283 | + } | ||
284 | + | ||
285 | + if (waitpid (pid, &status, 0) < 0) | ||
286 | + break; | ||
287 | + | ||
288 | + if (attempt < RETRY_ICE_ATTEMPTS | ||
289 | + && (! WIFEXITED (status) || WEXITSTATUS (status) != ICE_EXIT_CODE)) | ||
290 | + { | ||
291 | + notice ("The bug is not reproducible, so it is likely a hardware or OS problem.\n"); | ||
292 | + break; | ||
293 | + } | ||
294 | + else if (attempt == RETRY_ICE_ATTEMPTS) | ||
295 | + { | ||
296 | + close (fd); | ||
297 | + if (WIFEXITED (status) | ||
298 | + && WEXITSTATUS (status) == SUCCESS_EXIT_CODE) | ||
299 | + { | ||
300 | + notice ("Preprocessed source stored into %s file, please attach this to your bugreport.\n", | ||
301 | + temp_filenames[attempt * 2]); | ||
302 | + /* Make sure it is not deleted. */ | ||
303 | + free (temp_filenames[attempt * 2]); | ||
304 | + temp_filenames[attempt * 2] = NULL; | ||
305 | + break; | ||
306 | + } | ||
307 | + } | ||
308 | + } | ||
309 | + | ||
310 | + for (attempt = 0; attempt < RETRY_ICE_ATTEMPTS * 2 + 2; attempt++) | ||
311 | + if (temp_filenames[attempt]) | ||
312 | + { | ||
313 | + unlink (temp_filenames[attempt]); | ||
314 | + free (temp_filenames[attempt]); | ||
315 | + } | ||
316 | +} | ||
317 | +#endif | ||
318 | + | ||
319 | /* Search for a file named NAME trying various prefixes including the | ||
320 | user's -B prefix and some standard ones. | ||
321 | Return the absolute file name found. If nothing is found, return NAME. */ | ||
322 | --- gcc/Makefile.in.orig 2007-09-30 10:48:13.000000000 +0000 | ||
323 | +++ gcc/Makefile.in 2007-09-30 10:48:39.000000000 +0000 | ||
324 | @@ -192,6 +192,7 @@ | ||
325 | build/gengtype-lex.o-warn = -Wno-error | ||
326 | # SYSCALLS.c misses prototypes | ||
327 | SYSCALLS.c.X-warn = -Wno-strict-prototypes -Wno-error | ||
328 | +build/gcc.o-warn = -Wno-error | ||
329 | |||
330 | # All warnings have to be shut off in stage1 if the compiler used then | ||
331 | # isn't gcc; configure determines that. WARN_CFLAGS will be either | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-poison-system-directories.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-poison-system-directories.patch new file mode 100644 index 0000000000..e68a2de2a2 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-poison-system-directories.patch | |||
@@ -0,0 +1,149 @@ | |||
1 | gcc/ | ||
2 | 2008-07-02 Joseph Myers <joseph@codesourcery.com> | ||
3 | * c-incpath.c: Include toplev.h. | ||
4 | (merge_include_chains): Use warning instead of cpp_error for | ||
5 | system directory poisoning diagnostic. | ||
6 | * Makefile.in (c-incpath.o): Depend on toplev.h. | ||
7 | * gcc.c (LINK_COMMAND_SPEC): Pass | ||
8 | --error-poison-system-directories if | ||
9 | -Werror=poison-system-directories. | ||
10 | |||
11 | 2007-06-13 Joseph Myers <joseph@codesourcery.com> | ||
12 | * common.opt (--Wno-poison-system-directories): New. | ||
13 | * doc/invoke.texi (-Wno-poison-system-directories): Document. | ||
14 | * c-incpath.c: Include flags.h. | ||
15 | (merge_include_chains): Check flag_poison_system_directories. | ||
16 | * gcc.c (LINK_COMMAND_SPEC): Pass --no-poison-system-directories | ||
17 | to linker if -Wno-poison-system-directories. | ||
18 | * Makefile.in (c-incpath.o): Depend on $(FLAGS_H). | ||
19 | |||
20 | 2007-03-20 Daniel Jacobowitz <dan@codesourcery.com> | ||
21 | Joseph Myers <joseph@codesourcery.com> | ||
22 | * configure.ac (--enable-poison-system-directories): New option. | ||
23 | * configure, config.in: Regenerate. | ||
24 | * c-incpath.c (merge_include_chains): If | ||
25 | ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of | ||
26 | /usr/include, /usr/local/include or /usr/X11R6/include. | ||
27 | |||
28 | Index: gcc-4.5.0/gcc/common.opt | ||
29 | =================================================================== | ||
30 | --- gcc-4.5.0.orig/gcc/common.opt 2010-03-17 20:01:09.000000000 -0700 | ||
31 | +++ gcc-4.5.0/gcc/common.opt 2010-06-25 11:35:39.965383734 -0700 | ||
32 | @@ -152,6 +152,10 @@ | ||
33 | Common Var(warn_padded) Warning | ||
34 | Warn when padding is required to align structure members | ||
35 | |||
36 | +Wpoison-system-directories | ||
37 | +Common Var(flag_poison_system_directories) Init(1) | ||
38 | +Warn for -I and -L options using system directories if cross compiling | ||
39 | + | ||
40 | Wshadow | ||
41 | Common Var(warn_shadow) Warning | ||
42 | Warn when one local variable shadows another | ||
43 | Index: gcc-4.5.0/gcc/config.in | ||
44 | =================================================================== | ||
45 | --- gcc-4.5.0.orig/gcc/config.in 2010-04-14 02:30:07.000000000 -0700 | ||
46 | +++ gcc-4.5.0/gcc/config.in 2010-06-25 11:35:39.969383588 -0700 | ||
47 | @@ -132,6 +132,12 @@ | ||
48 | #endif | ||
49 | |||
50 | |||
51 | +/* Define to warn for use of native system header directories */ | ||
52 | +#ifndef USED_FOR_TARGET | ||
53 | +#undef ENABLE_POISON_SYSTEM_DIRECTORIES | ||
54 | +#endif | ||
55 | + | ||
56 | + | ||
57 | /* Define if you want all operations on RTL (the basic data structure of the | ||
58 | optimizer and back end) to be checked for dynamic type safety at runtime. | ||
59 | This is quite expensive. */ | ||
60 | Index: gcc-4.5.0/gcc/configure.ac | ||
61 | =================================================================== | ||
62 | --- gcc-4.5.0.orig/gcc/configure.ac 2010-06-25 11:34:01.433382161 -0700 | ||
63 | +++ gcc-4.5.0/gcc/configure.ac 2010-06-25 11:35:39.969383588 -0700 | ||
64 | @@ -4276,6 +4276,16 @@ | ||
65 | fi) | ||
66 | AC_SUBST(slibdir) | ||
67 | |||
68 | +AC_ARG_ENABLE([poison-system-directories], | ||
69 | + AS_HELP_STRING([--enable-poison-system-directories], | ||
70 | + [warn for use of native system header directories]),, | ||
71 | + [enable_poison_system_directories=no]) | ||
72 | +if test "x${enable_poison_system_directories}" = "xyes"; then | ||
73 | + AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], | ||
74 | + [1], | ||
75 | + [Define to warn for use of native system header directories]) | ||
76 | +fi | ||
77 | + | ||
78 | # Substitute configuration variables | ||
79 | AC_SUBST(subdirs) | ||
80 | AC_SUBST(srcdir) | ||
81 | Index: gcc-4.5.0/gcc/doc/invoke.texi | ||
82 | =================================================================== | ||
83 | --- gcc-4.5.0.orig/gcc/doc/invoke.texi 2010-04-06 07:02:22.000000000 -0700 | ||
84 | +++ gcc-4.5.0/gcc/doc/invoke.texi 2010-06-25 11:35:39.992666345 -0700 | ||
85 | @@ -252,6 +252,7 @@ | ||
86 | -Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded @gol | ||
87 | -Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format @gol | ||
88 | -Wpointer-arith -Wno-pointer-to-int-cast @gol | ||
89 | +-Wno-poison-system-directories @gol | ||
90 | -Wredundant-decls @gol | ||
91 | -Wreturn-type -Wsequence-point -Wshadow @gol | ||
92 | -Wsign-compare -Wsign-conversion -Wstack-protector @gol | ||
93 | @@ -3603,6 +3604,14 @@ | ||
94 | option will @emph{not} warn about unknown pragmas in system | ||
95 | headers---for that, @option{-Wunknown-pragmas} must also be used. | ||
96 | |||
97 | +@item -Wno-poison-system-directories | ||
98 | +@opindex Wno-poison-system-directories | ||
99 | +Do not warn for @option{-I} or @option{-L} options using system | ||
100 | +directories such as @file{/usr/include} when cross compiling. This | ||
101 | +option is intended for use in chroot environments when such | ||
102 | +directories contain the correct headers and libraries for the target | ||
103 | +system rather than the host. | ||
104 | + | ||
105 | @item -Wfloat-equal | ||
106 | @opindex Wfloat-equal | ||
107 | @opindex Wno-float-equal | ||
108 | Index: gcc-4.5.0/gcc/gcc.c | ||
109 | =================================================================== | ||
110 | --- gcc-4.5.0.orig/gcc/gcc.c 2010-02-11 04:23:08.000000000 -0800 | ||
111 | +++ gcc-4.5.0/gcc/gcc.c 2010-06-25 11:35:40.009381858 -0700 | ||
112 | @@ -792,6 +792,8 @@ | ||
113 | %{flto} %{fwhopr} %l " LINK_PIE_SPEC \ | ||
114 | "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\ | ||
115 | %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\ | ||
116 | + %{Wno-poison-system-directories:--no-poison-system-directories}\ | ||
117 | + %{Werror=poison-system-directories:--error-poison-system-directories}\ | ||
118 | %{static:} %{L*} %(mfwrap) %(link_libgcc) %o\ | ||
119 | %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)} %(mflib)\ | ||
120 | %{fprofile-arcs|fprofile-generate*|coverage:-lgcov}\ | ||
121 | Index: gcc-4.5.0/gcc/incpath.c | ||
122 | =================================================================== | ||
123 | --- gcc-4.5.0.orig/gcc/incpath.c 2009-11-25 02:55:54.000000000 -0800 | ||
124 | +++ gcc-4.5.0/gcc/incpath.c 2010-06-25 11:35:40.017209818 -0700 | ||
125 | @@ -353,6 +353,24 @@ | ||
126 | } | ||
127 | fprintf (stderr, _("End of search list.\n")); | ||
128 | } | ||
129 | + | ||
130 | +#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES | ||
131 | + if (flag_poison_system_directories) | ||
132 | + { | ||
133 | + struct cpp_dir *p; | ||
134 | + | ||
135 | + for (p = heads[QUOTE]; p; p = p->next) | ||
136 | + { | ||
137 | + if ((!strncmp (p->name, "/usr/include", 12)) | ||
138 | + || (!strncmp (p->name, "/usr/local/include", 18)) | ||
139 | + || (!strncmp (p->name, "/usr/X11R6/include", 18))) | ||
140 | + warning (OPT_Wpoison_system_directories, | ||
141 | + "include location \"%s\" is unsafe for " | ||
142 | + "cross-compilation", | ||
143 | + p->name); | ||
144 | + } | ||
145 | + } | ||
146 | +#endif | ||
147 | } | ||
148 | |||
149 | /* Use given -I paths for #include "..." but not #include <...>, and | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-pr43698-arm-rev-instr.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-pr43698-arm-rev-instr.patch new file mode 100644 index 0000000000..61c883e1ff --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-pr43698-arm-rev-instr.patch | |||
@@ -0,0 +1,117 @@ | |||
1 | backport http://gcc.gnu.org/viewcvs?view=revision&revision=162404 | ||
2 | from trunk | ||
3 | |||
4 | Which fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43698 | ||
5 | |||
6 | 2010-07-22 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> | ||
7 | |||
8 | PR target/43698 | ||
9 | * config/arm/arm.md: Split arm_rev into *arm_rev | ||
10 | and *thumb1_rev. Set *arm_rev to be predicable. | ||
11 | |||
12 | 2010-07-22 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> | ||
13 | |||
14 | PR target/43698 | ||
15 | * gcc.target/arm/pr43698.c: New test. | ||
16 | |||
17 | |||
18 | /scratch/oe/sysroots/i686-linux/usr/share/quilt/compat/date | ||
19 | Usage: date [OPTION]... [+FORMAT] | ||
20 | Display the current time in the given FORMAT. | ||
21 | |||
22 | -d, --date=STRING display time described by STRING, not `now' | ||
23 | -f, --file=DATEFILE like --date once for each line of DATEFILE | ||
24 | -R, --rfc-822 output RFC-822 compliant date string | ||
25 | -u, --utc, --universal print or set Coordinated Universal Time | ||
26 | --help display this help and exit | ||
27 | date is /scratch/oe/sysroots/i686-linux/usr/share/quilt/compat/date | ||
28 | date is /scratch/oe/sysroots/i686-linux/usr/share/quilt/compat/date | ||
29 | date is /bin/date | ||
30 | date is /scratch/oe/sysroots/i686-linux/usr/share/quilt/compat/date | ||
31 | date is /scratch/oe/sysroots/i686-linux/usr/share/quilt/compat/date | ||
32 | date is /bin/date | ||
33 | date is /scratch/oe/sysroots/i686-linux/usr/share/quilt/compat/date | ||
34 | date is /scratch/oe/sysroots/i686-linux/usr/share/quilt/compat/date | ||
35 | date is /bin/date | ||
36 | date is /scratch/oe/sysroots/i686-linux/usr/share/quilt/compat/date | ||
37 | date is /scratch/oe/sysroots/i686-linux/usr/share/quilt/compat/date | ||
38 | date is /bin/date | ||
39 | date | ||
40 | Khem | ||
41 | Index: gcc-4.5/gcc/config/arm/arm.md | ||
42 | =================================================================== | ||
43 | --- gcc-4.5.orig/gcc/config/arm/arm.md 2010-07-20 20:31:25.000000000 -0700 | ||
44 | +++ gcc-4.5/gcc/config/arm/arm.md 2010-07-22 14:55:54.303169081 -0700 | ||
45 | @@ -11197,15 +11197,21 @@ | ||
46 | (set_attr "length" "4")] | ||
47 | ) | ||
48 | |||
49 | -(define_insn "arm_rev" | ||
50 | +(define_insn "*arm_rev" | ||
51 | [(set (match_operand:SI 0 "s_register_operand" "=r") | ||
52 | (bswap:SI (match_operand:SI 1 "s_register_operand" "r")))] | ||
53 | - "TARGET_EITHER && arm_arch6" | ||
54 | - "rev\t%0, %1" | ||
55 | - [(set (attr "length") | ||
56 | - (if_then_else (eq_attr "is_thumb" "yes") | ||
57 | - (const_int 2) | ||
58 | - (const_int 4)))] | ||
59 | + "TARGET_32BIT && arm_arch6" | ||
60 | + "rev%?\t%0, %1" | ||
61 | + [(set_attr "predicable" "yes") | ||
62 | + (set_attr "length" "4")] | ||
63 | +) | ||
64 | + | ||
65 | +(define_insn "*thumb1_rev" | ||
66 | + [(set (match_operand:SI 0 "s_register_operand" "=l") | ||
67 | + (bswap:SI (match_operand:SI 1 "s_register_operand" "l")))] | ||
68 | + "TARGET_THUMB1 && arm_arch6" | ||
69 | + "rev\t%0, %1" | ||
70 | + [(set_attr "length" "2")] | ||
71 | ) | ||
72 | |||
73 | (define_expand "arm_legacy_rev" | ||
74 | Index: gcc-4.5/gcc/testsuite/gcc.target/arm/pr43698.c | ||
75 | =================================================================== | ||
76 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
77 | +++ gcc-4.5/gcc/testsuite/gcc.target/arm/pr43698.c 2010-07-22 14:56:35.406670213 -0700 | ||
78 | @@ -0,0 +1,39 @@ | ||
79 | +/* { dg-do run } */ | ||
80 | +/* { dg-options "-Os -march=armv7-a" } */ | ||
81 | +#include <stdint.h> | ||
82 | +#include <stdlib.h> | ||
83 | + | ||
84 | + | ||
85 | +char do_reverse_endian = 0; | ||
86 | + | ||
87 | +# define bswap_32(x) \ | ||
88 | + ((((x) & 0xff000000) >> 24) | \ | ||
89 | + (((x) & 0x00ff0000) >> 8) | \ | ||
90 | + (((x) & 0x0000ff00) << 8) | \ | ||
91 | + (((x) & 0x000000ff) << 24)) | ||
92 | + | ||
93 | +#define EGET(X) \ | ||
94 | + (__extension__ ({ \ | ||
95 | + uint64_t __res; \ | ||
96 | + if (!do_reverse_endian) { __res = (X); \ | ||
97 | + } else if (sizeof(X) == 4) { __res = bswap_32((X)); \ | ||
98 | + } \ | ||
99 | + __res; \ | ||
100 | + })) | ||
101 | + | ||
102 | +void __attribute__((noinline)) X(char **phdr, char **data, int *phoff) | ||
103 | +{ | ||
104 | + *phdr = *data + EGET(*phoff); | ||
105 | +} | ||
106 | + | ||
107 | +int main() | ||
108 | +{ | ||
109 | + char *phdr; | ||
110 | + char *data = (char *)0x40164000; | ||
111 | + int phoff = 0x34; | ||
112 | + X(&phdr, &data, &phoff); | ||
113 | + if (phdr != (char *)0x40164034) | ||
114 | + abort (); | ||
115 | + exit (0); | ||
116 | +} | ||
117 | + | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-uclibc-locale-ctype_touplow_t.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-uclibc-locale-ctype_touplow_t.patch new file mode 100644 index 0000000000..4f94fc9d66 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-uclibc-locale-ctype_touplow_t.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | Index: gcc-4.5/libstdc++-v3/config/locale/generic/c_locale.h | ||
2 | =================================================================== | ||
3 | --- gcc-4.5.orig/libstdc++-v3/config/locale/generic/c_locale.h 2010-06-30 22:30:53.993316002 -0700 | ||
4 | +++ gcc-4.5/libstdc++-v3/config/locale/generic/c_locale.h 2010-06-30 22:31:26.043316001 -0700 | ||
5 | @@ -41,12 +41,17 @@ | ||
6 | |||
7 | #include <clocale> | ||
8 | #include <cstddef> | ||
9 | +#include <features.h> | ||
10 | +#include <ctype.h> | ||
11 | |||
12 | #define _GLIBCXX_NUM_CATEGORIES 0 | ||
13 | |||
14 | _GLIBCXX_BEGIN_NAMESPACE(std) | ||
15 | - | ||
16 | - typedef int* __c_locale; | ||
17 | +#ifdef __UCLIBC__ | ||
18 | + typedef __ctype_touplow_t* __c_locale; | ||
19 | +#else | ||
20 | + typedef int* __c_locale; | ||
21 | +#endif | ||
22 | |||
23 | // Convert numeric value of type double and long double to string and | ||
24 | // return length of string. If vsnprintf is available use it, otherwise | ||
25 | Index: gcc-4.5/libstdc++-v3/config/os/gnu-linux/ctype_base.h | ||
26 | =================================================================== | ||
27 | --- gcc-4.5.orig/libstdc++-v3/config/os/gnu-linux/ctype_base.h 2010-06-30 22:30:54.013316002 -0700 | ||
28 | +++ gcc-4.5/libstdc++-v3/config/os/gnu-linux/ctype_base.h 2010-06-30 22:31:26.053316001 -0700 | ||
29 | @@ -33,14 +33,21 @@ | ||
30 | */ | ||
31 | |||
32 | // Information as gleaned from /usr/include/ctype.h | ||
33 | - | ||
34 | + | ||
35 | +#include <features.h> | ||
36 | +#include <ctype.h> | ||
37 | + | ||
38 | _GLIBCXX_BEGIN_NAMESPACE(std) | ||
39 | |||
40 | /// @brief Base class for ctype. | ||
41 | struct ctype_base | ||
42 | { | ||
43 | // Non-standard typedefs. | ||
44 | - typedef const int* __to_type; | ||
45 | +#ifdef __UCLIBC__ | ||
46 | + typedef const __ctype_touplow_t* __to_type; | ||
47 | +#else | ||
48 | + typedef const int* __to_type; | ||
49 | +#endif | ||
50 | |||
51 | // NB: Offsets into ctype<char>::_M_table force a particular size | ||
52 | // on the mask type. Because of this, we don't use an enum. | ||
53 | Index: gcc-4.5/libstdc++-v3/config/locale/generic/c_locale.cc | ||
54 | =================================================================== | ||
55 | --- gcc-4.5.orig/libstdc++-v3/config/locale/generic/c_locale.cc 2010-06-28 12:12:42.000000000 -0700 | ||
56 | +++ gcc-4.5/libstdc++-v3/config/locale/generic/c_locale.cc 2010-06-30 22:31:26.063316001 -0700 | ||
57 | @@ -256,5 +256,10 @@ _GLIBCXX_END_NAMESPACE | ||
58 | #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT | ||
59 | #define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \ | ||
60 | extern "C" void ldbl (void) __attribute__ ((alias (#dbl))) | ||
61 | +#ifdef __UCLIBC__ | ||
62 | +// This is because __c_locale is of type __ctype_touplow_t* which is short on uclibc. for glibc its int* | ||
63 | +_GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPs, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPs); | ||
64 | +#else | ||
65 | _GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPi, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPi); | ||
66 | +#endif | ||
67 | #endif // _GLIBCXX_LONG_DOUBLE_COMPAT | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/gcc_revert_base_version_to_4.5.0.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc_revert_base_version_to_4.5.0.patch new file mode 100644 index 0000000000..5f134ef338 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc_revert_base_version_to_4.5.0.patch | |||
@@ -0,0 +1,9 @@ | |||
1 | the svn patch changed the BASE-VER to 4.5.1, bring it back to 4.5.0 | ||
2 | - Nitin A Kamble nitin.a.kamble@intel.com | ||
3 | - 2010/07/20 | ||
4 | |||
5 | --- gcc-4.5.0/gcc/BASE-VER 2010-07-20 00:57:37.000000000 -0700 | ||
6 | +++ gcc-4.5.0.new/gcc/BASE-VER 2010-07-20 01:06:17.000000000 -0700 | ||
7 | @@ -1 +1 @@ | ||
8 | -4.5.1 | ||
9 | +4.5.0 | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/libstdc++-emit-__cxa_end_cleanup-in-text.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/libstdc++-emit-__cxa_end_cleanup-in-text.patch new file mode 100644 index 0000000000..ada36a5914 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/libstdc++-emit-__cxa_end_cleanup-in-text.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | 2010-06-07 Khem Raj <raj.khem@gmail.com> | ||
2 | |||
3 | * libsupc++/eh_arm.cc (__cxa_end_cleanup): Use .pushsection/.popsection | ||
4 | to emit inline assembly into .text section. | ||
5 | |||
6 | Index: gcc-4.5/libstdc++-v3/libsupc++/eh_arm.cc | ||
7 | =================================================================== | ||
8 | --- gcc-4.5.orig/libstdc++-v3/libsupc++/eh_arm.cc 2010-06-04 23:20:18.000000000 -0700 | ||
9 | +++ gcc-4.5/libstdc++-v3/libsupc++/eh_arm.cc 2010-06-08 11:27:34.247541722 -0700 | ||
10 | @@ -157,22 +157,26 @@ __gnu_end_cleanup(void) | ||
11 | // Assembly wrapper to call __gnu_end_cleanup without clobbering r1-r3. | ||
12 | // Also push r4 to preserve stack alignment. | ||
13 | #ifdef __thumb__ | ||
14 | -asm (".global __cxa_end_cleanup\n" | ||
15 | +asm (" .pushsection .text.__cxa_end_cleanup\n" | ||
16 | +" .global __cxa_end_cleanup\n" | ||
17 | " .type __cxa_end_cleanup, \"function\"\n" | ||
18 | " .thumb_func\n" | ||
19 | "__cxa_end_cleanup:\n" | ||
20 | " push\t{r1, r2, r3, r4}\n" | ||
21 | " bl\t__gnu_end_cleanup\n" | ||
22 | " pop\t{r1, r2, r3, r4}\n" | ||
23 | -" bl\t_Unwind_Resume @ Never returns\n"); | ||
24 | +" bl\t_Unwind_Resume @ Never returns\n" | ||
25 | +" .popsection\n"); | ||
26 | #else | ||
27 | -asm (".global __cxa_end_cleanup\n" | ||
28 | +asm (" .pushsection .text.__cxa_end_cleanup\n" | ||
29 | +" .global __cxa_end_cleanup\n" | ||
30 | " .type __cxa_end_cleanup, \"function\"\n" | ||
31 | "__cxa_end_cleanup:\n" | ||
32 | " stmfd\tsp!, {r1, r2, r3, r4}\n" | ||
33 | " bl\t__gnu_end_cleanup\n" | ||
34 | " ldmfd\tsp!, {r1, r2, r3, r4}\n" | ||
35 | -" bl\t_Unwind_Resume @ Never returns\n"); | ||
36 | +" bl\t_Unwind_Resume @ Never returns\n" | ||
37 | +" .popsection\n"); | ||
38 | #endif | ||
39 | |||
40 | #endif | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/libstdc++-pic.dpatch b/meta/recipes-devtools/gcc/gcc-4.5.0/libstdc++-pic.dpatch new file mode 100644 index 0000000000..70c9e81542 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/libstdc++-pic.dpatch | |||
@@ -0,0 +1,71 @@ | |||
1 | #! /bin/sh -e | ||
2 | |||
3 | # DP: Build and install libstdc++_pic.a library. | ||
4 | |||
5 | dir= | ||
6 | if [ $# -eq 3 -a "$2" = '-d' ]; then | ||
7 | pdir="-d $3" | ||
8 | dir="$3/" | ||
9 | elif [ $# -ne 1 ]; then | ||
10 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
11 | exit 1 | ||
12 | fi | ||
13 | case "$1" in | ||
14 | -patch) | ||
15 | patch $pdir -f --no-backup-if-mismatch -p0 < $0 | ||
16 | ;; | ||
17 | -unpatch) | ||
18 | patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 | ||
19 | ;; | ||
20 | *) | ||
21 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
22 | exit 1 | ||
23 | esac | ||
24 | exit 0 | ||
25 | |||
26 | diff -ur libstdc++-v3/src/Makefile.am libstdc++-v3/src/Makefile.am | ||
27 | --- libstdc++-v3/src/Makefile.am~ 2004-04-16 21:04:05.000000000 +0200 | ||
28 | +++ libstdc++-v3/src/Makefile.am 2004-07-03 20:22:43.000000000 +0200 | ||
29 | @@ -210,6 +210,10 @@ | ||
30 | $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@ | ||
31 | |||
32 | |||
33 | +install-exec-local: | ||
34 | + $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o || touch libstdc++_pic.a | ||
35 | + $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) | ||
36 | + | ||
37 | # Added bits to build debug library. | ||
38 | if GLIBCXX_BUILD_DEBUG | ||
39 | all-local: build_debug | ||
40 | diff -ur libstdc++-v3/src/Makefile.in libstdc++-v3/src/Makefile.in | ||
41 | --- libstdc++-v3/src/Makefile.in 2004-07-03 06:41:13.000000000 +0200 | ||
42 | +++ libstdc++-v3/src/Makefile.in 2004-07-03 20:25:05.000000000 +0200 | ||
43 | @@ -611,7 +611,7 @@ | ||
44 | |||
45 | install-data-am: install-data-local | ||
46 | |||
47 | -install-exec-am: install-toolexeclibLTLIBRARIES | ||
48 | +install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local | ||
49 | |||
50 | install-info: install-info-am | ||
51 | |||
52 | @@ -644,6 +644,7 @@ | ||
53 | distclean-libtool distclean-tags distdir dvi dvi-am html \ | ||
54 | html-am info info-am install install-am install-data \ | ||
55 | install-data-am install-data-local install-exec \ | ||
56 | + install-exec-local \ | ||
57 | install-exec-am install-info install-info-am install-man \ | ||
58 | install-strip install-toolexeclibLTLIBRARIES installcheck \ | ||
59 | installcheck-am installdirs maintainer-clean \ | ||
60 | @@ -729,6 +730,11 @@ | ||
61 | install_debug: | ||
62 | (cd ${debugdir} && $(MAKE) \ | ||
63 | toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install) | ||
64 | + | ||
65 | +install-exec-local: | ||
66 | + $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o || touch libstdc++_pic.a | ||
67 | + $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) | ||
68 | + | ||
69 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
70 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
71 | .NOEXPORT: | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/optional_libstdc.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/optional_libstdc.patch new file mode 100644 index 0000000000..0f74353a1f --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/optional_libstdc.patch | |||
@@ -0,0 +1,23 @@ | |||
1 | gcc-runtime builds libstdc++ separately from gcc-cross-*. Its configure tests using g++ | ||
2 | will not run correctly since my default the linker will try and link against libstdc++ | ||
3 | which shouldn't exist yet. We need an option to disable the automatically added -lstdc++ | ||
4 | option whilst leaving -lc, -lgcc and other automatic library dependencies. This patch | ||
5 | adds such an option which only disables the -lstdc++ linkage. | ||
6 | |||
7 | A "standard" gcc build uses xgcc and hence avoids this. We should ask upstream how to | ||
8 | do this officially, the likely answer is don't build libstdc++ separately. | ||
9 | |||
10 | RP 29/6/10 | ||
11 | |||
12 | Index: gcc-4.3.3/gcc/cp/g++spec.c | ||
13 | =================================================================== | ||
14 | --- gcc-4.3.3.orig/gcc/cp/g++spec.c 2010-06-29 00:06:03.901695025 +0100 | ||
15 | +++ gcc-4.3.3/gcc/cp/g++spec.c 2010-06-29 00:06:58.800325439 +0100 | ||
16 | @@ -131,6 +131,7 @@ | ||
17 | if (argv[i][0] == '-') | ||
18 | { | ||
19 | if (strcmp (argv[i], "-nostdlib") == 0 | ||
20 | + || strcmp (argv[i], "-nostdlib++") == 0 | ||
21 | || strcmp (argv[i], "-nodefaultlibs") == 0) | ||
22 | { | ||
23 | library = -1; | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/pr30961.dpatch b/meta/recipes-devtools/gcc/gcc-4.5.0/pr30961.dpatch new file mode 100644 index 0000000000..b20fdf5bf5 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/pr30961.dpatch | |||
@@ -0,0 +1,179 @@ | |||
1 | #! /bin/sh -e | ||
2 | |||
3 | # DP: <your description> | ||
4 | |||
5 | dir= | ||
6 | if [ $# -eq 3 -a "$2" = '-d' ]; then | ||
7 | pdir="-d $3" | ||
8 | dir="$3/" | ||
9 | elif [ $# -ne 1 ]; then | ||
10 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
11 | exit 1 | ||
12 | fi | ||
13 | case "$1" in | ||
14 | -patch) | ||
15 | patch $pdir -f --no-backup-if-mismatch -p0 < $0 | ||
16 | ;; | ||
17 | -unpatch) | ||
18 | patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 | ||
19 | ;; | ||
20 | *) | ||
21 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
22 | exit 1 | ||
23 | esac | ||
24 | exit 0 | ||
25 | |||
26 | From: "H.J. Lu" <hjl@lucon.org> | ||
27 | Sender: gcc-patches-owner@gcc.gnu.org | ||
28 | To: gcc-patches@gcc.gnu.org | ||
29 | Subject: PATCH: PR target/30961: [4.1/4.2/4.3 regression] redundant reg/mem stores/moves | ||
30 | Date: Mon, 27 Aug 2007 11:34:12 -0700 | ||
31 | |||
32 | We start with | ||
33 | |||
34 | (note:HI 3 4 22 2 NOTE_INSN_FUNCTION_BEG) | ||
35 | |||
36 | (insn:HI 6 3 10 2 c.c:3 (set (reg:DF 58 [ <result> ]) | ||
37 | (subreg:DF (reg/v:DI 59 [ in ]) 0)) 102 {*movdf_integer_rex64} (expr_list:REG_DEAD (reg/v:DI 59 [ in ]) | ||
38 | (nil))) | ||
39 | |||
40 | (insn:HI 10 6 16 2 c.c:7 (set (reg/i:DF 21 xmm0 [ <result> ]) | ||
41 | (reg:DF 58 [ <result> ])) 102 {*movdf_integer_rex64} (expr_list:REG_DEAD (reg:DF 58 [ <result> ]) | ||
42 | (nil))) | ||
43 | |||
44 | (insn:HI 16 10 0 2 c.c:7 (use (reg/i:DF 21 xmm0 [ <result> ])) -1 (nil)) | ||
45 | |||
46 | we are trying to allocate registers for insn 6 and we allocate | ||
47 | xmm0 for the return value. Reload doesn't check if xmm0 can be used for | ||
48 | DF 59, it allocates xmm1 for DF 59 and generates: | ||
49 | |||
50 | Reloads for insn # 6 | ||
51 | Reload 0: reload_in (DF) = (reg:DF 5 di) | ||
52 | SSE_REGS, RELOAD_FOR_INPUT (opnum = 1), can't combine | ||
53 | reload_in_reg: (subreg:DF (reg/v:DI 5 di [orig:59 in ] [59]) 0) | ||
54 | reload_reg_rtx: (reg:DF 22 xmm1) | ||
55 | ... | ||
56 | |||
57 | (note:HI 4 1 3 2 [bb 2] NOTE_INSN_BASIC_BLOCK) | ||
58 | |||
59 | (note:HI 3 4 22 2 NOTE_INSN_FUNCTION_BEG) | ||
60 | |||
61 | (insn 22 3 23 2 c.c:3 (set (mem/c:DF (plus:DI (reg/f:DI 7 sp) | ||
62 | (const_int -8 [0xfffffffffffffff8])) [0 S8 A8]) | ||
63 | (reg:DF 5 di)) 102 {*movdf_integer_rex64} (nil)) | ||
64 | |||
65 | (insn 23 22 6 2 c.c:3 (set (reg:DF 22 xmm1) | ||
66 | (mem/c:DF (plus:DI (reg/f:DI 7 sp) | ||
67 | (const_int -8 [0xfffffffffffffff8])) [0 S8 A8])) 102 {*movdf_integer_rex64} (nil)) | ||
68 | |||
69 | (insn:HI 6 23 16 2 c.c:3 (set (reg:DF 21 xmm0 [orig:58 <result> ] [58]) | ||
70 | (reg:DF 22 xmm1)) 102 {*movdf_integer_rex64} (nil)) | ||
71 | |||
72 | (insn 16 6 21 2 c.c:7 (use (reg/i:DF 21 xmm0 [ <result> ])) -1 (nil)) | ||
73 | |||
74 | This patch tries to use the destination register when reloading for input. It | ||
75 | generates | ||
76 | |||
77 | Reloads for insn # 6 | ||
78 | Reload 0: reload_in (DF) = (reg:DF 5 di) | ||
79 | SSE_REGS, RELOAD_FOR_INPUT (opnum = 1), can't combine | ||
80 | reload_in_reg: (subreg:DF (reg/v:DI 5 di [orig:59 in ] [59]) 0) | ||
81 | reload_reg_rtx: (reg:DF 21 xmm0) | ||
82 | ... | ||
83 | (note:HI 4 1 3 2 [bb 2] NOTE_INSN_BASIC_BLOCK) | ||
84 | |||
85 | (note:HI 3 4 22 2 NOTE_INSN_FUNCTION_BEG) | ||
86 | |||
87 | (insn 22 3 23 2 c.c:3 (set (mem/c:DF (plus:DI (reg/f:DI 7 sp) | ||
88 | (const_int -8 [0xfffffffffffffff8])) [0 S8 A8]) | ||
89 | (reg:DF 5 di)) 102 {*movdf_integer_rex64} (nil)) | ||
90 | |||
91 | (insn 23 22 6 2 c.c:3 (set (reg:DF 21 xmm0) | ||
92 | (mem/c:DF (plus:DI (reg/f:DI 7 sp) | ||
93 | (const_int -8 [0xfffffffffffffff8])) [0 S8 A8])) 102 {*movdf_integer_rex64} (nil)) | ||
94 | |||
95 | (insn:HI 6 23 10 2 c.c:3 (set (reg:DF 22 xmm1 [orig:58 <result> ] [58]) | ||
96 | (reg:DF 21 xmm0)) 102 {*movdf_integer_rex64} (nil)) | ||
97 | |||
98 | (insn:HI 10 6 16 2 c.c:7 (set (reg/i:DF 21 xmm0 [ <result> ]) | ||
99 | (reg:DF 22 xmm1 [orig:58 <result> ] [58])) 102 {*movdf_integer_rex64} (nil)) | ||
100 | |||
101 | (insn 16 10 21 2 c.c:7 (use (reg/i:DF 21 xmm0 [ <result> ])) -1 (nil)) | ||
102 | |||
103 | |||
104 | H.J. | ||
105 | ---- | ||
106 | gcc/ | ||
107 | |||
108 | 2007-08-27 H.J. Lu <hongjiu.lu@intel.com> | ||
109 | |||
110 | PR target/30961 | ||
111 | * reload1.c (find_reg): Favor the hard register in destination | ||
112 | if it is usable and a memory location is needed for reload | ||
113 | input. | ||
114 | |||
115 | gcc/testsuite/ | ||
116 | |||
117 | 2007-08-27 H.J. Lu <hongjiu.lu@intel.com> | ||
118 | |||
119 | PR target/30961 | ||
120 | * gcc.target/i386/pr30961-1.c: New. | ||
121 | |||
122 | --- gcc/reload1.c.second 2007-08-27 09:35:08.000000000 -0700 | ||
123 | +++ gcc/reload1.c 2007-08-27 09:36:33.000000000 -0700 | ||
124 | @@ -1781,6 +1781,20 @@ find_reg (struct insn_chain *chain, int | ||
125 | HARD_REG_SET not_usable; | ||
126 | HARD_REG_SET used_by_other_reload; | ||
127 | reg_set_iterator rsi; | ||
128 | +#ifdef SECONDARY_MEMORY_NEEDED | ||
129 | + rtx body = PATTERN (chain->insn); | ||
130 | + unsigned int dest_reg = FIRST_PSEUDO_REGISTER; | ||
131 | + | ||
132 | + if (GET_CODE (body) == SET) | ||
133 | + { | ||
134 | + rtx dest = SET_DEST (body); | ||
135 | + | ||
136 | + if ((REG_P (dest) | ||
137 | + || (GET_CODE (dest) == SUBREG | ||
138 | + && REG_P (SUBREG_REG (dest))))) | ||
139 | + dest_reg = reg_or_subregno (dest); | ||
140 | + } | ||
141 | +#endif | ||
142 | |||
143 | COPY_HARD_REG_SET (not_usable, bad_spill_regs); | ||
144 | IOR_HARD_REG_SET (not_usable, bad_spill_regs_global); | ||
145 | @@ -1821,6 +1835,18 @@ find_reg (struct insn_chain *chain, int | ||
146 | this_cost--; | ||
147 | if (rl->out && REG_P (rl->out) && REGNO (rl->out) == regno) | ||
148 | this_cost--; | ||
149 | +#ifdef SECONDARY_MEMORY_NEEDED | ||
150 | + /* If a memory location is needed for rl->in and dest_reg | ||
151 | + is usable, we will favor it. */ | ||
152 | + else if (dest_reg == regno | ||
153 | + && rl->in | ||
154 | + && REG_P (rl->in) | ||
155 | + && REGNO (rl->in) < FIRST_PSEUDO_REGISTER | ||
156 | + && SECONDARY_MEMORY_NEEDED (REGNO_REG_CLASS (REGNO (rl->in)), | ||
157 | + rl->class, | ||
158 | + rl->mode)) | ||
159 | + this_cost = 0; | ||
160 | +#endif | ||
161 | if (this_cost < best_cost | ||
162 | /* Among registers with equal cost, prefer caller-saved ones, or | ||
163 | use REG_ALLOC_ORDER if it is defined. */ | ||
164 | --- gcc/testsuite/gcc.target/i386/pr30961-1.c.second 2007-08-27 11:01:59.000000000 -0700 | ||
165 | +++ gcc/testsuite/gcc.target/i386/pr30961-1.c 2007-08-27 11:02:51.000000000 -0700 | ||
166 | @@ -0,0 +1,13 @@ | ||
167 | +/* { dg-do compile } */ | ||
168 | +/* { dg-require-effective-target lp64 } */ | ||
169 | +/* { dg-options "-O2" } */ | ||
170 | + | ||
171 | +double | ||
172 | +convert (long long in) | ||
173 | +{ | ||
174 | + double f; | ||
175 | + __builtin_memcpy( &f, &in, sizeof( in ) ); | ||
176 | + return f; | ||
177 | +} | ||
178 | + | ||
179 | +/* { dg-final { scan-assembler-not "movapd" } } */ | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/pr35942.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/pr35942.patch new file mode 100644 index 0000000000..da610f5189 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/pr35942.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | Fix PR 35942: remove -lstdc++ from libtool postdeps for CXX. | ||
2 | |||
3 | libstdc++-v3/ChangeLog: | ||
4 | 2010-01-04 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | ||
5 | |||
6 | PR libstdc++/35942 | ||
7 | * configure.ac: Remove -lstdc++ from libtool's postdeps_CXX. | ||
8 | * configure: Regenerate. | ||
9 | |||
10 | |||
11 | Index: gcc-4.3.3/libstdc++-v3/configure | ||
12 | =================================================================== | ||
13 | --- gcc-4.3.3.orig/libstdc++-v3/configure 2010-03-26 17:57:51.000000000 +0000 | ||
14 | +++ gcc-4.3.3/libstdc++-v3/configure 2010-03-26 17:57:58.000000000 +0000 | ||
15 | @@ -13759,6 +13759,9 @@ | ||
16 | |||
17 | |||
18 | |||
19 | +# Eliminate -lstdc++ addition to postdeps for cross compiles. | ||
20 | +postdeps_CXX=`echo " $postdeps_CXX " | sed 's, -lstdc++ ,,g'` | ||
21 | + | ||
22 | # Possibly disable most of the library. | ||
23 | ## TODO: Consider skipping unncessary tests altogether in this case, rather | ||
24 | ## than just ignoring the results. Faster /and/ more correct, win win. | ||
25 | Index: gcc-4.3.3/libstdc++-v3/configure.ac | ||
26 | =================================================================== | ||
27 | --- gcc-4.3.3.orig/libstdc++-v3/configure.ac 2010-03-26 17:57:54.000000000 +0000 | ||
28 | +++ gcc-4.3.3/libstdc++-v3/configure.ac 2010-03-26 17:57:58.000000000 +0000 | ||
29 | @@ -89,6 +89,9 @@ | ||
30 | AC_SUBST(enable_shared) | ||
31 | AC_SUBST(enable_static) | ||
32 | |||
33 | +# Eliminate -lstdc++ addition to postdeps for cross compiles. | ||
34 | +postdeps_CXX=`echo " $postdeps_CXX " | sed 's, -lstdc++ ,,g'` | ||
35 | + | ||
36 | # Possibly disable most of the library. | ||
37 | ## TODO: Consider skipping unncessary tests altogether in this case, rather | ||
38 | ## than just ignoring the results. Faster /and/ more correct, win win. | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/zecke-no-host-includes.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/zecke-no-host-includes.patch new file mode 100644 index 0000000000..4ccf35f627 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/zecke-no-host-includes.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | Index: gcc-4.4+svnr145550/gcc/incpath.c | ||
2 | =================================================================== | ||
3 | --- gcc-4.4+svnr145550.orig/gcc/incpath.c 2009-04-04 13:48:31.000000000 -0700 | ||
4 | +++ gcc-4.4+svnr145550/gcc/incpath.c 2009-04-04 14:49:29.000000000 -0700 | ||
5 | @@ -417,6 +417,26 @@ | ||
6 | p->construct = 0; | ||
7 | p->user_supplied_p = user_supplied_p; | ||
8 | |||
9 | +#ifdef CROSS_COMPILE | ||
10 | + /* A common error when cross compiling is including | ||
11 | + host headers. This code below will try to fail fast | ||
12 | + for cross compiling. Currently we consider /usr/include, | ||
13 | + /opt/include and /sw/include as harmful. */ | ||
14 | + { | ||
15 | + /* printf("Adding Path: %s\n", p->name ); */ | ||
16 | + if( strstr(p->name, "/usr/include" ) == p->name ) { | ||
17 | + fprintf(stderr, _("CROSS COMPILE Badness: /usr/include in INCLUDEPATH: %s\n"), p->name); | ||
18 | + abort(); | ||
19 | + } else if( strstr(p->name, "/sw/include") == p->name ) { | ||
20 | + fprintf(stderr, _("CROSS COMPILE Badness: /sw/include in INCLUDEPATH: %s\n"), p->name); | ||
21 | + abort(); | ||
22 | + } else if( strstr(p->name, "/opt/include") == p->name ) { | ||
23 | + fprintf(stderr, _("CROSS COMPILE Badness: /opt/include in INCLUDEPATH: %s\n"), p->name); | ||
24 | + abort(); | ||
25 | + } | ||
26 | + } | ||
27 | +#endif | ||
28 | + | ||
29 | add_cpp_dir_path (p, chain); | ||
30 | } | ||
31 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/zecke-xgcc-cpp.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/zecke-xgcc-cpp.patch new file mode 100644 index 0000000000..4b827d6397 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.0/zecke-xgcc-cpp.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | upstream: n/a | ||
2 | comment: Use the preprocessor we have just compiled instead the one of | ||
3 | the system. There might be incompabilities between us and them. | ||
4 | |||
5 | Index: gcc-4.5.0/Makefile.in | ||
6 | =================================================================== | ||
7 | --- gcc-4.5.0.orig/Makefile.in 2010-02-17 03:01:44.000000000 -0800 | ||
8 | +++ gcc-4.5.0/Makefile.in 2010-06-25 11:22:08.421381364 -0700 | ||
9 | @@ -266,6 +266,7 @@ | ||
10 | AR="$(AR_FOR_TARGET)"; export AR; \ | ||
11 | AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \ | ||
12 | CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \ | ||
13 | + CPP="$(CC_FOR_TARGET) -E"; export CPP; \ | ||
14 | CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ | ||
15 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
16 | CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ | ||
17 | Index: gcc-4.5.0/Makefile.tpl | ||
18 | =================================================================== | ||
19 | --- gcc-4.5.0.orig/Makefile.tpl 2010-02-17 03:01:44.000000000 -0800 | ||
20 | +++ gcc-4.5.0/Makefile.tpl 2010-06-25 11:22:16.945631990 -0700 | ||
21 | @@ -269,6 +269,7 @@ | ||
22 | AR="$(AR_FOR_TARGET)"; export AR; \ | ||
23 | AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \ | ||
24 | CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \ | ||
25 | + CPP="$(CC_FOR_TARGET) -E"; export CPP; \ | ||
26 | CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ | ||
27 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
28 | CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ | ||
diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc new file mode 100644 index 0000000000..1e9c65e662 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-common.inc | |||
@@ -0,0 +1,46 @@ | |||
1 | DESCRIPTION = "The GNU cc and gcc C compilers." | ||
2 | HOMEPAGE = "http://www.gnu.org/software/gcc/" | ||
3 | SECTION = "devel" | ||
4 | LICENSE = "GPL" | ||
5 | |||
6 | NATIVEDEPS = "" | ||
7 | |||
8 | inherit autotools gettext | ||
9 | |||
10 | FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/gcc-${PV}" | ||
11 | |||
12 | def get_gcc_fpu_setting(bb, d): | ||
13 | if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]: | ||
14 | return "--with-float=soft" | ||
15 | return "" | ||
16 | |||
17 | def get_gcc_mips_plt_setting(bb, d): | ||
18 | if bb.data.getVar('TARGET_ARCH', d, 1) in [ 'mips', 'mipsel' ] and 'mplt' in bb.data.getVar('DISTRO_FEATURES',d,1).split() : | ||
19 | return "--with-mips-plt" | ||
20 | return "" | ||
21 | |||
22 | # We really need HOST_SYS here for some packages and TARGET_SYS for others. | ||
23 | # For now, libgcc is most important so we fix for that - RP. | ||
24 | SHLIBSDIR = "${STAGING_DIR_TARGET}/shlibs" | ||
25 | |||
26 | DEBIANNAME_libgcc = "libgcc1" | ||
27 | |||
28 | MIRRORS_prepend () { | ||
29 | ${GNU_MIRROR}/gcc/releases/ ftp://gcc.gnu.org/pub/gcc/releases/ | ||
30 | ${GNU_MIRROR}/gcc/ http://mirrors.rcn.net/pub/sourceware/gcc/releases/ | ||
31 | ${GNU_MIRROR}/gcc/releases/ http://gcc.get-software.com/releases/ | ||
32 | ${GNU_MIRROR}/gcc/ http://gcc.get-software.com/releases/ | ||
33 | } | ||
34 | |||
35 | # | ||
36 | # Set some default values | ||
37 | # | ||
38 | gcclibdir = "${libdir}/gcc" | ||
39 | BINV = "${PV}" | ||
40 | S = "${WORKDIR}/gcc-${PV}" | ||
41 | B = "${S}/build.${HOST_SYS}.${TARGET_SYS}" | ||
42 | |||
43 | target_includedir ?= "${includedir}" | ||
44 | target_libdir ?= "${libdir}" | ||
45 | target_base_libdir ?= "${base_libdir}" | ||
46 | target_prefix ?= "${prefix}" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc new file mode 100644 index 0000000000..5a55025ac5 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc | |||
@@ -0,0 +1,107 @@ | |||
1 | # | ||
2 | # Build the list of lanaguages to build. | ||
3 | # | ||
4 | # These can be overridden by the version specific .inc file. | ||
5 | |||
6 | # Java (gcj doesn't work on all architectures) | ||
7 | JAVA ?= ",java" | ||
8 | JAVA_arm ?= "" | ||
9 | JAVA_armeb ?= "" | ||
10 | JAVA_mipsel ?= "" | ||
11 | JAVA_sh3 ?= "" | ||
12 | # gcc 3.x expects 'f77', 4.0 expects 'f95', 4.1 and 4.2 expect 'fortran' | ||
13 | FORTRAN ?= ",f77" | ||
14 | LANGUAGES ?= "c,c++${FORTRAN}${JAVA}" | ||
15 | # disable --enable-target-optspace for powerpc SPE | ||
16 | # at -Os libgcc.so.1 creates references into | ||
17 | # hidden symbols in libgcc.a which linker complains | ||
18 | # when linking shared libraries further in the build like (gnutls) | ||
19 | |||
20 | OPTSPACE = "${@base_contains('TARGET_ARCH', ['powerpc', 'arm'], '', '--enable-target-optspace',d)}" | ||
21 | |||
22 | EXTRA_OECONF_BASE ?= "" | ||
23 | EXTRA_OECONF_PATHS ?= "" | ||
24 | EXTRA_OECONF_INITIAL ?= "" | ||
25 | EXTRA_OECONF_INTERMEDIATE ?= "" | ||
26 | |||
27 | GCCMULTILIB = "--disable-multilib" | ||
28 | |||
29 | EXTRA_OECONF = "${@['--enable-clocale=generic', ''][bb.data.getVar('USE_NLS', d, 1) != 'no']} \ | ||
30 | --with-gnu-ld \ | ||
31 | --enable-shared \ | ||
32 | --enable-languages=${LANGUAGES} \ | ||
33 | --enable-threads=posix \ | ||
34 | ${GCCMULTILIB} \ | ||
35 | --enable-c99 \ | ||
36 | --enable-long-long \ | ||
37 | --enable-symvers=gnu \ | ||
38 | --enable-libstdcxx-pch \ | ||
39 | --program-prefix=${TARGET_PREFIX} \ | ||
40 | ${OPTSPACE} \ | ||
41 | ${EXTRA_OECONF_BASE} \ | ||
42 | ${EXTRA_OECONF_FPU} \ | ||
43 | ${EXTRA_OECONF_PATHS} \ | ||
44 | ${@get_gcc_mips_plt_setting(bb, d)}" | ||
45 | |||
46 | # Build uclibc compilers without cxa_atexit support | ||
47 | EXTRA_OECONF_append_linux = " --enable-__cxa_atexit" | ||
48 | EXTRA_OECONF_append_linux-gnueabi = " --enable-__cxa_atexit" | ||
49 | EXTRA_OECONF_append_linux-uclibc = " --disable-__cxa_atexit" | ||
50 | EXTRA_OECONF_append_linux-uclibcgnueabi = " --disable-__cxa_atexit" | ||
51 | EXTRA_OECONF_FPU = "${@get_gcc_fpu_setting(bb, d)}" | ||
52 | CPPFLAGS = "" | ||
53 | |||
54 | # Used by configure to define additional values for FLAGS_FOR_TARGET - | ||
55 | # passed to all the compilers. | ||
56 | ARCH_FLAGS_FOR_TARGET = "${TARGET_CC_ARCH}" | ||
57 | EXTRA_OEMAKE += "ARCH_FLAGS_FOR_TARGET='${ARCH_FLAGS_FOR_TARGET}'" | ||
58 | |||
59 | SYSTEMHEADERS = "${target_includedir}" | ||
60 | SYSTEMLIBS = "${target_base_libdir}/" | ||
61 | SYSTEMLIBS1 = "${target_libdir}/" | ||
62 | |||
63 | do_configure () { | ||
64 | # Setup these vars for cross building only | ||
65 | # ... because foo_FOR_TARGET apparently gets misinterpreted inside the | ||
66 | # gcc build stuff when the build is producing a cross compiler - i.e. | ||
67 | # when the 'current' target is the 'host' system, and the host is not | ||
68 | # the target (because the build is actually making a cross compiler!) | ||
69 | if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then | ||
70 | export CC_FOR_TARGET="${CC}" | ||
71 | export GCC_FOR_TARGET="${CC}" | ||
72 | export CXX_FOR_TARGET="${CXX}" | ||
73 | export AS_FOR_TARGET="${HOST_PREFIX}as" | ||
74 | export LD_FOR_TARGET="${HOST_PREFIX}ld" | ||
75 | export NM_FOR_TARGET="${HOST_PREFIX}nm" | ||
76 | export AR_FOR_TARGET="${HOST_PREFIX}ar" | ||
77 | export GFORTRAN_FOR_TARGET="gfortran" | ||
78 | export RANLIB_FOR_TARGET="${HOST_PREFIX}ranlib" | ||
79 | fi | ||
80 | export CC_FOR_BUILD="${BUILD_CC}" | ||
81 | export CXX_FOR_BUILD="${BUILD_CXX}" | ||
82 | export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}" | ||
83 | export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}" | ||
84 | export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}" | ||
85 | export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}" | ||
86 | export ARCH_FLAGS_FOR_TARGET="${ARCH_FLAGS_FOR_TARGET}" | ||
87 | (cd ${S} && gnu-configize) || die "failure running gnu-configize" | ||
88 | |||
89 | # splice our idea of where the headers live into gcc's world | ||
90 | echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${T}/t-oe | ||
91 | sed 's%^tmake_file=.*$%& ${T}/t-oe%' < ${S}/gcc/Makefile.in >${S}/gcc/Makefile.in.new | ||
92 | mv ${S}/gcc/Makefile.in.new ${S}/gcc/Makefile.in | ||
93 | cat ${S}/gcc/defaults.h | grep -v "\#endif.*GCC_DEFAULTS_H" > ${S}/gcc/defaults.h.new | ||
94 | echo "#ifndef STANDARD_INCLUDE_DIR" >> ${S}/gcc/defaults.h.new | ||
95 | echo "#define STANDARD_INCLUDE_DIR \"${SYSTEMHEADERS}\"" >> ${S}/gcc/defaults.h.new | ||
96 | echo "#endif" >> ${S}/gcc/defaults.h.new | ||
97 | echo "#ifndef STANDARD_STARTFILE_PREFIX_1" >> ${S}/gcc/defaults.h.new | ||
98 | echo "#define STANDARD_STARTFILE_PREFIX_1 \"${SYSTEMLIBS}\"" >> ${S}/gcc/defaults.h.new | ||
99 | echo "#endif" >> ${S}/gcc/defaults.h.new | ||
100 | echo "#ifndef STANDARD_STARTFILE_PREFIX_2" >> ${S}/gcc/defaults.h.new | ||
101 | echo "#define STANDARD_STARTFILE_PREFIX_2 \"${SYSTEMLIBS1}\"" >> ${S}/gcc/defaults.h.new | ||
102 | echo "#endif" >> ${S}/gcc/defaults.h.new | ||
103 | echo "#endif /* ! GCC_DEFAULTS_H */" >> ${S}/gcc/defaults.h.new | ||
104 | mv ${S}/gcc/defaults.h.new ${S}/gcc/defaults.h | ||
105 | oe_runconf | ||
106 | } | ||
107 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-configure-cross.inc b/meta/recipes-devtools/gcc/gcc-configure-cross.inc new file mode 100644 index 0000000000..6051a7678e --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-configure-cross.inc | |||
@@ -0,0 +1,22 @@ | |||
1 | require gcc-configure-common.inc | ||
2 | |||
3 | USE_NLS = '${@base_conditional( "TARGET_OS", "linux-uclibc", "no", "", d )}' | ||
4 | |||
5 | EXTRA_OECONF_PATHS = "--with-local-prefix=${STAGING_DIR_TARGET}${target_exec_prefix} \ | ||
6 | --with-gxx-include-dir=${STAGING_DIR_TARGET}/${target_includedir}/c++ \ | ||
7 | --with-sysroot=${STAGING_DIR_TARGET} \ | ||
8 | --with-build-sysroot=${STAGING_DIR_TARGET}" | ||
9 | |||
10 | do_compile_prepend () { | ||
11 | export CC="${BUILD_CC}" | ||
12 | export AR_FOR_TARGET="${TARGET_SYS}-ar" | ||
13 | export RANLIB_FOR_TARGET="${TARGET_SYS}-ranlib" | ||
14 | export LD_FOR_TARGET="${TARGET_SYS}-ld" | ||
15 | export NM_FOR_TARGET="${TARGET_SYS}-nm" | ||
16 | export CC_FOR_TARGET="${CCACHE} ${TARGET_SYS}-gcc ${TARGET_CC_ARCH}" | ||
17 | } | ||
18 | |||
19 | LIBGCCS_VAR = "-lgcc_s" | ||
20 | LIBGCCS_VAR_avr32 = "" | ||
21 | |||
22 | do_package_write_ipk[depends] += "virtual/libc:do_package" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-configure-runtime.inc b/meta/recipes-devtools/gcc/gcc-configure-runtime.inc new file mode 100644 index 0000000000..f9ad61d129 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-configure-runtime.inc | |||
@@ -0,0 +1,59 @@ | |||
1 | require gcc-configure-common.inc | ||
2 | |||
3 | EXTRA_OECONF_PATHS = " \ | ||
4 | --with-local-prefix=${STAGING_DIR_TARGET}${prefix} \ | ||
5 | --with-gxx-include-dir=${includedir}/c++/ \ | ||
6 | --with-sysroot=${STAGING_DIR_TARGET} \ | ||
7 | --with-build-sysroot=${STAGING_DIR_TARGET}" | ||
8 | |||
9 | RUNTIMETARGET = "libssp libstdc++-v3" | ||
10 | # ? | ||
11 | # libiberty | ||
12 | # libmudflap | ||
13 | # libgfortran | ||
14 | |||
15 | do_configure () { | ||
16 | export CXX="${CXX} -nostdinc++ -nostdlib++" | ||
17 | for d in ${RUNTIMETARGET}; do | ||
18 | echo "Configuring $d" | ||
19 | mkdir -p ${B}/$d/ | ||
20 | cd ${B}/$d/ | ||
21 | chmod a+x ${S}/$d/configure | ||
22 | ${S}/$d/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} | ||
23 | done | ||
24 | } | ||
25 | |||
26 | do_compile () { | ||
27 | for d in ${RUNTIMETARGET}; do | ||
28 | cd ${B}/$d/ | ||
29 | oe_runmake | ||
30 | done | ||
31 | } | ||
32 | |||
33 | do_install () { | ||
34 | target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-nativesdk##` | ||
35 | |||
36 | # Install libgcc from our gcc-cross saved data | ||
37 | install -d ${D}${base_libdir} ${D}${libdir} | ||
38 | cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$target/* ${D} | ||
39 | |||
40 | for d in ${RUNTIMETARGET}; do | ||
41 | cd ${B}/$d/ | ||
42 | oe_runmake 'DESTDIR=${D}' install | ||
43 | done | ||
44 | |||
45 | # Move libgcc_s into /lib | ||
46 | mkdir -p ${D}${base_libdir} | ||
47 | if [ -f ${D}${libdir}/nof/libgcc_s.so ]; then | ||
48 | mv ${D}${libdir}/nof/libgcc* ${D}${base_libdir} | ||
49 | else | ||
50 | mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true | ||
51 | fi | ||
52 | } | ||
53 | |||
54 | INHIBIT_DEFAULT_DEPS = "1" | ||
55 | DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++" | ||
56 | PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs" | ||
57 | |||
58 | BBCLASSEXTEND = "nativesdk" | ||
59 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-configure-sdk.inc b/meta/recipes-devtools/gcc/gcc-configure-sdk.inc new file mode 100644 index 0000000000..0eb33adda8 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-configure-sdk.inc | |||
@@ -0,0 +1,48 @@ | |||
1 | require gcc-configure-common.inc | ||
2 | |||
3 | # The two lines below conflict, this needs fixing - RP | ||
4 | USE_NLS = '${@base_conditional( "TARGET_OS", "linux-uclibc", "no", "", d )}' | ||
5 | USE_NLS = '${@base_conditional( "TARGET_OS", "linux-uclibcgnueabi", "no", "", d )}' | ||
6 | |||
7 | EXTRA_OECONF_PATHS = "--with-local-prefix=${SDKPATH}/sysroots/${TARGET_SYS}${target_exec_prefix} \ | ||
8 | --with-gxx-include-dir=${SDKPATH}/sysroots/${TARGET_SYS}${target_includedir}/c++ \ | ||
9 | --with-build-time-tools=${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/bin \ | ||
10 | --with-sysroot=${SDKPATH}/sysroots/${TARGET_SYS} \ | ||
11 | --with-build-sysroot=${STAGING_DIR_TARGET}" | ||
12 | |||
13 | # | ||
14 | # gcc-cross looks and finds these in ${exec_prefix} but we're not so lucky | ||
15 | # for the sdk. Hardcoding the paths ensures the build doesn't go canadian or worse. | ||
16 | # | ||
17 | export AR_FOR_TARGET = "${TARGET_PREFIX}ar" | ||
18 | export AS_FOR_TARGET = "${TARGET_PREFIX}as" | ||
19 | export DLLTOOL_FOR_TARGET = "${TARGET_PREFIX}dlltool" | ||
20 | export CC_FOR_TARGET = "${TARGET_PREFIX}gcc" | ||
21 | export CXX_FOR_TARGET = "${TARGET_PREFIX}g++" | ||
22 | export LD_FOR_TARGET = "${TARGET_PREFIX}ld" | ||
23 | export LIPO_FOR_TARGET = "${TARGET_PREFIX}lipo" | ||
24 | export NM_FOR_TARGET = "${TARGET_PREFIX}nm" | ||
25 | export OBJDUMP_FOR_TARGET = "${TARGET_PREFIX}objdump" | ||
26 | export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib" | ||
27 | export STRIP_FOR_TARGET = "${TARGET_PREFIX}strip" | ||
28 | export WINDRES_FOR_TARGET = "${TARGET_PREFIX}windres" | ||
29 | |||
30 | # | ||
31 | # We need to override this and make sure the compiler can find staging | ||
32 | # | ||
33 | export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET}" | ||
34 | |||
35 | do_configure () { | ||
36 | export CC_FOR_BUILD="${BUILD_CC}" | ||
37 | export CXX_FOR_BUILD="${BUILD_CXX}" | ||
38 | export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}" | ||
39 | export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}" | ||
40 | export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}" | ||
41 | export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}" | ||
42 | (cd ${S} && gnu-configize) || die "failure running gnu-configize" | ||
43 | oe_runconf | ||
44 | } | ||
45 | |||
46 | do_compile () { | ||
47 | oe_runmake all-host all-target-libgcc | ||
48 | } | ||
diff --git a/meta/recipes-devtools/gcc/gcc-configure-target.inc b/meta/recipes-devtools/gcc/gcc-configure-target.inc new file mode 100644 index 0000000000..2fd3114911 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-configure-target.inc | |||
@@ -0,0 +1,5 @@ | |||
1 | require gcc-configure-common.inc | ||
2 | |||
3 | EXTRA_OECONF_PATHS = " \ | ||
4 | --with-local-prefix=${STAGING_DIR_TARGET}${prefix} \ | ||
5 | --with-gxx-include-dir=${includedir}/c++/${BINV}/" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc new file mode 100644 index 0000000000..a3b15c3dc6 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc | |||
@@ -0,0 +1,4 @@ | |||
1 | inherit cross-canadian | ||
2 | |||
3 | DEPENDS = "virtual/${HOST_PREFIX}binutils-crosssdk virtual/${TARGET_PREFIX}libc-for-gcc gettext-nativesdk" | ||
4 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.3.3.bb new file mode 100644 index 0000000000..981452b7a7 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.3.3.bb | |||
@@ -0,0 +1,24 @@ | |||
1 | inherit cross-canadian | ||
2 | |||
3 | require gcc-${PV}.inc | ||
4 | require gcc-cross-canadian.inc | ||
5 | require gcc-configure-sdk.inc | ||
6 | require gcc-package-sdk.inc | ||
7 | |||
8 | PR = "r17" | ||
9 | |||
10 | DEPENDS += "gmp-nativesdk mpfr-nativesdk" | ||
11 | RDEPENDS_${PN} += "mpfr-nativesdk" | ||
12 | |||
13 | SYSTEMHEADERS = "/usr/include" | ||
14 | SYSTEMLIBS = "/lib/" | ||
15 | SYSTEMLIBS1 = "/usr/lib/" | ||
16 | |||
17 | EXTRA_OECONF += "--disable-libunwind-exceptions --disable-libssp \ | ||
18 | --disable-libgomp --disable-libmudflap \ | ||
19 | --with-mpfr=${STAGING_DIR_HOST}${layout_exec_prefix}" | ||
20 | |||
21 | # to find libmpfr | ||
22 | # export LD_LIBRARY_PATH = "{STAGING_DIR_HOST}${layout_exec_prefix}" | ||
23 | |||
24 | PARALLEL_MAKE = "" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.5.0.bb new file mode 100644 index 0000000000..dd19412139 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.5.0.bb | |||
@@ -0,0 +1,25 @@ | |||
1 | inherit cross-canadian | ||
2 | |||
3 | require gcc-${PV}.inc | ||
4 | require gcc-cross-canadian.inc | ||
5 | require gcc-configure-sdk.inc | ||
6 | require gcc-package-sdk.inc | ||
7 | |||
8 | PR = "r6" | ||
9 | |||
10 | DEPENDS += "gmp-nativesdk mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk" | ||
11 | RDEPENDS_${PN} += "mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk" | ||
12 | |||
13 | SYSTEMHEADERS = "/usr/include" | ||
14 | SYSTEMLIBS = "/lib/" | ||
15 | SYSTEMLIBS1 = "/usr/lib/" | ||
16 | |||
17 | EXTRA_OECONF += "--disable-libunwind-exceptions --disable-libssp \ | ||
18 | --disable-libgomp --disable-libmudflap \ | ||
19 | --with-mpfr=${STAGING_DIR_HOST}${layout_exec_prefix} \ | ||
20 | --with-mpc=${STAGING_DIR_HOST}${layout_exec_prefix}" | ||
21 | |||
22 | # to find libmpfr | ||
23 | # export LD_LIBRARY_PATH = "{STAGING_DIR_HOST}${layout_exec_prefix}" | ||
24 | |||
25 | PARALLEL_MAKE = "" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial.inc b/meta/recipes-devtools/gcc/gcc-cross-initial.inc new file mode 100644 index 0000000000..f582de9843 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-cross-initial.inc | |||
@@ -0,0 +1,24 @@ | |||
1 | DEPENDS = "virtual/${TARGET_PREFIX}binutils gettext-native ${NATIVEDEPS}" | ||
2 | PROVIDES = "virtual/${TARGET_PREFIX}gcc-initial" | ||
3 | PACKAGES = "" | ||
4 | |||
5 | # This is intended to be a -very- basic config | ||
6 | # sysroot is needed in case we use libc-initial | ||
7 | EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${target_prefix} \ | ||
8 | --with-newlib \ | ||
9 | --without-headers \ | ||
10 | --disable-shared \ | ||
11 | --disable-threads \ | ||
12 | --disable-multilib \ | ||
13 | --disable-__cxa_atexit \ | ||
14 | --enable-languages=c \ | ||
15 | ${OPTSPACE} \ | ||
16 | --program-prefix=${TARGET_PREFIX} \ | ||
17 | --with-sysroot=${STAGING_DIR_TARGET} \ | ||
18 | --with-build-sysroot=${STAGING_DIR_TARGET} \ | ||
19 | ${EXTRA_OECONF_INITIAL} \ | ||
20 | ${@get_gcc_fpu_setting(bb, d)}" | ||
21 | |||
22 | do_compile () { | ||
23 | oe_runmake | ||
24 | } | ||
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-cross-initial_4.3.3.bb new file mode 100644 index 0000000000..b2c257d9d4 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-cross-initial_4.3.3.bb | |||
@@ -0,0 +1,5 @@ | |||
1 | require gcc-cross_${PV}.bb | ||
2 | require gcc-cross-initial.inc | ||
3 | |||
4 | PR = "r2" | ||
5 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.0.bb new file mode 100644 index 0000000000..ef52845b01 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.0.bb | |||
@@ -0,0 +1,5 @@ | |||
1 | require gcc-cross_${PV}.bb | ||
2 | require gcc-cross-initial.inc | ||
3 | |||
4 | PR = "r6" | ||
5 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial_csl-arm-2008q1.bb b/meta/recipes-devtools/gcc/gcc-cross-initial_csl-arm-2008q1.bb new file mode 100644 index 0000000000..06211033b8 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-cross-initial_csl-arm-2008q1.bb | |||
@@ -0,0 +1,10 @@ | |||
1 | require gcc-cross_${PV}.bb | ||
2 | require gcc-cross-initial.inc | ||
3 | |||
4 | S = "${WORKDIR}/gcc-4.2" | ||
5 | |||
6 | # Hack till we fix *libc properly | ||
7 | do_install_append() { | ||
8 | ln -sf ${STAGING_DIR_NATIVE}${prefix_native}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${D}${STAGING_DIR_NATIVE}${prefix_native}/lib/gcc/${TARGET_SYS}/${BINV}/include/ | ||
9 | } | ||
10 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc b/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc new file mode 100644 index 0000000000..72a42411b1 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc | |||
@@ -0,0 +1,28 @@ | |||
1 | DEPENDS = "virtual/${TARGET_PREFIX}binutils ${NATIVEDEPS}" | ||
2 | DEPENDS += "virtual/${TARGET_PREFIX}libc-initial gettext-native" | ||
3 | PROVIDES = "virtual/${TARGET_PREFIX}gcc-intermediate" | ||
4 | PACKAGES = "" | ||
5 | |||
6 | # This is intended to be a -very- basic config | ||
7 | # sysroot is needed in case we use libc-initial | ||
8 | EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${target_prefix} \ | ||
9 | --enable-shared \ | ||
10 | --disable-multilib \ | ||
11 | --disable-threads \ | ||
12 | --enable-languages=c \ | ||
13 | ${OPTSPACE} \ | ||
14 | --program-prefix=${TARGET_PREFIX} \ | ||
15 | --with-sysroot=${STAGING_DIR_TARGET} \ | ||
16 | --with-build-sysroot=${STAGING_DIR_TARGET} \ | ||
17 | ${EXTRA_OECONF_INTERMEDIATE} \ | ||
18 | ${@get_gcc_fpu_setting(bb, d)}" | ||
19 | |||
20 | do_compile () { | ||
21 | oe_runmake | ||
22 | } | ||
23 | |||
24 | do_install () { | ||
25 | oe_runmake 'DESTDIR=${D}' install | ||
26 | install -d ${D}${target_base_libdir}/ | ||
27 | mv ${D}${exec_prefix}/${TARGET_SYS}/lib/* ${D}${target_base_libdir}/ | ||
28 | } | ||
diff --git a/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.3.3.bb new file mode 100644 index 0000000000..10681dad4b --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.3.3.bb | |||
@@ -0,0 +1,4 @@ | |||
1 | require gcc-cross_${PV}.bb | ||
2 | require gcc-cross-intermediate.inc | ||
3 | PR = "r2" | ||
4 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.0.bb new file mode 100644 index 0000000000..deeee37c26 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.0.bb | |||
@@ -0,0 +1,4 @@ | |||
1 | require gcc-cross_${PV}.bb | ||
2 | require gcc-cross-intermediate.inc | ||
3 | PR = "r6" | ||
4 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-cross-intermediate_csl-arm-2008q1.bb b/meta/recipes-devtools/gcc/gcc-cross-intermediate_csl-arm-2008q1.bb new file mode 100644 index 0000000000..8a8f21a575 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-cross-intermediate_csl-arm-2008q1.bb | |||
@@ -0,0 +1,10 @@ | |||
1 | require gcc-cross_${PV}.bb | ||
2 | require gcc-cross-intermediate.inc | ||
3 | |||
4 | S = "${WORKDIR}/gcc-4.2" | ||
5 | |||
6 | # Hack till we fix *libc properly | ||
7 | do_install_append() { | ||
8 | ln -sf ${STAGING_DIR_NATIVE}${prefix_native}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${D}${STAGING_DIR_NATIVE}${prefix_native}/lib/gcc/${TARGET_SYS}/${BINV}/include/ | ||
9 | } | ||
10 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-cross-kernel-3.4.4_csl-arm-2005q3.bb b/meta/recipes-devtools/gcc/gcc-cross-kernel-3.4.4_csl-arm-2005q3.bb new file mode 100644 index 0000000000..6dbb19cec9 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-cross-kernel-3.4.4_csl-arm-2005q3.bb | |||
@@ -0,0 +1,15 @@ | |||
1 | # This kernel compiler is required by the Freecom FSG-3 machine | ||
2 | # This kernel compiler is required by the Nokia tablets | ||
3 | # Please talk to Rod Whitby and Richard Purdie before considering removing this file. | ||
4 | |||
5 | require gcc-csl-arm-2005q3.inc | ||
6 | require gcc-cross.inc | ||
7 | require gcc-cross-initial.inc | ||
8 | require gcc-cross-kernel.inc | ||
9 | |||
10 | DEFAULT_PREFERENCE = "-1" | ||
11 | |||
12 | PR = "r1" | ||
13 | |||
14 | SRC_URI += "file://gcc-3.4.4-makefile-fix.patch;patch=1" | ||
15 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-cross-kernel.inc b/meta/recipes-devtools/gcc/gcc-cross-kernel.inc new file mode 100644 index 0000000000..5347762762 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-cross-kernel.inc | |||
@@ -0,0 +1,10 @@ | |||
1 | # Cut-down gcc for kernel builds | ||
2 | # Only installs ${TARGET_PREFIX}gcc-${PV}, not ${TARGET_PREFIX}gcc. | ||
3 | |||
4 | PROVIDES = "virtual/${TARGET_PREFIX}gcc-${PV}" | ||
5 | |||
6 | do_install () { | ||
7 | cd gcc | ||
8 | oe_runmake 'DESTDIR=${D}' install-common install-headers install-libgcc | ||
9 | install -m 0755 xgcc ${D}${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}gcc-${PV} | ||
10 | } | ||
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc new file mode 100644 index 0000000000..5a796bcde6 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-cross.inc | |||
@@ -0,0 +1,12 @@ | |||
1 | inherit cross | ||
2 | |||
3 | DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc ${NATIVEDEPS}" | ||
4 | PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++" | ||
5 | |||
6 | require gcc-configure-cross.inc | ||
7 | require gcc-package-cross.inc | ||
8 | |||
9 | do_compile () { | ||
10 | oe_runmake all-host all-target-libgcc | ||
11 | } | ||
12 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-cross4.inc b/meta/recipes-devtools/gcc/gcc-cross4.inc new file mode 100644 index 0000000000..ea20a24a01 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-cross4.inc | |||
@@ -0,0 +1 @@ | |||
require gcc-cross.inc | |||
diff --git a/meta/recipes-devtools/gcc/gcc-cross_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-cross_4.3.3.bb new file mode 100644 index 0000000000..36f91d0221 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-cross_4.3.3.bb | |||
@@ -0,0 +1,10 @@ | |||
1 | PR = "r15" | ||
2 | |||
3 | require gcc-${PV}.inc | ||
4 | require gcc-cross4.inc | ||
5 | |||
6 | SRC_URI_append_fail-fast = " file://zecke-no-host-includes.patch;patch=1 " | ||
7 | |||
8 | EXTRA_OECONF += "--disable-libunwind-exceptions --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native}" | ||
9 | |||
10 | ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-cross_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-cross_4.5.0.bb new file mode 100644 index 0000000000..8d28ab3e59 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-cross_4.5.0.bb | |||
@@ -0,0 +1,12 @@ | |||
1 | PR = "r6" | ||
2 | |||
3 | require gcc-${PV}.inc | ||
4 | require gcc-cross4.inc | ||
5 | |||
6 | SRC_URI_append_fail-fast = " file://zecke-no-host-includes.patch " | ||
7 | |||
8 | EXTRA_OECONF += "--disable-libunwind-exceptions \ | ||
9 | --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \ | ||
10 | --with-system-zlib" | ||
11 | |||
12 | ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-cross_csl-arm-2008q1.bb b/meta/recipes-devtools/gcc/gcc-cross_csl-arm-2008q1.bb new file mode 100644 index 0000000000..11857b2c37 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-cross_csl-arm-2008q1.bb | |||
@@ -0,0 +1,26 @@ | |||
1 | PR = "r2" | ||
2 | |||
3 | require gcc-csl-arm-2008q1.inc | ||
4 | require gcc-cross4.inc | ||
5 | require gcc-configure-cross.inc | ||
6 | require gcc-package-cross.inc | ||
7 | |||
8 | SRC_URI_append_fail-fast = " file://zecke-no-host-includes.patch " | ||
9 | |||
10 | EXTRA_OECONF += "--disable-multilib --disable-libunwind-exceptions --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native}" | ||
11 | |||
12 | #We don't want i686 linux ending up in the CFLAGS_FOR_TARGET like this: -isystem/OE/angstrom-tmp/staging/i686-linux/usr/include | ||
13 | CFLAGS = "" | ||
14 | CXXFLAGS = "" | ||
15 | LDFLAGS = "" | ||
16 | |||
17 | # staging-linkage and cross-linkage recipes don't work anymore, so do it by hand for this backwards CSL toolchain | ||
18 | do_compile_prepend() { | ||
19 | ln -sf ${STAGING_DIR_TARGET}${target_libdir}/crt*.o ${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/lib/ | ||
20 | ln -sf ${STAGING_DIR_TARGET}${target_libdir}/ld-* ${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/lib/ | ||
21 | ln -sf ${STAGING_DIR_TARGET}/lib/libc* ${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/lib/ | ||
22 | sed -i -e 's:gcc_no_link=yes:gcc_no_link=no:' ${S}/libstdc++-v3/configure | ||
23 | |||
24 | } | ||
25 | |||
26 | ARCH_FLAGS_FOR_TARGET += " -L${STAGING_DIR_TARGET}${target_libdir} -isystem${STAGING_DIR_TARGET}${target_includedir}" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc b/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc new file mode 100644 index 0000000000..eb8d27397d --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc | |||
@@ -0,0 +1,8 @@ | |||
1 | inherit crosssdk | ||
2 | |||
3 | SYSTEMHEADERS = "${SDKPATHNATIVE}${prefix_nativesdk}/include" | ||
4 | SYSTEMLIBS = "${SDKPATHNATIVE}${base_libdir_nativesdk}/" | ||
5 | SYSTEMLIBS1 = "${SDKPATHNATIVE}${libdir_nativesdk}/" | ||
6 | |||
7 | DEPENDS = "virtual/${TARGET_PREFIX}binutils-crosssdk gettext-native" | ||
8 | PROVIDES = "virtual/${TARGET_PREFIX}gcc-initial-crosssdk" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.3.3.bb new file mode 100644 index 0000000000..e804b4b016 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.3.3.bb | |||
@@ -0,0 +1,3 @@ | |||
1 | require gcc-cross-initial_${PV}.bb | ||
2 | require gcc-crosssdk-initial.inc | ||
3 | PR = "r3" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.0.bb new file mode 100644 index 0000000000..c76e4074dc --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.0.bb | |||
@@ -0,0 +1,4 @@ | |||
1 | require gcc-cross-initial_${PV}.bb | ||
2 | require gcc-crosssdk-initial.inc | ||
3 | |||
4 | PR = "r6" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate.inc b/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate.inc new file mode 100644 index 0000000000..ed5d5e838d --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate.inc | |||
@@ -0,0 +1,9 @@ | |||
1 | inherit crosssdk | ||
2 | |||
3 | SYSTEMHEADERS = "${SDKPATHNATIVE}${prefix_nativesdk}/include" | ||
4 | SYSTEMLIBS = "${SDKPATHNATIVE}${base_libdir_nativesdk}/" | ||
5 | SYSTEMLIBS1 = "${SDKPATHNATIVE}${libdir_nativesdk}/" | ||
6 | |||
7 | DEPENDS = "virtual/${TARGET_PREFIX}binutils-crosssdk gettext-native" | ||
8 | DEPENDS += "virtual/${TARGET_PREFIX}libc-initial-nativesdk" | ||
9 | PROVIDES = "virtual/${TARGET_PREFIX}gcc-intermediate-crosssdk" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.3.3.bb new file mode 100644 index 0000000000..5f01473add --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.3.3.bb | |||
@@ -0,0 +1,3 @@ | |||
1 | require gcc-cross-intermediate_${PV}.bb | ||
2 | require gcc-crosssdk-intermediate.inc | ||
3 | PR = "r6" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.0.bb new file mode 100644 index 0000000000..42c498704a --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.0.bb | |||
@@ -0,0 +1,4 @@ | |||
1 | require gcc-cross-intermediate_${PV}.bb | ||
2 | require gcc-crosssdk-intermediate.inc | ||
3 | |||
4 | PR = "r6" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk.inc b/meta/recipes-devtools/gcc/gcc-crosssdk.inc new file mode 100644 index 0000000000..6e7d5a73f9 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-crosssdk.inc | |||
@@ -0,0 +1,16 @@ | |||
1 | inherit crosssdk | ||
2 | |||
3 | SYSTEMHEADERS = "${SDKPATHNATIVE}${prefix_nativesdk}/include" | ||
4 | SYSTEMLIBS = "${SDKPATHNATIVE}${base_libdir_nativesdk}/" | ||
5 | SYSTEMLIBS1 = "${SDKPATHNATIVE}${libdir_nativesdk}/" | ||
6 | |||
7 | GCCMULTILIB = "--disable-multilib" | ||
8 | |||
9 | DEPENDS = "virtual/${TARGET_PREFIX}binutils-crosssdk virtual/${TARGET_PREFIX}libc-for-gcc-nativesdk gettext-native" | ||
10 | PROVIDES = "virtual/${TARGET_PREFIX}gcc-crosssdk virtual/${TARGET_PREFIX}g++-crosssdk" | ||
11 | |||
12 | do_configure_prepend () { | ||
13 | # Change the default dynamic linker path to the one in the SDK | ||
14 | sed -i ${S}/gcc/config/*/linux*.h -e 's#\(GLIBC_DYNAMIC_LINKER.*\)/lib/#\1${SYSTEMLIBS}#' | ||
15 | sed -i ${S}/gcc/config/*/linux*.h -e 's#\(GLIBC_DYNAMIC_LINKER.*\)/lib64/#\1${SYSTEMLIBS}#' | ||
16 | } | ||
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-crosssdk_4.3.3.bb new file mode 100644 index 0000000000..92a3f11388 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-crosssdk_4.3.3.bb | |||
@@ -0,0 +1,3 @@ | |||
1 | require gcc-cross_${PV}.bb | ||
2 | require gcc-crosssdk.inc | ||
3 | PR="r1" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-crosssdk_4.5.0.bb new file mode 100644 index 0000000000..9e94c806d1 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-crosssdk_4.5.0.bb | |||
@@ -0,0 +1,4 @@ | |||
1 | require gcc-cross_${PV}.bb | ||
2 | require gcc-crosssdk.inc | ||
3 | |||
4 | PR = "r6" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm-2005q3.inc b/meta/recipes-devtools/gcc/gcc-csl-arm-2005q3.inc new file mode 100644 index 0000000000..fd2b3793dc --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm-2005q3.inc | |||
@@ -0,0 +1,22 @@ | |||
1 | require gcc-common.inc | ||
2 | |||
3 | BINV = "3.4.4" | ||
4 | PV = "3.4.4+csl-arm-2005q3-2" | ||
5 | PV_chinook-compat = "3.4.4cs2005q3.2" | ||
6 | |||
7 | FILESDIR = "${FILE_DIRNAME}/gcc-csl-arm" | ||
8 | |||
9 | SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/arm-none-eabi/arm-2005q3-2-arm-none-eabi.src.tar.bz2 \ | ||
10 | file://gcc_optab_arm.patch;patch=1 \ | ||
11 | file://gcc-3.4.4-eabi-bigendian.patch;patch=1" | ||
12 | |||
13 | S = "${WORKDIR}/gcc-2005q3" | ||
14 | |||
15 | do_unpack2() { | ||
16 | cd ${WORKDIR} | ||
17 | tar -xvjf ./arm-2005q3-2-arm-none-eabi/gcc-2005q3-2.tar.bz2 | ||
18 | } | ||
19 | |||
20 | addtask unpack2 after do_unpack before do_patch | ||
21 | |||
22 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm-2008q1.inc b/meta/recipes-devtools/gcc/gcc-csl-arm-2008q1.inc new file mode 100644 index 0000000000..e84bd835d2 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm-2008q1.inc | |||
@@ -0,0 +1,53 @@ | |||
1 | require gcc-common.inc | ||
2 | |||
3 | BINV = "4.2.3" | ||
4 | PV = "4.2.3+csl-arm-2008q1-126" | ||
5 | |||
6 | FILESDIR = "${FILE_DIRNAME}/gcc-csl-arm" | ||
7 | |||
8 | SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/arm-none-eabi/arm-2008q1-126-arm-none-eabi.src.tar.bz2 \ | ||
9 | # file://100-uclibc-conf.patch;patch=1 \ | ||
10 | # file://103-uclibc-conf-noupstream.patch;patch=1 \ | ||
11 | # file://200-uclibc-locale.patch;patch=1 \ | ||
12 | # file://203-uclibc-locale-no__x.patch;patch=1 \ | ||
13 | # file://204-uclibc-locale-wchar_fix.patch;patch=1 \ | ||
14 | # file://205-uclibc-locale-update.patch;patch=1 \ | ||
15 | # file://300-libstdc++-pic.patch;patch=1 \ | ||
16 | # file://302-c99-snprintf.patch;patch=1 \ | ||
17 | # file://303-c99-complex-ugly-hack.patch;patch=1 \ | ||
18 | # file://304-index_macro.patch;patch=1 \ | ||
19 | # file://305-libmudflap-susv3-legacy.patch;patch=1 \ | ||
20 | # file://306-libstdc++-namespace.patch;patch=1 \ | ||
21 | # file://307-locale_facets.patch;patch=1 \ | ||
22 | # file://402-libbackend_dep_gcov-iov.h.patch;patch=1 \ | ||
23 | # file://602-sdk-libstdc++-includes.patch;patch=1 \ | ||
24 | file://gcc41-configure.in.patch;patch=1 \ | ||
25 | file://arm-nolibfloat.patch;patch=1 \ | ||
26 | file://arm-softfloat.patch;patch=1 \ | ||
27 | file://zecke-xgcc-cpp.patch;patch=1 \ | ||
28 | # file://gfortran.patch;patch=1 \ | ||
29 | # file://fortran-static-linking.patch;patch=1 \ | ||
30 | # file://gcc-configure-no-fortran.patch;patch=1;pnum=1 \ | ||
31 | # file://gcc-new-makeinfo.patch;patch=1 \ | ||
32 | " | ||
33 | |||
34 | |||
35 | S = "${WORKDIR}/gcc-4.2" | ||
36 | |||
37 | do_unpack2() { | ||
38 | cd ${WORKDIR} | ||
39 | tar -xvjf ./arm-2008q1-126-arm-none-eabi/gcc-2008q1-126.tar.bz2 | ||
40 | } | ||
41 | |||
42 | # Language Overrides | ||
43 | FORTRAN = "" | ||
44 | #FORTRAN_linux-gnueabi = ",fortran" | ||
45 | #JAVA = ",java" | ||
46 | |||
47 | EXTRA_OECONF_BASE = "--enable-libssp --disable-bootstrap --disable-libgomp --disable-libmudflap" | ||
48 | EXTRA_OECONF_INITIAL = "--disable-libmudflap --disable-libgomp --disable-libssp --disable-bootstrap" | ||
49 | EXTRA_OECONF_INTERMEDIATE = "--disable-libmudflap --disable-libgomp --disable-libssp --disable-bootstrap" | ||
50 | |||
51 | ARM_INSTRUCTION_SET = "arm" | ||
52 | |||
53 | addtask unpack2 after do_unpack before do_patch | ||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm/15342.patch b/meta/recipes-devtools/gcc/gcc-csl-arm/15342.patch new file mode 100644 index 0000000000..d0f3e72d47 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm/15342.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | --- gcc/gcc/regrename.c~ 2004-01-14 17:55:20.000000000 +0000 | ||
2 | +++ gcc/gcc/regrename.c 2005-02-28 07:24:25.893015200 +0000 | ||
3 | @@ -671,7 +671,8 @@ | ||
4 | |||
5 | case SET: | ||
6 | scan_rtx (insn, &SET_SRC (x), class, action, OP_IN, 0); | ||
7 | - scan_rtx (insn, &SET_DEST (x), class, action, OP_OUT, 0); | ||
8 | + scan_rtx (insn, &SET_DEST (x), class, action, | ||
9 | + GET_CODE (PATTERN (insn)) == COND_EXEC ? OP_INOUT : OP_OUT, 0); | ||
10 | return; | ||
11 | |||
12 | case STRICT_LOW_PART: | ||
13 | @@ -696,7 +697,8 @@ | ||
14 | abort (); | ||
15 | |||
16 | case CLOBBER: | ||
17 | - scan_rtx (insn, &SET_DEST (x), class, action, OP_OUT, 1); | ||
18 | + scan_rtx (insn, &SET_DEST (x), class, action, | ||
19 | + GET_CODE (PATTERN (insn)) == COND_EXEC ? OP_INOUT : OP_OUT, 0); | ||
20 | return; | ||
21 | |||
22 | case EXPR_LIST: | ||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm/arm-nolibfloat.patch b/meta/recipes-devtools/gcc/gcc-csl-arm/arm-nolibfloat.patch new file mode 100644 index 0000000000..c4897c0330 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm/arm-nolibfloat.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | # Dimitry Andric <dimitry@andric.com>, 2004-05-01 | ||
2 | # | ||
3 | # * Removed the extra -lfloat option from LIBGCC_SPEC, since it isn't needed | ||
4 | # anymore. (The required functions are now in libgcc.) | ||
5 | # | ||
6 | # Fixes errors like | ||
7 | # arm-softfloat-linux-gnu/3.4.0/../../../../arm-softfloat-linux-gnu/bin/ld: cannot find -lfloat | ||
8 | # collect2: ld returned 1 exit status | ||
9 | # make[2]: *** [arm-softfloat-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/iconvdata/ISO8859-1.so] Error 1 | ||
10 | # when building glibc-2.3.3 with gcc-3.4.0 for arm-softfloat | ||
11 | |||
12 | Index: gcc-4.0.2/gcc/config/arm/linux-elf.h | ||
13 | =================================================================== | ||
14 | --- gcc-4.0.2.orig/gcc/config/arm/linux-elf.h 2005-03-04 16:14:01.000000000 +0000 | ||
15 | +++ gcc-4.0.2/gcc/config/arm/linux-elf.h 2005-11-11 18:02:54.000000000 +0000 | ||
16 | @@ -56,7 +56,7 @@ | ||
17 | %{shared:-lc} \ | ||
18 | %{!shared:%{profile:-lc_p}%{!profile:-lc}}" | ||
19 | |||
20 | -#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc" | ||
21 | +#define LIBGCC_SPEC "-lgcc" | ||
22 | |||
23 | /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add | ||
24 | the GNU/Linux magical crtbegin.o file (see crtstuff.c) which | ||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm/arm-softfloat.patch b/meta/recipes-devtools/gcc/gcc-csl-arm/arm-softfloat.patch new file mode 100644 index 0000000000..5e1edd9208 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm/arm-softfloat.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | Index: gcc-4.0.2/gcc/config/arm/t-linux | ||
2 | =================================================================== | ||
3 | --- gcc-4.0.2.orig/gcc/config/arm/t-linux 2004-05-15 12:41:35.000000000 +0000 | ||
4 | +++ gcc-4.0.2/gcc/config/arm/t-linux 2005-11-11 16:07:53.000000000 +0000 | ||
5 | @@ -4,7 +4,10 @@ | ||
6 | LIBGCC2_DEBUG_CFLAGS = -g0 | ||
7 | |||
8 | LIB1ASMSRC = arm/lib1funcs.asm | ||
9 | -LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx | ||
10 | +LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \ | ||
11 | + _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \ | ||
12 | + _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ | ||
13 | + _fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundisf _floatundidf | ||
14 | |||
15 | # MULTILIB_OPTIONS = mhard-float/msoft-float | ||
16 | # MULTILIB_DIRNAMES = hard-float soft-float | ||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm/cache-amnesia.patch b/meta/recipes-devtools/gcc/gcc-csl-arm/cache-amnesia.patch new file mode 100644 index 0000000000..ef7cd111c5 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm/cache-amnesia.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | diff --git a/gcc/configure b/gcc/configure | ||
2 | index 44620ab..6e1830c 100755 | ||
3 | --- a/gcc/configure | ||
4 | +++ b/gcc/configure | ||
5 | @@ -12272,7 +12272,7 @@ else | ||
6 | esac | ||
7 | saved_CFLAGS="${CFLAGS}" | ||
8 | CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ | ||
9 | - ${realsrcdir}/configure \ | ||
10 | + CONFIG_SITE= ${realsrcdir}/configure --cache-file=./other.cache \ | ||
11 | --enable-languages=${enable_languages-all} \ | ||
12 | --target=$target_alias --host=$build_alias --build=$build_alias | ||
13 | CFLAGS="${saved_CFLAGS}" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm/fortran-static-linking.patch b/meta/recipes-devtools/gcc/gcc-csl-arm/fortran-static-linking.patch new file mode 100644 index 0000000000..3dd6321dc3 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm/fortran-static-linking.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | f951 (fortran) links to MPFR and GMP of our staging area but when executing | ||
2 | the command the libs can not be found. Use rpath like all the other apps in | ||
3 | our staging bin/ directory. | ||
4 | |||
5 | Patch the configure to avoid the regeneration... | ||
6 | |||
7 | Index: gcc-4.2.2/configure | ||
8 | =================================================================== | ||
9 | --- gcc-4.2.2.orig/configure 2008-01-15 23:23:41.000000000 +0100 | ||
10 | +++ gcc-4.2.2/configure 2008-01-15 23:25:20.000000000 +0100 | ||
11 | @@ -2278,14 +2278,14 @@ | ||
12 | |||
13 | |||
14 | if test "x$with_mpfr" != x; then | ||
15 | - gmplibs="-L$with_mpfr/lib $gmplibs" | ||
16 | + gmplibs="-static -L$with_mpfr/lib $gmplibs" | ||
17 | gmpinc="-I$with_mpfr/include" | ||
18 | fi | ||
19 | if test "x$with_mpfr_include" != x; then | ||
20 | gmpinc="-I$with_mpfr_include" | ||
21 | fi | ||
22 | if test "x$with_mpfr_lib" != x; then | ||
23 | - gmplibs="-L$with_mpfr_lib $gmplibs" | ||
24 | + gmplibs="-static -L$with_mpfr_lib $gmplibs" | ||
25 | fi | ||
26 | |||
27 | # Specify a location for gmp | ||
28 | Index: gcc-4.2.2/configure.in | ||
29 | =================================================================== | ||
30 | --- gcc-4.2.2.orig/configure.in 2008-01-15 23:23:41.000000000 +0100 | ||
31 | +++ gcc-4.2.2/configure.in 2008-01-15 23:24:36.000000000 +0100 | ||
32 | @@ -1066,14 +1066,14 @@ | ||
33 | AC_ARG_WITH(mpfr_lib, [ --with-mpfr-lib=PATH Specify the directory for the installed MPFR library]) | ||
34 | |||
35 | if test "x$with_mpfr" != x; then | ||
36 | - gmplibs="-L$with_mpfr/lib $gmplibs" | ||
37 | + gmplibs="-static -L$with_mpfr/lib $gmplibs" | ||
38 | gmpinc="-I$with_mpfr/include" | ||
39 | fi | ||
40 | if test "x$with_mpfr_include" != x; then | ||
41 | gmpinc="-I$with_mpfr_include" | ||
42 | fi | ||
43 | if test "x$with_mpfr_lib" != x; then | ||
44 | - gmplibs="-L$with_mpfr_lib $gmplibs" | ||
45 | + gmplibs="-static -L$with_mpfr_lib $gmplibs" | ||
46 | fi | ||
47 | |||
48 | # Specify a location for gmp | ||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm/gcc-3.4.0-arm-lib1asm.patch b/meta/recipes-devtools/gcc/gcc-csl-arm/gcc-3.4.0-arm-lib1asm.patch new file mode 100644 index 0000000000..cf17da6a02 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm/gcc-3.4.0-arm-lib1asm.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | # Fixes errors like the following when building glibc (or any other executable | ||
2 | # or shared library) when using gcc 3.4.0 for ARM with softfloat: | ||
3 | # | ||
4 | # .../libc_pic.os(.text+0x15834): In function `__modf': undefined reference to `__subdf3' | ||
5 | # .../libc_pic.os(.text+0x158b8): In function `__modf': undefined reference to `__subdf3' | ||
6 | # .../libc_pic.os(.text+0x1590c): In function `scalbn': undefined reference to `__muldf3' | ||
7 | # .../libc_pic.os(.text+0x15e94): In function `__ldexpf': undefined reference to `__eqsf2' | ||
8 | # .../libc_pic.os(.text+0xcee4c): In function `monstartup': undefined reference to `__fixsfsi' | ||
9 | |||
10 | diff -urNd gcc-3.4.0-orig/gcc/config/arm/t-linux gcc-3.4.0/gcc/config/arm/t-linux | ||
11 | --- gcc-3.4.0-orig/gcc/config/arm/t-linux 2003-09-20 23:09:07.000000000 +0200 | ||
12 | +++ gcc-3.4.0/gcc/config/arm/t-linux 2004-05-01 20:31:59.102846400 +0200 | ||
13 | @@ -4,7 +4,10 @@ | ||
14 | LIBGCC2_DEBUG_CFLAGS = -g0 | ||
15 | |||
16 | LIB1ASMSRC = arm/lib1funcs.asm | ||
17 | -LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx | ||
18 | +LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \ | ||
19 | + _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \ | ||
20 | + _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ | ||
21 | + _fixsfsi _fixunssfsi _floatdidf _floatdisf | ||
22 | |||
23 | # MULTILIB_OPTIONS = mhard-float/msoft-float | ||
24 | # MULTILIB_DIRNAMES = hard-float soft-float | ||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm/gcc-3.4.4-eabi-bigendian.patch b/meta/recipes-devtools/gcc/gcc-csl-arm/gcc-3.4.4-eabi-bigendian.patch new file mode 100644 index 0000000000..e6cc42bb65 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm/gcc-3.4.4-eabi-bigendian.patch | |||
@@ -0,0 +1,12 @@ | |||
1 | --- gcc-2005q3/gcc/config/arm/linux-eabi.h~ 2007-07-10 09:19:47.000000000 +0930 | ||
2 | +++ gcc-2005q3/gcc/config/arm/linux-eabi.h 2007-07-10 10:42:37.000000000 +0930 | ||
3 | @@ -48,7 +48,8 @@ | ||
4 | #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi | ||
5 | |||
6 | #undef SUBTARGET_EXTRA_LINK_SPEC | ||
7 | -#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi" | ||
8 | +#define SUBTARGET_EXTRA_LINK_SPEC \ | ||
9 | + " %{mbig-endian:-m armelfb_linux_eabi} %{mlittle-endian:-m armelf_linux_eabi} " | ||
10 | |||
11 | /* Use ld-linux.so.3 so that it will be possible to run "classic" | ||
12 | GNU/Linux binaries on an EABI system. */ | ||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm/gcc-3.4.4-makefile-fix.patch b/meta/recipes-devtools/gcc/gcc-csl-arm/gcc-3.4.4-makefile-fix.patch new file mode 100644 index 0000000000..74c1f26833 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm/gcc-3.4.4-makefile-fix.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | --- gcc-3.4.4/gcc/Makefile.in.orig 2005-07-25 21:00:37 +0200 | ||
2 | +++ gcc-3.4.4/gcc/Makefile.in 2005-07-25 21:01:19 +0200 | ||
3 | @@ -304,7 +304,7 @@ | ||
4 | if [ "$(host)" = "$(target)" ] ; then \ | ||
5 | echo ar; \ | ||
6 | else \ | ||
7 | - t='$(program_transform_name)'; echo ar | sed -e $$t ; \ | ||
8 | + t='$(program_transform_name)'; echo ar | sed -e "$$t" ; \ | ||
9 | fi; \ | ||
10 | fi` | ||
11 | AR_FLAGS_FOR_TARGET = | ||
12 | @@ -317,7 +317,7 @@ | ||
13 | if [ "$(host)" = "$(target)" ] ; then \ | ||
14 | echo $(RANLIB); \ | ||
15 | else \ | ||
16 | - t='$(program_transform_name)'; echo ranlib | sed -e $$t ; \ | ||
17 | + t='$(program_transform_name)'; echo ranlib | sed -e "$$t" ; \ | ||
18 | fi; \ | ||
19 | fi` | ||
20 | NM_FOR_TARGET = ` \ | ||
21 | @@ -329,7 +329,7 @@ | ||
22 | if [ "$(host)" = "$(target)" ] ; then \ | ||
23 | echo nm; \ | ||
24 | else \ | ||
25 | - t='$(program_transform_name)'; echo nm | sed -e $$t ; \ | ||
26 | + t='$(program_transform_name)'; echo nm | sed -e "$$t" ; \ | ||
27 | fi; \ | ||
28 | fi` | ||
29 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm/gcc-configure-no-fortran.patch b/meta/recipes-devtools/gcc/gcc-csl-arm/gcc-configure-no-fortran.patch new file mode 100644 index 0000000000..c845503303 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm/gcc-configure-no-fortran.patch | |||
@@ -0,0 +1,1075 @@ | |||
1 | --- tmp/configure.in.orig 2006-09-05 17:50:48.000000000 +0100 | ||
2 | +++ tmp/configure.in 2006-09-05 17:50:48.000000000 +0100 | ||
3 | @@ -157,7 +157,6 @@ | ||
4 | target-libstdc++-v3 \ | ||
5 | target-libmudflap \ | ||
6 | target-libssp \ | ||
7 | - target-libgfortran \ | ||
8 | ${libgcj} \ | ||
9 | target-libobjc \ | ||
10 | target-libada" | ||
11 | @@ -1084,77 +1083,6 @@ | ||
12 | AC_SUBST(docdir) | ||
13 | AC_SUBST(htmldir) | ||
14 | |||
15 | -# Check for GMP and MPFR | ||
16 | -gmplibs= | ||
17 | -gmpinc= | ||
18 | -have_gmp=yes | ||
19 | -# Specify a location for mpfr | ||
20 | -# check for this first so it ends up on the link line before gmp. | ||
21 | -AC_ARG_WITH(mpfr-dir, [ --with-mpfr-dir=PATH Specify source directory for MPFR library]) | ||
22 | - | ||
23 | -if test "x$with_mpfr_dir" != x; then | ||
24 | - gmpinc="-I$with_mpfr_dir" | ||
25 | - gmplibs="$with_mpfr_dir/libmpfr.a" | ||
26 | -else | ||
27 | - gmplibs="-lmpfr" | ||
28 | -fi | ||
29 | - | ||
30 | -AC_ARG_WITH(mpfr, [ --with-mpfr=PATH Specify directory for installed MPFR library]) | ||
31 | - | ||
32 | -if test "x$with_mpfr" != x; then | ||
33 | - gmplibs="-L$with_mpfr/lib $gmplibs" | ||
34 | - gmpinc="-I$with_mpfr/include" | ||
35 | -fi | ||
36 | - | ||
37 | -# Specify a location for gmp | ||
38 | -AC_ARG_WITH(gmp-dir, [ --with-gmp-dir=PATH Specify source directory for GMP library]) | ||
39 | - | ||
40 | -if test "x$with_gmp_dir" != x; then | ||
41 | - gmpinc="$gmpinc -I$with_gmp_dir" | ||
42 | - if test -f "$with_gmp_dir/.libs/libgmp.a"; then | ||
43 | - gmplibs="$gmplibs $with_gmp_dir/.libs/libgmp.a" | ||
44 | - elif test -f "$with_gmp_dir/_libs/libgmp.a"; then | ||
45 | - gmplibs="$gmplibs $with_gmp_dir/_libs/libgmp.a" | ||
46 | - fi | ||
47 | - # One of the later tests will catch the error if neither library is present. | ||
48 | -else | ||
49 | - gmplibs="$gmplibs -lgmp" | ||
50 | -fi | ||
51 | - | ||
52 | -AC_ARG_WITH(gmp, [ --with-gmp=PATH Specify directory for installed GMP library]) | ||
53 | - | ||
54 | -if test "x$with_gmp" != x; then | ||
55 | - gmplibs="-L$with_gmp/lib $gmplibs" | ||
56 | - gmpinc="-I$with_gmp/include $gmpinc" | ||
57 | -fi | ||
58 | - | ||
59 | -saved_CFLAGS="$CFLAGS" | ||
60 | -CFLAGS="$CFLAGS $gmpinc" | ||
61 | -# Check GMP actually works | ||
62 | -AC_MSG_CHECKING([for correct version of gmp.h]) | ||
63 | -AC_TRY_COMPILE([#include "gmp.h"],[ | ||
64 | -#if __GNU_MP_VERSION < 3 | ||
65 | -choke me | ||
66 | -#endif | ||
67 | -], [AC_MSG_RESULT([yes])], | ||
68 | - [AC_MSG_RESULT([no]); have_gmp=no]) | ||
69 | - | ||
70 | -if test x"$have_gmp" = xyes; then | ||
71 | - AC_MSG_CHECKING([for MPFR]) | ||
72 | - | ||
73 | - saved_LIBS="$LIBS" | ||
74 | - LIBS="$LIBS $gmplibs" | ||
75 | - AC_TRY_LINK([#include <gmp.h> | ||
76 | -#include <mpfr.h>], [mpfr_t n; mpfr_init(n);], | ||
77 | - [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no]) | ||
78 | - LIBS="$saved_LIBS" | ||
79 | - CFLAGS="$saved_CFLAGS" | ||
80 | -fi | ||
81 | - | ||
82 | -# Flags needed for both GMP and/or MPFR | ||
83 | -AC_SUBST(gmplibs) | ||
84 | -AC_SUBST(gmpinc) | ||
85 | - | ||
86 | # By default, C is the only stage 1 language. | ||
87 | stage1_languages=c | ||
88 | AC_SUBST(stage1_languages) | ||
89 | @@ -1182,15 +1110,6 @@ | ||
90 | fi | ||
91 | enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e 's/,$//'` | ||
92 | |||
93 | - # 'f95' is the old name for the 'fortran' language. We issue a warning | ||
94 | - # and make the substitution. | ||
95 | - case ,${enable_languages}, in | ||
96 | - *,f95,*) | ||
97 | - echo configure.in: warning: 'f95' as language name is deprecated, use 'fortran' instead 1>&2 | ||
98 | - enable_languages=`echo "${enable_languages}" | sed -e 's/f95/fortran/g'` | ||
99 | - ;; | ||
100 | - esac | ||
101 | - | ||
102 | # First scan to see if an enabled language requires some other language. | ||
103 | # We assume that a given config-lang.in will list all the language | ||
104 | # front ends it requires, even if some are required indirectly. | ||
105 | @@ -2213,7 +2132,6 @@ | ||
106 | NCN_STRICT_CHECK_TARGET_TOOLS(DLLTOOL_FOR_TARGET, dlltool) | ||
107 | NCN_STRICT_CHECK_TARGET_TOOLS(GCC_FOR_TARGET, gcc, ${CC_FOR_TARGET}) | ||
108 | NCN_STRICT_CHECK_TARGET_TOOLS(GCJ_FOR_TARGET, gcj) | ||
109 | -NCN_STRICT_CHECK_TARGET_TOOLS(GFORTRAN_FOR_TARGET, gfortran) | ||
110 | NCN_STRICT_CHECK_TARGET_TOOLS(LD_FOR_TARGET, ld) | ||
111 | NCN_STRICT_CHECK_TARGET_TOOLS(LIPO_FOR_TARGET, lipo) | ||
112 | NCN_STRICT_CHECK_TARGET_TOOLS(NM_FOR_TARGET, nm) | ||
113 | @@ -2237,9 +2155,7 @@ | ||
114 | GCC_TARGET_TOOL(gcc, GCC_FOR_TARGET, , [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/]) | ||
115 | GCC_TARGET_TOOL(gcj, GCJ_FOR_TARGET, GCJ, | ||
116 | [gcc/gcj -B$$r/$(HOST_SUBDIR)/gcc/], java) | ||
117 | -GCC_TARGET_TOOL(gfortran, GFORTRAN_FOR_TARGET, GFORTRAN, | ||
118 | - [gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/], fortran) | ||
119 | GCC_TARGET_TOOL(ld, LD_FOR_TARGET, LD, [ld/ld-new]) | ||
120 | GCC_TARGET_TOOL(lipo, LIPO_FOR_TARGET, LIPO) | ||
121 | GCC_TARGET_TOOL(nm, NM_FOR_TARGET, NM, [binutils/nm-new]) | ||
122 | |||
123 | --- tmp/Makefile.in.orig 2006-09-06 08:33:46.000000000 +0100 | ||
124 | +++ tmp/Makefile.in 2006-09-06 08:33:46.000000000 +0100 | ||
125 | @@ -119,7 +119,6 @@ | ||
126 | CXX="$(CXX_FOR_BUILD)"; export CXX; \ | ||
127 | CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ | ||
128 | GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \ | ||
129 | - GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \ | ||
130 | DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \ | ||
131 | LD="$(LD_FOR_BUILD)"; export LD; \ | ||
132 | LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \ | ||
133 | @@ -201,7 +200,6 @@ | ||
134 | CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ | ||
135 | CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ | ||
136 | GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ | ||
137 | - GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \ | ||
138 | DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ | ||
139 | LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \ | ||
140 | LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ | ||
141 | @@ -313,7 +311,6 @@ | ||
142 | CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@ $(FLAGS_FOR_TARGET) | ||
143 | RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@ $(FLAGS_FOR_TARGET) | ||
144 | GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@ $(FLAGS_FOR_TARGET) | ||
145 | -GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@ $(FLAGS_FOR_TARGET) | ||
146 | DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@ | ||
147 | LD_FOR_TARGET=@LD_FOR_TARGET@ | ||
148 | |||
149 | @@ -452,7 +449,6 @@ | ||
150 | "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \ | ||
151 | "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \ | ||
152 | "GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \ | ||
153 | - "GFORTRAN_FOR_TARGET=$(GFORTRAN_FOR_TARGET)" \ | ||
154 | "LD_FOR_TARGET=$(LD_FOR_TARGET)" \ | ||
155 | "LIPO_FOR_TARGET=$(LIPO_FOR_TARGET)" \ | ||
156 | "LDFLAGS_FOR_TARGET=$(LDFLAGS_FOR_TARGET)" \ | ||
157 | @@ -618,7 +614,6 @@ | ||
158 | maybe-configure-target-libmudflap \ | ||
159 | maybe-configure-target-libssp \ | ||
160 | maybe-configure-target-newlib \ | ||
161 | - maybe-configure-target-libgfortran \ | ||
162 | maybe-configure-target-libobjc \ | ||
163 | maybe-configure-target-libtermcap \ | ||
164 | maybe-configure-target-winsup \ | ||
165 | @@ -737,7 +732,6 @@ | ||
166 | maybe-all-target-libmudflap \ | ||
167 | maybe-all-target-libssp \ | ||
168 | maybe-all-target-newlib \ | ||
169 | - maybe-all-target-libgfortran \ | ||
170 | maybe-all-target-libobjc \ | ||
171 | maybe-all-target-libtermcap \ | ||
172 | maybe-all-target-winsup \ | ||
173 | @@ -844,7 +838,6 @@ | ||
174 | maybe-info-target-libmudflap \ | ||
175 | maybe-info-target-libssp \ | ||
176 | maybe-info-target-newlib \ | ||
177 | - maybe-info-target-libgfortran \ | ||
178 | maybe-info-target-libobjc \ | ||
179 | maybe-info-target-libtermcap \ | ||
180 | maybe-info-target-winsup \ | ||
181 | @@ -946,7 +939,6 @@ | ||
182 | maybe-dvi-target-libmudflap \ | ||
183 | maybe-dvi-target-libssp \ | ||
184 | maybe-dvi-target-newlib \ | ||
185 | - maybe-dvi-target-libgfortran \ | ||
186 | maybe-dvi-target-libobjc \ | ||
187 | maybe-dvi-target-libtermcap \ | ||
188 | maybe-dvi-target-winsup \ | ||
189 | @@ -1048,7 +1040,6 @@ | ||
190 | maybe-html-target-libmudflap \ | ||
191 | maybe-html-target-libssp \ | ||
192 | maybe-html-target-newlib \ | ||
193 | - maybe-html-target-libgfortran \ | ||
194 | maybe-html-target-libobjc \ | ||
195 | maybe-html-target-libtermcap \ | ||
196 | maybe-html-target-winsup \ | ||
197 | @@ -1150,7 +1141,6 @@ | ||
198 | maybe-TAGS-target-libmudflap \ | ||
199 | maybe-TAGS-target-libssp \ | ||
200 | maybe-TAGS-target-newlib \ | ||
201 | - maybe-TAGS-target-libgfortran \ | ||
202 | maybe-TAGS-target-libobjc \ | ||
203 | maybe-TAGS-target-libtermcap \ | ||
204 | maybe-TAGS-target-winsup \ | ||
205 | @@ -1252,7 +1242,6 @@ | ||
206 | maybe-install-info-target-libmudflap \ | ||
207 | maybe-install-info-target-libssp \ | ||
208 | maybe-install-info-target-newlib \ | ||
209 | - maybe-install-info-target-libgfortran \ | ||
210 | maybe-install-info-target-libobjc \ | ||
211 | maybe-install-info-target-libtermcap \ | ||
212 | maybe-install-info-target-winsup \ | ||
213 | @@ -1354,7 +1343,6 @@ | ||
214 | maybe-install-html-target-libmudflap \ | ||
215 | maybe-install-html-target-libssp \ | ||
216 | maybe-install-html-target-newlib \ | ||
217 | - maybe-install-html-target-libgfortran \ | ||
218 | maybe-install-html-target-libobjc \ | ||
219 | maybe-install-html-target-libtermcap \ | ||
220 | maybe-install-html-target-winsup \ | ||
221 | @@ -1456,7 +1444,6 @@ | ||
222 | maybe-installcheck-target-libmudflap \ | ||
223 | maybe-installcheck-target-libssp \ | ||
224 | maybe-installcheck-target-newlib \ | ||
225 | - maybe-installcheck-target-libgfortran \ | ||
226 | maybe-installcheck-target-libobjc \ | ||
227 | maybe-installcheck-target-libtermcap \ | ||
228 | maybe-installcheck-target-winsup \ | ||
229 | @@ -1558,7 +1545,6 @@ | ||
230 | maybe-mostlyclean-target-libmudflap \ | ||
231 | maybe-mostlyclean-target-libssp \ | ||
232 | maybe-mostlyclean-target-newlib \ | ||
233 | - maybe-mostlyclean-target-libgfortran \ | ||
234 | maybe-mostlyclean-target-libobjc \ | ||
235 | maybe-mostlyclean-target-libtermcap \ | ||
236 | maybe-mostlyclean-target-winsup \ | ||
237 | @@ -1660,7 +1646,6 @@ | ||
238 | maybe-clean-target-libmudflap \ | ||
239 | maybe-clean-target-libssp \ | ||
240 | maybe-clean-target-newlib \ | ||
241 | - maybe-clean-target-libgfortran \ | ||
242 | maybe-clean-target-libobjc \ | ||
243 | maybe-clean-target-libtermcap \ | ||
244 | maybe-clean-target-winsup \ | ||
245 | @@ -1762,7 +1747,6 @@ | ||
246 | maybe-distclean-target-libmudflap \ | ||
247 | maybe-distclean-target-libssp \ | ||
248 | maybe-distclean-target-newlib \ | ||
249 | - maybe-distclean-target-libgfortran \ | ||
250 | maybe-distclean-target-libobjc \ | ||
251 | maybe-distclean-target-libtermcap \ | ||
252 | maybe-distclean-target-winsup \ | ||
253 | @@ -1864,7 +1848,6 @@ | ||
254 | maybe-maintainer-clean-target-libmudflap \ | ||
255 | maybe-maintainer-clean-target-libssp \ | ||
256 | maybe-maintainer-clean-target-newlib \ | ||
257 | - maybe-maintainer-clean-target-libgfortran \ | ||
258 | maybe-maintainer-clean-target-libobjc \ | ||
259 | maybe-maintainer-clean-target-libtermcap \ | ||
260 | maybe-maintainer-clean-target-winsup \ | ||
261 | @@ -2024,7 +2007,6 @@ | ||
262 | maybe-check-target-libmudflap \ | ||
263 | maybe-check-target-libssp \ | ||
264 | maybe-check-target-newlib \ | ||
265 | - maybe-check-target-libgfortran \ | ||
266 | maybe-check-target-libobjc \ | ||
267 | maybe-check-target-libtermcap \ | ||
268 | maybe-check-target-winsup \ | ||
269 | @@ -2223,7 +2205,6 @@ | ||
270 | maybe-install-target-libmudflap \ | ||
271 | maybe-install-target-libssp \ | ||
272 | maybe-install-target-newlib \ | ||
273 | - maybe-install-target-libgfortran \ | ||
274 | maybe-install-target-libobjc \ | ||
275 | maybe-install-target-libtermcap \ | ||
276 | maybe-install-target-winsup \ | ||
277 | @@ -31606,382 +31587,6 @@ | ||
278 | |||
279 | |||
280 | # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. | ||
281 | -@if target-libgfortran | ||
282 | -$(TARGET_SUBDIR)/libgfortran/multilib.out: multilib.out | ||
283 | - $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgfortran ; \ | ||
284 | - rm -f $(TARGET_SUBDIR)/libgfortran/Makefile || : ; \ | ||
285 | - cp multilib.out $(TARGET_SUBDIR)/libgfortran/multilib.out | ||
286 | -@endif target-libgfortran | ||
287 | - | ||
288 | - | ||
289 | - | ||
290 | -.PHONY: configure-target-libgfortran maybe-configure-target-libgfortran | ||
291 | -maybe-configure-target-libgfortran: | ||
292 | -@if target-libgfortran | ||
293 | -maybe-configure-target-libgfortran: configure-target-libgfortran | ||
294 | -configure-target-libgfortran: $(TARGET_SUBDIR)/libgfortran/multilib.out | ||
295 | - @$(unstage) | ||
296 | - @test ! -f $(TARGET_SUBDIR)/libgfortran/Makefile || exit 0; \ | ||
297 | - $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgfortran ; \ | ||
298 | - r=`${PWD_COMMAND}`; export r; \ | ||
299 | - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
300 | - $(NORMAL_TARGET_EXPORTS) \ | ||
301 | - echo Configuring in $(TARGET_SUBDIR)/libgfortran; \ | ||
302 | - cd "$(TARGET_SUBDIR)/libgfortran" || exit 1; \ | ||
303 | - case $(srcdir) in \ | ||
304 | - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ | ||
305 | - *) topdir=`echo $(TARGET_SUBDIR)/libgfortran/ | \ | ||
306 | - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ | ||
307 | - esac; \ | ||
308 | - srcdiroption="--srcdir=$${topdir}/libgfortran"; \ | ||
309 | - libsrcdir="$$s/libgfortran"; \ | ||
310 | - rm -f no-such-file || : ; \ | ||
311 | - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ | ||
312 | - $(TARGET_CONFIGARGS) $${srcdiroption} \ | ||
313 | - || exit 1 | ||
314 | -@endif target-libgfortran | ||
315 | - | ||
316 | - | ||
317 | - | ||
318 | - | ||
319 | - | ||
320 | -.PHONY: all-target-libgfortran maybe-all-target-libgfortran | ||
321 | -maybe-all-target-libgfortran: | ||
322 | -@if target-libgfortran | ||
323 | -TARGET-target-libgfortran=all | ||
324 | -maybe-all-target-libgfortran: all-target-libgfortran | ||
325 | -all-target-libgfortran: configure-target-libgfortran | ||
326 | - @$(unstage) | ||
327 | - @r=`${PWD_COMMAND}`; export r; \ | ||
328 | - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
329 | - $(NORMAL_TARGET_EXPORTS) \ | ||
330 | - (cd $(TARGET_SUBDIR)/libgfortran && \ | ||
331 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libgfortran)) | ||
332 | -@endif target-libgfortran | ||
333 | - | ||
334 | - | ||
335 | - | ||
336 | - | ||
337 | - | ||
338 | -.PHONY: check-target-libgfortran maybe-check-target-libgfortran | ||
339 | -maybe-check-target-libgfortran: | ||
340 | -@if target-libgfortran | ||
341 | -maybe-check-target-libgfortran: check-target-libgfortran | ||
342 | - | ||
343 | -check-target-libgfortran: | ||
344 | - @: $(MAKE); $(unstage) | ||
345 | - @r=`${PWD_COMMAND}`; export r; \ | ||
346 | - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
347 | - $(NORMAL_TARGET_EXPORTS) \ | ||
348 | - (cd $(TARGET_SUBDIR)/libgfortran && \ | ||
349 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) check) | ||
350 | - | ||
351 | -@endif target-libgfortran | ||
352 | - | ||
353 | -.PHONY: install-target-libgfortran maybe-install-target-libgfortran | ||
354 | -maybe-install-target-libgfortran: | ||
355 | -@if target-libgfortran | ||
356 | -maybe-install-target-libgfortran: install-target-libgfortran | ||
357 | - | ||
358 | -install-target-libgfortran: installdirs | ||
359 | - @: $(MAKE); $(unstage) | ||
360 | - @r=`${PWD_COMMAND}`; export r; \ | ||
361 | - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
362 | - $(NORMAL_TARGET_EXPORTS) \ | ||
363 | - (cd $(TARGET_SUBDIR)/libgfortran && \ | ||
364 | - $(MAKE) $(TARGET_FLAGS_TO_PASS) install) | ||
365 | - | ||
366 | -@endif target-libgfortran | ||
367 | - | ||
368 | -# Other targets (info, dvi, etc.) | ||
369 | - | ||
370 | -.PHONY: maybe-info-target-libgfortran info-target-libgfortran | ||
371 | -maybe-info-target-libgfortran: | ||
372 | -@if target-libgfortran | ||
373 | -maybe-info-target-libgfortran: info-target-libgfortran | ||
374 | - | ||
375 | -info-target-libgfortran: \ | ||
376 | - configure-target-libgfortran | ||
377 | - @: $(MAKE); $(unstage) | ||
378 | - @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ | ||
379 | - r=`${PWD_COMMAND}`; export r; \ | ||
380 | - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
381 | - $(NORMAL_TARGET_EXPORTS) \ | ||
382 | - echo "Doing info in $(TARGET_SUBDIR)/libgfortran" ; \ | ||
383 | - for flag in $(EXTRA_TARGET_FLAGS); do \ | ||
384 | - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | ||
385 | - done; \ | ||
386 | - (cd $(TARGET_SUBDIR)/libgfortran && \ | ||
387 | - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ | ||
388 | - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | ||
389 | - "RANLIB=$${RANLIB}" \ | ||
390 | - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | ||
391 | - info) \ | ||
392 | - || exit 1 | ||
393 | - | ||
394 | -@endif target-libgfortran | ||
395 | - | ||
396 | -.PHONY: maybe-dvi-target-libgfortran dvi-target-libgfortran | ||
397 | -maybe-dvi-target-libgfortran: | ||
398 | -@if target-libgfortran | ||
399 | -maybe-dvi-target-libgfortran: dvi-target-libgfortran | ||
400 | - | ||
401 | -dvi-target-libgfortran: \ | ||
402 | - configure-target-libgfortran | ||
403 | - @: $(MAKE); $(unstage) | ||
404 | - @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ | ||
405 | - r=`${PWD_COMMAND}`; export r; \ | ||
406 | - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
407 | - $(NORMAL_TARGET_EXPORTS) \ | ||
408 | - echo "Doing dvi in $(TARGET_SUBDIR)/libgfortran" ; \ | ||
409 | - for flag in $(EXTRA_TARGET_FLAGS); do \ | ||
410 | - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | ||
411 | - done; \ | ||
412 | - (cd $(TARGET_SUBDIR)/libgfortran && \ | ||
413 | - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ | ||
414 | - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | ||
415 | - "RANLIB=$${RANLIB}" \ | ||
416 | - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | ||
417 | - dvi) \ | ||
418 | - || exit 1 | ||
419 | - | ||
420 | -@endif target-libgfortran | ||
421 | - | ||
422 | -.PHONY: maybe-html-target-libgfortran html-target-libgfortran | ||
423 | -maybe-html-target-libgfortran: | ||
424 | -@if target-libgfortran | ||
425 | -maybe-html-target-libgfortran: html-target-libgfortran | ||
426 | - | ||
427 | -html-target-libgfortran: \ | ||
428 | - configure-target-libgfortran | ||
429 | - @: $(MAKE); $(unstage) | ||
430 | - @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ | ||
431 | - r=`${PWD_COMMAND}`; export r; \ | ||
432 | - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
433 | - $(NORMAL_TARGET_EXPORTS) \ | ||
434 | - echo "Doing html in $(TARGET_SUBDIR)/libgfortran" ; \ | ||
435 | - for flag in $(EXTRA_TARGET_FLAGS); do \ | ||
436 | - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | ||
437 | - done; \ | ||
438 | - (cd $(TARGET_SUBDIR)/libgfortran && \ | ||
439 | - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ | ||
440 | - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | ||
441 | - "RANLIB=$${RANLIB}" \ | ||
442 | - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | ||
443 | - html) \ | ||
444 | - || exit 1 | ||
445 | - | ||
446 | -@endif target-libgfortran | ||
447 | - | ||
448 | -.PHONY: maybe-TAGS-target-libgfortran TAGS-target-libgfortran | ||
449 | -maybe-TAGS-target-libgfortran: | ||
450 | -@if target-libgfortran | ||
451 | -maybe-TAGS-target-libgfortran: TAGS-target-libgfortran | ||
452 | - | ||
453 | -TAGS-target-libgfortran: \ | ||
454 | - configure-target-libgfortran | ||
455 | - @: $(MAKE); $(unstage) | ||
456 | - @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ | ||
457 | - r=`${PWD_COMMAND}`; export r; \ | ||
458 | - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
459 | - $(NORMAL_TARGET_EXPORTS) \ | ||
460 | - echo "Doing TAGS in $(TARGET_SUBDIR)/libgfortran" ; \ | ||
461 | - for flag in $(EXTRA_TARGET_FLAGS); do \ | ||
462 | - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | ||
463 | - done; \ | ||
464 | - (cd $(TARGET_SUBDIR)/libgfortran && \ | ||
465 | - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ | ||
466 | - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | ||
467 | - "RANLIB=$${RANLIB}" \ | ||
468 | - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | ||
469 | - TAGS) \ | ||
470 | - || exit 1 | ||
471 | - | ||
472 | -@endif target-libgfortran | ||
473 | - | ||
474 | -.PHONY: maybe-install-info-target-libgfortran install-info-target-libgfortran | ||
475 | -maybe-install-info-target-libgfortran: | ||
476 | -@if target-libgfortran | ||
477 | -maybe-install-info-target-libgfortran: install-info-target-libgfortran | ||
478 | - | ||
479 | -install-info-target-libgfortran: \ | ||
480 | - configure-target-libgfortran \ | ||
481 | - info-target-libgfortran | ||
482 | - @: $(MAKE); $(unstage) | ||
483 | - @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ | ||
484 | - r=`${PWD_COMMAND}`; export r; \ | ||
485 | - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
486 | - $(NORMAL_TARGET_EXPORTS) \ | ||
487 | - echo "Doing install-info in $(TARGET_SUBDIR)/libgfortran" ; \ | ||
488 | - for flag in $(EXTRA_TARGET_FLAGS); do \ | ||
489 | - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | ||
490 | - done; \ | ||
491 | - (cd $(TARGET_SUBDIR)/libgfortran && \ | ||
492 | - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ | ||
493 | - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | ||
494 | - "RANLIB=$${RANLIB}" \ | ||
495 | - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | ||
496 | - install-info) \ | ||
497 | - || exit 1 | ||
498 | - | ||
499 | -@endif target-libgfortran | ||
500 | - | ||
501 | -.PHONY: maybe-install-html-target-libgfortran install-html-target-libgfortran | ||
502 | -maybe-install-html-target-libgfortran: | ||
503 | -@if target-libgfortran | ||
504 | -maybe-install-html-target-libgfortran: install-html-target-libgfortran | ||
505 | - | ||
506 | -install-html-target-libgfortran: \ | ||
507 | - configure-target-libgfortran \ | ||
508 | - html-target-libgfortran | ||
509 | - @: $(MAKE); $(unstage) | ||
510 | - @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ | ||
511 | - r=`${PWD_COMMAND}`; export r; \ | ||
512 | - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
513 | - $(NORMAL_TARGET_EXPORTS) \ | ||
514 | - echo "Doing install-html in $(TARGET_SUBDIR)/libgfortran" ; \ | ||
515 | - for flag in $(EXTRA_TARGET_FLAGS); do \ | ||
516 | - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | ||
517 | - done; \ | ||
518 | - (cd $(TARGET_SUBDIR)/libgfortran && \ | ||
519 | - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ | ||
520 | - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | ||
521 | - "RANLIB=$${RANLIB}" \ | ||
522 | - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | ||
523 | - install-html) \ | ||
524 | - || exit 1 | ||
525 | - | ||
526 | -@endif target-libgfortran | ||
527 | - | ||
528 | -.PHONY: maybe-installcheck-target-libgfortran installcheck-target-libgfortran | ||
529 | -maybe-installcheck-target-libgfortran: | ||
530 | -@if target-libgfortran | ||
531 | -maybe-installcheck-target-libgfortran: installcheck-target-libgfortran | ||
532 | - | ||
533 | -installcheck-target-libgfortran: \ | ||
534 | - configure-target-libgfortran | ||
535 | - @: $(MAKE); $(unstage) | ||
536 | - @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ | ||
537 | - r=`${PWD_COMMAND}`; export r; \ | ||
538 | - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
539 | - $(NORMAL_TARGET_EXPORTS) \ | ||
540 | - echo "Doing installcheck in $(TARGET_SUBDIR)/libgfortran" ; \ | ||
541 | - for flag in $(EXTRA_TARGET_FLAGS); do \ | ||
542 | - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | ||
543 | - done; \ | ||
544 | - (cd $(TARGET_SUBDIR)/libgfortran && \ | ||
545 | - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ | ||
546 | - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | ||
547 | - "RANLIB=$${RANLIB}" \ | ||
548 | - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | ||
549 | - installcheck) \ | ||
550 | - || exit 1 | ||
551 | - | ||
552 | -@endif target-libgfortran | ||
553 | - | ||
554 | -.PHONY: maybe-mostlyclean-target-libgfortran mostlyclean-target-libgfortran | ||
555 | -maybe-mostlyclean-target-libgfortran: | ||
556 | -@if target-libgfortran | ||
557 | -maybe-mostlyclean-target-libgfortran: mostlyclean-target-libgfortran | ||
558 | - | ||
559 | -mostlyclean-target-libgfortran: | ||
560 | - @: $(MAKE); $(unstage) | ||
561 | - @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ | ||
562 | - r=`${PWD_COMMAND}`; export r; \ | ||
563 | - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
564 | - $(NORMAL_TARGET_EXPORTS) \ | ||
565 | - echo "Doing mostlyclean in $(TARGET_SUBDIR)/libgfortran" ; \ | ||
566 | - for flag in $(EXTRA_TARGET_FLAGS); do \ | ||
567 | - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | ||
568 | - done; \ | ||
569 | - (cd $(TARGET_SUBDIR)/libgfortran && \ | ||
570 | - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ | ||
571 | - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | ||
572 | - "RANLIB=$${RANLIB}" \ | ||
573 | - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | ||
574 | - mostlyclean) \ | ||
575 | - || exit 1 | ||
576 | - | ||
577 | -@endif target-libgfortran | ||
578 | - | ||
579 | -.PHONY: maybe-clean-target-libgfortran clean-target-libgfortran | ||
580 | -maybe-clean-target-libgfortran: | ||
581 | -@if target-libgfortran | ||
582 | -maybe-clean-target-libgfortran: clean-target-libgfortran | ||
583 | - | ||
584 | -clean-target-libgfortran: | ||
585 | - @: $(MAKE); $(unstage) | ||
586 | - @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ | ||
587 | - r=`${PWD_COMMAND}`; export r; \ | ||
588 | - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
589 | - $(NORMAL_TARGET_EXPORTS) \ | ||
590 | - echo "Doing clean in $(TARGET_SUBDIR)/libgfortran" ; \ | ||
591 | - for flag in $(EXTRA_TARGET_FLAGS); do \ | ||
592 | - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | ||
593 | - done; \ | ||
594 | - (cd $(TARGET_SUBDIR)/libgfortran && \ | ||
595 | - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ | ||
596 | - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | ||
597 | - "RANLIB=$${RANLIB}" \ | ||
598 | - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | ||
599 | - clean) \ | ||
600 | - || exit 1 | ||
601 | - | ||
602 | -@endif target-libgfortran | ||
603 | - | ||
604 | -.PHONY: maybe-distclean-target-libgfortran distclean-target-libgfortran | ||
605 | -maybe-distclean-target-libgfortran: | ||
606 | -@if target-libgfortran | ||
607 | -maybe-distclean-target-libgfortran: distclean-target-libgfortran | ||
608 | - | ||
609 | -distclean-target-libgfortran: | ||
610 | - @: $(MAKE); $(unstage) | ||
611 | - @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ | ||
612 | - r=`${PWD_COMMAND}`; export r; \ | ||
613 | - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
614 | - $(NORMAL_TARGET_EXPORTS) \ | ||
615 | - echo "Doing distclean in $(TARGET_SUBDIR)/libgfortran" ; \ | ||
616 | - for flag in $(EXTRA_TARGET_FLAGS); do \ | ||
617 | - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | ||
618 | - done; \ | ||
619 | - (cd $(TARGET_SUBDIR)/libgfortran && \ | ||
620 | - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ | ||
621 | - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | ||
622 | - "RANLIB=$${RANLIB}" \ | ||
623 | - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | ||
624 | - distclean) \ | ||
625 | - || exit 1 | ||
626 | - | ||
627 | -@endif target-libgfortran | ||
628 | - | ||
629 | -.PHONY: maybe-maintainer-clean-target-libgfortran maintainer-clean-target-libgfortran | ||
630 | -maybe-maintainer-clean-target-libgfortran: | ||
631 | -@if target-libgfortran | ||
632 | -maybe-maintainer-clean-target-libgfortran: maintainer-clean-target-libgfortran | ||
633 | - | ||
634 | -maintainer-clean-target-libgfortran: | ||
635 | - @: $(MAKE); $(unstage) | ||
636 | - @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ | ||
637 | - r=`${PWD_COMMAND}`; export r; \ | ||
638 | - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | ||
639 | - $(NORMAL_TARGET_EXPORTS) \ | ||
640 | - echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libgfortran" ; \ | ||
641 | - for flag in $(EXTRA_TARGET_FLAGS); do \ | ||
642 | - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | ||
643 | - done; \ | ||
644 | - (cd $(TARGET_SUBDIR)/libgfortran && \ | ||
645 | - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ | ||
646 | - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | ||
647 | - "RANLIB=$${RANLIB}" \ | ||
648 | - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | ||
649 | - maintainer-clean) \ | ||
650 | - || exit 1 | ||
651 | - | ||
652 | -@endif target-libgfortran | ||
653 | - | ||
654 | - | ||
655 | - | ||
656 | -# There's only one multilib.out. Cleverer subdirs shouldn't need it copied. | ||
657 | @if target-libobjc | ||
658 | $(TARGET_SUBDIR)/libobjc/multilib.out: multilib.out | ||
659 | $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libobjc ; \ | ||
660 | @@ -38574,8 +38179,6 @@ | ||
661 | |||
662 | configure-target-newlib: maybe-all-gcc | ||
663 | |||
664 | -configure-target-libgfortran: maybe-all-gcc | ||
665 | - | ||
666 | configure-target-libobjc: maybe-all-gcc | ||
667 | |||
668 | configure-target-libtermcap: maybe-all-gcc | ||
669 | @@ -38613,9 +38216,7 @@ | ||
670 | |||
671 | configure-target-libada: maybe-all-target-newlib maybe-all-target-libgloss | ||
672 | |||
673 | -configure-target-libgfortran: maybe-all-target-newlib maybe-all-target-libgloss | ||
674 | - | ||
675 | configure-target-libffi: maybe-all-target-newlib maybe-all-target-libgloss | ||
676 | |||
677 | configure-target-libjava: maybe-all-target-newlib maybe-all-target-libgloss | ||
678 | |||
679 | --- tmp/Makefile.tpl.orig 2006-09-06 08:36:52.000000000 +0100 | ||
680 | +++ tmp/Makefile.tpl 2006-09-06 08:36:52.000000000 +0100 | ||
681 | @@ -122,7 +122,6 @@ | ||
682 | CXX="$(CXX_FOR_BUILD)"; export CXX; \ | ||
683 | CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ | ||
684 | GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \ | ||
685 | - GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \ | ||
686 | DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \ | ||
687 | LD="$(LD_FOR_BUILD)"; export LD; \ | ||
688 | LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \ | ||
689 | @@ -204,7 +203,6 @@ | ||
690 | CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ | ||
691 | CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ | ||
692 | GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ | ||
693 | - GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \ | ||
694 | DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ | ||
695 | LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \ | ||
696 | LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ | ||
697 | @@ -316,7 +314,6 @@ | ||
698 | CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@ $(FLAGS_FOR_TARGET) | ||
699 | RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@ $(FLAGS_FOR_TARGET) | ||
700 | GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@ $(FLAGS_FOR_TARGET) | ||
701 | -GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@ $(FLAGS_FOR_TARGET) | ||
702 | DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@ | ||
703 | LD_FOR_TARGET=@LD_FOR_TARGET@ | ||
704 | |||
705 | --- tmp/Makefile.def.orig 2006-09-06 08:38:50.000000000 +0100 | ||
706 | +++ tmp/Makefile.def 2006-09-06 08:38:50.000000000 +0100 | ||
707 | @@ -117,7 +117,6 @@ | ||
708 | target_modules = { module= libmudflap; lib_path=.libs; }; | ||
709 | target_modules = { module= libssp; lib_path=.libs; }; | ||
710 | target_modules = { module= newlib; }; | ||
711 | -target_modules = { module= libgfortran; }; | ||
712 | target_modules = { module= libobjc; }; | ||
713 | target_modules = { module= libtermcap; no_check=true; | ||
714 | missing=mostlyclean; | ||
715 | @@ -227,7 +226,6 @@ | ||
716 | flags_to_pass = { flag= CXXFLAGS_FOR_TARGET ; }; | ||
717 | flags_to_pass = { flag= DLLTOOL_FOR_TARGET ; }; | ||
718 | flags_to_pass = { flag= GCJ_FOR_TARGET ; }; | ||
719 | -flags_to_pass = { flag= GFORTRAN_FOR_TARGET ; }; | ||
720 | flags_to_pass = { flag= LD_FOR_TARGET ; }; | ||
721 | flags_to_pass = { flag= LIPO_FOR_TARGET ; }; | ||
722 | flags_to_pass = { flag= LDFLAGS_FOR_TARGET ; }; | ||
723 | @@ -415,7 +413,6 @@ | ||
724 | lang_env_dependencies = { module=boehm-gc; }; | ||
725 | lang_env_dependencies = { module=gperf; cxx=true; }; | ||
726 | lang_env_dependencies = { module=libada; }; | ||
727 | -lang_env_dependencies = { module=libgfortran; }; | ||
728 | lang_env_dependencies = { module=libffi; }; | ||
729 | lang_env_dependencies = { module=libjava; cxx=true; }; | ||
730 | lang_env_dependencies = { module=libmudflap; }; | ||
731 | |||
732 | --- tmp/configure.orgig 2006-09-06 10:01:52.000000000 +0100 | ||
733 | +++ tmp/configure 2006-09-06 10:01:52.000000000 +0100 | ||
734 | @@ -921,7 +921,6 @@ | ||
735 | target-libstdc++-v3 \ | ||
736 | target-libmudflap \ | ||
737 | target-libssp \ | ||
738 | - target-libgfortran \ | ||
739 | ${libgcj} \ | ||
740 | target-libobjc \ | ||
741 | target-libada" | ||
742 | @@ -2246,135 +2245,6 @@ | ||
743 | fi | ||
744 | |||
745 | |||
746 | - | ||
747 | - | ||
748 | - | ||
749 | - | ||
750 | -# Check for GMP and MPFR | ||
751 | -gmplibs= | ||
752 | -gmpinc= | ||
753 | -have_gmp=yes | ||
754 | -# Specify a location for mpfr | ||
755 | -# check for this first so it ends up on the link line before gmp. | ||
756 | -# Check whether --with-mpfr-dir or --without-mpfr-dir was given. | ||
757 | -if test "${with_mpfr_dir+set}" = set; then | ||
758 | - withval="$with_mpfr_dir" | ||
759 | - : | ||
760 | -fi | ||
761 | - | ||
762 | - | ||
763 | -if test "x$with_mpfr_dir" != x; then | ||
764 | - gmpinc="-I$with_mpfr_dir" | ||
765 | - gmplibs="$with_mpfr_dir/libmpfr.a" | ||
766 | -else | ||
767 | - gmplibs="-lmpfr" | ||
768 | -fi | ||
769 | - | ||
770 | -# Check whether --with-mpfr or --without-mpfr was given. | ||
771 | -if test "${with_mpfr+set}" = set; then | ||
772 | - withval="$with_mpfr" | ||
773 | - : | ||
774 | -fi | ||
775 | - | ||
776 | - | ||
777 | -if test "x$with_mpfr" != x; then | ||
778 | - gmplibs="-L$with_mpfr/lib $gmplibs" | ||
779 | - gmpinc="-I$with_mpfr/include" | ||
780 | -fi | ||
781 | - | ||
782 | -# Specify a location for gmp | ||
783 | -# Check whether --with-gmp-dir or --without-gmp-dir was given. | ||
784 | -if test "${with_gmp_dir+set}" = set; then | ||
785 | - withval="$with_gmp_dir" | ||
786 | - : | ||
787 | -fi | ||
788 | - | ||
789 | - | ||
790 | -if test "x$with_gmp_dir" != x; then | ||
791 | - gmpinc="$gmpinc -I$with_gmp_dir" | ||
792 | - if test -f "$with_gmp_dir/.libs/libgmp.a"; then | ||
793 | - gmplibs="$gmplibs $with_gmp_dir/.libs/libgmp.a" | ||
794 | - elif test -f "$with_gmp_dir/_libs/libgmp.a"; then | ||
795 | - gmplibs="$gmplibs $with_gmp_dir/_libs/libgmp.a" | ||
796 | - fi | ||
797 | - # One of the later tests will catch the error if neither library is present. | ||
798 | -else | ||
799 | - gmplibs="$gmplibs -lgmp" | ||
800 | -fi | ||
801 | - | ||
802 | -# Check whether --with-gmp or --without-gmp was given. | ||
803 | -if test "${with_gmp+set}" = set; then | ||
804 | - withval="$with_gmp" | ||
805 | - : | ||
806 | -fi | ||
807 | - | ||
808 | - | ||
809 | -if test "x$with_gmp" != x; then | ||
810 | - gmplibs="-L$with_gmp/lib $gmplibs" | ||
811 | - gmpinc="-I$with_gmp/include $gmpinc" | ||
812 | -fi | ||
813 | - | ||
814 | -saved_CFLAGS="$CFLAGS" | ||
815 | -CFLAGS="$CFLAGS $gmpinc" | ||
816 | -# Check GMP actually works | ||
817 | -echo $ac_n "checking for correct version of gmp.h""... $ac_c" 1>&6 | ||
818 | -echo "configure:2322: checking for correct version of gmp.h" >&5 | ||
819 | -cat > conftest.$ac_ext <<EOF | ||
820 | -#line 2324 "configure" | ||
821 | -#include "confdefs.h" | ||
822 | -#include "gmp.h" | ||
823 | -int main() { | ||
824 | - | ||
825 | -#if __GNU_MP_VERSION < 3 | ||
826 | -choke me | ||
827 | -#endif | ||
828 | - | ||
829 | -; return 0; } | ||
830 | -EOF | ||
831 | -if { (eval echo configure:2335: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then | ||
832 | - rm -rf conftest* | ||
833 | - echo "$ac_t""yes" 1>&6 | ||
834 | -else | ||
835 | - echo "configure: failed program was:" >&5 | ||
836 | - cat conftest.$ac_ext >&5 | ||
837 | - rm -rf conftest* | ||
838 | - echo "$ac_t""no" 1>&6; have_gmp=no | ||
839 | -fi | ||
840 | -rm -f conftest* | ||
841 | - | ||
842 | -if test x"$have_gmp" = xyes; then | ||
843 | - echo $ac_n "checking for MPFR""... $ac_c" 1>&6 | ||
844 | -echo "configure:2348: checking for MPFR" >&5 | ||
845 | - | ||
846 | - saved_LIBS="$LIBS" | ||
847 | - LIBS="$LIBS $gmplibs" | ||
848 | - cat > conftest.$ac_ext <<EOF | ||
849 | -#line 2353 "configure" | ||
850 | -#include "confdefs.h" | ||
851 | -#include <gmp.h> | ||
852 | -#include <mpfr.h> | ||
853 | -int main() { | ||
854 | -mpfr_t n; mpfr_init(n); | ||
855 | -; return 0; } | ||
856 | -EOF | ||
857 | -if { (eval echo configure:2361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then | ||
858 | - rm -rf conftest* | ||
859 | - echo "$ac_t""yes" 1>&6 | ||
860 | -else | ||
861 | - echo "configure: failed program was:" >&5 | ||
862 | - cat conftest.$ac_ext >&5 | ||
863 | - rm -rf conftest* | ||
864 | - echo "$ac_t""no" 1>&6; have_gmp=no | ||
865 | -fi | ||
866 | -rm -f conftest* | ||
867 | - LIBS="$saved_LIBS" | ||
868 | - CFLAGS="$saved_CFLAGS" | ||
869 | -fi | ||
870 | - | ||
871 | -# Flags needed for both GMP and/or MPFR | ||
872 | - | ||
873 | - | ||
874 | - | ||
875 | # By default, C is the only stage 1 language. | ||
876 | stage1_languages=c | ||
877 | |||
878 | @@ -2402,15 +2272,6 @@ | ||
879 | fi | ||
880 | enable_languages=`echo "${enable_languages}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/,$//'` | ||
881 | |||
882 | - # 'f95' is the old name for the 'fortran' language. We issue a warning | ||
883 | - # and make the substitution. | ||
884 | - case ,${enable_languages}, in | ||
885 | - *,f95,*) | ||
886 | - echo configure.in: warning: 'f95' as language name is deprecated, use 'fortran' instead 1>&2 | ||
887 | - enable_languages=`echo "${enable_languages}" | sed -e 's/f95/fortran/g'` | ||
888 | - ;; | ||
889 | - esac | ||
890 | - | ||
891 | # First scan to see if an enabled language requires some other language. | ||
892 | # We assume that a given config-lang.in will list all the language | ||
893 | # front ends it requires, even if some are required indirectly. | ||
894 | @@ -5036,81 +4897,6 @@ | ||
895 | fi | ||
896 | fi | ||
897 | |||
898 | - for ncn_progname in gfortran; do | ||
899 | - if test -n "$ncn_target_tool_prefix"; then | ||
900 | - # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. | ||
901 | -set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 | ||
902 | -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | ||
903 | -echo "configure:5045: checking for $ac_word" >&5 | ||
904 | -if eval "test \"`echo '$''{'ac_cv_prog_GFORTRAN_FOR_TARGET'+set}'`\" = set"; then | ||
905 | - echo $ac_n "(cached) $ac_c" 1>&6 | ||
906 | -else | ||
907 | - if test -n "$GFORTRAN_FOR_TARGET"; then | ||
908 | - ac_cv_prog_GFORTRAN_FOR_TARGET="$GFORTRAN_FOR_TARGET" # Let the user override the test. | ||
909 | -else | ||
910 | - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" | ||
911 | - ac_dummy="$PATH" | ||
912 | - for ac_dir in $ac_dummy; do | ||
913 | - test -z "$ac_dir" && ac_dir=. | ||
914 | - if test -f $ac_dir/$ac_word; then | ||
915 | - ac_cv_prog_GFORTRAN_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" | ||
916 | - break | ||
917 | - fi | ||
918 | - done | ||
919 | - IFS="$ac_save_ifs" | ||
920 | -fi | ||
921 | -fi | ||
922 | -GFORTRAN_FOR_TARGET="$ac_cv_prog_GFORTRAN_FOR_TARGET" | ||
923 | -if test -n "$GFORTRAN_FOR_TARGET"; then | ||
924 | - echo "$ac_t""$GFORTRAN_FOR_TARGET" 1>&6 | ||
925 | -else | ||
926 | - echo "$ac_t""no" 1>&6 | ||
927 | -fi | ||
928 | - | ||
929 | - fi | ||
930 | - if test -z "$ac_cv_prog_GFORTRAN_FOR_TARGET" && test $build = $target ; then | ||
931 | - # Extract the first word of "${ncn_progname}", so it can be a program name with args. | ||
932 | -set dummy ${ncn_progname}; ac_word=$2 | ||
933 | -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | ||
934 | -echo "configure:5076: checking for $ac_word" >&5 | ||
935 | -if eval "test \"`echo '$''{'ac_cv_prog_GFORTRAN_FOR_TARGET'+set}'`\" = set"; then | ||
936 | - echo $ac_n "(cached) $ac_c" 1>&6 | ||
937 | -else | ||
938 | - if test -n "$GFORTRAN_FOR_TARGET"; then | ||
939 | - ac_cv_prog_GFORTRAN_FOR_TARGET="$GFORTRAN_FOR_TARGET" # Let the user override the test. | ||
940 | -else | ||
941 | - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" | ||
942 | - ac_dummy="$PATH" | ||
943 | - for ac_dir in $ac_dummy; do | ||
944 | - test -z "$ac_dir" && ac_dir=. | ||
945 | - if test -f $ac_dir/$ac_word; then | ||
946 | - ac_cv_prog_GFORTRAN_FOR_TARGET="${ncn_progname}" | ||
947 | - break | ||
948 | - fi | ||
949 | - done | ||
950 | - IFS="$ac_save_ifs" | ||
951 | -fi | ||
952 | -fi | ||
953 | -GFORTRAN_FOR_TARGET="$ac_cv_prog_GFORTRAN_FOR_TARGET" | ||
954 | -if test -n "$GFORTRAN_FOR_TARGET"; then | ||
955 | - echo "$ac_t""$GFORTRAN_FOR_TARGET" 1>&6 | ||
956 | -else | ||
957 | - echo "$ac_t""no" 1>&6 | ||
958 | -fi | ||
959 | - | ||
960 | - fi | ||
961 | - test -n "$ac_cv_prog_GFORTRAN_FOR_TARGET" && break | ||
962 | -done | ||
963 | - | ||
964 | -if test -z "$ac_cv_prog_GFORTRAN_FOR_TARGET" ; then | ||
965 | - set dummy gfortran | ||
966 | - if test $build = $target ; then | ||
967 | - GFORTRAN_FOR_TARGET="$2" | ||
968 | - else | ||
969 | - GFORTRAN_FOR_TARGET="${ncn_target_tool_prefix}$2" | ||
970 | - fi | ||
971 | -fi | ||
972 | - | ||
973 | for ncn_progname in ld; do | ||
974 | if test -n "$ncn_target_tool_prefix"; then | ||
975 | # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. | ||
976 | @@ -5843,34 +5629,6 @@ | ||
977 | echo "$ac_t""pre-installed" 1>&6 | ||
978 | fi | ||
979 | fi | ||
980 | -echo $ac_n "checking where to find the target gfortran""... $ac_c" 1>&6 | ||
981 | -echo "configure:5848: checking where to find the target gfortran" >&5 | ||
982 | -if test "x${build}" != "x${host}" ; then | ||
983 | - # Canadian cross, just use what we found | ||
984 | - echo "$ac_t""pre-installed" 1>&6 | ||
985 | -else | ||
986 | - ok=yes | ||
987 | - case " ${configdirs} " in | ||
988 | - *" gcc "*) ;; | ||
989 | - *) ok=no ;; | ||
990 | - esac | ||
991 | - case ,${enable_languages}, in | ||
992 | - *,fortran,*) ;; | ||
993 | - *) ok=no ;; | ||
994 | - esac | ||
995 | - if test $ok = yes; then | ||
996 | - # An in-tree tool is available and we can use it | ||
997 | - GFORTRAN_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/' | ||
998 | - echo "$ac_t""just compiled" 1>&6 | ||
999 | - elif test "x$target" = "x$host"; then | ||
1000 | - # We can use an host tool | ||
1001 | - GFORTRAN_FOR_TARGET='$(GFORTRAN)' | ||
1002 | - echo "$ac_t""host tool" 1>&6 | ||
1003 | - else | ||
1004 | - # We need a cross tool | ||
1005 | - echo "$ac_t""pre-installed" 1>&6 | ||
1006 | - fi | ||
1007 | -fi | ||
1008 | echo $ac_n "checking where to find the target ld""... $ac_c" 1>&6 | ||
1009 | echo "configure:5876: checking where to find the target ld" >&5 | ||
1010 | if test "x${build}" != "x${host}" ; then | ||
1011 | @@ -6413,7 +6171,6 @@ | ||
1012 | s%@DLLTOOL_FOR_TARGET@%$DLLTOOL_FOR_TARGET%g | ||
1013 | s%@GCC_FOR_TARGET@%$GCC_FOR_TARGET%g | ||
1014 | s%@GCJ_FOR_TARGET@%$GCJ_FOR_TARGET%g | ||
1015 | -s%@GFORTRAN_FOR_TARGET@%$GFORTRAN_FOR_TARGET%g | ||
1016 | s%@LD_FOR_TARGET@%$LD_FOR_TARGET%g | ||
1017 | s%@LIPO_FOR_TARGET@%$LIPO_FOR_TARGET%g | ||
1018 | s%@NM_FOR_TARGET@%$NM_FOR_TARGET%g | ||
1019 | |||
1020 | --- tmp/config-ml.in.orig 2006-09-06 10:27:49.000000000 +0100 | ||
1021 | +++ tmp/config-ml.in 2006-09-06 10:27:49.000000000 +0100 | ||
1022 | @@ -785,14 +785,12 @@ | ||
1023 | break | ||
1024 | fi | ||
1025 | done | ||
1026 | - ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" F77="${F77_}$flags" GCJ="${GCJ_}$flags" GFORTRAN="${GFORTRAN_}$flags"' | ||
1027 | + ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" GCJ="${GCJ_}$flags"' | ||
1028 | |||
1029 | if [ "${with_target_subdir}" = "." ]; then | ||
1030 | CC_=$CC' ' | ||
1031 | CXX_=$CXX' ' | ||
1032 | - F77_=$F77' ' | ||
1033 | GCJ_=$GCJ' ' | ||
1034 | - GFORTRAN_=$GFORTRAN' ' | ||
1035 | else | ||
1036 | # Create a regular expression that matches any string as long | ||
1037 | # as ML_POPDIR. | ||
1038 | @@ -821,18 +819,6 @@ | ||
1039 | esac | ||
1040 | done | ||
1041 | |||
1042 | - F77_= | ||
1043 | - for arg in ${F77}; do | ||
1044 | - case $arg in | ||
1045 | - -[BIL]"${ML_POPDIR}"/*) | ||
1046 | - F77_="${F77_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; | ||
1047 | - "${ML_POPDIR}"/*) | ||
1048 | - F77_="${F77_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; | ||
1049 | - *) | ||
1050 | - F77_="${F77_}${arg} " ;; | ||
1051 | - esac | ||
1052 | - done | ||
1053 | - | ||
1054 | GCJ_= | ||
1055 | for arg in ${GCJ}; do | ||
1056 | case $arg in | ||
1057 | @@ -845,18 +831,6 @@ | ||
1058 | esac | ||
1059 | done | ||
1060 | |||
1061 | - GFORTRAN_= | ||
1062 | - for arg in ${GFORTRAN}; do | ||
1063 | - case $arg in | ||
1064 | - -[BIL]"${ML_POPDIR}"/*) | ||
1065 | - GFORTRAN_="${GFORTRAN_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; | ||
1066 | - "${ML_POPDIR}"/*) | ||
1067 | - GFORTRAN_="${GFORTRAN_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; | ||
1068 | - *) | ||
1069 | - GFORTRAN_="${GFORTRAN_}${arg} " ;; | ||
1070 | - esac | ||
1071 | - done | ||
1072 | - | ||
1073 | if test "x${LD_LIBRARY_PATH+set}" = xset; then | ||
1074 | LD_LIBRARY_PATH_= | ||
1075 | for arg in `echo "$LD_LIBRARY_PATH" | tr ':' ' '`; do | ||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm/gcc-new-makeinfo.patch b/meta/recipes-devtools/gcc/gcc-csl-arm/gcc-new-makeinfo.patch new file mode 100644 index 0000000000..b984605af7 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm/gcc-new-makeinfo.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | --- | ||
2 | configure | 2 +- | ||
3 | configure.in | 2 +- | ||
4 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
5 | |||
6 | --- gcc-2006q1.orig/configure | ||
7 | +++ gcc-2006q1/configure | ||
8 | @@ -3453,11 +3453,11 @@ case " $build_configdirs " in | ||
9 | *) | ||
10 | |||
11 | # For an installed makeinfo, we require it to be from texinfo 4.2 or | ||
12 | # higher, else we use the "missing" dummy. | ||
13 | if ${MAKEINFO} --version \ | ||
14 | - | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])' >/dev/null 2>&1; then | ||
15 | + | egrep 'texinfo[^0-9]*(4\.([6-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then | ||
16 | : | ||
17 | else | ||
18 | MAKEINFO="$MISSING makeinfo" | ||
19 | fi | ||
20 | ;; | ||
21 | --- gcc-2006q1.orig/configure.in | ||
22 | +++ gcc-2006q1/configure.in | ||
23 | @@ -2078,11 +2078,11 @@ case " $build_configdirs " in | ||
24 | *) | ||
25 | changequote(,) | ||
26 | # For an installed makeinfo, we require it to be from texinfo 4.2 or | ||
27 | # higher, else we use the "missing" dummy. | ||
28 | if ${MAKEINFO} --version \ | ||
29 | - | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])' >/dev/null 2>&1; then | ||
30 | + | egrep 'texinfo[^0-9]*(4\.([6-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then | ||
31 | : | ||
32 | else | ||
33 | MAKEINFO="$MISSING makeinfo" | ||
34 | fi | ||
35 | ;; | ||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm/gcc34-arm-tune.patch b/meta/recipes-devtools/gcc/gcc-csl-arm/gcc34-arm-tune.patch new file mode 100644 index 0000000000..cdb20bef9b --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm/gcc34-arm-tune.patch | |||
@@ -0,0 +1,9 @@ | |||
1 | --- gcc-3.4.0/gcc/config/arm/linux-elf.h.arm-tune 2004-01-31 01:18:11.000000000 -0500 | ||
2 | +++ gcc-3.4.0/gcc/config/arm/linux-elf.h 2004-04-24 18:19:10.000000000 -0400 | ||
3 | @@ -126,3 +126,6 @@ | ||
4 | |||
5 | #define LINK_GCC_C_SEQUENCE_SPEC \ | ||
6 | "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" | ||
7 | + | ||
8 | +/* Tune for XScale. */ | ||
9 | +#define TARGET_TUNE_DEFAULT TARGET_CPU_xscale | ||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm/gcc41-configure.in.patch b/meta/recipes-devtools/gcc/gcc-csl-arm/gcc41-configure.in.patch new file mode 100644 index 0000000000..3d33bcb978 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm/gcc41-configure.in.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | --- gcc-3.4.4/configure.in.orig 2005-08-09 19:57:51.504323183 -0700 | ||
2 | +++ gcc-3.4.4/configure.in 2005-08-09 20:00:12.073168623 -0700 | ||
3 | @@ -1907,7 +1907,7 @@ | ||
4 | *) gxx_include_dir=${with_gxx_include_dir} ;; | ||
5 | esac | ||
6 | |||
7 | -FLAGS_FOR_TARGET= | ||
8 | +FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET" | ||
9 | case " $target_configdirs " in | ||
10 | *" newlib "*) | ||
11 | case " $target_configargs " in | ||
12 | --- gcc-3.4.4/configure.orig 2005-08-09 21:02:29.668360660 -0700 | ||
13 | +++ gcc-3.4.4/configure 2005-08-09 21:02:50.157649970 -0700 | ||
14 | @@ -2669,7 +2669,7 @@ | ||
15 | *) gxx_include_dir=${with_gxx_include_dir} ;; | ||
16 | esac | ||
17 | |||
18 | -FLAGS_FOR_TARGET= | ||
19 | +FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET" | ||
20 | case " $target_configdirs " in | ||
21 | *" newlib "*) | ||
22 | case " $target_configargs " in | ||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm/gcc_optab_arm.patch b/meta/recipes-devtools/gcc/gcc-csl-arm/gcc_optab_arm.patch new file mode 100644 index 0000000000..fa21b26554 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm/gcc_optab_arm.patch | |||
@@ -0,0 +1,95 @@ | |||
1 | ARM is the only architecture that has a helper function that returns | ||
2 | an unbiased result. This fix is trivial enough that we can show it | ||
3 | doesn't effect any of the other arches. Can we consider this a | ||
4 | regression fix since it used to work until the helper was added :} | ||
5 | |||
6 | Tested with no regressions on x86_64-pc-linux-gnu and arm-none-eabi. | ||
7 | |||
8 | Cheers, | ||
9 | Carlos. | ||
10 | -- | ||
11 | Carlos O'Donell | ||
12 | CodeSourcery | ||
13 | carlos@codesourcery.com | ||
14 | (650) 331-3385 x716 | ||
15 | |||
16 | gcc/ | ||
17 | |||
18 | 2006-01-27 Carlos O'Donell <carlos@codesourcery.com> | ||
19 | |||
20 | * optabs.c (prepare_cmp_insn): If unbaised and unsigned then bias | ||
21 | the comparison routine return. | ||
22 | |||
23 | gcc/testsuite/ | ||
24 | |||
25 | 2006-01-27 Carlos O'Donell <carlos@codesourcery.com> | ||
26 | |||
27 | * gcc.dg/unsigned-long-compare.c: New test. | ||
28 | |||
29 | Index: gcc/optabs.c | ||
30 | =================================================================== | ||
31 | --- 1/gcc/optabs.c (revision 110300) | ||
32 | +++ 2/gcc/optabs.c (working copy) | ||
33 | @@ -3711,18 +3711,24 @@ | ||
34 | result = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST_MAKE_BLOCK, | ||
35 | word_mode, 2, x, mode, y, mode); | ||
36 | |||
37 | + /* There are two kinds of comparison routines. Biased routines | ||
38 | + return 0/1/2, and unbiased routines return -1/0/1. Other parts | ||
39 | + of gcc expect that the comparison operation is equivalent | ||
40 | + to the modified comparison. For signed comparisons compare the | ||
41 | + result against 1 in the unbiased case, and zero in the biased | ||
42 | + case. For unsigned comparisons always compare against 1 after | ||
43 | + biasing the unbased result by adding 1. This gives us a way to | ||
44 | + represent LTU. */ | ||
45 | *px = result; | ||
46 | *pmode = word_mode; | ||
47 | - if (TARGET_LIB_INT_CMP_BIASED) | ||
48 | - /* Integer comparison returns a result that must be compared | ||
49 | - against 1, so that even if we do an unsigned compare | ||
50 | - afterward, there is still a value that can represent the | ||
51 | - result "less than". */ | ||
52 | - *py = const1_rtx; | ||
53 | - else | ||
54 | + *py = const1_rtx; | ||
55 | + | ||
56 | + if (!TARGET_LIB_INT_CMP_BIASED) | ||
57 | { | ||
58 | - *py = const0_rtx; | ||
59 | - *punsignedp = 1; | ||
60 | + if (*punsignedp) | ||
61 | + *px = plus_constant (result, 1); | ||
62 | + else | ||
63 | + *py = const0_rtx; | ||
64 | } | ||
65 | return; | ||
66 | } | ||
67 | Index: gcc/testsuite/gcc.dg/unsigned-long-compare.c | ||
68 | =================================================================== | ||
69 | --- 1/gcc/testsuite/gcc.dg/unsigned-long-compare.c (revision 0) | ||
70 | +++ 2/gcc/testsuite/gcc.dg/unsigned-long-compare.c (revision 0) | ||
71 | @@ -0,0 +1,24 @@ | ||
72 | +/* Copyright (C) 2006 Free Software Foundation, Inc. */ | ||
73 | +/* Contributed by Carlos O'Donell on 2006-01-27 */ | ||
74 | + | ||
75 | +/* Test a division corner case where the expression simplifies | ||
76 | + to a comparison, and the optab expansion is wrong. The optab | ||
77 | + expansion emits a function whose return is unbiased and needs | ||
78 | + adjustment. */ | ||
79 | +/* Origin: Carlos O'Donell <carlos@codesourcery.com> */ | ||
80 | +/* { dg-do run { target arm-*-*eabi* } } */ | ||
81 | +/* { dg-options "" } */ | ||
82 | +#include <stdlib.h> | ||
83 | + | ||
84 | +#define BIG_CONSTANT 0xFFFFFFFF80000000ULL | ||
85 | + | ||
86 | +int main (void) | ||
87 | +{ | ||
88 | + unsigned long long OneULL = 1ULL; | ||
89 | + unsigned long long result; | ||
90 | + | ||
91 | + result = OneULL / BIG_CONSTANT; | ||
92 | + if (result) | ||
93 | + abort (); | ||
94 | + exit (0); | ||
95 | +} | ||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm/no-libfloat.patch b/meta/recipes-devtools/gcc/gcc-csl-arm/no-libfloat.patch new file mode 100644 index 0000000000..e5d12cfb4f --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm/no-libfloat.patch | |||
@@ -0,0 +1,11 @@ | |||
1 | --- gcc/gcc/config/arm/linux-elf.h.old 2005-04-20 00:46:28.923375320 +0100 | ||
2 | +++ gcc/gcc/config/arm/linux-elf.h 2005-04-20 00:46:34.181575952 +0100 | ||
3 | @@ -56,7 +56,7 @@ | ||
4 | %{shared:-lc} \ | ||
5 | %{!shared:%{profile:-lc_p}%{!profile:-lc}}" | ||
6 | |||
7 | -#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc" | ||
8 | +#define LIBGCC_SPEC "-lgcc" | ||
9 | |||
10 | /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add | ||
11 | the GNU/Linux magical crtbegin.o file (see crtstuff.c) which | ||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm/pic-without-sl.patch b/meta/recipes-devtools/gcc/gcc-csl-arm/pic-without-sl.patch new file mode 100644 index 0000000000..9a49794da4 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm/pic-without-sl.patch | |||
@@ -0,0 +1,303 @@ | |||
1 | Index: gcc/config/arm/arm-protos.h | ||
2 | =================================================================== | ||
3 | RCS file: /cvsroot/gcc/gcc/gcc/config/arm/arm-protos.h,v | ||
4 | retrieving revision 1.60.4.20 | ||
5 | diff -u -r1.60.4.20 arm-protos.h | ||
6 | --- gcc/config/arm/arm-protos.h 29 Mar 2005 03:00:11 -0000 1.60.4.20 | ||
7 | +++ gcc/config/arm/arm-protos.h 23 Apr 2005 04:41:06 -0000 | ||
8 | @@ -64,6 +64,7 @@ | ||
9 | extern enum reg_class vfp_secondary_reload_class (enum machine_mode, rtx); | ||
10 | extern int tls_symbolic_operand (rtx, enum machine_mode); | ||
11 | extern bool arm_tls_operand_p (rtx x); | ||
12 | +extern bool arm_pc_pic_operand_p (rtx x); | ||
13 | |||
14 | /* Predicates. */ | ||
15 | extern int s_register_operand (rtx, enum machine_mode); | ||
16 | Index: gcc/config/arm/arm.c | ||
17 | =================================================================== | ||
18 | RCS file: /cvsroot/gcc/gcc/gcc/config/arm/arm.c,v | ||
19 | retrieving revision 1.303.2.79 | ||
20 | diff -u -r1.303.2.79 arm.c | ||
21 | --- gcc/config/arm/arm.c 12 Apr 2005 06:17:07 -0000 1.303.2.79 | ||
22 | +++ gcc/config/arm/arm.c 23 Apr 2005 04:41:09 -0000 | ||
23 | @@ -1003,7 +1003,7 @@ | ||
24 | |||
25 | /* If stack checking is disabled, we can use r10 as the PIC register, | ||
26 | which keeps r9 available. */ | ||
27 | - if (flag_pic) | ||
28 | + if (0 && flag_pic) | ||
29 | arm_pic_register = TARGET_APCS_STACK ? 9 : 10; | ||
30 | |||
31 | if (TARGET_APCS_FLOAT) | ||
32 | @@ -3120,6 +3120,10 @@ | ||
33 | rtx | ||
34 | legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) | ||
35 | { | ||
36 | + if (GET_CODE (orig) == UNSPEC | ||
37 | + && XINT (orig, 1) == UNSPEC_GOTSLOTPC) | ||
38 | + abort (); | ||
39 | + | ||
40 | if (GET_CODE (orig) == SYMBOL_REF | ||
41 | || GET_CODE (orig) == LABEL_REF) | ||
42 | { | ||
43 | @@ -3149,27 +3153,80 @@ | ||
44 | else | ||
45 | address = reg; | ||
46 | |||
47 | - if (TARGET_ARM) | ||
48 | - emit_insn (gen_pic_load_addr_arm (address, orig)); | ||
49 | - else | ||
50 | - emit_insn (gen_pic_load_addr_thumb (address, orig)); | ||
51 | + if (arm_pic_register != INVALID_REGNUM) | ||
52 | + { | ||
53 | + /* Using GP-based PIC addressing. */ | ||
54 | + if (TARGET_ARM) | ||
55 | + emit_insn (gen_pic_load_addr_arm (address, orig)); | ||
56 | + else | ||
57 | + emit_insn (gen_pic_load_addr_thumb (address, orig)); | ||
58 | + | ||
59 | + if ((GET_CODE (orig) == LABEL_REF | ||
60 | + || (GET_CODE (orig) == SYMBOL_REF && | ||
61 | + SYMBOL_REF_LOCAL_P (orig))) | ||
62 | + && NEED_GOT_RELOC) | ||
63 | + pic_ref = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, address); | ||
64 | + else | ||
65 | + { | ||
66 | + pic_ref = gen_rtx_MEM (Pmode, | ||
67 | + gen_rtx_PLUS (Pmode, pic_offset_table_rtx, | ||
68 | + address)); | ||
69 | + RTX_UNCHANGING_P (pic_ref) = 1; | ||
70 | + } | ||
71 | |||
72 | - if ((GET_CODE (orig) == LABEL_REF | ||
73 | - || (GET_CODE (orig) == SYMBOL_REF && | ||
74 | - SYMBOL_REF_LOCAL_P (orig))) | ||
75 | - && NEED_GOT_RELOC) | ||
76 | - pic_ref = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, address); | ||
77 | + current_function_uses_pic_offset_table = 1; | ||
78 | + } | ||
79 | else | ||
80 | { | ||
81 | - pic_ref = gen_rtx_MEM (Pmode, | ||
82 | - gen_rtx_PLUS (Pmode, pic_offset_table_rtx, | ||
83 | - address)); | ||
84 | - RTX_UNCHANGING_P (pic_ref) = 1; | ||
85 | + /* Using PC-based PIC addressing. */ | ||
86 | + rtx label, tmp; | ||
87 | + int offset; | ||
88 | + | ||
89 | + label = gen_label_rtx (); | ||
90 | + offset = TARGET_ARM ? 8 : 4; | ||
91 | + | ||
92 | + if (GET_CODE (orig) == LABEL_REF | ||
93 | + || (GET_CODE (orig) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (orig))) | ||
94 | + { | ||
95 | + /* This symbol is defined locally. We don't need a GOT entry. */ | ||
96 | + tmp = gen_rtx_MINUS (Pmode, gen_rtx_UNSPEC (Pmode, gen_rtvec (1, orig), UNSPEC_PIC_SYM), gen_rtx_PLUS (Pmode, | ||
97 | + gen_rtx_LABEL_REF (Pmode, label), | ||
98 | + GEN_INT (offset))); | ||
99 | + | ||
100 | + load_tls_operand (tmp, address); | ||
101 | + | ||
102 | + if (TARGET_ARM) | ||
103 | + emit_insn (gen_pic_add_dot_plus_eight (address, label)); | ||
104 | + else | ||
105 | + emit_insn (gen_pic_add_dot_plus_four (address, label)); | ||
106 | + } | ||
107 | + else | ||
108 | + { | ||
109 | + rtx x = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, orig), UNSPEC_GOTSLOTPC); | ||
110 | + rtx dummy_label; | ||
111 | + | ||
112 | + dummy_label = gen_label_rtx (); | ||
113 | + LABEL_PRESERVE_P (dummy_label) = 1; | ||
114 | + LABEL_NUSES (dummy_label) = 1; | ||
115 | + | ||
116 | + tmp = gen_rtx_MINUS (Pmode, x, gen_rtx_PLUS (Pmode, | ||
117 | + gen_rtx_LABEL_REF (Pmode, label), | ||
118 | + GEN_INT (offset))); | ||
119 | + | ||
120 | + load_tls_operand (tmp, address); | ||
121 | + | ||
122 | + if (TARGET_ARM) | ||
123 | + emit_insn (gen_tls_load_dot_plus_eight (address, address, label, dummy_label)); | ||
124 | + else | ||
125 | + emit_insn (gen_tls_load_dot_plus_four (address, address, label, dummy_label)); | ||
126 | + } | ||
127 | + | ||
128 | + pic_ref = address; | ||
129 | } | ||
130 | |||
131 | insn = emit_move_insn (reg, pic_ref); | ||
132 | #endif | ||
133 | - current_function_uses_pic_offset_table = 1; | ||
134 | + | ||
135 | /* Put a REG_EQUAL note on this insn, so that it can be optimized | ||
136 | by loop. */ | ||
137 | REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, orig, | ||
138 | @@ -3179,11 +3236,17 @@ | ||
139 | else if (GET_CODE (orig) == CONST) | ||
140 | { | ||
141 | rtx base, offset; | ||
142 | + bool minus = FALSE; | ||
143 | |||
144 | if (GET_CODE (XEXP (orig, 0)) == PLUS | ||
145 | && XEXP (XEXP (orig, 0), 0) == pic_offset_table_rtx) | ||
146 | return orig; | ||
147 | |||
148 | + if (GET_CODE (XEXP (orig, 0)) == MINUS | ||
149 | + && GET_CODE (XEXP (XEXP (orig, 0), 0)) == UNSPEC | ||
150 | + && XINT (XEXP (XEXP (orig, 0), 0), 1) == UNSPEC_GOTSLOTPC) | ||
151 | + return orig; | ||
152 | + | ||
153 | if (GET_CODE (XEXP (orig, 0)) == UNSPEC) | ||
154 | return orig; | ||
155 | |||
156 | @@ -3201,6 +3264,13 @@ | ||
157 | offset = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode, | ||
158 | base == reg ? 0 : reg); | ||
159 | } | ||
160 | + else if (GET_CODE (XEXP (orig, 0)) == MINUS) | ||
161 | + { | ||
162 | + minus = TRUE; | ||
163 | + base = legitimize_pic_address (XEXP (XEXP (orig, 0), 0), Pmode, reg); | ||
164 | + offset = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode, | ||
165 | + base == reg ? 0 : reg); | ||
166 | + } | ||
167 | else | ||
168 | abort (); | ||
169 | |||
170 | @@ -3228,7 +3298,7 @@ | ||
171 | return reg; | ||
172 | } | ||
173 | |||
174 | - return gen_rtx_PLUS (Pmode, base, offset); | ||
175 | + return minus ? gen_rtx_MINUS (Pmode, base, offset) : gen_rtx_PLUS (Pmode, base, offset); | ||
176 | } | ||
177 | |||
178 | return orig; | ||
179 | @@ -3267,7 +3337,7 @@ | ||
180 | rtx l1, pic_tmp, pic_tmp2, pic_rtx; | ||
181 | rtx global_offset_table; | ||
182 | |||
183 | - if (current_function_uses_pic_offset_table == 0 || TARGET_SINGLE_PIC_BASE) | ||
184 | + if (current_function_uses_pic_offset_table == 0 || TARGET_SINGLE_PIC_BASE || arm_pic_register == INVALID_REGNUM) | ||
185 | return; | ||
186 | |||
187 | if (!flag_pic) | ||
188 | @@ -3341,8 +3411,11 @@ | ||
189 | static int | ||
190 | pcrel_constant_p (rtx x) | ||
191 | { | ||
192 | + if (GET_CODE (x) == CONST) | ||
193 | + return pcrel_constant_p (XEXP (x, 0)); | ||
194 | + | ||
195 | if (GET_CODE (x) == MINUS) | ||
196 | - return symbol_mentioned_p (XEXP (x, 0)) && label_mentioned_p (XEXP (x, 1)); | ||
197 | + return (((GET_CODE (XEXP (x, 0)) == UNSPEC && XINT (XEXP (x, 0), 1) == UNSPEC_PIC_SYM)) || symbol_mentioned_p (XEXP (x, 0))) && label_mentioned_p (XEXP (x, 1)); | ||
198 | |||
199 | if (GET_CODE (x) == UNSPEC | ||
200 | && XINT (x, 1) == UNSPEC_TLS | ||
201 | @@ -3946,12 +4019,32 @@ | ||
202 | return SYMBOL_REF_TLS_MODEL (op); | ||
203 | } | ||
204 | |||
205 | +bool | ||
206 | +arm_pc_pic_operand_p (rtx op) | ||
207 | +{ | ||
208 | + if (GET_CODE (op) == CONST | ||
209 | + && GET_CODE (XEXP (op, 0)) == MINUS | ||
210 | + && GET_CODE (XEXP (XEXP (op, 0), 0)) == UNSPEC | ||
211 | + && XINT (XEXP (XEXP (op, 0), 0), 1) == UNSPEC_GOTSLOTPC) | ||
212 | + return 1; | ||
213 | + | ||
214 | + if (GET_CODE (op) == CONST | ||
215 | + && GET_CODE (XEXP (op, 0)) == MINUS | ||
216 | + && GET_CODE (XEXP (XEXP (op, 0), 0)) == UNSPEC | ||
217 | + && XINT (XEXP (XEXP (op, 0), 0), 1) == UNSPEC_PIC_SYM) | ||
218 | + return 1; | ||
219 | + | ||
220 | + return 0; | ||
221 | +} | ||
222 | + | ||
223 | /* Valid input to a move instruction. */ | ||
224 | int | ||
225 | move_input_operand (rtx op, enum machine_mode mode) | ||
226 | { | ||
227 | if (tls_symbolic_operand (op, mode)) | ||
228 | return 0; | ||
229 | + if (pcrel_constant_p (op)) | ||
230 | + return 1; | ||
231 | return general_operand (op, mode); | ||
232 | } | ||
233 | |||
234 | @@ -15634,11 +15727,34 @@ | ||
235 | return TRUE; | ||
236 | } | ||
237 | |||
238 | +static bool | ||
239 | +arm_emit_got_decoration (FILE *fp, rtx x) | ||
240 | +{ | ||
241 | + rtx val; | ||
242 | + | ||
243 | + val = XVECEXP (x, 0, 0); | ||
244 | + | ||
245 | + fputs ("_gotslotpc_(", fp); | ||
246 | + | ||
247 | + output_addr_const (fp, val); | ||
248 | + | ||
249 | + fputc (')', fp); | ||
250 | + | ||
251 | + return TRUE; | ||
252 | +} | ||
253 | + | ||
254 | bool | ||
255 | arm_output_addr_const_extra (FILE *fp, rtx x) | ||
256 | { | ||
257 | if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_TLS) | ||
258 | return arm_emit_tls_decoration (fp, x); | ||
259 | + else if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_GOTSLOTPC) | ||
260 | + return arm_emit_got_decoration (fp, x); | ||
261 | + else if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_PIC_SYM) | ||
262 | + { | ||
263 | + output_addr_const (fp, XVECEXP (x, 0, 0)); | ||
264 | + return TRUE; | ||
265 | + } | ||
266 | else if (GET_CODE (x) == CONST_VECTOR) | ||
267 | return arm_emit_vector_const (fp, x); | ||
268 | |||
269 | Index: gcc/config/arm/arm.md | ||
270 | =================================================================== | ||
271 | RCS file: /cvsroot/gcc/gcc/gcc/config/arm/arm.md,v | ||
272 | retrieving revision 1.145.2.31 | ||
273 | diff -u -r1.145.2.31 arm.md | ||
274 | --- gcc/config/arm/arm.md 28 Mar 2005 19:04:37 -0000 1.145.2.31 | ||
275 | +++ gcc/config/arm/arm.md 23 Apr 2005 04:41:11 -0000 | ||
276 | @@ -88,6 +88,7 @@ | ||
277 | (UNSPEC_WMADDS 18) ; Used by the intrinsic form of the iWMMXt WMADDS instruction. | ||
278 | (UNSPEC_WMADDU 19) ; Used by the intrinsic form of the iWMMXt WMADDU instruction. | ||
279 | (UNSPEC_TLS 20) ; A symbol that has been treated properly for TLS usage. | ||
280 | + (UNSPEC_GOTSLOTPC 21) | ||
281 | ] | ||
282 | ) | ||
283 | |||
284 | @@ -4179,7 +4180,8 @@ | ||
285 | && (CONSTANT_P (operands[1]) | ||
286 | || symbol_mentioned_p (operands[1]) | ||
287 | || label_mentioned_p (operands[1])) | ||
288 | - && ! tls_mentioned_p (operands[1])) | ||
289 | + && ! tls_mentioned_p (operands[1]) | ||
290 | + && ! arm_pc_pic_operand_p (operands[1])) | ||
291 | operands[1] = legitimize_pic_address (operands[1], SImode, | ||
292 | (no_new_pseudos ? operands[0] : 0)); | ||
293 | } | ||
294 | @@ -4412,7 +4414,8 @@ | ||
295 | (mem:SI (unspec:SI [(plus:SI (match_dup 0) | ||
296 | (const (plus:SI (pc) (const_int 8))))] | ||
297 | UNSPEC_PIC_BASE))) | ||
298 | - (use (label_ref (match_operand 1 "" "")))])] | ||
299 | + (use (label_ref (match_operand 1 "" ""))) | ||
300 | + (use (label_ref (match_operand 1 "" "")))])] | ||
301 | "" | ||
302 | ) | ||
303 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm/pr34130.patch b/meta/recipes-devtools/gcc/gcc-csl-arm/pr34130.patch new file mode 100644 index 0000000000..415335f4b4 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm/pr34130.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | Index: gcc-4.1.2/gcc/fold-const.c | ||
2 | =================================================================== | ||
3 | --- gcc-4.1.2.orig/gcc/fold-const.c 2007-11-21 18:53:42.000000000 +0100 | ||
4 | +++ gcc-4.1.2/gcc/fold-const.c 2007-11-21 18:56:26.000000000 +0100 | ||
5 | @@ -5339,7 +5339,10 @@ | ||
6 | } | ||
7 | break; | ||
8 | } | ||
9 | - /* FALLTHROUGH */ | ||
10 | + /* If the constant is negative, we cannot simplify this. */ | ||
11 | + if (tree_int_cst_sgn (c) == -1) | ||
12 | + break; | ||
13 | + /* FALLTHROUGH */ | ||
14 | case NEGATE_EXPR: | ||
15 | if ((t1 = extract_muldiv (op0, c, code, wide_type)) != 0) | ||
16 | return fold_build1 (tcode, ctype, fold_convert (ctype, t1)); | ||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm/zecke-no-host-includes.patch b/meta/recipes-devtools/gcc/gcc-csl-arm/zecke-no-host-includes.patch new file mode 100644 index 0000000000..8b05cb73a9 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm/zecke-no-host-includes.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | Index: gcc-4.0.2/gcc/c-incpath.c | ||
2 | =================================================================== | ||
3 | --- gcc-4.0.2.orig/gcc/c-incpath.c 2005-01-23 16:05:27.000000000 +0100 | ||
4 | +++ gcc-4.0.2/gcc/c-incpath.c 2006-05-15 21:23:02.000000000 +0200 | ||
5 | @@ -350,6 +350,26 @@ | ||
6 | p->construct = 0; | ||
7 | p->user_supplied_p = user_supplied_p; | ||
8 | |||
9 | +#ifdef CROSS_COMPILE | ||
10 | + /* A common error when cross compiling is including | ||
11 | + host headers. This code below will try to fail fast | ||
12 | + for cross compiling. Currently we consider /usr/include, | ||
13 | + /opt/include and /sw/include as harmful. */ | ||
14 | + { | ||
15 | + /* printf("Adding Path: %s\n", p->name ); */ | ||
16 | + if( strstr(p->name, "/usr/include" ) == p->name ) { | ||
17 | + fprintf(stderr, _("BUILD ISOLATION FAILURE: /usr/include in INCLUDEPATH: %s\n Please fix the flags passed to the compiler to use the correct prefix.\n"), p->name); | ||
18 | + abort(); | ||
19 | + } else if( strstr(p->name, "/sw/include") == p->name ) { | ||
20 | + fprintf(stderr, _("BUILD ISOLATION FAILURE: /sw/include in INCLUDEPATH: %s\n Please fix the flags passed to the compiler to use the correct prefix.\n"), p->name); | ||
21 | + abort(); | ||
22 | + } else if( strstr(p->name, "/opt/include") == p->name ) { | ||
23 | + fprintf(stderr, _("BUILD ISOLATION FAILURE: /opt/include in INCLUDEPATH: %s\n Please fix the flags passed to the compiler to use the correct prefix.\n"), p->name); | ||
24 | + abort(); | ||
25 | + } | ||
26 | + } | ||
27 | +#endif | ||
28 | + | ||
29 | add_cpp_dir_path (p, chain); | ||
30 | } | ||
31 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm/zecke-xgcc-cpp.patch b/meta/recipes-devtools/gcc/gcc-csl-arm/zecke-xgcc-cpp.patch new file mode 100644 index 0000000000..921cab6e18 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-csl-arm/zecke-xgcc-cpp.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | upstream: n/a | ||
2 | comment: Use the preprocessor we have just compiled instead the one of | ||
3 | the system. There might be incompabilities between us and them. | ||
4 | |||
5 | Index: gcc-4.1.1/Makefile.in | ||
6 | =================================================================== | ||
7 | --- gcc-4.1.1.orig/Makefile.in 2006-08-06 13:32:44.000000000 +0200 | ||
8 | +++ gcc-4.1.1/Makefile.in 2006-08-06 13:32:46.000000000 +0200 | ||
9 | @@ -194,6 +194,7 @@ | ||
10 | AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \ | ||
11 | CC="$(CC_FOR_TARGET)"; export CC; \ | ||
12 | CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ | ||
13 | + CPP="$(CC_FOR_TARGET) -E"; export CCP; \ | ||
14 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
15 | CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ | ||
16 | CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ | ||
diff --git a/meta/recipes-devtools/gcc/gcc-package-cross.inc b/meta/recipes-devtools/gcc/gcc-package-cross.inc new file mode 100644 index 0000000000..4f902fa149 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-package-cross.inc | |||
@@ -0,0 +1,47 @@ | |||
1 | INHIBIT_PACKAGE_STRIP = "1" | ||
2 | |||
3 | # Compute how to get from libexecdir to bindir in python (easier than shell) | ||
4 | BINRELPATH = "${@oe.path.relative(bb.data.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}", d), bb.data.expand("${STAGING_DIR_NATIVE}${prefix_native}/bin/${MULTIMACH_TARGET_SYS}", d))}" | ||
5 | |||
6 | do_install () { | ||
7 | oe_runmake 'DESTDIR=${D}' install-host | ||
8 | |||
9 | install -d ${D}${target_base_libdir} | ||
10 | install -d ${D}${target_libdir} | ||
11 | |||
12 | # Link gfortran to g77 to satisfy not-so-smart configure or hard coded g77 | ||
13 | # gfortran is fully backwards compatible. This is a safe and practical solution. | ||
14 | ln -sf ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}gfortran ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}g77 || true | ||
15 | |||
16 | |||
17 | # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are | ||
18 | # found. These need to be relative paths so they work in different locations. | ||
19 | dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/ | ||
20 | install -d $dest | ||
21 | for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do | ||
22 | ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t | ||
23 | done | ||
24 | |||
25 | # Remove things we don't need but keep share/java | ||
26 | for d in info man share/doc share/locale share/man share/info; do | ||
27 | rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/$d | ||
28 | done | ||
29 | |||
30 | # gcc-runtime installs libgcc into a special location in staging since it breaks doing a standalone build | ||
31 | if [ "${PN}" == "gcc-cross" -o "${PN}" == "gcc-crosssdk" ]; then | ||
32 | dest=${D}/${includedir}/gcc-build-internal-${MULTIMACH_TARGET_SYS} | ||
33 | oe_runmake "DESTDIR=$dest" libdir=${target_libdir} base_libdir=${target_base_libdir} prefix=${target_prefix} exec_prefix=${target_exec_prefix} install-target-libgcc | ||
34 | |||
35 | # Ideally here we'd override the libgcc Makefile's idea of slibdir but | ||
36 | # for now, we just move the files to the correct location | ||
37 | |||
38 | install -d $dest${target_base_libdir} | ||
39 | mv $dest${target_exec_prefix}/${TARGET_SYS}/lib*/* $dest${target_base_libdir} | ||
40 | rm -rf $dest${target_exec_prefix}/${TARGET_SYS} | ||
41 | |||
42 | # Also need to move gcc from /usr/lib/gcc/* to /usr/lib/ else the search paths won't find the crt*.o files | ||
43 | |||
44 | mv $dest${target_libdir}/gcc/* $dest${target_libdir}/ | ||
45 | rmdir $dest${target_libdir}/gcc | ||
46 | fi | ||
47 | } | ||
diff --git a/meta/recipes-devtools/gcc/gcc-package-runtime.inc b/meta/recipes-devtools/gcc/gcc-package-runtime.inc new file mode 100644 index 0000000000..40a9ed0d70 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-package-runtime.inc | |||
@@ -0,0 +1,58 @@ | |||
1 | PACKAGES = "\ | ||
2 | libgcc \ | ||
3 | libgcc-dev \ | ||
4 | libstdc++ \ | ||
5 | libstdc++-precompile-dev \ | ||
6 | libstdc++-dev \ | ||
7 | libg2c \ | ||
8 | libg2c-dev \ | ||
9 | libssp \ | ||
10 | libssp-dev \ | ||
11 | libgfortran \ | ||
12 | libgfortran-dev \ | ||
13 | libmudflap \ | ||
14 | libmudflap-dev \ | ||
15 | " | ||
16 | |||
17 | FILES_libgcc = "${base_libdir}/libgcc*.so.*" | ||
18 | FILES_libgcc-dev = " \ | ||
19 | ${base_libdir}/libgcc*.so \ | ||
20 | ${libdir}/${TARGET_SYS}/${BINV}/crt* \ | ||
21 | ${libdir}/${TARGET_SYS}/${BINV}/libgcc*" | ||
22 | |||
23 | FILES_libg2c = "${target_libdir}/libg2c.so.*" | ||
24 | FILES_libg2c-dev = "\ | ||
25 | ${libdir}/libg2c.so \ | ||
26 | ${libdir}/libg2c.a \ | ||
27 | ${libdir}/libfrtbegin.a" | ||
28 | |||
29 | FILES_libstdc++ = "${libdir}/libstdc++.so.*" | ||
30 | FILES_libstdc++-dev = "\ | ||
31 | ${includedir}/c++/ \ | ||
32 | ${libdir}/libstdc++.so \ | ||
33 | ${libdir}/libstdc++.la \ | ||
34 | ${libdir}/libstdc++.a \ | ||
35 | ${libdir}/libsupc++.la \ | ||
36 | ${libdir}/libsupc++.a" | ||
37 | |||
38 | FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch" | ||
39 | |||
40 | FILES_libssp = "${libdir}/libssp.so.*" | ||
41 | FILES_libssp-dev = " \ | ||
42 | ${libdir}/libssp*.so \ | ||
43 | ${libdir}/libssp*.a \ | ||
44 | ${libdir}/libssp*.la \ | ||
45 | ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp" | ||
46 | |||
47 | FILES_libgfortran = "${libdir}/libgfortran.so.*" | ||
48 | FILES_libgfortran-dev = " \ | ||
49 | ${libdir}/libgfortran.a \ | ||
50 | ${libdir}/libgfortran.so \ | ||
51 | ${libdir}/libgfortranbegin.a" | ||
52 | |||
53 | FILES_libmudflap = "${libdir}/libmudflap*.so.*" | ||
54 | FILES_libmudflap-dev = "\ | ||
55 | ${libdir}/libmudflap*.so \ | ||
56 | ${libdir}/libmudflap*.a \ | ||
57 | ${libdir}/libmudflap*.la" | ||
58 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-package-sdk.inc b/meta/recipes-devtools/gcc/gcc-package-sdk.inc new file mode 100644 index 0000000000..23b9a48eb3 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-package-sdk.inc | |||
@@ -0,0 +1,52 @@ | |||
1 | INHIBIT_PACKAGE_STRIP = "1" | ||
2 | |||
3 | # Having anything auto depending on gcc-cross-sdk is a really bad idea... | ||
4 | EXCLUDE_FROM_SHLIBS = "1" | ||
5 | |||
6 | PACKAGES = "${PN} ${PN}-doc" | ||
7 | |||
8 | FILES_${PN} = "\ | ||
9 | ${bindir}/* \ | ||
10 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/* \ | ||
11 | ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \ | ||
12 | ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \ | ||
13 | ${gcclibdir}/${TARGET_SYS}/${BINV}/lib* \ | ||
14 | ${gcclibdir}/${TARGET_SYS}/${BINV}/include \ | ||
15 | ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \ | ||
16 | ${includedir}/c++/${BINV} \ | ||
17 | ${prefix}/${TARGET_SYS}/bin/* \ | ||
18 | ${prefix}/${TARGET_SYS}/lib/* \ | ||
19 | ${prefix}/${TARGET_SYS}/usr/include/* \ | ||
20 | " | ||
21 | FILES_${PN}-doc = "\ | ||
22 | ${infodir} \ | ||
23 | ${mandir} \ | ||
24 | ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \ | ||
25 | " | ||
26 | |||
27 | do_install () { | ||
28 | oe_runmake 'DESTDIR=${D}' install-host | ||
29 | |||
30 | # Cleanup some of the ${libdir}{,exec}/gcc stuff ... | ||
31 | rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools | ||
32 | rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools | ||
33 | |||
34 | # We care about g++ not c++ | ||
35 | rm -f ${D}${bindir}/*c++ | ||
36 | |||
37 | # We don't care about the gcc-<version> copies | ||
38 | rm -f ${D}${bindir}/*gcc-?.?* | ||
39 | |||
40 | # We use libiberty from binutils | ||
41 | rm -f ${D}${prefix}/${TARGET_SYS}/lib/libiberty.a | ||
42 | rm -f ${D}${libdir}/libiberty.a | ||
43 | |||
44 | # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are | ||
45 | # found. | ||
46 | dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/ | ||
47 | install -d $dest | ||
48 | for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do | ||
49 | ln -sf ${bindir}/${TARGET_PREFIX}$t $dest$t | ||
50 | done | ||
51 | } | ||
52 | |||
diff --git a/meta/recipes-devtools/gcc/gcc-package-target.inc b/meta/recipes-devtools/gcc/gcc-package-target.inc new file mode 100644 index 0000000000..3286da6a95 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-package-target.inc | |||
@@ -0,0 +1,99 @@ | |||
1 | PACKAGES = "\ | ||
2 | ${PN} ${PN}-symlinks \ | ||
3 | g++ g++-symlinks \ | ||
4 | cpp cpp-symlinks \ | ||
5 | g77 g77-symlinks \ | ||
6 | gfortran gfortran-symlinks \ | ||
7 | gcov gcov-symlinks \ | ||
8 | ${PN}-doc \ | ||
9 | " | ||
10 | |||
11 | FILES_${PN} = "\ | ||
12 | ${bindir}/${TARGET_PREFIX}gcc \ | ||
13 | ${bindir}/${TARGET_PREFIX}gccbug \ | ||
14 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/collect2 \ | ||
15 | ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \ | ||
16 | ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \ | ||
17 | ${gcclibdir}/${TARGET_SYS}/${BINV}/lib* \ | ||
18 | ${gcclibdir}/${TARGET_SYS}/${BINV}/include \ | ||
19 | ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \ | ||
20 | " | ||
21 | FILES_${PN}-symlinks = "\ | ||
22 | ${bindir}/cc \ | ||
23 | ${bindir}/gcc \ | ||
24 | ${bindir}/gccbug \ | ||
25 | " | ||
26 | |||
27 | FILES_g77 = "\ | ||
28 | ${bindir}/${TARGET_PREFIX}g77 \ | ||
29 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f771 \ | ||
30 | " | ||
31 | FILES_g77-symlinks = "\ | ||
32 | ${bindir}/g77 \ | ||
33 | ${bindir}/f77 \ | ||
34 | " | ||
35 | FILES_gfortran = "\ | ||
36 | ${bindir}/${TARGET_PREFIX}gfortran \ | ||
37 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f951 \ | ||
38 | " | ||
39 | FILES_gfortran-symlinks = "\ | ||
40 | ${bindir}/gfortran \ | ||
41 | ${bindir}/f95" | ||
42 | |||
43 | FILES_cpp = "\ | ||
44 | ${bindir}/${TARGET_PREFIX}cpp \ | ||
45 | ${base_libdir}/cpp \ | ||
46 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1" | ||
47 | FILES_cpp-symlinks = "${bindir}/cpp" | ||
48 | |||
49 | FILES_gcov = "${bindir}/${TARGET_PREFIX}gcov" | ||
50 | FILES_gcov-symlinks = "${bindir}/gcov" | ||
51 | |||
52 | FILES_g++ = "\ | ||
53 | ${bindir}/${TARGET_PREFIX}g++ \ | ||
54 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus \ | ||
55 | " | ||
56 | FILES_g++-symlinks = "\ | ||
57 | ${bindir}/c++ \ | ||
58 | ${bindir}/g++ \ | ||
59 | " | ||
60 | |||
61 | |||
62 | FILES_${PN}-doc = "\ | ||
63 | ${infodir} \ | ||
64 | ${mandir} \ | ||
65 | ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \ | ||
66 | " | ||
67 | |||
68 | do_install () { | ||
69 | oe_runmake 'DESTDIR=${D}' install-host | ||
70 | |||
71 | # Cleanup some of the ${libdir}{,exec}/gcc stuff ... | ||
72 | rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools | ||
73 | rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools | ||
74 | |||
75 | # Hack around specs file assumptions | ||
76 | test -f ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs && sed -i -e '/^*cross_compile:$/ { n; s/1/0/; }' ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs | ||
77 | |||
78 | # Cleanup manpages.. | ||
79 | rm -rf ${D}${mandir}/man7 | ||
80 | |||
81 | cd ${D}${bindir} | ||
82 | |||
83 | # We care about g++ not c++ | ||
84 | rm -f *c++ | ||
85 | |||
86 | # We don't care about the gcc-<version> ones for this | ||
87 | rm -f *gcc-?.?* | ||
88 | |||
89 | # Symlinks so we can use these trivially on the target | ||
90 | ln -sf ${TARGET_SYS}-g77 g77 || true | ||
91 | ln -sf ${TARGET_SYS}-gfortran gfortran || true | ||
92 | ln -sf ${TARGET_SYS}-g++ g++ | ||
93 | ln -sf ${TARGET_SYS}-gcc gcc | ||
94 | ln -sf g77 f77 || true | ||
95 | ln -sf gfortran f95 || true | ||
96 | ln -sf g++ c++ | ||
97 | ln -sf gcc cc | ||
98 | ln -sf ${bindir}/${TARGET_SYS}-cpp ${D}${bindir}/cpp | ||
99 | } | ||
diff --git a/meta/recipes-devtools/gcc/gcc-runtime_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-runtime_4.3.3.bb new file mode 100644 index 0000000000..543bf24b77 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-runtime_4.3.3.bb | |||
@@ -0,0 +1,11 @@ | |||
1 | PR = "r15" | ||
2 | |||
3 | require gcc-${PV}.inc | ||
4 | require gcc-configure-runtime.inc | ||
5 | require gcc-package-runtime.inc | ||
6 | |||
7 | SRC_URI_append = "file://fortran-cross-compile-hack.patch;patch=1" | ||
8 | |||
9 | ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR}" | ||
10 | |||
11 | EXTRA_OECONF += "--disable-libunwind-exceptions" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-runtime_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-runtime_4.5.0.bb new file mode 100644 index 0000000000..28bae50197 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-runtime_4.5.0.bb | |||
@@ -0,0 +1,11 @@ | |||
1 | PR = "r6" | ||
2 | |||
3 | require gcc-${PV}.inc | ||
4 | require gcc-configure-runtime.inc | ||
5 | require gcc-package-runtime.inc | ||
6 | |||
7 | SRC_URI_append = "file://fortran-cross-compile-hack.patch" | ||
8 | |||
9 | ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR}" | ||
10 | |||
11 | EXTRA_OECONF += "--disable-libunwind-exceptions" | ||
diff --git a/meta/recipes-devtools/gcc/gcc_4.3.3.bb b/meta/recipes-devtools/gcc/gcc_4.3.3.bb new file mode 100644 index 0000000000..a2ae0c0e92 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc_4.3.3.bb | |||
@@ -0,0 +1,10 @@ | |||
1 | PR = "r8" | ||
2 | |||
3 | require gcc-${PV}.inc | ||
4 | require gcc-configure-target.inc | ||
5 | require gcc-package-target.inc | ||
6 | |||
7 | SRC_URI_append = "file://fortran-cross-compile-hack.patch;patch=1" | ||
8 | |||
9 | ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR}" | ||
10 | |||
diff --git a/meta/recipes-devtools/gcc/gcc_4.5.0.bb b/meta/recipes-devtools/gcc/gcc_4.5.0.bb new file mode 100644 index 0000000000..e133c5bac7 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc_4.5.0.bb | |||
@@ -0,0 +1,10 @@ | |||
1 | PR = "r6" | ||
2 | |||
3 | require gcc-${PV}.inc | ||
4 | require gcc-configure-target.inc | ||
5 | require gcc-package-target.inc | ||
6 | |||
7 | SRC_URI_append = "file://fortran-cross-compile-hack.patch" | ||
8 | |||
9 | ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR}" | ||
10 | |||
diff --git a/meta/recipes-devtools/gcc/gcc_csl-arm-2008q1.bb b/meta/recipes-devtools/gcc/gcc_csl-arm-2008q1.bb new file mode 100644 index 0000000000..832167ca4e --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc_csl-arm-2008q1.bb | |||
@@ -0,0 +1,5 @@ | |||
1 | PR = "r1" | ||
2 | |||
3 | require gcc-${PV}.inc | ||
4 | require gcc-configure-target.inc | ||
5 | require gcc-package-target.inc | ||