Skip to content

Commit

Permalink
kbuild: fix false positive warning/error about missing libelf
Browse files Browse the repository at this point in the history
[ Upstream commit ef7cfd00b2caf6edeb7f169682b64be2d0a798cf ]

For the same reason as commit 25896d073d8a ("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 <[email protected]>
Reported-by: Bernd Edlinger <[email protected]>
Reported-by: Qian Cai <[email protected]>
Cc: Josh Poimboeuf <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
Tested-by: Qian Cai <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
masahir0y authored and gregkh committed Jan 13, 2019
1 parent ff01471 commit ae206a1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -954,11 +954,6 @@ ifdef CONFIG_STACK_VALIDATION
ifeq ($(has_libelf),1)
objtool_target := tools/objtool FORCE
else
ifdef CONFIG_UNWINDER_ORC
$(error "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
else
$(warning "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
endif
SKIP_STACK_VALIDATION := 1
export SKIP_STACK_VALIDATION
endif
Expand Down Expand Up @@ -1115,6 +1110,14 @@ uapi-asm-generic:

PHONY += prepare-objtool
prepare-objtool: $(objtool_target)
ifeq ($(SKIP_STACK_VALIDATION),1)
ifdef CONFIG_UNWINDER_ORC
@echo "error: Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2
@false
else
@echo "warning: Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2
endif
endif

# Generate some files
# ---------------------------------------------------------------------------
Expand Down

0 comments on commit ae206a1

Please sign in to comment.