diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6/GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch | 189 |
1 files changed, 170 insertions, 19 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch b/meta/recipes-devtools/gcc/gcc-4.6/GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch index 05b2fa96c2..6ccbeea00d 100644 --- a/meta/recipes-devtools/gcc/gcc-4.6/GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch +++ b/meta/recipes-devtools/gcc/gcc-4.6/GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch | |||
@@ -1,35 +1,186 @@ | |||
1 | Upstream-Status: Pending | 1 | source: http://patchwork.ozlabs.org/patch/129800/ |
2 | 2 | Upstream-Status: Submitted | |
3 | # by default c++ include directories are not relative to "--sysroot" | 3 | |
4 | # which brings one trouble when using the toolchain in an environment | 4 | ChangeLog |
5 | # where the build directory generating that toolchain doesn't exist, | 5 | * Makefile.in (gcc_gxx_include_dir_add_sysroot): New. |
6 | # e.g. in sstate, machine specific sysroot and relocatable SDK | 6 | (PREPROCESSOR_DEFINES): Define GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT. |
7 | # toolchain. This patch now enables c++ include paths under sysroot. | 7 | |
8 | # This way it's enough as long as "--sysroot" is correctly enabled | 8 | * cppdefault.c (cpp_include_defaults): replace hard coded "1" with |
9 | # in the new environment. | 9 | GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT for "add_sysroot" field. |
10 | # | 10 | |
11 | # Signed-off-by Kevin Tian <kevin.tian@intel.com>, 2010-12-30 | 11 | * configure.ac (AC_SUBST): Add gcc_gxx_include_dir_add_sysroot to |
12 | 12 | control whether sysroot should be prepended to gxx include dir. | |
13 | Index: gcc-4.6.0/gcc/cppdefault.c | 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 | Index: gcc-4_6-branch/gcc/Makefile.in | ||
60 | =================================================================== | ||
61 | --- gcc-4_6-branch.orig/gcc/Makefile.in 2011-12-13 22:52:15.000000000 -0800 | ||
62 | +++ gcc-4_6-branch/gcc/Makefile.in 2011-12-13 22:52:21.933635767 -0800 | ||
63 | @@ -587,6 +587,7 @@ | ||
64 | build_tooldir = $(exec_prefix)/$(target_noncanonical) | ||
65 | # Directory in which the compiler finds target-independent g++ includes. | ||
66 | gcc_gxx_include_dir = @gcc_gxx_include_dir@ | ||
67 | +gcc_gxx_include_dir_add_sysroot = @gcc_gxx_include_dir_add_sysroot@ | ||
68 | # Directory to search for site-specific includes. | ||
69 | local_includedir = $(local_prefix)/include | ||
70 | includedir = $(prefix)/include | ||
71 | @@ -3964,6 +3965,7 @@ | ||
72 | -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \ | ||
73 | -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \ | ||
74 | -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \ | ||
75 | + -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \ | ||
76 | -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \ | ||
77 | -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \ | ||
78 | -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \ | ||
79 | Index: gcc-4_6-branch/gcc/configure.ac | ||
14 | =================================================================== | 80 | =================================================================== |
15 | --- gcc-4.6.0.orig/gcc/cppdefault.c | 81 | --- gcc-4_6-branch.orig/gcc/configure.ac 2011-12-13 22:52:15.000000000 -0800 |
16 | +++ gcc-4.6.0/gcc/cppdefault.c | 82 | +++ gcc-4_6-branch/gcc/configure.ac 2011-12-13 22:52:21.937635526 -0800 |
17 | @@ -48,15 +48,15 @@ const struct default_include cpp_include | 83 | @@ -144,6 +144,15 @@ |
84 | fi | ||
85 | fi | ||
86 | |||
87 | +gcc_gxx_include_dir_add_sysroot=0 | ||
88 | +if test "${with_sysroot+set}" = set; then : | ||
89 | + gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'` | ||
90 | + if test "${gcc_gxx_without_sysroot}"; then : | ||
91 | + gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" | ||
92 | + gcc_gxx_include_dir_add_sysroot=1 | ||
93 | + fi | ||
94 | +fi | ||
95 | + | ||
96 | AC_ARG_WITH(cpp_install_dir, | ||
97 | [ --with-cpp-install-dir=DIR | ||
98 | install the user visible C preprocessor in DIR | ||
99 | @@ -4737,6 +4746,7 @@ | ||
100 | AC_SUBST(float_h_file) | ||
101 | AC_SUBST(gcc_config_arguments) | ||
102 | AC_SUBST(gcc_gxx_include_dir) | ||
103 | +AC_SUBST(gcc_gxx_include_dir_add_sysroot) | ||
104 | AC_SUBST(host_exeext) | ||
105 | AC_SUBST(host_xm_file_list) | ||
106 | AC_SUBST(host_xm_include_list) | ||
107 | Index: gcc-4_6-branch/gcc/cppdefault.c | ||
108 | =================================================================== | ||
109 | --- gcc-4_6-branch.orig/gcc/cppdefault.c 2011-12-13 22:51:28.000000000 -0800 | ||
110 | +++ gcc-4_6-branch/gcc/cppdefault.c 2011-12-13 22:52:21.937635526 -0800 | ||
111 | @@ -48,15 +48,18 @@ | ||
18 | = { | 112 | = { |
19 | #ifdef GPLUSPLUS_INCLUDE_DIR | 113 | #ifdef GPLUSPLUS_INCLUDE_DIR |
20 | /* Pick up GNU C++ generic include files. */ | 114 | /* Pick up GNU C++ generic include files. */ |
21 | - { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, | 115 | - { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, |
22 | + { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 1, 0 }, | 116 | + { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, |
117 | + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, | ||
23 | #endif | 118 | #endif |
24 | #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR | 119 | #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR |
25 | /* Pick up GNU C++ target-dependent include files. */ | 120 | /* Pick up GNU C++ target-dependent include files. */ |
26 | - { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 1 }, | 121 | - { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 1 }, |
27 | + { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 1, 1 }, | 122 | + { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, |
123 | + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, | ||
28 | #endif | 124 | #endif |
29 | #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR | 125 | #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR |
30 | /* Pick up GNU C++ backward and deprecated include files. */ | 126 | /* Pick up GNU C++ backward and deprecated include files. */ |
31 | - { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, | 127 | - { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, |
32 | + { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 1, 0 }, | 128 | + { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, |
129 | + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, | ||
33 | #endif | 130 | #endif |
34 | #ifdef GCC_INCLUDE_DIR | 131 | #ifdef GCC_INCLUDE_DIR |
35 | /* This is the dir for gcc's private headers. */ | 132 | /* This is the dir for gcc's private headers. */ |
133 | Index: gcc-4_6-branch/gcc/configure | ||
134 | =================================================================== | ||
135 | --- gcc-4_6-branch.orig/gcc/configure 2011-12-13 22:52:15.000000000 -0800 | ||
136 | +++ gcc-4_6-branch/gcc/configure 2011-12-13 22:52:33.185690436 -0800 | ||
137 | @@ -636,6 +636,7 @@ | ||
138 | host_xm_include_list | ||
139 | host_xm_file_list | ||
140 | host_exeext | ||
141 | +gcc_gxx_include_dir_add_sysroot | ||
142 | gcc_gxx_include_dir | ||
143 | gcc_config_arguments | ||
144 | float_h_file | ||
145 | @@ -3313,6 +3314,15 @@ | ||
146 | fi | ||
147 | fi | ||
148 | |||
149 | +gcc_gxx_include_dir_add_sysroot=0 | ||
150 | +if test "${with_sysroot+set}" = set; then : | ||
151 | + gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'` | ||
152 | + if test "${gcc_gxx_without_sysroot}"; then : | ||
153 | + gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" | ||
154 | + gcc_gxx_include_dir_add_sysroot=1 | ||
155 | + fi | ||
156 | +fi | ||
157 | + | ||
158 | |||
159 | # Check whether --with-cpp_install_dir was given. | ||
160 | if test "${with_cpp_install_dir+set}" = set; then : | ||
161 | @@ -17514,7 +17524,7 @@ | ||
162 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
163 | lt_status=$lt_dlunknown | ||
164 | cat > conftest.$ac_ext <<_LT_EOF | ||
165 | -#line 17517 "configure" | ||
166 | +#line 17527 "configure" | ||
167 | #include "confdefs.h" | ||
168 | |||
169 | #if HAVE_DLFCN_H | ||
170 | @@ -17620,7 +17630,7 @@ | ||
171 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
172 | lt_status=$lt_dlunknown | ||
173 | cat > conftest.$ac_ext <<_LT_EOF | ||
174 | -#line 17623 "configure" | ||
175 | +#line 17633 "configure" | ||
176 | #include "confdefs.h" | ||
177 | |||
178 | #if HAVE_DLFCN_H | ||
179 | @@ -26151,6 +26161,7 @@ | ||
180 | |||
181 | |||
182 | |||
183 | + | ||
184 | |||
185 | |||
186 | |||