This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Mark linker Makefile rules for job server build
- From: Ralf Wildenhues <Ralf dot Wildenhues at gmx dot de>
- To: Andi Kleen <andi at firstfloor dot org>
- Cc: gcc-patches at gcc dot gnu dot org, Andi Kleen <ak at linux dot intel dot com>
- Date: Mon, 4 Oct 2010 19:42:46 +0200
- Subject: Re: [PATCH] Mark linker Makefile rules for job server build
- References: <1286197899-24667-1-git-send-email-andi@firstfloor.org>
Hello,
* Andi Kleen wrote on Mon, Oct 04, 2010 at 03:11:39PM CEST:
> -fwhopr=jobserver requires telling GNU make that the linker (= lto)
> rules support job server, so that the necessary jobserver
> information is passed through.
>
> Add + to all the executable targets that run LTO for this purpose.
FWIW, this will break 'make -n'. I sent a feature request for GNU make:
<http://thread.gmane.org/gmane.comp.gnu.make.bugs/5015>
With GNU make-specific code, we could probably work around it. I'm
thinking of something along these lines:
jobserv := $(shell dry=no; for f in $(MAKEFLAGS); do \
case $$f in \
(*=*|--*);; \
(*n*) dry=yes;; \
esac; \
done; \
test "$$dry" = no && echo +)
cc1: ...
$(jobserv)$(LINK) ...
but the open parens in the case patterns are probably not portable
enough to all shells.
Although you may argue that 'make -n' is at least mildly broken in GCC
anyway.
FWIW, the '+' feature is not GNU make-specific, only the $(MAKE) string
detection is.
> This improves build performance with a -fwhopr=jobserver
> bootstrap (or BUILD_CONFIG=bootstrap-lto) significantly.
Yep.
Cheers,
Ralf