diff options
author | Matthew McClintock <msm@freescale.com> | 2012-03-13 14:55:41 -0500 |
---|---|---|
committer | Matthew McClintock <msm@freescale.com> | 2012-03-14 10:52:53 -0500 |
commit | cd8d01a52100e0a88c7c62ad0a7503ba9d9cb064 (patch) | |
tree | d14d60eb9599a36b9e1e469c6affdc266232f6d9 /recipes-devtools | |
parent | 122c5bfdad95930de96e191aafb0304fded007b2 (diff) | |
download | meta-fsl-ppc-cd8d01a52100e0a88c7c62ad0a7503ba9d9cb064.tar.gz |
gcc-fsl.inc: Add patches to fix gxx-include-dir
The patch in this patch is copied from upstream and is just
updated to apply cleanly with respect to our patch series
Signed-off-by: Matthew McClintock <msm@freescale.com>
Diffstat (limited to 'recipes-devtools')
-rw-r--r-- | recipes-devtools/gcc/files/GPLUSPLUS_INCLUDE_DIR_with_sysroot_fsl.patch | 186 | ||||
-rw-r--r-- | recipes-devtools/gcc/gcc-fsl.inc | 3 |
2 files changed, 188 insertions, 1 deletions
diff --git a/recipes-devtools/gcc/files/GPLUSPLUS_INCLUDE_DIR_with_sysroot_fsl.patch b/recipes-devtools/gcc/files/GPLUSPLUS_INCLUDE_DIR_with_sysroot_fsl.patch new file mode 100644 index 0000000..6ae6190 --- /dev/null +++ b/recipes-devtools/gcc/files/GPLUSPLUS_INCLUDE_DIR_with_sysroot_fsl.patch | |||
@@ -0,0 +1,186 @@ | |||
1 | source: http://patchwork.ozlabs.org/patch/129800/ | ||
2 | Upstream-Status: Submitted | ||
3 | |||
4 | ChangeLog | ||
5 | * Makefile.in (gcc_gxx_include_dir_add_sysroot): New. | ||
6 | (PREPROCESSOR_DEFINES): Define GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT. | ||
7 | |||
8 | * cppdefault.c (cpp_include_defaults): replace hard coded "1" with | ||
9 | GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT for "add_sysroot" field. | ||
10 | |||
11 | * configure.ac (AC_SUBST): Add gcc_gxx_include_dir_add_sysroot to | ||
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 | Index: gcc-4_6-branch/gcc/Makefile.in | ||
60 | =================================================================== | ||
61 | --- gcc-4_6-branch.orig/gcc/Makefile.in | ||
62 | +++ gcc-4_6-branch/gcc/Makefile.in | ||
63 | @@ -587,6 +587,7 @@ slibdir = @slibdir@ | ||
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 | @@ -3982,6 +3983,7 @@ PREPROCESSOR_DEFINES = \ | ||
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 | ||
80 | =================================================================== | ||
81 | --- gcc-4_6-branch.orig/gcc/configure.ac | ||
82 | +++ gcc-4_6-branch/gcc/configure.ac | ||
83 | @@ -144,6 +144,15 @@ if test x${gcc_gxx_include_dir} = x; the | ||
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 | @@ -4732,6 +4741,7 @@ AC_SUBST(extra_programs) | ||
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 | ||
110 | +++ gcc-4_6-branch/gcc/cppdefault.c | ||
111 | @@ -48,15 +48,18 @@ const struct default_include cpp_include | ||
112 | = { | ||
113 | #ifdef GPLUSPLUS_INCLUDE_DIR | ||
114 | /* Pick up GNU C++ generic include files. */ | ||
115 | - { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, | ||
116 | + { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, | ||
117 | + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, | ||
118 | #endif | ||
119 | #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR | ||
120 | /* Pick up GNU C++ target-dependent include files. */ | ||
121 | - { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 1 }, | ||
122 | + { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, | ||
123 | + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, | ||
124 | #endif | ||
125 | #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR | ||
126 | /* Pick up GNU C++ backward and deprecated include files. */ | ||
127 | - { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, | ||
128 | + { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, | ||
129 | + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, | ||
130 | #endif | ||
131 | #ifdef GCC_INCLUDE_DIR | ||
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 | ||
136 | +++ gcc-4_6-branch/gcc/configure | ||
137 | @@ -636,6 +636,7 @@ host_xm_defines | ||
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 | @@ -3306,6 +3307,15 @@ if test x${gcc_gxx_include_dir} = x; the | ||
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 | @@ -17505,7 +17515,7 @@ else | ||
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 17508 "configure" | ||
166 | +#line 17518 "configure" | ||
167 | #include "confdefs.h" | ||
168 | |||
169 | #if HAVE_DLFCN_H | ||
170 | @@ -17611,7 +17621,7 @@ else | ||
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 17614 "configure" | ||
175 | +#line 17624 "configure" | ||
176 | #include "confdefs.h" | ||
177 | |||
178 | #if HAVE_DLFCN_H | ||
179 | @@ -26195,6 +26205,7 @@ fi | ||
180 | |||
181 | |||
182 | |||
183 | + | ||
184 | # Echo link setup. | ||
185 | if test x${build} = x${host} ; then | ||
186 | if test x${host} = x${target} ; then | ||
diff --git a/recipes-devtools/gcc/gcc-fsl.inc b/recipes-devtools/gcc/gcc-fsl.inc index 83d519c..47555c8 100644 --- a/recipes-devtools/gcc/gcc-fsl.inc +++ b/recipes-devtools/gcc/gcc-fsl.inc | |||
@@ -37,8 +37,9 @@ SRC_URI = "svn://gcc.gnu.org/svn/gcc/branches;module=${BRANCH};proto=http \ | |||
37 | file://gcc.check_path_validity.patch \ | 37 | file://gcc.check_path_validity.patch \ |
38 | file://gcc.fix_header_issue.patch \ | 38 | file://gcc.fix_header_issue.patch \ |
39 | file://gcc.fix_SSIZE_MAX_undefine_issue.patch \ | 39 | file://gcc.fix_SSIZE_MAX_undefine_issue.patch \ |
40 | file://GPLUSPLUS_INCLUDE_DIR_with_sysroot_fsl.patch \ | ||
40 | " | 41 | " |
41 | 42 | ||
42 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | 43 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" |
43 | 44 | ||
44 | PR .= "+${DISTRO}.0" | 45 | PR .= "+${DISTRO}.1" |