linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* include/config/auto.conf not sync up with .config
@ 2018-12-17  3:56 Qian Cai
  2018-12-17 16:17 ` [PATCH] kbuild: error for CONFIG_ORC_UNWINDER is too much Qian Cai
  0 siblings, 1 reply; 6+ messages in thread
From: Qian Cai @ 2018-12-17  3:56 UTC (permalink / raw)
  To: yamada.masahiro, michal.lkml; +Cc: linux-kbuild, linux-kernel

This bug can be reproduced this way on x86_64.

* make sure none of libelf-dev, libelf-devel or elfutils-libelf-devel installed.

# make distclean

* generate a default .config where CONFIG_UNWINDER_ORC is enabled by default.
# make menuconfig (exit -> save)

# grep CONFIG_UNWINDER_ORC .config
CONFIG_UNWINDER_ORC=y

# make menuconfig (unselect CONFIG_UNWINDER_ORC)

# grep CONFIG_UNWINDER_ORC .config
# CONFIG_UNWINDER_ORC is not set

# make
Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install
libelf-dev, libelf-devel or elfutils-libelf-devel

# grep CONFIG_UNWINDER_ORC include/config/auto.conf
CONFIG_UNWINDER_ORC=y

This is due to this receipe in Makefile had never been executed even though
.config has is more recent than auto.conf.

# The actual configuration files used during the build are
# stored in include/generated/ and include/config/. Update
# them if .config is newer than include/config/auto.conf
#(which mirrors .config).
include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
	$(Q)$(MAKE) -f $(srctree)/Makefile syncconfig

Actually, replaced that rule with any rule would never executed the recipe
there, For example,

/tmp/noexist:
	$(warning "never print anything")

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] kbuild: error for CONFIG_ORC_UNWINDER is too much
  2018-12-17  3:56 include/config/auto.conf not sync up with .config Qian Cai
@ 2018-12-17 16:17 ` Qian Cai
  2018-12-17 17:03   ` Josh Poimboeuf
  0 siblings, 1 reply; 6+ messages in thread
From: Qian Cai @ 2018-12-17 16:17 UTC (permalink / raw)
  To: yamada.masahiro, michal.lkml
  Cc: jpoimboe, mingo, bp, linux-kbuild, linux-kernel, Qian Cai

Since ifdef will be evaluated immediately in the first phrase of the
Makefile read-in, there is no guarantee that the value for
CONFIG_ORC_UNWINDER will be up-to-date until in the second phrase that
this recipe is ran.

include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
	$(Q)$(MAKE) -f $(srctree)/Makefile syncconfig

Hence, change error to warning as this is essentially a best guess. The
original bug can be reproduced this way,

* make sure none of libelf-dev, libelf-devel or elfutils-libelf-devel
installed.

 # make distclean

* generate a default .config where CONFIG_UNWINDER_ORC is enabled by
default.
 # make menuconfig (exit -> save)

 # grep CONFIG_UNWINDER_ORC .config
CONFIG_UNWINDER_ORC=y

 # make menuconfig (deselect CONFIG_UNWINDER_ORC)

 # grep CONFIG_UNWINDER_ORC .config
 # CONFIG_UNWINDER_ORC is not set

 # make
Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install
libelf-dev, libelf-devel or elfutils-libelf-devel

 # grep CONFIG_UNWINDER_ORC include/config/auto.conf
CONFIG_UNWINDER_ORC=y

Fixes: 3dd40cb320f (objtool: Upgrade libelf-devel warning to error for
CONFIG_ORC_UNWINDER)
Signed-off-by: Qian Cai <cai@lca.pw>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 56d5270f22f8..eeb4ec49d393 100644
--- a/Makefile
+++ b/Makefile
@@ -963,7 +963,7 @@ ifdef CONFIG_STACK_VALIDATION
     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")
+      $(warning "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
-- 
2.17.2 (Apple Git-113)


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] kbuild: error for CONFIG_ORC_UNWINDER is too much
  2018-12-17 16:17 ` [PATCH] kbuild: error for CONFIG_ORC_UNWINDER is too much Qian Cai
