From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932378Ab2DTPCF (ORCPT ); Fri, 20 Apr 2012 11:02:05 -0400 Received: from smtp.snhosting.dk ([87.238.248.203]:33545 "EHLO smtp.domainteam.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932127Ab2DTPCD (ORCPT ); Fri, 20 Apr 2012 11:02:03 -0400 Date: Fri, 20 Apr 2012 17:02:01 +0200 From: Sam Ravnborg To: David Daney Cc: Ralf Baechle , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Linus Torvalds , Michal Marek , linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, Andrew Morton , David Daney Subject: Re: [PATCH v2 3/5] kbuild/extable: Hook up sortextable into the build system. Message-ID: <20120420150201.GB2891@merkur.ravnborg.org> References: <1334872799-14589-1-git-send-email-ddaney.cavm@gmail.com> <1334872799-14589-4-git-send-email-ddaney.cavm@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1334872799-14589-4-git-send-email-ddaney.cavm@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 19, 2012 at 02:59:57PM -0700, David Daney wrote: > From: David Daney > > Define a config variable BUILDTIME_EXTABLE_SORT to control build time > sorting of the kernel's exception table. > > Patch Makefile to do the sorting when BUILDTIME_EXTABLE_SORT is > selected. > > Signed-off-by: David Daney > --- > Makefile | 10 ++++++++++ > init/Kconfig | 3 +++ > 2 files changed, 13 insertions(+), 0 deletions(-) > > diff --git a/Makefile b/Makefile > index ae947cc..e3bbca9 100644 > --- a/Makefile > +++ b/Makefile > @@ -784,6 +784,10 @@ quiet_cmd_vmlinux_version = GEN .version > quiet_cmd_sysmap = SYSMAP > cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap > > +# Sort exception table at build time > +quiet_cmd_sortextable = SORTEX > + cmd_sortextable = $(objtree)/scripts/sortextable > + > # Link of vmlinux > # If CONFIG_KALLSYMS is set .version is already updated > # Generate System.map and verify that the content is consistent > @@ -796,6 +800,12 @@ define rule_vmlinux__ > $(call cmd,vmlinux__) > $(Q)echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd > > + $(if $(CONFIG_BUILDTIME_EXTABLE_SORT), \ > + $(Q)$(if $($(quiet)cmd_sortextable), \ > + echo ' $($(quiet)cmd_sortextable) vmlinux' &&) \ > + $(cmd_sortextable) vmlinux) > + > + Anything that add complexity to the top-level Makefile is bad :-( I once looked at moving all the final link stuff to a script. Maybe it is time to open that again... > +config BUILDTIME_EXTABLE_SORT > + bool > + Please add a comment about what this symbol is used for. Also we often name such symbols: HAVE_* Sam