Brad Bishop | c68388fc | 2019-08-26 01:33:31 -0400 | [diff] [blame] | 1 | From 987338cd847a723de533bb317e452a60b1e52165 Mon Sep 17 00:00:00 2001 |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Fri, 20 Feb 2015 09:40:59 +0000 |
Brad Bishop | c68388fc | 2019-08-26 01:33:31 -0400 | [diff] [blame] | 4 | Subject: [PATCH 18/36] export CPP |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 5 | |
| 6 | The OE environment sets and exports CPP as being the target gcc. When |
| 7 | building gcc-cross-canadian for a mingw targetted sdk, the following can be found |
| 8 | in build.x86_64-pokysdk-mingw32.i586-poky-linux/build-x86_64-linux/libiberty/config.log: |
| 9 | |
| 10 | configure:3641: checking for _FILE_OFFSET_BITS value needed for large files |
| 11 | configure:3666: gcc -c -isystem/media/build1/poky/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe conftest.c >&5 |
| 12 | configure:3666: $? = 0 |
| 13 | configure:3698: result: no |
| 14 | configure:3786: checking how to run the C preprocessor |
| 15 | configure:3856: result: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32 |
| 16 | configure:3876: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32 conftest.c |
| 17 | configure:3876: $? = 0 |
| 18 | |
| 19 | Note this is a *build* target (in build-x86_64-linux) so it should be |
| 20 | using the host "gcc", not x86_64-pokysdk-mingw32-gcc. Since the mingw32 |
| 21 | headers are very different, using the wrong cpp is a real problem. It is leaking |
| 22 | into configure through the CPP variable. Ultimately this leads to build |
| 23 | failures related to not being able to include a process.h file for pem-unix.c. |
| 24 | |
| 25 | The fix is to ensure we export a sane CPP value into the build |
| 26 | environment when using build targets. We could define a CPP_FOR_BUILD value which may be |
| 27 | the version which needs to be upstreamed but for now, this fix is good enough to |
| 28 | avoid the problem. |
| 29 | |
| 30 | RP 22/08/2013 |
| 31 | |
| 32 | Upstream-Status: Pending |
| 33 | |
| 34 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 35 | --- |
| 36 | Makefile.in | 1 + |
| 37 | 1 file changed, 1 insertion(+) |
| 38 | |
| 39 | diff --git a/Makefile.in b/Makefile.in |
Brad Bishop | c68388fc | 2019-08-26 01:33:31 -0400 | [diff] [blame] | 40 | index 64e091ba71d..255822e3f27 100644 |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 41 | --- a/Makefile.in |
| 42 | +++ b/Makefile.in |
| 43 | @@ -149,6 +149,7 @@ BUILD_EXPORTS = \ |
| 44 | AR="$(AR_FOR_BUILD)"; export AR; \ |
| 45 | AS="$(AS_FOR_BUILD)"; export AS; \ |
| 46 | CC="$(CC_FOR_BUILD)"; export CC; \ |
| 47 | + CPP="$(CC_FOR_BUILD) -E"; export CPP; \ |
| 48 | CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ |
| 49 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ |
| 50 | CXX="$(CXX_FOR_BUILD)"; export CXX; \ |
| 51 | -- |
Brad Bishop | c68388fc | 2019-08-26 01:33:31 -0400 | [diff] [blame] | 52 | 2.22.1 |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 53 | |