Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758197AbcLARmk (ORCPT ); Thu, 1 Dec 2016 12:42:40 -0500 Received: from mail-qk0-f179.google.com ([209.85.220.179]:35429 "EHLO mail-qk0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758005AbcLARmi (ORCPT ); Thu, 1 Dec 2016 12:42:38 -0500 Date: Thu, 1 Dec 2016 12:42:36 -0500 (EST) From: Nicolas Pitre To: Paul Bolle cc: Jarod Wilson , Tony Luck , Linus Torvalds , Prarit Bhargava , linux-kernel@vger.kernel.org Subject: Re: Odd build breakage in 4.9-rc7 In-Reply-To: <1480599966.19457.4.camel@tiscali.nl> Message-ID: References: <20161130172435.GG8563@redhat.com> <1480539150.27962.11.camel@tiscali.nl> <942ca543-de49-abda-7e3b-a8a31c0c2c88@redhat.com> <222b47f2-55e0-3410-c87d-183ca5e2a0fe@redhat.com> <1480542127.27962.17.camel@tiscali.nl> <1480543047.27962.23.camel@tiscali.nl> <4330d00e-ed4f-35fe-586e-f3d5dd6db875@redhat.com> <1480582887.27962.48.camel@tiscali.nl> <1480599966.19457.4.camel@tiscali.nl> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323328-1986335620-1480614157=:1715" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3575 Lines: 100 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-1986335620-1480614157=:1715 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Thu, 1 Dec 2016, Paul Bolle wrote: > On Thu, 2016-12-01 at 10:01 +0100, Paul Bolle wrote: > > Perhaps this is all documented somewhere. But even then it would be nice if > > the build would fail right at the start. Ie, the build probably should fail if > > one does "make bzImage" while having a .config with > >     CONFIG_TRIM_UNUSED_KSYMS=y > >     CONFIG_MODULES=y > >     # CONFIG_MODVERSIONS is not set > > > > Because it seems in that case the subsequent "make modules" will then end in > > this flood of ERRORs.  > > Or, alternatively, we could use something like the following hack to keep a > two step build (ie, "make bzImage" and "make modules") do the right thing even > if CONFING_MODVERSIONS is not set. > > The hack was cobbled together with a fair amount of cargo-cult coding so > perhaps a hunk or two aren't really needed. We'll see. OK I understand what the problem is. However most of those hunks below are definitely wrong. ;-) I'm trying to determine the best way to fix it. Stay tuned. > Paul Bolle > > diff --git a/Makefile b/Makefile > index 694111b43cf8..5820f803ca64 100644 > --- a/Makefile > +++ b/Makefile > @@ -321,7 +321,7 @@ KBUILD_BUILTIN := 1 > # make sure the checksums are up to date before we record them. > > ifeq ($(MAKECMDGOALS),modules) > - KBUILD_BUILTIN := $(if $(CONFIG_MODVERSIONS),1) > + KBUILD_BUILTIN := $(if $(or $(CONFIG_MODVERSIONS),$(CONFIG_TRIM_UNUSED_KSYMS)),1) > endif > > # If we have "make modules", compile modules > diff --git a/scripts/Makefile b/scripts/Makefile > index 1d80897a9644..f23e5c4f2496 100644 > --- a/scripts/Makefile > +++ b/scripts/Makefile > @@ -40,7 +40,9 @@ build_docproc: $(obj)/docproc > build_check-lc_ctype: $(obj)/check-lc_ctype > @: > > -subdir-$(CONFIG_MODVERSIONS) += genksyms > +ifeq ($(or $(CONFIG_MODVERSIONS),$(CONFIG_TRIM_UNUSED_KSYMS)),y) > +subdir-y += genksyms > +endif > subdir-y += mod > subdir-$(CONFIG_SECURITY_SELINUX) += selinux > subdir-$(CONFIG_DTC) += dtc > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > index 7675d11ee65e..50ce2cf86b7c 100644 > --- a/scripts/Makefile.build > +++ b/scripts/Makefile.build > @@ -182,7 +182,7 @@ $(obj)/%.symtypes : $(src)/%.c FORCE > > quiet_cmd_cc_o_c = CC $(quiet_modtag) $@ > > -ifndef CONFIG_MODVERSIONS > +ifneq ($(if $(CONFIG_MODVERSIONS),1,$(if $(CONFIG_TRIM_UNUSED_KSYMS),1)),1) > cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $< > > else > @@ -358,7 +358,7 @@ $(obj)/%.s: $(src)/%.S FORCE > > quiet_cmd_as_o_S = AS $(quiet_modtag) $@ > > -ifndef CONFIG_MODVERSIONS > +ifneq ($(if $(CONFIG_MODVERSIONS),1,$(if $(CONFIG_TRIM_UNUSED_KSYMS),1)),1) > cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< > > else > diff --git a/scripts/adjust_autoksyms.sh b/scripts/adjust_autoksyms.sh > index 8dc1918b6783..7525da1cc2f7 100755 > --- a/scripts/adjust_autoksyms.sh > +++ b/scripts/adjust_autoksyms.sh > @@ -68,7 +68,7 @@ while read sym; do > done >> "$new_ksyms_file" > > # Special case for modversions (see modpost.c) > -if [ -n "$CONFIG_MODVERSIONS" ]; then > +if [ -n "$CONFIG_MODVERSIONS" -o -n "$CONFIG_TRIM_UNUSED_KSYMS" ]; then > echo "#define __KSYM_module_layout 1" >> "$new_ksyms_file" > fi > > --8323328-1986335620-1480614157=:1715--