diff options
author | Juro Bystricky <juro.bystricky@intel.com> | 2015-11-07 09:46:42 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-11-25 08:08:09 +0000 |
commit | d8adfd28f71136e67fffbf79c32384a81ef29676 (patch) | |
tree | 8b38a4b6002801b146f44c319351fe492e93c1e2 /meta/recipes-devtools | |
parent | 8ae27fa07be08b2c841d8e9a29ea1c909136f170 (diff) | |
download | poky-d8adfd28f71136e67fffbf79c32384a81ef29676.tar.gz |
gcc-4.9: Fix various _FOR_BUILD and related variables
This patch is based on the patch for gcc-5.2 (41cbfd7af60f93a4bd496b7b6bf477215a286950)
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: e6dc4b2ac0cc6417c0e0ddcdcbe3f334581af8fc)
Signed-off-by: Juro Bystricky <juro.bystricky@intel.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-4.9.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.9/0066-cxxflags-for-build.patch | 123 |
2 files changed, 124 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc b/meta/recipes-devtools/gcc/gcc-4.9.inc index 95b553cb87..6ac368558b 100644 --- a/meta/recipes-devtools/gcc/gcc-4.9.inc +++ b/meta/recipes-devtools/gcc/gcc-4.9.inc | |||
@@ -81,6 +81,7 @@ SRC_URI = "\ | |||
81 | file://0063-nativesdk-gcc-support.patch \ | 81 | file://0063-nativesdk-gcc-support.patch \ |
82 | file://0064-handle-target-sysroot-multilib.patch \ | 82 | file://0064-handle-target-sysroot-multilib.patch \ |
83 | file://0065-gcc-483-universal-initializer-no-warning.patch \ | 83 | file://0065-gcc-483-universal-initializer-no-warning.patch \ |
84 | file://0066-cxxflags-for-build.patch \ | ||
84 | " | 85 | " |
85 | SRC_URI[md5sum] = "6f831b4d251872736e8e9cc09746f327" | 86 | SRC_URI[md5sum] = "6f831b4d251872736e8e9cc09746f327" |
86 | SRC_URI[sha256sum] = "2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e" | 87 | SRC_URI[sha256sum] = "2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e" |
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0066-cxxflags-for-build.patch b/meta/recipes-devtools/gcc/gcc-4.9/0066-cxxflags-for-build.patch new file mode 100644 index 0000000000..1105e29f68 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.9/0066-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 | ||