diff mbox series

[3/5] classes/cmake: CMAKE_RANLIB needs to be a filename without arguments

Message ID 20250924120745.2883969-3-ross.burton@arm.com
State Accepted, archived
Commit 598fa6761488bffb09ba0cbe115b562fb95df959
Headers show
Series [1/5] lame: don't use -march=native when building with clang | expand

Commit Message

Ross Burton Sept. 24, 2025, 12:07 p.m. UTC
CMAKE_RANLIB is the path to the binary without any arguments. However,
gcc-native.bbclass sets BUILD_RANLIB to "ranlib -D" which means that
CMake looks for a binary called "ranlib;-D".

This is expected behaviour upstream[1] and as there's no variable for
"ranlib flags", we should just set CMAKE_RANLIB to the first element of
the list.

[1] https://gitlab.kitware.com/cmake/cmake/-/issues/23554

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/classes-recipe/cmake.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/cmake.bbclass b/meta/classes-recipe/cmake.bbclass
index 1488d744d40..0dc8ea143b2 100644
--- a/meta/classes-recipe/cmake.bbclass
+++ b/meta/classes-recipe/cmake.bbclass
@@ -56,7 +56,7 @@  OECMAKE_NATIVE_C_COMPILER_LAUNCHER ?= "${@oecmake_map_compiler('BUILD_CC', d)[1]
 OECMAKE_NATIVE_CXX_COMPILER ?= "${@oecmake_map_compiler('BUILD_CXX', d)[0]}"
 OECMAKE_NATIVE_CXX_COMPILER_LAUNCHER ?= "${@oecmake_map_compiler('BUILD_CXX', d)[1]}"
 OECMAKE_NATIVE_AR ?= "${BUILD_AR}"
-OECMAKE_NATIVE_RANLIB ?= "${BUILD_RANLIB}"
+OECMAKE_NATIVE_RANLIB ?= "${@d.getVar('BUILD_RANLIB').split()[0]}"
 OECMAKE_NATIVE_NM ?= "${BUILD_NM}"
 
 # Native compiler flags