Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752999AbbHMOnE (ORCPT ); Thu, 13 Aug 2015 10:43:04 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:49898 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751862AbbHMOnC (ORCPT ); Thu, 13 Aug 2015 10:43:02 -0400 Date: Thu, 13 Aug 2015 09:42:25 -0500 From: Chris J Arges To: Josh Poimboeuf Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Michal Marek , Peter Zijlstra , Andy Lutomirski , Borislav Petkov , Linus Torvalds , Andi Kleen , Pedro Alves , Namhyung Kim , Bernd Petrovitsch , x86@kernel.org, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 00/21] Compile-time stack validation Message-ID: <20150813144224.GA9536@canonical.com> References: <55CA699B.4070809@canonical.com> <20150812044317.GB25439@treble.redhat.com> <55CBB9A1.7000800@canonical.com> <20150813112220.GA30251@treble.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150813112220.GA30251@treble.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3039 Lines: 89 On Thu, Aug 13, 2015 at 06:22:20AM -0500, Josh Poimboeuf wrote: > On Wed, Aug 12, 2015 at 04:24:49PM -0500, Chris J Arges wrote: > > I still get build failures and I've pared it down to x86_64 defconfig plus: > > CONFIG_MODVERSIONS=y > > CONFIG_STACK_VALIDATION=y > > > > And it seems like some modules may get the .tmp_foo.o treatment while > > others end up foo.o so something like the following will not work: > > > > cmd_stackvalidate = $(if $(patsubst n%,, \ > > $(STACKVALIDATE_$(basetarget).o)$(STACKVALIDATE)y), \ > > $(__stackvalidate) $(nofp) "$(@D)/.tmp_$(@F)";) > > Does this fix it? > > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > index ec96c51..0181915 100644 > --- a/scripts/Makefile.build > +++ b/scripts/Makefile.build > @@ -263,8 +263,8 @@ endif # CONFIG_STACK_VALIDATION > define rule_cc_o_c > $(call echo-cmd,checksrc) $(cmd_checksrc) \ > $(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \ > - $(cmd_stackvalidate) \ > $(cmd_modversions) \ > + $(cmd_stackvalidate) \ > $(call echo-cmd,record_mcount) \ > $(cmd_record_mcount) \ > scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \ > Josh, Yes, this fixes my build. For completeness this is my current diff: diff --git a/scripts/Makefile.build b/scripts/Makefile.build index a1270d3..0181915 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -243,7 +243,7 @@ endif ifdef CONFIG_STACK_VALIDATION -stackvalidate = $(objtree)/scripts/stackvalidate/stackvalidate +__stackvalidate = $(objtree)/scripts/stackvalidate/stackvalidate ifndef CONFIG_FRAME_POINTER nofp = --no-frame-pointer @@ -251,17 +251,20 @@ endif # Set STACKVALIDATE_foo.o=n to skip stack validation for a file. # Set STACKVALIDATE=n to skip stack validation for a directory. +stackvalidate = $(if $(patsubst n%,, \ + $(STACKVALIDATE_$(basetarget).o)$(STACKVALIDATE)y), \ + $(__stackvalidate)) cmd_stackvalidate = $(if $(patsubst n%,, \ $(STACKVALIDATE_$(basetarget).o)$(STACKVALIDATE)y), \ - $(stackvalidate) $(nofp) "$(@)";) + $(__stackvalidate) $(nofp) "$(@)";) endif # CONFIG_STACK_VALIDATION define rule_cc_o_c $(call echo-cmd,checksrc) $(cmd_checksrc) \ $(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \ - $(cmd_stackvalidate) \ $(cmd_modversions) \ + $(cmd_stackvalidate) \ $(call echo-cmd,record_mcount) \ $(cmd_record_mcount) \ scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \ diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile index c11212f..374c413 100644 --- a/scripts/mod/Makefile +++ b/scripts/mod/Makefile @@ -1,3 +1,5 @@ +STACKVALIDATE := n + hostprogs-y := modpost mk_elfconfig always := $(hostprogs-y) empty.o Thanks, --chris -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/