@ 2018-12-17 17:03   ` Josh Poimboeuf
  2018-12-17 17:13     ` Qian Cai
  0 siblings, 1 reply; 6+ messages in thread
From: Josh Poimboeuf @ 2018-12-17 17:03 UTC (permalink / raw)
  To: Qian Cai
  Cc: yamada.masahiro, michal.lkml, mingo, bp, linux-kbuild,
	linux-kernel, Paul Gortmaker

On Mon, Dec 17, 2018 at 11:17:28AM -0500, Qian Cai wrote:
> Since ifdef will be evaluated immediately in the first phrase of the
> Makefile read-in, there is no guarantee that the value for
> CONFIG_ORC_UNWINDER will be up-to-date until in the second phrase that
> this recipe is ran.
> 
> include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
> 	$(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
> 
> Hence, change error to warning as this is essentially a best guess. The
> original bug can be reproduced this way,

But this still doesn't fix the root of the problem, that the check
relies on a stale auto.conf.

-- 
Josh

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] kbuild: error for CONFIG_ORC_UNWINDER is too much
  2018-12-17 17:03   ` Josh Poimboeuf
@ 2018-12-17 17:13     ` Qian Cai
  2018-12-17 17:49       ` Josh Poimboeuf
  0 siblings, 1 reply; 6+ messages in thread
From: Qian Cai @ 2018-12-17 17:13 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: yamada.masahiro, michal.lkml, mingo, bp, linux-kbuild,
	linux-kernel, Paul Gortmaker

On Mon, 2018-12-17 at 11:03 -0600, Josh Poimboeuf wrote:
> On Mon, Dec 17, 2018 at 11:17:28AM -0500, Qian Cai wrote:
> > Since ifdef will be evaluated immediately in the first phrase of the
> > Makefile read-in, there is no guarantee that the value for
> > CONFIG_ORC_UNWINDER will be up-to-date until in the second phrase that
> > this recipe is ran.
> > 
> > include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
> > 	$(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
> > 
> > Hence, change error to warning as this is essentially a best guess. The
> > original bug can be reproduced this way,
> 
> But this still doesn't fix the root of the problem, that the check
> relies on a stale auto.conf.
> 

Yes, but it at least let people to be able to continue compiling kernel without
prematurely being terminated incorrectly. The good thing is that that check will
be triggered again to print out the right message once auto.conf has been synced
up.

# make
Makefile:966: "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please
install libelf-dev, libelf-devel or elfutils-libelf-devel"
  HOSTCC  scripts/kconfig/conf.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --syncconfig Kconfig
Makefile:968: "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev,
libelf-devel or elfutils-libelf-devel"

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] kbuild: error for CONFIG_ORC_UNWINDER is too much
  2018-12-17 17:13     ` Qian Cai
@ 2018-12-17 17:49       ` Josh Poimboeuf
  2018-12-17 18:11         ` Qian Cai
  0 siblings, 1 reply; 6+ messages in thread
From: Josh Poimboeuf @ 2018-12-17 17:49 UTC (permalink / raw)
  To: Qian Cai
  Cc: yamada.masahiro, michal.lkml, mingo, bp, linux-kbuild,
	linux-kernel, Paul Gortmaker

