0012-export-CPP.patch 2.2 KB

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