summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2012-06-20 08:18:39 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-21 13:03:04 +0100
commitc0b54eb457b682b082d7cd4ebc5d1801eaeba85f (patch)
tree4d078f82736085e5b3f0667e68306e4b2dd802a8 /meta/recipes-devtools/gcc
parent7fb442a320d7fd0ebe43ce090cf1f3a1525cb6d1 (diff)
downloadpoky-c0b54eb457b682b082d7cd4ebc5d1801eaeba85f.tar.gz
gcc: Fix a case of sysroot with trailing / and gxx-include-dir leading slash
when using --with-sysroot=/ and --with-gxx-headers=/usr/include/c++ configure eats up one leading / from gxx include dir fixed thusly (From OE-Core rev: 51064de5fb92c53c99b21487c0ebcafeaf3cc3ad) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.7.inc1
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.7/fix-g++-sysroot.patch428
2 files changed, 429 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.7.inc b/meta/recipes-devtools/gcc/gcc-4.7.inc
index 25a1088623..65153b3b80 100644
--- a/meta/recipes-devtools/gcc/gcc-4.7.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.7.inc
@@ -67,6 +67,7 @@ SRC_URI = "svn://gcc.gnu.org/svn/gcc/branches;module=${BRANCH};proto=http \
67 file://mips64-default-n64.patch \ 67 file://mips64-default-n64.patch \
68 file://arm-hard-float-loader.patch \ 68 file://arm-hard-float-loader.patch \
69 file://gcc-argument-list-too-long.patch \ 69 file://gcc-argument-list-too-long.patch \
70 file://fix-g++-sysroot.patch \
70 " 71 "
71 72
72S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/${BRANCH}" 73S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/${BRANCH}"
diff --git a/meta/recipes-devtools/gcc/gcc-4.7/fix-g++-sysroot.patch b/meta/recipes-devtools/gcc/gcc-4.7/fix-g++-sysroot.patch
new file mode 100644
index 0000000000..116f137a94
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.7/fix-g++-sysroot.patch
@@ -0,0 +1,428 @@
1backport
2
3http://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg26013.html
4
5Upstream-Status: Pending
6
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8
9Index: gcc-4_7-branch/gcc/configure.ac
10===================================================================
11--- gcc-4_7-branch.orig/gcc/configure.ac 2012-06-20 00:21:52.182955919 -0700
12+++ gcc-4_7-branch/gcc/configure.ac 2012-06-20 00:28:01.386973785 -0700
13@@ -118,6 +118,72 @@
14 local_prefix=/usr/local
15 fi
16
17+AC_ARG_WITH([native-system-header-dir],
18+ [ --with-native-system-header-dir=dir
19+ use dir as the directory to look for standard
20+ system header files in. Defaults to /usr/include.],
21+[
22+ case ${with_native_system_header_dir} in
23+ yes|no) AC_MSG_ERROR([bad value ${withval} given for --with-native-system-header-dir]) ;;
24+ /* | [[A-Za-z]]:[[\\/]]*) ;;
25+ *) AC_MSG_ERROR([--with-native-system-header-dir argument ${withval} must be an absolute directory]) ;;
26+ esac
27+ configured_native_system_header_dir="${withval}"
28+], [configured_native_system_header_dir=])
29+
30+AC_ARG_WITH(build-sysroot,
31+ [AS_HELP_STRING([--with-build-sysroot=sysroot],
32+ [use sysroot as the system root during the build])],
33+ [if test x"$withval" != x ; then
34+ SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval"
35+ fi],
36+ [SYSROOT_CFLAGS_FOR_TARGET=])
37+AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)
38+
39+AC_ARG_WITH(sysroot,
40+[AS_HELP_STRING([[--with-sysroot[=DIR]]],
41+ [search for usr/lib, usr/include, et al, within DIR])],
42+[
43+ case ${with_sysroot} in
44+ /) ;;
45+ */) with_sysroot=`echo $with_sysroot | sed 's,/$,,'` ;;
46+ esac
47+ case ${with_sysroot} in
48+ yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_noncanonical}/sys-root' ;;
49+ *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
50+ esac
51+
52+ TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
53+ CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)'
54+
55+ if test "x$prefix" = xNONE; then
56+ test_prefix=/usr/local
57+ else
58+ test_prefix=$prefix
59+ fi
60+ if test "x$exec_prefix" = xNONE; then
61+ test_exec_prefix=$test_prefix
62+ else
63+ test_exec_prefix=$exec_prefix
64+ fi
65+ case ${TARGET_SYSTEM_ROOT} in
66+ "${test_prefix}"|"${test_prefix}/"*|\
67+ "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
68+ '${prefix}'|'${prefix}/'*|\
69+ '${exec_prefix}'|'${exec_prefix}/'*)
70+ t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
71+ TARGET_SYSTEM_ROOT_DEFINE="$t"
72+ ;;
73+ esac
74+], [
75+ TARGET_SYSTEM_ROOT=
76+ TARGET_SYSTEM_ROOT_DEFINE=
77+ CROSS_SYSTEM_HEADER_DIR='$(gcc_tooldir)/sys-include'
78+])
79+AC_SUBST(TARGET_SYSTEM_ROOT)
80+AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
81+AC_SUBST(CROSS_SYSTEM_HEADER_DIR)
82+
83 # Don't set gcc_gxx_include_dir to gxx_include_dir since that's only
84 # passed in by the toplevel make and thus we'd get different behavior
85 # depending on where we built the sources.
86@@ -149,7 +215,9 @@
87 if test "${with_sysroot+set}" = set; then
88 gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
89 if test "${gcc_gxx_without_sysroot}"; then
90- gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
91+ if test x${with_sysroot} != x/; then
92+ gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
93+ fi
94 gcc_gxx_include_dir_add_sysroot=1
95 fi
96 fi
97@@ -733,68 +801,6 @@
98 ], [enable_shared=yes])
99 AC_SUBST(enable_shared)
100
101-AC_ARG_WITH([native-system-header-dir],
102- [ --with-native-system-header-dir=dir
103- use dir as the directory to look for standard
104- system header files in. Defaults to /usr/include.],
105-[
106- case ${with_native_system_header_dir} in
107- yes|no) AC_MSG_ERROR([bad value ${withval} given for --with-native-system-header-dir]) ;;
108- /* | [[A-Za-z]]:[[\\/]]*) ;;
109- *) AC_MSG_ERROR([--with-native-system-header-dir argument ${withval} must be an absolute directory]) ;;
110- esac
111- configured_native_system_header_dir="${withval}"
112-], [configured_native_system_header_dir=])
113-
114-AC_ARG_WITH(build-sysroot,
115- [AS_HELP_STRING([--with-build-sysroot=sysroot],
116- [use sysroot as the system root during the build])],
117- [if test x"$withval" != x ; then
118- SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval"
119- fi],
120- [SYSROOT_CFLAGS_FOR_TARGET=])
121-AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)
122-
123-AC_ARG_WITH(sysroot,
124-[AS_HELP_STRING([[--with-sysroot[=DIR]]],
125- [search for usr/lib, usr/include, et al, within DIR])],
126-[
127- case ${with_sysroot} in
128- yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_noncanonical}/sys-root' ;;
129- *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
130- esac
131-
132- TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
133- CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)'
134-
135- if test "x$prefix" = xNONE; then
136- test_prefix=/usr/local
137- else
138- test_prefix=$prefix
139- fi
140- if test "x$exec_prefix" = xNONE; then
141- test_exec_prefix=$test_prefix
142- else
143- test_exec_prefix=$exec_prefix
144- fi
145- case ${TARGET_SYSTEM_ROOT} in
146- "${test_prefix}"|"${test_prefix}/"*|\
147- "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
148- '${prefix}'|'${prefix}/'*|\
149- '${exec_prefix}'|'${exec_prefix}/'*)
150- t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
151- TARGET_SYSTEM_ROOT_DEFINE="$t"
152- ;;
153- esac
154-], [
155- TARGET_SYSTEM_ROOT=
156- TARGET_SYSTEM_ROOT_DEFINE=
157- CROSS_SYSTEM_HEADER_DIR='$(gcc_tooldir)/sys-include'
158-])
159-AC_SUBST(TARGET_SYSTEM_ROOT)
160-AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
161-AC_SUBST(CROSS_SYSTEM_HEADER_DIR)
162-
163 AC_ARG_WITH(specs,
164 [AS_HELP_STRING([--with-specs=SPECS],
165 [add SPECS to driver command-line processing])],
166Index: gcc-4_7-branch/gcc/configure
167===================================================================
168--- gcc-4_7-branch.orig/gcc/configure 2012-06-20 00:27:18.778971725 -0700
169+++ gcc-4_7-branch/gcc/configure 2012-06-20 00:28:06.634974041 -0700
170@@ -757,10 +757,6 @@
171 REPORT_BUGS_TO
172 PKGVERSION
173 CONFIGURE_SPECS
174-CROSS_SYSTEM_HEADER_DIR
175-TARGET_SYSTEM_ROOT_DEFINE
176-TARGET_SYSTEM_ROOT
177-SYSROOT_CFLAGS_FOR_TARGET
178 enable_shared
179 enable_fixed_point
180 enable_decimal_float
181@@ -798,6 +794,10 @@
182 CFLAGS
183 CC
184 GENINSRC
185+CROSS_SYSTEM_HEADER_DIR
186+TARGET_SYSTEM_ROOT_DEFINE
187+TARGET_SYSTEM_ROOT
188+SYSROOT_CFLAGS_FOR_TARGET
189 target_subdir
190 host_subdir
191 build_subdir
192@@ -859,6 +859,9 @@
193 enable_option_checking
194 with_build_libsubdir
195 with_local_prefix
196+with_native_system_header_dir
197+with_build_sysroot
198+with_sysroot
199 with_gxx_include_dir
200 with_cpp_install_dir
201 enable_generated_files_in_srcdir
202@@ -883,9 +886,6 @@
203 enable_objc_gc
204 with_dwarf2
205 enable_shared
206-with_native_system_header_dir
207-with_build_sysroot
208-with_sysroot
209 with_specs
210 with_pkgversion
211 with_bugurl
212@@ -1639,6 +1639,12 @@
213 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
214 --with-build-libsubdir=DIR Directory where to find libraries for build system
215 --with-local-prefix=DIR specifies directory to put local include
216+ --with-native-system-header-dir=dir
217+ use dir as the directory to look for standard
218+ system header files in. Defaults to /usr/include.
219+ --with-build-sysroot=sysroot
220+ use sysroot as the system root during the build
221+ --with-sysroot[=DIR] search for usr/lib, usr/include, et al, within DIR
222 --with-gxx-include-dir=DIR
223 specifies directory to put g++ header files
224 --with-cpp-install-dir=DIR
225@@ -1651,12 +1657,6 @@
226 --with-as arrange to use the specified as (full pathname)
227 --with-stabs arrange to use stabs instead of host debug format
228 --with-dwarf2 force the default debug format to be DWARF 2
229- --with-native-system-header-dir=dir
230- use dir as the directory to look for standard
231- system header files in. Defaults to /usr/include.
232- --with-build-sysroot=sysroot
233- use sysroot as the system root during the build
234- --with-sysroot[=DIR] search for usr/lib, usr/include, et al, within DIR
235 --with-specs=SPECS add SPECS to driver command-line processing
236 --with-pkgversion=PKG Use PKG in the version string in place of "GCC"
237 --with-bugurl=URL Direct users to URL to report a bug
238@@ -3288,6 +3288,82 @@
239 local_prefix=/usr/local
240 fi
241
242+
243+# Check whether --with-native-system-header-dir was given.
244+if test "${with_native_system_header_dir+set}" = set; then :
245+ withval=$with_native_system_header_dir;
246+ case ${with_native_system_header_dir} in
247+ yes|no) as_fn_error "bad value ${withval} given for --with-native-system-header-dir" "$LINENO" 5 ;;
248+ /* | [A-Za-z]:[\\/]*) ;;
249+ *) as_fn_error "--with-native-system-header-dir argument ${withval} must be an absolute directory" "$LINENO" 5 ;;
250+ esac
251+ configured_native_system_header_dir="${withval}"
252+
253+else
254+ configured_native_system_header_dir=
255+fi
256+
257+
258+
259+# Check whether --with-build-sysroot was given.
260+if test "${with_build_sysroot+set}" = set; then :
261+ withval=$with_build_sysroot; if test x"$withval" != x ; then
262+ SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval"
263+ fi
264+else
265+ SYSROOT_CFLAGS_FOR_TARGET=
266+fi
267+
268+
269+
270+
271+# Check whether --with-sysroot was given.
272+if test "${with_sysroot+set}" = set; then :
273+ withval=$with_sysroot;
274+ case ${with_sysroot} in
275+ /) ;;
276+ */) with_sysroot=`echo $with_sysroot | sed 's,/$,,'` ;;
277+ esac
278+ case ${with_sysroot} in
279+ yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_noncanonical}/sys-root' ;;
280+ *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
281+ esac
282+
283+ TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
284+ CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)'
285+
286+ if test "x$prefix" = xNONE; then
287+ test_prefix=/usr/local
288+ else
289+ test_prefix=$prefix
290+ fi
291+ if test "x$exec_prefix" = xNONE; then
292+ test_exec_prefix=$test_prefix
293+ else
294+ test_exec_prefix=$exec_prefix
295+ fi
296+ case ${TARGET_SYSTEM_ROOT} in
297+ "${test_prefix}"|"${test_prefix}/"*|\
298+ "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
299+ '${prefix}'|'${prefix}/'*|\
300+ '${exec_prefix}'|'${exec_prefix}/'*)
301+ t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
302+ TARGET_SYSTEM_ROOT_DEFINE="$t"
303+ ;;
304+ esac
305+
306+else
307+
308+ TARGET_SYSTEM_ROOT=
309+ TARGET_SYSTEM_ROOT_DEFINE=
310+ CROSS_SYSTEM_HEADER_DIR='$(gcc_tooldir)/sys-include'
311+
312+fi
313+
314+
315+
316+
317+
318 # Don't set gcc_gxx_include_dir to gxx_include_dir since that's only
319 # passed in by the toplevel make and thus we'd get different behavior
320 # depending on where we built the sources.
321@@ -3321,7 +3397,9 @@
322 if test "${with_sysroot+set}" = set; then
323 gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
324 if test "${gcc_gxx_without_sysroot}"; then
325- gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
326+ if test x${with_sysroot} != x/; then
327+ gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
328+ fi
329 gcc_gxx_include_dir_add_sysroot=1
330 fi
331 fi
332@@ -7220,78 +7298,6 @@
333
334
335
336-# Check whether --with-native-system-header-dir was given.
337-if test "${with_native_system_header_dir+set}" = set; then :
338- withval=$with_native_system_header_dir;
339- case ${with_native_system_header_dir} in
340- yes|no) as_fn_error "bad value ${withval} given for --with-native-system-header-dir" "$LINENO" 5 ;;
341- /* | [A-Za-z]:[\\/]*) ;;
342- *) as_fn_error "--with-native-system-header-dir argument ${withval} must be an absolute directory" "$LINENO" 5 ;;
343- esac
344- configured_native_system_header_dir="${withval}"
345-
346-else
347- configured_native_system_header_dir=
348-fi
349-
350-
351-
352-# Check whether --with-build-sysroot was given.
353-if test "${with_build_sysroot+set}" = set; then :
354- withval=$with_build_sysroot; if test x"$withval" != x ; then
355- SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval"
356- fi
357-else
358- SYSROOT_CFLAGS_FOR_TARGET=
359-fi
360-
361-
362-
363-
364-# Check whether --with-sysroot was given.
365-if test "${with_sysroot+set}" = set; then :
366- withval=$with_sysroot;
367- case ${with_sysroot} in
368- yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_noncanonical}/sys-root' ;;
369- *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
370- esac
371-
372- TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
373- CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)'
374-
375- if test "x$prefix" = xNONE; then
376- test_prefix=/usr/local
377- else
378- test_prefix=$prefix
379- fi
380- if test "x$exec_prefix" = xNONE; then
381- test_exec_prefix=$test_prefix
382- else
383- test_exec_prefix=$exec_prefix
384- fi
385- case ${TARGET_SYSTEM_ROOT} in
386- "${test_prefix}"|"${test_prefix}/"*|\
387- "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
388- '${prefix}'|'${prefix}/'*|\
389- '${exec_prefix}'|'${exec_prefix}/'*)
390- t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
391- TARGET_SYSTEM_ROOT_DEFINE="$t"
392- ;;
393- esac
394-
395-else
396-
397- TARGET_SYSTEM_ROOT=
398- TARGET_SYSTEM_ROOT_DEFINE=
399- CROSS_SYSTEM_HEADER_DIR='$(gcc_tooldir)/sys-include'
400-
401-fi
402-
403-
404-
405-
406-
407-
408 # Check whether --with-specs was given.
409 if test "${with_specs+set}" = set; then :
410 withval=$with_specs; CONFIGURE_SPECS=$withval
411@@ -17973,7 +17979,7 @@
412 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
413 lt_status=$lt_dlunknown
414 cat > conftest.$ac_ext <<_LT_EOF
415-#line 17976 "configure"
416+#line 17982 "configure"
417 #include "confdefs.h"
418
419 #if HAVE_DLFCN_H
420@@ -18079,7 +18085,7 @@
421 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
422 lt_status=$lt_dlunknown
423 cat > conftest.$ac_ext <<_LT_EOF
424-#line 18082 "configure"
425+#line 18088 "configure"
426 #include "confdefs.h"
427
428 #if HAVE_DLFCN_H