From 8f6331e169aeefe624bacb88da7b578bfe61ab04 Mon Sep 17 00:00:00 2001 From: Flatcar Buildbot Date: Mon, 17 Mar 2025 07:08:32 +0000 Subject: [PATCH] eclass/llvm-utils: Sync with Gentoo It's from Gentoo commit b465171bf81e25c18bc6443185215e6f80838766. --- .../portage-stable/eclass/llvm-utils.eclass | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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