|
@@ -0,0 +1,52 @@
|
|
|
+From bd94bbdc35a9da4c73d538e0cc55bc95944f620d Mon Sep 17 00:00:00 2001
|
|
|
+From: Philip Lorenz <philip.lorenz@bmw.de>
|
|
|
+Date: Mon, 3 Jun 2024 13:19:24 +0200
|
|
|
+Subject: [PATCH] CMakeDetermineCompilerABI: Strip -pipe from compile flags
|
|
|
+
|
|
|
+When `-pipe` is enabled, GCC passes data between its different
|
|
|
+executables using pipes instead of temporary files. This leads to issues
|
|
|
+when cmake attempts to infer compiler internals via the `-v` parameter
|
|
|
+as each executable will print to `stderr` in parallel.
|
|
|
+
|
|
|
+For example we have observed the following outputs in our builds which
|
|
|
+sporadically lead to build failures as system include directories were
|
|
|
+not detected reliably:
|
|
|
+
|
|
|
+Parsed CXX implicit include dir info from above output: rv=done
|
|
|
+ found start of include info
|
|
|
+ found start of implicit include info
|
|
|
+ add: [.../usr/bin/x86_64-poky-linux/../../lib/x86_64-poky-linux/gcc/x86_64-poky-linux/11.4.0/include]
|
|
|
+ add: [.../usr/bin/x86_64-poky-linux/../../lib/x86_64-poky-linux/gcc/x86_64-poky-linux/11.4.0/include-fixed]
|
|
|
+ add: [.../usr/include/c++/11.4.0]
|
|
|
+ add: [.../usr/include/c++/11.4.0/x86_64-poky-linux]
|
|
|
+ add: [.../usr/include/c++/11.4.0/backward]
|
|
|
+ add: [.../usr/lib/x86_64-poky-linux/11.4.0/include]
|
|
|
+ add: [...GNU assembler version 2.38 (x86_64-poky-linux) using BFD version (GNU Binutils) 2.38.20220708]
|
|
|
+ add: [/usr/include]
|
|
|
+ end of search list found
|
|
|
+
|
|
|
+Fix this issue by stripping the `-pipe` parameter from the compilation
|
|
|
+flag when determining the toolchain configuration.
|
|
|
+
|
|
|
+Upstream-Status: Backport [3.32.0, 71be059f3f32b6791427893a48ba4815a19e2e78]
|
|
|
+Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de>
|
|
|
+---
|
|
|
+ Modules/CMakeDetermineCompilerABI.cmake | 5 +++++
|
|
|
+ 1 file changed, 5 insertions(+)
|
|
|
+
|
|
|
+diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
|
|
|
+index efc18f93c2..f2e40479b1 100644
|
|
|
+--- a/Modules/CMakeDetermineCompilerABI.cmake
|
|
|
++++ b/Modules/CMakeDetermineCompilerABI.cmake
|
|
|
+@@ -43,6 +43,11 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
|
|
|
+
|
|
|
+ # Avoid failing ABI detection on warnings.
|
|
|
+ string(REGEX REPLACE "(^| )-Werror([= ][^-][^ ]*)?( |$)" " " CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}")
|
|
|
++ # Avoid passing of "-pipe" when determining the compiler internals. With
|
|
|
++ # "-pipe" GCC will use pipes to pass data between the involved
|
|
|
++ # executables. This may lead to issues when their stderr output (which
|
|
|
++ # contains the relevant compiler internals) becomes interweaved.
|
|
|
++ string(REGEX REPLACE "(^| )-pipe( |$)" " " CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}")
|
|
|
+
|
|
|
+ # Save the current LC_ALL, LC_MESSAGES, and LANG environment variables
|
|
|
+ # and set them to "C" that way GCC's "search starts here" text is in
|