On Mon, Dec 17, 2018 at 12:13:59PM -0500, Qian Cai wrote:
> On Mon, 2018-12-17 at 11:03 -0600, Josh Poimboeuf wrote:
> > On Mon, Dec 17, 2018 at 11:17:28AM -0500, Qian Cai wrote:
> > > Since ifdef will be evaluated immediately in the first phrase of the
> > > Makefile read-in, there is no guarantee that the value for
> > > CONFIG_ORC_UNWINDER will be up-to-date until in the second phrase that
> > > this recipe is ran.
> > > 
> > > include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
> > > 	$(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
> > > 
> > > Hence, change error to warning as this is essentially a best guess. The
> > > original bug can be reproduced this way,
> > 
> > But this still doesn't fix the root of the problem, that the check
> > relies on a stale auto.conf.
> > 
> 
> Yes, but it at least let people to be able to continue compiling kernel without
> prematurely being terminated incorrectly. The good thing is that that check will
> be triggered again to print out the right message once auto.conf has been synced
> up.
> 
> # make
> Makefile:966: "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please
> install libelf-dev, libelf-devel or elfutils-libelf-devel"
>   HOSTCC  scripts/kconfig/conf.o
>   HOSTLD  scripts/kconfig/conf
> scripts/kconfig/conf  --syncconfig Kconfig
> Makefile:968: "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev,
> libelf-devel or elfutils-libelf-devel"

Instead of giving false (or silent) warnings, why not just fix the real
problem?

Also the error exists for a reason: if the user misses the warning then
the ORC unwinder is broken and oops stack dumps are much less useful.

-- 
Josh

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] kbuild: error for CONFIG_ORC_UNWINDER is too much
  2018-12-17 17:49       ` Josh Poimboeuf
@ 2018-12-17 18:11         ` Qian Cai
  0 siblings, 0 replies; 6+ messages in thread
From: Qian Cai @ 2018-12-17 18:11 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: yamada.masahiro, michal.lkml, mingo, bp, linux-kbuild,
	linux-kernel, Paul Gortmaker

On Mon, 2018-12-17 at 11:49 -0600, Josh Poimboeuf wrote:
> On Mon, Dec 17, 2018 at 12:13:59PM -0500, Qian Cai wrote:
> > On Mon, 2018-12-17 at 11:03 -0600, Josh Poimboeuf wrote:
> > > On Mon, Dec 17, 2018 at 11:17:28AM -0500, Qian Cai wrote:
> > > > Since ifdef will be evaluated immediately in the first phrase of the
> > > > Makefile read-in, there is no guarantee that the value for
> > > > CONFIG_ORC_UNWINDER will be up-to-date until in the second phrase that
> > > > this recipe is ran.
> > > > 
> > > > include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
> > > > 	$(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
> > > > 
> > > > Hence, change error to warning as this is essentially a best guess. The
> > > > original bug can be reproduced this way,
> > > 
> > > But this still doesn't fix the root of the problem, that the check
> > > relies on a stale auto.conf.
> > > 
> > 
> > Yes, but it at least let people to be able to continue compiling kernel
> > without
> > prematurely being terminated incorrectly. The good thing is that that check
> > will
> > be triggered again to print out the right message once auto.conf has been
> > synced
> > up.
> > 
> > # make
> > Makefile:966: "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y,
> > please
> > install libelf-dev, libelf-devel or elfutils-libelf-devel"
> >   HOSTCC  scripts/kconfig/conf.o
> >   HOSTLD  scripts/kconfig/conf
> > scripts/kconfig/conf  --syncconfig Kconfig
> > Makefile:968: "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-
> > dev,
> > libelf-devel or elfutils-libelf-devel"
> 
> Instead of giving false (or silent) warnings, why not just fix the real
> problem?

The purpose of this patch here is to fix or revert the regression introduced by
3dd40cb320f (objtool: Upgrade libelf-devel warning to error for
CONFIG_ORC_UNWINDER).

> 
> Also the error exists for a reason: if the user misses the warning then
> the ORC unwinder is broken and oops stack dumps are much less useful.
> 

This is a separate issue. I am all ears if anyone has a better ideal to fix both
issues at the same time.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-12-17 18:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-17  3:56 include/config/auto.conf not sync up with .config Qian Cai
2018-12-17 16:17 ` [PATCH] kbuild: error for CONFIG_ORC_UNWINDER is too much Qian Cai
2018-12-17 17:03   ` Josh Poimboeuf
2018-12-17 17:13     ` Qian Cai
2018-12-17 17:49       ` Josh Poimboeuf
2018-12-17 18:11         ` Qian Cai

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).