Closes:
https://bugs.gentoo.org/951975
Signed-off-by: Michał Górny <
mgorny@gentoo.org>
---
eclass/llvm-utils.eclass | 5 ++---
eclass/tests/llvm-utils.sh | 21 +++++++++++++++++++++
2 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/eclass/llvm-utils.eclass b/eclass/llvm-utils.eclass
index abe8bb7d7d0f..98fc81408415 100644
--- a/eclass/llvm-utils.eclass
+++ b/eclass/llvm-utils.eclass
@@ -126,10 +126,9 @@ llvm_fix_tool_path() {
llvm_prepend_path() {
debug-print-function ${FUNCNAME} "$@"
- local prefix
- case ${1--d} in
+ local prefix=${ESYSROOT}
+ case ${1} in
-d)
- prefix=${ESYSROOT}
shift
;;
-b)
diff --git a/eclass/tests/llvm-utils.sh b/eclass/tests/llvm-utils.sh
index 4ba767a442f2..a3219d23b491 100755
--- a/eclass/tests/llvm-utils.sh
+++ b/eclass/tests/llvm-utils.sh
@@ -104,6 +104,8 @@ test_fix_tool_path AR ar 1
test_fix_tool_path AR ar 0
ESYSROOT=
+einfo "Testing with ESYSROOT=${ESYSROOT}"
+eindent
test_prepend_path 17 /usr/bin /usr/bin:/usr/lib/llvm/17/bin
test_prepend_path 17 /usr/lib/llvm/17/bin:/usr/bin /usr/lib/l