diff --git a/sdk_container/src/third_party/portage-stable/eclass/llvm-utils.eclass b/sdk_container/src/third_party/portage-stable/eclass/llvm-utils.eclass index b105e169fb..abe8bb7d7d 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/llvm-utils.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/llvm-utils.eclass @@ -1,4 +1,4 @@ -# Copyright 2024 Gentoo Authors +# Copyright 2024-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: llvm-utils.eclass @@ -171,4 +171,19 @@ llvm_prepend_path() { export PATH=${new_path[*]} } +# @FUNCTION: llvm_cmake_use_musl +# @DESCRIPTION: +# Determine whether the given LLVM project should be built with musl +# support. That should be the case if the CTARGET (or CHOST) is a musl +# environment. +# +# If musl should be used, echo "ON", otherwise echo "OFF". +llvm_cmake_use_musl() { + if [[ "${CTARGET:-${CHOST}}" == *-*-*-musl* ]]; then + echo "ON" + else + echo "OFF" + fi +} + fi