summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2013-06-24 09:44:30 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-25 17:44:58 +0100
commit216e4dc4aa3bf49afa70b793ecc8a683783c0675 (patch)
treeb257383f882227a0b1aa4dc013da40b23d850387 /meta/recipes-devtools/gcc
parent65385d4bb92c8938a48281462448d1efc6123920 (diff)
downloadpoky-216e4dc4aa3bf49afa70b793ecc8a683783c0675.tar.gz
gcc: When cross compiling a target gcc, target flags may be used on the host
The original fix worked some of the time, but not on all machines. Fix this by applying the change in a different way. Following the example of the existing BUILD_CFLAGS. Below is the commit message from the original change to help explain why this is needed: Configure identifies a number of warning flags (WARN_CFLAGS and WARN_CXXFLAGS) from the $CC value. The cross compiler may be different from the host compiler and may not support the same set of flags. This leads to problems such as: cc1plus: error: unrecognized command line option "-Wno-narrowing" cc1plus: error: unrecognized command line option "-Wno-overlength-strings" Work around this problem by removing the warning flags from the BUILD_CXXFLAGS value, in a way similar to the BUILD_CFLAGS. (From OE-Core rev: be21c6e8e4f810e826538337dac6e34ed96e1f6f) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.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.8/gcc-4.8-build-args.patch58
1 files changed, 24 insertions, 34 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/gcc-4.8-build-args.patch b/meta/recipes-devtools/gcc/gcc-4.8/gcc-4.8-build-args.patch
index 95f39bb23d..c27e009619 100644
--- a/meta/recipes-devtools/gcc/gcc-4.8/gcc-4.8-build-args.patch
+++ b/meta/recipes-devtools/gcc/gcc-4.8/gcc-4.8-build-args.patch
@@ -1,6 +1,6 @@
1When cross compiling a target gcc, target flags may be used on the host 1When cross compiling a target gcc, target flags may be used on the host
2 2
3Configure identifies a number of warning flags (WARN_CFLAGS and 3Configure identifies a number of warning flags (WARN_CFLAGS and
4WARN_CXXFLAGS) from the $CC value. The cross compiler may be different 4WARN_CXXFLAGS) from the $CC value. The cross compiler may be different
5from the host compiler and may not support the same set of flags. This 5from the host compiler and may not support the same set of flags. This
6leads to problems such as: 6leads to problems such as:
@@ -9,43 +9,33 @@ cc1plus: error: unrecognized command line option "-Wno-narrowing"
9cc1plus: error: unrecognized command line option "-Wno-overlength-strings" 9cc1plus: error: unrecognized command line option "-Wno-overlength-strings"
10 10
11Work around this problem by removing the warning flags from the 11Work around this problem by removing the warning flags from the
12BUILD_*FLAGS values. 12BUILD_CXXFLAGS value, in a way similar to the BUILD_CFLAGS.
13 13
14Upstream-Status: Pending 14Upstream-Status: Pending
15 15
16Signed-off-by: Mark Hatle <mark.hatle@windriver.com> 16Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
17 17
18diff -ur gcc-4.8.0.orig/gcc/configure.ac gcc-4.8.0/gcc/configure.ac 18Index: gcc-4.8.0/gcc/configure
19--- gcc-4.8.0.orig/gcc/configure.ac 2013-05-29 14:44:24.960853593 -0500 19===================================================================
20+++ gcc-4.8.0/gcc/configure.ac 2013-05-31 01:34:09.518775962 -0500 20--- gcc-4.8.0.orig/gcc/configure
21@@ -1892,8 +1892,8 @@ 21+++ gcc-4.8.0/gcc/configure
22 # These are the normal (build=host) settings: 22@@ -11720,6 +10581,7 @@ STMP_FIXINC=stmp-fixinc
23 CC_FOR_BUILD='$(CC)' AC_SUBST(CC_FOR_BUILD) 23 if test x$build != x$host || test "x$coverage_flags" != x
24 CXX_FOR_BUILD='$(CXX)' AC_SUBST(CXX_FOR_BUILD) 24 then
25-BUILD_CFLAGS='$(ALL_CFLAGS)' AC_SUBST(BUILD_CFLAGS) 25 BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
26-BUILD_CXXFLAGS='$(ALL_CXXFLAGS)' AC_SUBST(BUILD_CXXFLAGS) 26+ BUILD_CXXFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
27+BUILD_CFLAGS='$(ALL_BUILD_CFLAGS)' AC_SUBST(BUILD_CFLAGS) 27 BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)'
28+BUILD_CXXFLAGS='$(ALL_BUILD_CXXFLAGS)' AC_SUBST(BUILD_CXXFLAGS) 28 fi
29 BUILD_LDFLAGS='$(LDFLAGS)' AC_SUBST(BUILD_LDFLAGS)
30 STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_FIXINC)
31 29
32diff -ur gcc-4.8.0.orig/gcc/Makefile.in gcc-4.8.0/gcc/Makefile.in 30Index: gcc-4.8.0/gcc/configure.ac
33--- gcc-4.8.0.orig/gcc/Makefile.in 2013-05-29 14:44:24.369853593 -0500 31===================================================================
34+++ gcc-4.8.0/gcc/Makefile.in 2013-05-31 01:34:30.360776427 -0500 32--- gcc-4.8.0.orig/gcc/configure.ac
35@@ -989,10 +989,16 @@ 33+++ gcc-4.8.0/gcc/configure.ac
36 ALL_CFLAGS = $(T_CFLAGS) $(CFLAGS-$@) \ 34@@ -1901,6 +1901,7 @@ STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_F
37 $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@ 35 if test x$build != x$host || test "x$coverage_flags" != x
36 then
37 BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
38+ BUILD_CXXFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
39 BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)'
40 fi
38 41
39+ALL_BUILD_CFLAGS = $(T_CFLAGS) $(CFLAGS-$@) \
40+ $(CFLAGS) $(INTERNAL_CFLAGS) @DEFS@
41+
42 # The C++ version.
43 ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) $(INTERNAL_CFLAGS) \
44 $(COVERAGE_FLAGS) $(NOEXCEPTION_FLAGS) $(WARN_CXXFLAGS) @DEFS@
45
46+ALL_BUILD_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) $(INTERNAL_CFLAGS) \
47+ $(NOEXCEPTION_FLAGS) @DEFS@
48+
49 # Likewise. Put INCLUDES at the beginning: this way, if some autoconf macro
50 # puts -I options in CPPFLAGS, our include files in the srcdir will always
51 # win against random include files in /usr/include.