0001-Disable-c-standard-compiler-flags-for-the-host-build.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From e69e69519661954716d59bfa5bbd0626515cfda9 Mon Sep 17 00:00:00 2001
  2. From: Peter Seiderer <ps.report@gmx.net>
  3. Date: Thu, 3 Mar 2016 15:17:31 +0100
  4. Subject: [PATCH] Disable c++ standard compiler flags for the host build
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. There is no test for c++ standard support for the host build
  9. (only for the target compiler/build) which leads to trouble
  10. in some cross compiling environments (old host compiler, new
  11. cross compiler):
  12. g++: error: unrecognized command line option ‘-std=c++1z’
  13. So disable c++ standard compiler flags unconditionally for host builds.
  14. Task-number: QTBUG-51644
  15. Change-Id: Ifb3042e125fe199a7e081740d1171d26ccacf0c5
  16. Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
  17. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
  18. ---
  19. mkspecs/features/default_post.prf | 5 ++++-
  20. 1 file changed, 4 insertions(+), 1 deletion(-)
  21. diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf
  22. index cd8d885..561c8f4 100644
  23. --- a/mkspecs/features/default_post.prf
  24. +++ b/mkspecs/features/default_post.prf
  25. @@ -95,7 +95,10 @@ breakpad {
  26. !isEmpty(QMAKE_STRIP):QMAKE_POST_LINK = $$QMAKE_POST_LINK$$escape_expand(\\n\\t)$$quote($$QMAKE_STRIP $$DEBUGFILENAME)
  27. }
  28. -c++11|c++14|c++1z {
  29. +# Disable special compiler flags for host builds (needs to be changed for 5.7
  30. +# to fall back to c++11 because since 5.7 c++11 is required everywhere,
  31. +# including host builds).
  32. +if(!host_build|!cross_compile):if(c++11|c++14|c++1z) {
  33. c++1z: cxxstd = CXX1Z
  34. else: c++14: cxxstd = CXX14
  35. else: cxxstd = CXX11
  36. --
  37. 2.1.4