On Thu, Mar 16, 2017 at 03:39:36PM +0100, Arnd Bergmann wrote: > On Thu, Mar 16, 2017 at 2:59 PM, Jiri Olsa <jo...@redhat.com> wrote: > > On Thu, Mar 16, 2017 at 02:44:45PM +0100, Arnd Bergmann wrote: > >> On Thu, Mar 16, 2017 at 1:49 PM, Jiri Olsa <jo...@redhat.com> wrote: > >> > On Thu, Mar 16, 2017 at 09:29:07AM -0300, Arnaldo Carvalho de Melo wrote: > >> >> Em Wed, Mar 15, 2017 at 02:15:22PM +0100, Arnd Bergmann escreveu: > >> >> > On Wed, Mar 15, 2017 at 8:22 AM, gregkh <gre...@linuxfoundation.org> > >> >> > wrote: > >> >> > > > >> >> > > All now queued up in the stable trees, thanks. > >> >> > > >> >> > Like 4.9.y it builds clean except for a couple of stack frame size > >> >> > warnings > >> >> > and this one that continues to puzzle me. > >> >> > > >> >> > /bin/sh: 1: > >> >> > /home/buildslave/workspace/kernel-builder/arch/x86/defconfig/allmodconfig+CONFIG_OF=n/label/builder/next/build-x86/tools/objtool//fixdep: > >> >> > Permission denied > >> >> > >> >> Jiri? Josh? > >> > > >> > hum, looks like it imight be related to this fix we did for perf: > >> > abb26210a395 perf tools: Force fixdep compilation at the start of the > >> > build > >> > > >> > it's forcing fixdep to be build as first.. having it as a simple > >> > dependency > >> > (which AFAICS is objtool case), the make -jX occasionaly raced on high > >> > cpu > >> > servers, and executed unfinished binary, hence the permission fail > >> > >> It's probably another variation of this bug, but the commit you cite got > >> merged > >> into 4.10-rc1, while the problem still persists in mainline (4.11-rc2+). > > > > the problem is in objtool build right? the fix was for perf build > > Ah, got it. Yes, that must be it then. I supposed we coul duplicate what you > did for perf in objtool, but a cleaner way would be to generalize it for all > of > tools/, right? > > Arnd
i came up quickly with attached change.. not too much tested, but basically it's the idea applied to objtool looks like we could generalize some of those pieces, I'll try to look at it next week if nobody beats me to it ;-) thanks, jirka --- diff --git a/tools/lib/subcmd/Makefile b/tools/lib/subcmd/Makefile index 3d1c3b5b5150..a00942fbe43b 100644 --- a/tools/lib/subcmd/Makefile +++ b/tools/lib/subcmd/Makefile @@ -1,6 +1,18 @@ include ../../scripts/Makefile.include include ../../scripts/utilities.mak # QUIET_CLEAN +all: + +config := 1 + +NON_CONFIG_TARGETS := clean + +ifdef MAKECMDGOALS +ifeq ($(filter-out $(NON_CONFIG_TARGETS),$(MAKECMDGOALS)),) + config := 0 +endif +endif + ifeq ($(srctree),) srctree := $(patsubst %/,%,$(dir $(CURDIR))) srctree := $(patsubst %/,%,$(dir $(srctree))) @@ -45,7 +57,24 @@ all: export srctree OUTPUT CC LD CFLAGS V include $(srctree)/tools/build/Makefile.include -all: fixdep $(LIBFILE) +ifdef FIXDEP + force_fixdep := 0 +else + force_fixdep := $(config) +endif + +ifeq ($(force_fixdep),1) +goals := $(filter-out all sub-make, $(MAKECMDGOALS)) + +$(goals) all: sub-make + +sub-make: fixdep + $(Q)$(MAKE) FIXDEP=1 -f Makefile $(goals) + +else # force_fixdep + + +all: $(LIBFILE) $(SUBCMD_IN): FORCE @$(MAKE) $(build)=libsubcmd @@ -59,4 +88,6 @@ clean: FORCE: -.PHONY: clean FORCE +endif # force_fixdep + +.PHONY: clean FORCE sub-make diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile index 27e019c09bd2..8c78a9114ab5 100644 --- a/tools/objtool/Makefile +++ b/tools/objtool/Makefile @@ -1,6 +1,18 @@ include ../scripts/Makefile.include include ../scripts/Makefile.arch +all: + +config := 1 + +NON_CONFIG_TARGETS := clean + +ifdef MAKECMDGOALS +ifeq ($(filter-out $(NON_CONFIG_TARGETS),$(MAKECMDGOALS)),) + config := 0 +endif +endif + ifeq ($(ARCH),x86_64) ARCH := x86 endif @@ -22,8 +34,6 @@ LIBSUBCMD = $(LIBSUBCMD_OUTPUT)libsubcmd.a OBJTOOL := $(OUTPUT)objtool OBJTOOL_IN := $(OBJTOOL)-in.o -all: $(OBJTOOL) - INCLUDES := -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(HOSTARCH)/include/uapi CFLAGS += -Wall -Werror $(EXTRA_WARNINGS) -fomit-frame-pointer -O2 -g $(INCLUDES) LDFLAGS += -lelf $(LIBSUBCMD) @@ -36,7 +46,25 @@ AWK = awk export srctree OUTPUT CFLAGS SRCARCH AWK include $(srctree)/tools/build/Makefile.include -$(OBJTOOL_IN): fixdep FORCE +ifdef FIXDEP + force_fixdep := 0 +else + force_fixdep := $(config) +endif + +ifeq ($(force_fixdep),1) +goals := $(filter-out all sub-make, $(MAKECMDGOALS)) + +$(goals) all: sub-make + +sub-make: fixdep + $(Q)$(MAKE) FIXDEP=1 -f Makefile $(goals) + +else # force_fixdep + +all: $(OBJTOOL) + +$(OBJTOOL_IN): FORCE @$(MAKE) $(build)=objtool # Busybox's diff doesn't have -I, avoid warning in that case @@ -55,7 +83,7 @@ $(OBJTOOL): $(LIBSUBCMD) $(OBJTOOL_IN) $(QUIET_LINK)$(CC) $(OBJTOOL_IN) $(LDFLAGS) -o $@ -$(LIBSUBCMD): fixdep FORCE +$(LIBSUBCMD): FORCE $(Q)$(MAKE) -C $(SUBCMD_SRCDIR) OUTPUT=$(LIBSUBCMD_OUTPUT) clean: @@ -65,4 +93,6 @@ clean: FORCE: -.PHONY: clean FORCE +endif # force_fixdep + +.PHONY: clean FORCE sub-make