diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2015-10-19 10:29:49 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-10-21 22:56:04 +0100 |
commit | 41cbfd7af60f93a4bd496b7b6bf477215a286950 (patch) | |
tree | 9038f2c5ed037ee5fc033539728d3773328fccf0 /meta/recipes-devtools | |
parent | a27da70b3a58e5232b683f055d425cde99499f7e (diff) | |
download | poky-41cbfd7af60f93a4bd496b7b6bf477215a286950.tar.gz |
gcc-5.2: Fix various _FOR_BUILD and related variables
When doing a FOR_BUILD thing, you have to override CFLAGS with
CFLAGS_FOR_BUILD. And if you use C++, you also have to override
CXXFLAGS with CXXFLAGS_FOR_BUILD.
Without this, when building for mingw, you end up trying to use
the mingw headers for a host build.
The same goes for other variables as well, such as CPPFLAGS,
CPP, and GMPINC.
(From OE-Core rev: 85ca40c42950315f2783b98f57df16b261d2826e)
Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-5.2.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-5.2/0042-cxxflags-for-build.patch | 123 |
2 files changed, 124 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-5.2.inc b/meta/recipes-devtools/gcc/gcc-5.2.inc index f6673e6a35..a6b385ac65 100644 --- a/meta/recipes-devtools/gcc/gcc-5.2.inc +++ b/meta/recipes-devtools/gcc/gcc-5.2.inc | |||
@@ -73,6 +73,7 @@ SRC_URI = "\ | |||
73 | file://0039-libcc1-fix-libcc1-s-install-path-and-rpath.patch \ | 73 | file://0039-libcc1-fix-libcc1-s-install-path-and-rpath.patch \ |
74 | file://0040-nativesdk-gcc-support.patch \ | 74 | file://0040-nativesdk-gcc-support.patch \ |
75 | file://0041-handle-target-sysroot-multilib.patch \ | 75 | file://0041-handle-target-sysroot-multilib.patch \ |
76 | file://0042-cxxflags-for-build.patch \ | ||
76 | " | 77 | " |
77 | 78 | ||
78 | BACKPORTS = "" | 79 | BACKPORTS = "" |
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0042-cxxflags-for-build.patch b/meta/recipes-devtools/gcc/gcc-5.2/0042-cxxflags-for-build.patch new file mode 100644 index 0000000000..1105e29f68 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-5.2/0042-cxxflags-for-build.patch | |||
@@ -0,0 +1,123 @@ | |||
1 | Fix various _FOR_BUILD and related variables | ||
2 | |||
3 | When doing a FOR_BUILD thing, you have to override CFLAGS with | ||
4 | CFLAGS_FOR_BUILD. And if you use C++, you also have to override | ||
5 | CXXFLAGS with CXXFLAGS_FOR_BUILD. | ||
6 | Without this, when building for mingw, you end up trying to use | ||
7 | the mingw headers for a host build. | ||
8 | |||
9 | The same goes for other variables as well, such as CPPFLAGS, | ||
10 | CPP, and GMPINC. | ||
11 | |||
12 | Upstream-Status: Pending | ||
13 | |||
14 | Signed-off-by: Peter Seebach <peter.seebach@windriver.com> | ||
15 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
16 | |||
17 | diff --git a/Makefile.in b/Makefile.in | ||
18 | index 9370174..011c29a 100644 | ||
19 | --- a/Makefile.in | ||
20 | +++ b/Makefile.in | ||
21 | @@ -152,6 +152,7 @@ BUILD_EXPORTS = \ | ||
22 | CPP="$(CC_FOR_BUILD) -E"; export CPP; \ | ||
23 | CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ | ||
24 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
25 | + CPPFLAGS="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS; \ | ||
26 | CXX="$(CXX_FOR_BUILD)"; export CXX; \ | ||
27 | CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ | ||
28 | GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \ | ||
29 | @@ -170,6 +171,9 @@ BUILD_EXPORTS = \ | ||
30 | # built for the build system to override those in BASE_FLAGS_TO_PASS. | ||
31 | EXTRA_BUILD_FLAGS = \ | ||
32 | CFLAGS="$(CFLAGS_FOR_BUILD)" \ | ||
33 | + CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \ | ||
34 | + CPP="$(CC_FOR_BUILD) -E" \ | ||
35 | + CPPFLAGS="$(CPPFLAGS_FOR_BUILD)" \ | ||
36 | LDFLAGS="$(LDFLAGS_FOR_BUILD)" | ||
37 | |||
38 | # This is the list of directories to built for the host system. | ||
39 | @@ -187,6 +191,7 @@ HOST_SUBDIR = @host_subdir@ | ||
40 | HOST_EXPORTS = \ | ||
41 | $(BASE_EXPORTS) \ | ||
42 | CC="$(CC)"; export CC; \ | ||
43 | + CPP="$(CC) -E"; export CPP; \ | ||
44 | ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \ | ||
45 | CFLAGS="$(CFLAGS)"; export CFLAGS; \ | ||
46 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
47 | @@ -711,6 +715,7 @@ BASE_FLAGS_TO_PASS = \ | ||
48 | "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ | ||
49 | "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ | ||
50 | "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \ | ||
51 | + "CXXFLAGS_FOR_BUILD=$(CXXFLAGS_FOR_BUILD)" \ | ||
52 | "EXPECT=$(EXPECT)" \ | ||
53 | "FLEX=$(FLEX)" \ | ||
54 | "INSTALL=$(INSTALL)" \ | ||
55 | diff --git a/Makefile.tpl b/Makefile.tpl | ||
56 | index 1ea1954..78a59c3 100644 | ||
57 | --- a/Makefile.tpl | ||
58 | +++ b/Makefile.tpl | ||
59 | @@ -154,6 +154,7 @@ BUILD_EXPORTS = \ | ||
60 | CC="$(CC_FOR_BUILD)"; export CC; \ | ||
61 | CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ | ||
62 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
63 | + CPPFLAGS="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS; \ | ||
64 | CXX="$(CXX_FOR_BUILD)"; export CXX; \ | ||
65 | CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ | ||
66 | GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \ | ||
67 | @@ -172,6 +173,9 @@ BUILD_EXPORTS = \ | ||
68 | # built for the build system to override those in BASE_FLAGS_TO_PASS. | ||
69 | EXTRA_BUILD_FLAGS = \ | ||
70 | CFLAGS="$(CFLAGS_FOR_BUILD)" \ | ||
71 | + CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \ | ||
72 | + CPP="$(CC_FOR_BUILD) -E" \ | ||
73 | + CPPFLAGS="$(CPPFLAGS_FOR_BUILD)" \ | ||
74 | LDFLAGS="$(LDFLAGS_FOR_BUILD)" | ||
75 | |||
76 | # This is the list of directories to built for the host system. | ||
77 | @@ -189,6 +193,7 @@ HOST_SUBDIR = @host_subdir@ | ||
78 | HOST_EXPORTS = \ | ||
79 | $(BASE_EXPORTS) \ | ||
80 | CC="$(CC)"; export CC; \ | ||
81 | + CPP="$(CC) -E"; export CPP; \ | ||
82 | ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \ | ||
83 | CFLAGS="$(CFLAGS)"; export CFLAGS; \ | ||
84 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
85 | diff --git a/gcc/Makefile.in b/gcc/Makefile.in | ||
86 | index cd5bc4a..98ae4f4 100644 | ||
87 | --- a/gcc/Makefile.in | ||
88 | +++ b/gcc/Makefile.in | ||
89 | @@ -762,7 +762,7 @@ BUILD_LINKERFLAGS = $(BUILD_CXXFLAGS) | ||
90 | # Native linker and preprocessor flags. For x-fragment overrides. | ||
91 | BUILD_LDFLAGS=@BUILD_LDFLAGS@ | ||
92 | BUILD_CPPFLAGS= -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \ | ||
93 | - -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(CPPFLAGS) | ||
94 | + -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(CPPFLAGS_FOR_BUILD) | ||
95 | |||
96 | # Actual name to use when installing a native compiler. | ||
97 | GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)') | ||
98 | diff --git a/gcc/configure b/gcc/configure | ||
99 | index c7ac14b..5ac63e4 100755 | ||
100 | --- a/gcc/configure | ||
101 | +++ b/gcc/configure | ||
102 | @@ -11521,7 +11521,7 @@ else | ||
103 | CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ | ||
104 | CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \ | ||
105 | LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \ | ||
106 | - GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \ | ||
107 | + GMPINC="" CPPFLAGS="${CPPFLAGS_FOR_BUILD} -DGENERATOR_FILE" \ | ||
108 | ${realsrcdir}/configure \ | ||
109 | --enable-languages=${enable_languages-all} \ | ||
110 | --target=$target_alias --host=$build_alias --build=$build_alias | ||
111 | diff --git a/gcc/configure.ac b/gcc/configure.ac | ||
112 | index 50856e6..17a4dfd 100644 | ||
113 | --- a/gcc/configure.ac | ||
114 | +++ b/gcc/configure.ac | ||
115 | @@ -1633,7 +1633,7 @@ else | ||
116 | CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ | ||
117 | CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \ | ||
118 | LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \ | ||
119 | - GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \ | ||
120 | + GMPINC="" CPPFLAGS="${CPPFLAGS_FOR_BUILD} -DGENERATOR_FILE" \ | ||
121 | ${realsrcdir}/configure \ | ||
122 | --enable-languages=${enable_languages-all} \ | ||
123 | --target=$target_alias --host=$build_alias --build=$build_alias | ||