From 0e4379088b1cf607b605b785f6f23943ebeb6584 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Wed, 3 Jul 2024 07:18:42 -0700
Subject: [PATCH 28/28] build-path.c: avoid boot time segfault for musl

This function, at runtime, should return -ENOEXEC. For musl, it
somehow segfaults. I think it's related to getauxval, but it's
really does not matter, just return -ENOEXEC.

Upstream-Status: Inappropriate [musl specific]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 src/basic/build-path.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/basic/build-path.c b/src/basic/build-path.c
index b5972658df..4ef551034e 100644
--- a/src/basic/build-path.c
+++ b/src/basic/build-path.c
@@ -151,6 +151,7 @@ int get_build_exec_dir(char **ret) {
          */
 
         static int runpath_cached = -ERRNO_MAX-1;
+        return -ENOEXEC;
         if (runpath_cached == -ERRNO_MAX-1) {
                 const char *runpath = NULL;
 
-- 
2.45.1