diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-9.1/0028-Fix-various-_FOR_BUILD-and-related-variables.patch')
| -rw-r--r-- | meta/recipes-devtools/gcc/gcc-9.1/0028-Fix-various-_FOR_BUILD-and-related-variables.patch | 137 |
1 files changed, 137 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-9.1/0028-Fix-various-_FOR_BUILD-and-related-variables.patch b/meta/recipes-devtools/gcc/gcc-9.1/0028-Fix-various-_FOR_BUILD-and-related-variables.patch new file mode 100644 index 0000000000..bdcbd323cb --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-9.1/0028-Fix-various-_FOR_BUILD-and-related-variables.patch | |||
| @@ -0,0 +1,137 @@ | |||
| 1 | From 16ab14b7221b3491cd43ab745f57b60ca83089df Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Mon, 7 Dec 2015 23:42:45 +0000 | ||
| 4 | Subject: [PATCH 28/37] Fix various _FOR_BUILD and related variables | ||
| 5 | |||
| 6 | When doing a FOR_BUILD thing, you have to override CFLAGS with | ||
| 7 | CFLAGS_FOR_BUILD. And if you use C++, you also have to override | ||
| 8 | CXXFLAGS with CXXFLAGS_FOR_BUILD. | ||
| 9 | Without this, when building for mingw, you end up trying to use | ||
| 10 | the mingw headers for a host build. | ||
| 11 | |||
| 12 | The same goes for other variables as well, such as CPPFLAGS, | ||
| 13 | CPP, and GMPINC. | ||
| 14 | |||
| 15 | Upstream-Status: Pending | ||
| 16 | |||
| 17 | Signed-off-by: Peter Seebach <peter.seebach@windriver.com> | ||
| 18 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
| 19 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 20 | --- | ||
| 21 | Makefile.in | 6 ++++++ | ||
| 22 | Makefile.tpl | 5 +++++ | ||
| 23 | gcc/Makefile.in | 2 +- | ||
| 24 | gcc/configure | 2 +- | ||
| 25 | gcc/configure.ac | 2 +- | ||
| 26 | 5 files changed, 14 insertions(+), 3 deletions(-) | ||
| 27 | |||
| 28 | diff --git a/Makefile.in b/Makefile.in | ||
| 29 | index b21e0791f55..0e573791202 100644 | ||
| 30 | --- a/Makefile.in | ||
| 31 | +++ b/Makefile.in | ||
| 32 | @@ -152,6 +152,7 @@ BUILD_EXPORTS = \ | ||
| 33 | CPP="$(CC_FOR_BUILD) -E"; export CPP; \ | ||
| 34 | CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ | ||
| 35 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
| 36 | + CPPFLAGS="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS; \ | ||
| 37 | CXX="$(CXX_FOR_BUILD)"; export CXX; \ | ||
| 38 | CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ | ||
| 39 | GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \ | ||
| 40 | @@ -171,6 +172,9 @@ BUILD_EXPORTS = \ | ||
| 41 | # built for the build system to override those in BASE_FLAGS_TO_PASS. | ||
| 42 | EXTRA_BUILD_FLAGS = \ | ||
| 43 | CFLAGS="$(CFLAGS_FOR_BUILD)" \ | ||
| 44 | + CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \ | ||
| 45 | + CPP="$(CC_FOR_BUILD) -E" \ | ||
| 46 | + CPPFLAGS="$(CPPFLAGS_FOR_BUILD)" \ | ||
| 47 | LDFLAGS="$(LDFLAGS_FOR_BUILD)" | ||
| 48 | |||
| 49 | # This is the list of directories to built for the host system. | ||
| 50 | @@ -188,6 +192,7 @@ HOST_SUBDIR = @host_subdir@ | ||
| 51 | HOST_EXPORTS = \ | ||
| 52 | $(BASE_EXPORTS) \ | ||
| 53 | CC="$(CC)"; export CC; \ | ||
| 54 | + CPP="$(CC) -E"; export CPP; \ | ||
| 55 | ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \ | ||
| 56 | CFLAGS="$(CFLAGS)"; export CFLAGS; \ | ||
| 57 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
| 58 | @@ -775,6 +780,7 @@ BASE_FLAGS_TO_PASS = \ | ||
| 59 | "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ | ||
| 60 | "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ | ||
| 61 | "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \ | ||
| 62 | + "CXXFLAGS_FOR_BUILD=$(CXXFLAGS_FOR_BUILD)" \ | ||
| 63 | "EXPECT=$(EXPECT)" \ | ||
| 64 | "FLEX=$(FLEX)" \ | ||
| 65 | "INSTALL=$(INSTALL)" \ | ||
| 66 | diff --git a/Makefile.tpl b/Makefile.tpl | ||
| 67 | index 126296fb49a..15fb236bcc0 100644 | ||
| 68 | --- a/Makefile.tpl | ||
| 69 | +++ b/Makefile.tpl | ||
| 70 | @@ -154,6 +154,7 @@ BUILD_EXPORTS = \ | ||
| 71 | CC="$(CC_FOR_BUILD)"; export CC; \ | ||
| 72 | CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ | ||
| 73 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
| 74 | + CPPFLAGS="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS; \ | ||
| 75 | CXX="$(CXX_FOR_BUILD)"; export CXX; \ | ||
| 76 | CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ | ||
| 77 | GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \ | ||
| 78 | @@ -173,6 +174,9 @@ BUILD_EXPORTS = \ | ||
| 79 | # built for the build system to override those in BASE_FLAGS_TO_PASS. | ||
| 80 | EXTRA_BUILD_FLAGS = \ | ||
| 81 | CFLAGS="$(CFLAGS_FOR_BUILD)" \ | ||
| 82 | + CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \ | ||
| 83 | + CPP="$(CC_FOR_BUILD) -E" \ | ||
| 84 | + CPPFLAGS="$(CPPFLAGS_FOR_BUILD)" \ | ||
| 85 | LDFLAGS="$(LDFLAGS_FOR_BUILD)" | ||
| 86 | |||
| 87 | # This is the list of directories to built for the host system. | ||
| 88 | @@ -190,6 +194,7 @@ HOST_SUBDIR = @host_subdir@ | ||
| 89 | HOST_EXPORTS = \ | ||
| 90 | $(BASE_EXPORTS) \ | ||
| 91 | CC="$(CC)"; export CC; \ | ||
| 92 | + CPP="$(CC) -E"; export CPP; \ | ||
| 93 | ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \ | ||
| 94 | CFLAGS="$(CFLAGS)"; export CFLAGS; \ | ||
| 95 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
| 96 | diff --git a/gcc/Makefile.in b/gcc/Makefile.in | ||
| 97 | index eb1dc304de2..93a43146846 100644 | ||
| 98 | --- a/gcc/Makefile.in | ||
| 99 | +++ b/gcc/Makefile.in | ||
| 100 | @@ -805,7 +805,7 @@ BUILD_LDFLAGS=@BUILD_LDFLAGS@ | ||
| 101 | BUILD_NO_PIE_FLAG = @BUILD_NO_PIE_FLAG@ | ||
| 102 | BUILD_LDFLAGS += $(BUILD_NO_PIE_FLAG) | ||
| 103 | BUILD_CPPFLAGS= -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \ | ||
| 104 | - -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(CPPFLAGS) | ||
| 105 | + -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(CPPFLAGS_FOR_BUILD) | ||
| 106 | |||
| 107 | # Actual name to use when installing a native compiler. | ||
| 108 | GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)') | ||
| 109 | diff --git a/gcc/configure b/gcc/configure | ||
| 110 | index 2e822caf66d..2c50676a2bf 100755 | ||
| 111 | --- a/gcc/configure | ||
| 112 | +++ b/gcc/configure | ||
| 113 | @@ -11965,7 +11965,7 @@ else | ||
| 114 | CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ | ||
| 115 | CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \ | ||
| 116 | LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \ | ||
| 117 | - GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \ | ||
| 118 | + GMPINC="" CPPFLAGS="${CPPFLAGS_FOR_BUILD} -DGENERATOR_FILE" \ | ||
| 119 | ${realsrcdir}/configure \ | ||
| 120 | --enable-languages=${enable_languages-all} \ | ||
| 121 | --target=$target_alias --host=$build_alias --build=$build_alias | ||
| 122 | diff --git a/gcc/configure.ac b/gcc/configure.ac | ||
| 123 | index 70e7bac78c4..d29eb580429 100644 | ||
| 124 | --- a/gcc/configure.ac | ||
| 125 | +++ b/gcc/configure.ac | ||
| 126 | @@ -1743,7 +1743,7 @@ else | ||
| 127 | CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ | ||
| 128 | CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \ | ||
| 129 | LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \ | ||
| 130 | - GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \ | ||
| 131 | + GMPINC="" CPPFLAGS="${CPPFLAGS_FOR_BUILD} -DGENERATOR_FILE" \ | ||
| 132 | ${realsrcdir}/configure \ | ||
| 133 | --enable-languages=${enable_languages-all} \ | ||
| 134 | --target=$target_alias --host=$build_alias --build=$build_alias | ||
| 135 | -- | ||
| 136 | 2.20.1 | ||
| 137 | |||
