mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Bolle <pebolle@tiscali.nl>
To: Jarod Wilson <jarod@redhat.com>,
	Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: Tony Luck <tony.luck@intel.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Prarit Bhargava <prarit@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: Odd build breakage in 4.9-rc7
Date: Thu, 01 Dec 2016 14:46:06 +0100	[thread overview]
Message-ID: <1480599966.19457.4.camel@tiscali.nl> (raw)
In-Reply-To: <1480582887.27962.48.camel@tiscali.nl>

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.

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 <whatever> 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
 

  reply	other threads:[~2016-12-01 13:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-30 17:24 Jarod Wilson
2016-11-30 18:18 ` Linus Torvalds
2016-11-30 18:28   ` Prarit Bhargava
2016-11-30 18:36     ` Linus Torvalds
2016-11-30 18:50       ` Prarit Bhargava
2016-11-30 19:00         ` Jarod Wilson
2016-11-30 19:35         ` Linus Torvalds
2016-11-30 22:41           ` Nicolas Pitre
2016-12-01 12:47             ` Prarit Bhargava
2016-12-01 14:03             ` Prarit Bhargava
2016-12-01 15:22               ` Jarod Wilson
2016-11-30 22:54         ` Nicolas Pitre
2016-11-30 20:52 ` Paul Bolle
2016-11-30 21:07   ` Jarod Wilson
2016-11-30 21:35     ` Jarod Wilson
2016-11-30 21:42       ` Paul Bolle
2016-11-30 21:57         ` Paul Bolle
2016-11-30 23:40           ` Jarod Wilson
2016-12-01  9:01             ` Paul Bolle
2016-12-01 13:46               ` Paul Bolle [this message]
2016-12-01 17:42                 ` Nicolas Pitre
2016-12-01 20:15                   ` Paul Bolle
2016-12-02 20:11                     ` Nicolas Pitre
2016-12-02 22:41                       ` Jarod Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1480599966.19457.4.camel@tiscali.nl \
    --to=pebolle@tiscali.nl \
    --cc=jarod@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.pitre@linaro.org \
    --cc=prarit@redhat.com \
    --cc=tony.luck@intel.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®