When libelf headers and libs are not found and CONFIG_UNWINDER_ORC is
selected, there is a make error introduced by
commit 3dd40cb320fe ("objtool: Upgrade libelf-devel warning to error for

Host headers and libs may be in a non-standard location and the check is
performed without host flags. Make sure to use host flags for the check
(they will be used later when building objtool anyway).

Fixes: 3b27a0c85d70 ("objtool: Detect and warn if libelf is missing and don't 
break the build")
Signed-off-by: Robin Jarry <robin.ja...@6wind.com>
Cc: Josh Poimboeuf <jpoim...@redhat.com>
Cc: Ingo Molnar <mi...@kernel.org>
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index e9609319d2b8..4e8c667b9f3f 100644
--- a/Makefile
+++ b/Makefile
@@ -955,7 +955,7 @@ export mod_sign_cmd
   has_libelf := $(call try-run,\
-               echo "int main() {}" | $(HOSTCC) -xc -o /dev/null -lelf -,1,0)
+               echo "int main() {}" | $(HOSTCC) $(host_clfags) $(HOSTLDFLAGS) 
-xc -o /dev/null -lelf -,1,0)
   ifeq ($(has_libelf),1)
     objtool_target := tools/objtool FORCE

Reply via email to