Skip to content

Commit ef7cfd0

Browse files
committed
kbuild: fix false positive warning/error about missing libelf
For the same reason as commit 25896d0 ("x86/build: Fix compiler support check for CONFIG_RETPOLINE"), you cannot put this $(error ...) into the parse stage of the top Makefile. Perhaps I'd propose a more sophisticated solution later, but this is the best I can do for now. Link: https://lkml.org/lkml/2017/12/25/211 Reported-by: Paul Gortmaker <paul.gortmaker@windriver.com> Reported-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reported-by: Qian Cai <cai@lca.pw> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Tested-by: Qian Cai <cai@lca.pw>
1 parent ccda4af commit ef7cfd0

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -962,11 +962,6 @@ ifdef CONFIG_STACK_VALIDATION
962962
ifeq ($(has_libelf),1)
963963
objtool_target := tools/objtool FORCE
964964
else
965-
ifdef CONFIG_UNWINDER_ORC
966-
$(error "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
967-
else
968-
$(warning "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
969-
endif
970965
SKIP_STACK_VALIDATION := 1
971966
export SKIP_STACK_VALIDATION
972967
endif
@@ -1125,6 +1120,14 @@ uapi-asm-generic:
11251120

11261121
PHONY += prepare-objtool
11271122
prepare-objtool: $(objtool_target)
1123+
ifeq ($(SKIP_STACK_VALIDATION),1)
1124+
ifdef CONFIG_UNWINDER_ORC
1125+
@echo "error: Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2
1126+
@false
1127+
else
1128+
@echo "warning: Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2
1129+
endif
1130+
endif
11281131

11291132
# Generate some files
11301133
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)