diff options
author | Khem Raj <raj.khem@gmail.com> | 2011-12-21 17:09:19 +0000 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2011-12-21 20:34:38 +0100 |
commit | ac52f114fb1f2cc0b28a7457fb1a64b39a196e5a (patch) | |
tree | 51a8d20f86d8adc5dbeb7e44110278b755b443aa /meta-oe/recipes-devtools | |
parent | 89fc3c7f28f6e4d2dc1fcbe760db8c8fdc229dc3 (diff) | |
download | meta-openembedded-ac52f114fb1f2cc0b28a7457fb1a64b39a196e5a.tar.gz |
gcc-4.5: Update gxx headers patch
This patch now expects gxx-include-dir
to be specified under sysroot which we
already do through gcc-cross4.inc from
oe-core
Please test
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe/recipes-devtools')
-rw-r--r-- | meta-oe/recipes-devtools/gcc/gcc-4.5.inc | 4 | ||||
-rw-r--r-- | meta-oe/recipes-devtools/gcc/gcc-4.5/GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch | 177 |
2 files changed, 163 insertions, 18 deletions
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5.inc b/meta-oe/recipes-devtools/gcc/gcc-4.5.inc index a0c2a7b28..c2c451b6a 100644 --- a/meta-oe/recipes-devtools/gcc/gcc-4.5.inc +++ b/meta-oe/recipes-devtools/gcc/gcc-4.5.inc | |||
@@ -14,7 +14,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \ | |||
14 | 14 | ||
15 | 15 | ||
16 | PV = "4.5" | 16 | PV = "4.5" |
17 | PR = "r44" | 17 | PR = "r45" |
18 | 18 | ||
19 | # BINV should be incremented after updating to a revision | 19 | # BINV should be incremented after updating to a revision |
20 | # after a minor gcc release (e.g. 4.5.1 or 4.5.2) has been made | 20 | # after a minor gcc release (e.g. 4.5.1 or 4.5.2) has been made |
@@ -226,13 +226,13 @@ SRC_URI = "svn://gcc.gnu.org/svn/gcc/branches;module=${BRANCH};proto=http \ | |||
226 | file://fedora/gcc45-no-add-needed.patch;striplevel=0 \ | 226 | file://fedora/gcc45-no-add-needed.patch;striplevel=0 \ |
227 | file://optional_libstdc.patch \ | 227 | file://optional_libstdc.patch \ |
228 | file://64bithack.patch \ | 228 | file://64bithack.patch \ |
229 | file://GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch \ | ||
230 | file://COLLECT_GCC_OPTIONS.patch \ | 229 | file://COLLECT_GCC_OPTIONS.patch \ |
231 | file://gcc-poison-dir-extend.patch \ | 230 | file://gcc-poison-dir-extend.patch \ |
232 | file://gcc-poison-parameters.patch \ | 231 | file://gcc-poison-parameters.patch \ |
233 | file://gcc-ppc-config-fix.patch \ | 232 | file://gcc-ppc-config-fix.patch \ |
234 | file://use-defaults.h-and-t-oe-in-B.patch \ | 233 | file://use-defaults.h-and-t-oe-in-B.patch \ |
235 | file://gcc-with-linker-hash-style.patch \ | 234 | file://gcc-with-linker-hash-style.patch \ |
235 | file://GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch \ | ||
236 | " | 236 | " |
237 | 237 | ||
238 | # Language Overrides | 238 | # Language Overrides |
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch index 9ae01c3fc..5c7b346ca 100644 --- a/meta-oe/recipes-devtools/gcc/gcc-4.5/GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch +++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch | |||
@@ -1,33 +1,178 @@ | |||
1 | # by default c++ include directories are not relative to "--sysroot" | 1 | source: http://patchwork.ozlabs.org/patch/129800/ |
2 | # which brings one trouble when using the toolchain in an environment | 2 | Upstream-Status: Submitted |
3 | # where the build directory generating that toolchain doesn't exist, | 3 | |
4 | # e.g. in sstate, machine specific sysroot and relocatable SDK | 4 | ChangeLog |
5 | # toolchain. This patch now enables c++ include paths under sysroot. | 5 | * Makefile.in (gcc_gxx_include_dir_add_sysroot): New. |
6 | # This way it's enough as long as "--sysroot" is correctly enabled | 6 | (PREPROCESSOR_DEFINES): Define GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT. |
7 | # in the new environment. | 7 | |
8 | # | 8 | * cppdefault.c (cpp_include_defaults): replace hard coded "1" with |
9 | # Signed-off-by Kevin Tian <kevin.tian@intel.com>, 2010-12-30 | 9 | GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT for "add_sysroot" field. |
10 | 10 | ||
11 | diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c | 11 | * configure.ac (AC_SUBST): Add gcc_gxx_include_dir_add_sysroot to |
12 | index 5024f48..9b47d1c 100644 | 12 | control whether sysroot should be prepended to gxx include dir. |
13 | |||
14 | * configure: Regenerate. | ||
15 | |||
16 | Hi, this is a follow up for issue "http://codereview.appspot.com/4641076". | ||
17 | |||
18 | The rationale for the patch copied from previous thread: | ||
19 | ======================================= | ||
20 | The setup: | ||
21 | |||
22 | Configuring a toolchain targeting x86-64 GNU Linux (Ubuntu Lucid), as a | ||
23 | cross-compiler. Using a sysroot to provide the Lucid headers+libraries, | ||
24 | with the sysroot path being within the GCC install tree. Want to use the | ||
25 | Lucid system libstdc++ and headers, which means that I'm not | ||
26 | building/installing libstdc++-v3. | ||
27 | |||
28 | So, configuring with: | ||
29 | --with-sysroot="$SYSROOT" | ||
30 | --disable-libstdc++-v3 \ | ||
31 | --with-gxx-include-dir="$SYSROOT/usr/include/c++/4.4" \ | ||
32 | (among other options). | ||
33 | |||
34 | Hoping to support two usage models with this configuration, w.r.t. use of | ||
35 | the sysroot: | ||
36 | |||
37 | (1) somebody installs the sysroot in the normal location relative to the | ||
38 | GCC install, and relocates the whole bundle (sysroot+GCC). This works | ||
39 | great AFAICT, GCC finds its includes (including the C++ includes) thanks | ||
40 | to the add_standard_paths iprefix handling. | ||
41 | |||
42 | (2) somebody installs the sysroot in a non-standard location, and uses | ||
43 | --sysroot to try to access it. This works fine for the C headers, but | ||
44 | doesn't work. | ||
45 | |||
46 | For the C headers, add_standard_paths prepends the sysroot location to | ||
47 | the /usr/include path (since that's what's specified in cppdefault.c for | ||
48 | that path). It doesn't do the same for the C++ include path, though | ||
49 | (again, as specified in cppdefault.c). | ||
50 | |||
51 | add_standard_paths doesn't attempt to relocate built-in include paths that | ||
52 | start with the compiled-in sysroot location (e.g., the g++ include dir, in | ||
53 | this case). This isn't surprising really: normally you either prepend the | ||
54 | sysroot location or you don't (as specified by cppdefault.c); none of the | ||
55 | built-in paths normally *start* with the sysroot location and need to be | ||
56 | relocated. However, in this odd-ball case of trying to use the C++ headers | ||
57 | from the sysroot, one of the paths *does* need to be relocated in this way. | ||
58 | =========================== | ||
59 | --- a/gcc/Makefile.in | ||
60 | +++ b/gcc/Makefile.in | ||
61 | @@ -585,6 +585,7 @@ slibdir = @slibdir@ | ||
62 | build_tooldir = $(exec_prefix)/$(target_noncanonical) | ||
63 | # Directory in which the compiler finds target-independent g++ includes. | ||
64 | gcc_gxx_include_dir = @gcc_gxx_include_dir@ | ||
65 | +gcc_gxx_include_dir_add_sysroot = @gcc_gxx_include_dir_add_sysroot@ | ||
66 | # Directory to search for site-specific includes. | ||
67 | local_includedir = $(local_prefix)/include | ||
68 | includedir = $(prefix)/include | ||
69 | @@ -3788,6 +3789,7 @@ PREPROCESSOR_DEFINES = \ | ||
70 | -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \ | ||
71 | -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \ | ||
72 | -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \ | ||
73 | + -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \ | ||
74 | -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \ | ||
75 | -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \ | ||
76 | -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \ | ||
77 | --- a/gcc/configure.ac | ||
78 | +++ b/gcc/configure.ac | ||
79 | @@ -144,6 +144,15 @@ if test x${gcc_gxx_include_dir} = x; the | ||
80 | fi | ||
81 | fi | ||
82 | |||
83 | +gcc_gxx_include_dir_add_sysroot=0 | ||
84 | +if test "${with_sysroot+set}" = set; then : | ||
85 | + gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'` | ||
86 | + if test "${gcc_gxx_without_sysroot}"; then : | ||
87 | + gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" | ||
88 | + gcc_gxx_include_dir_add_sysroot=1 | ||
89 | + fi | ||
90 | +fi | ||
91 | + | ||
92 | AC_ARG_WITH(cpp_install_dir, | ||
93 | [ --with-cpp-install-dir=DIR | ||
94 | install the user visible C preprocessor in DIR | ||
95 | @@ -4492,6 +4501,7 @@ AC_SUBST(extra_programs) | ||
96 | AC_SUBST(float_h_file) | ||
97 | AC_SUBST(gcc_config_arguments) | ||
98 | AC_SUBST(gcc_gxx_include_dir) | ||
99 | +AC_SUBST(gcc_gxx_include_dir_add_sysroot) | ||
100 | AC_SUBST(host_exeext) | ||
101 | AC_SUBST(host_xm_file_list) | ||
102 | AC_SUBST(host_xm_include_list) | ||
13 | --- a/gcc/cppdefault.c | 103 | --- a/gcc/cppdefault.c |
14 | +++ b/gcc/cppdefault.c | 104 | +++ b/gcc/cppdefault.c |
15 | @@ -48,15 +48,15 @@ const struct default_include cpp_include_defaults[] | 105 | @@ -48,15 +48,18 @@ const struct default_include cpp_include |
16 | = { | 106 | = { |
17 | #ifdef GPLUSPLUS_INCLUDE_DIR | 107 | #ifdef GPLUSPLUS_INCLUDE_DIR |
18 | /* Pick up GNU C++ generic include files. */ | 108 | /* Pick up GNU C++ generic include files. */ |
19 | - { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, | 109 | - { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, |
20 | + { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 1, 0 }, | 110 | + { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, |
111 | + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, | ||
21 | #endif | 112 | #endif |
22 | #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR | 113 | #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR |
23 | /* Pick up GNU C++ target-dependent include files. */ | 114 | /* Pick up GNU C++ target-dependent include files. */ |
24 | - { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 1 }, | 115 | - { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 1 }, |
25 | + { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 1, 1 }, | 116 | + { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, |
117 | + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, | ||
26 | #endif | 118 | #endif |
27 | #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR | 119 | #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR |
28 | /* Pick up GNU C++ backward and deprecated include files. */ | 120 | /* Pick up GNU C++ backward and deprecated include files. */ |
29 | - { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, | 121 | - { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, |
30 | + { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 1, 0 }, | 122 | + { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, |
123 | + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, | ||
31 | #endif | 124 | #endif |
32 | #ifdef LOCAL_INCLUDE_DIR | 125 | #ifdef LOCAL_INCLUDE_DIR |
33 | /* /usr/local/include comes before the fixincluded header files. */ | 126 | /* /usr/local/include comes before the fixincluded header files. */ |
127 | --- a/gcc/configure | ||
128 | +++ b/gcc/configure | ||
129 | @@ -639,6 +639,7 @@ host_xm_defines | ||
130 | host_xm_include_list | ||
131 | host_xm_file_list | ||
132 | host_exeext | ||
133 | +gcc_gxx_include_dir_add_sysroot | ||
134 | gcc_gxx_include_dir | ||
135 | gcc_config_arguments | ||
136 | float_h_file | ||
137 | @@ -3282,6 +3283,15 @@ if test x${gcc_gxx_include_dir} = x; the | ||
138 | fi | ||
139 | fi | ||
140 | |||
141 | +gcc_gxx_include_dir_add_sysroot=0 | ||
142 | +if test "${with_sysroot+set}" = set; then : | ||
143 | + gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'` | ||
144 | + if test "${gcc_gxx_without_sysroot}"; then : | ||
145 | + gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" | ||
146 | + gcc_gxx_include_dir_add_sysroot=1 | ||
147 | + fi | ||
148 | +fi | ||
149 | + | ||
150 | |||
151 | # Check whether --with-cpp_install_dir was given. | ||
152 | if test "${with_cpp_install_dir+set}" = set; then : | ||
153 | @@ -17118,7 +17128,7 @@ else | ||
154 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
155 | lt_status=$lt_dlunknown | ||
156 | cat > conftest.$ac_ext <<_LT_EOF | ||
157 | -#line 17121 "configure" | ||
158 | +#line 17131 "configure" | ||
159 | #include "confdefs.h" | ||
160 | |||
161 | #if HAVE_DLFCN_H | ||
162 | @@ -17224,7 +17234,7 @@ else | ||
163 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
164 | lt_status=$lt_dlunknown | ||
165 | cat > conftest.$ac_ext <<_LT_EOF | ||
166 | -#line 17227 "configure" | ||
167 | +#line 17237 "configure" | ||
168 | #include "confdefs.h" | ||
169 | |||
170 | #if HAVE_DLFCN_H | ||
171 | @@ -25381,6 +25391,7 @@ fi | ||
172 | |||
173 | |||
174 | |||
175 | + | ||
176 | |||
177 | |||
178 | |||