diff options
| -rw-r--r-- | meta/recipes-devtools/cmake/cmake.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/cmake/cmake/0001-CMakeDetermineCompilerABI-Strip-pipe-from-compile-fl.patch | 52 |
2 files changed, 53 insertions, 0 deletions
diff --git a/meta/recipes-devtools/cmake/cmake.inc b/meta/recipes-devtools/cmake/cmake.inc index d500321138..3811aae9c4 100644 --- a/meta/recipes-devtools/cmake/cmake.inc +++ b/meta/recipes-devtools/cmake/cmake.inc | |||
| @@ -17,6 +17,7 @@ LIC_FILES_CHKSUM = "file://Copyright.txt;md5=31023e1d3f51ca90a58f55bcee8e2339 \ | |||
| 17 | CMAKE_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}" | 17 | CMAKE_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}" |
| 18 | 18 | ||
| 19 | SRC_URI = "https://cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz \ | 19 | SRC_URI = "https://cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz \ |
| 20 | file://0001-CMakeDetermineCompilerABI-Strip-pipe-from-compile-fl.patch \ | ||
| 20 | file://0003-cmake-support-OpenEmbedded-Qt4-tool-binary-names.patch \ | 21 | file://0003-cmake-support-OpenEmbedded-Qt4-tool-binary-names.patch \ |
| 21 | file://0004-Fail-silently-if-system-Qt-installation-is-broken.patch \ | 22 | file://0004-Fail-silently-if-system-Qt-installation-is-broken.patch \ |
| 22 | " | 23 | " |
diff --git a/meta/recipes-devtools/cmake/cmake/0001-CMakeDetermineCompilerABI-Strip-pipe-from-compile-fl.patch b/meta/recipes-devtools/cmake/cmake/0001-CMakeDetermineCompilerABI-Strip-pipe-from-compile-fl.patch new file mode 100644 index 0000000000..a30273458f --- /dev/null +++ b/meta/recipes-devtools/cmake/cmake/0001-CMakeDetermineCompilerABI-Strip-pipe-from-compile-fl.patch | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | From dab7ba34f87be0172f6586325656ee962de0029e Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Philip Lorenz <philip.lorenz@bmw.de> | ||
| 3 | Date: Mon, 3 Jun 2024 13:19:24 +0200 | ||
| 4 | Subject: [PATCH] CMakeDetermineCompilerABI: Strip -pipe from compile flags | ||
| 5 | |||
| 6 | When `-pipe` is enabled, GCC passes data between its different | ||
| 7 | executables using pipes instead of temporary files. This leads to issues | ||
| 8 | when cmake attempts to infer compiler internals via the `-v` parameter | ||
| 9 | as each executable will print to `stderr` in parallel. | ||
| 10 | |||
| 11 | For example we have observed the following outputs in our builds which | ||
| 12 | sporadically lead to build failures as system include directories were | ||
| 13 | not detected reliably: | ||
| 14 | |||
| 15 | Parsed CXX implicit include dir info from above output: rv=done | ||
| 16 | found start of include info | ||
| 17 | found start of implicit include info | ||
| 18 | add: [.../usr/bin/x86_64-poky-linux/../../lib/x86_64-poky-linux/gcc/x86_64-poky-linux/11.4.0/include] | ||
| 19 | add: [.../usr/bin/x86_64-poky-linux/../../lib/x86_64-poky-linux/gcc/x86_64-poky-linux/11.4.0/include-fixed] | ||
| 20 | add: [.../usr/include/c++/11.4.0] | ||
| 21 | add: [.../usr/include/c++/11.4.0/x86_64-poky-linux] | ||
| 22 | add: [.../usr/include/c++/11.4.0/backward] | ||
| 23 | add: [.../usr/lib/x86_64-poky-linux/11.4.0/include] | ||
| 24 | add: [...GNU assembler version 2.38 (x86_64-poky-linux) using BFD version (GNU Binutils) 2.38.20220708] | ||
| 25 | add: [/usr/include] | ||
| 26 | end of search list found | ||
| 27 | |||
| 28 | Fix this issue by stripping the `-pipe` parameter from the compilation | ||
| 29 | flag when determining the toolchain configuration. | ||
| 30 | |||
| 31 | Upstream-Status: Backport [3.32.0, 71be059f3f32b6791427893a48ba4815a19e2e78] | ||
| 32 | Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de> | ||
| 33 | --- | ||
| 34 | Modules/CMakeDetermineCompilerABI.cmake | 5 +++++ | ||
| 35 | 1 file changed, 5 insertions(+) | ||
| 36 | |||
| 37 | diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake | ||
| 38 | index 8191d819bf..ae4c9ee44e 100644 | ||
| 39 | --- a/Modules/CMakeDetermineCompilerABI.cmake | ||
| 40 | +++ b/Modules/CMakeDetermineCompilerABI.cmake | ||
| 41 | @@ -35,6 +35,11 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) | ||
| 42 | |||
| 43 | # Avoid failing ABI detection on warnings. | ||
| 44 | string(REGEX REPLACE "(^| )-Werror([= ][^ ]*)?( |$)" " " CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}") | ||
| 45 | + # Avoid passing of "-pipe" when determining the compiler internals. With | ||
| 46 | + # "-pipe" GCC will use pipes to pass data between the involved | ||
| 47 | + # executables. This may lead to issues when their stderr output (which | ||
| 48 | + # contains the relevant compiler internals) becomes interweaved. | ||
| 49 | + string(REGEX REPLACE "(^| )-pipe( |$)" " " CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}") | ||
| 50 | |||
| 51 | # Save the current LC_ALL, LC_MESSAGES, and LANG environment variables | ||
| 52 | # and set them to "C" that way GCC's "search starts here" text is in | ||
