* [PATCH] kbuild: fix false positive warning/error about missing libelf
@ 2018-12-18 5:25 Masahiro Yamada
2018-12-18 14:34 ` Qian Cai
0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2018-12-18 5:25 UTC (permalink / raw)
To: linux-kbuild
Cc: Paul Gortmaker, Bernd Edlinger, Qian Cai, Masahiro Yamada,
Josh Poimboeuf, Michal Marek, linux-kernel
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 <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>
---
Makefile | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 56d5270..d45856f 100644
--- a/Makefile
+++ b/Makefile
@@ -962,11 +962,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
@@ -1125,6 +1120,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
# ---------------------------------------------------------------------------
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] kbuild: fix false positive warning/error about missing libelf
2018-12-18 5:25 [PATCH] kbuild: fix false positive warning/error about missing libelf Masahiro Yamada
@ 2018-12-18 14:34 ` Qian Cai
2018-12-20 1:59 ` Masahiro Yamada
0 siblings, 1 reply; 3+ messages in thread
From: Qian Cai @ 2018-12-18 14:34 UTC (permalink / raw)
To: Masahiro Yamada, linux-kbuild
Cc: Paul Gortmaker, Bernd Edlinger, Josh Poimboeuf, Michal Marek,
linux-kernel
On Tue, 2018-12-18 at 14:25 +0900, Masahiro Yamada wrote:
> 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 <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>
> Makefile | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 56d5270..d45856f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -962,11 +962,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
> @@ -1125,6 +1120,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
> # ---------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] kbuild: fix false positive warning/error about missing libelf
2018-12-18 14:34 ` Qian Cai
@ 2018-12-20 1:59 ` Masahiro Yamada
0 siblings, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2018-12-20 1:59 UTC (permalink / raw)
To: Qian Cai
Cc: Linux Kbuild mailing list, Paul Gortmaker, Bernd Edlinger,
Josh Poimboeuf, Michal Marek, Linux Kernel Mailing List
On Tue, Dec 18, 2018 at 11:35 PM Qian Cai <cai@lca.pw> wrote:
>
> On Tue, 2018-12-18 at 14:25 +0900, Masahiro Yamada wrote:
> > 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 <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>
Applied to linux-kbuild/fixes.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-12-20 2:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-18 5:25 [PATCH] kbuild: fix false positive warning/error about missing libelf Masahiro Yamada
2018-12-18 14:34 ` Qian Cai
2018-12-20 1:59 ` Masahiro Yamada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).