This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Mark linker Makefile rules for job server build


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]