From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8941 invoked by alias); 24 Aug 2010 16:07:48 -0000 Received: (qmail 8841 invoked by uid 22791); 24 Aug 2010 16:07:46 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from claranetfr-outbound-smtp06.mail.eu.clara.net (HELO claranetfr-outbound-smtp06.mail.eu.clara.net) (195.8.64.55) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 Aug 2010 16:07:39 +0000 Received: from 28.165.100-84.rev.gaoland.net ([84.100.165.28]:38978 helo=[192.168.0.100]) by relay06.mail.eu.clara.net (smtp-vh.fr.clara.net [213.253.3.46]:1725) with esmtpa (authdaemon_plain:jean-marc.saffroy@joguin.com) id 1Onw2B-0000eT-Ko (return-path ); Tue, 24 Aug 2010 16:07:35 +0000 Message-ID: <4C73EE46.3050709@joguin.com> Date: Mon, 30 Aug 2010 16:52:00 -0000 From: Jean-Marc Saffroy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6 MIME-Version: 1.0 To: Mike Stump CC: cgen@sourceware.org Subject: Re: -j6 build References: In-Reply-To: Content-Type: multipart/mixed; boundary="------------080409030600000608090109" X-IsSubscribed: yes Mailing-List: contact cgen-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sourceware.org X-SW-Source: 2010-q3/txt/msg00006.txt.bz2 This is a multi-part message in MIME format. --------------080409030600000608090109 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 650 On 08/24/2010 06:33 AM, Mike Stump wrote: > So, I have a cgen port and am wondering, is there anyway to speed up the 6 minute build that uses 1 core, to being a 1 minute build that uses 6 cores? -j8 didn't seem to do it. > FWIW setting CC="ccache gcc" and CFLAGS="-O0 -pipe" at configure time did wonders for me (in addition to make -jN with N = 2 x number of cores). Also I issue a single make command for all targets. See attached makefile, which builds a complete toolchain (binutils, gcc, newlib, and gcc for newlib). Binutils (cgen, gas, ld, sim) now build in 36 seconds on my quad core (44secs user, 34secs sys), with hot caches. HTH, JM --------------080409030600000608090109 Content-Type: text/plain; name="Makefile" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Makefile" Content-length: 2802 # Makefile for the whole bare-metal C toolchain (binutils, gcc, newlib) # arch name target ?= xxx TARGET ?= $(target)-elf # install dir DESTDIR = /tmp/$(target) # build dirs BUILDROOT = $(HOME)/build/$(target) SRCBUILDDIR = $(BUILDROOT)/binutils LIBBUILDDIR = $(BUILDROOT)/newlib GCCELFBUILDDIR = $(BUILDROOT)/gccelf GCCLIBBUILDDIR = $(BUILDROOT)/gcclib # source dirs GCCDIR = $(HOME)/gcc/src SRCDIR = $(HOME)/cygnus/src # build flags BUILD_CC = ccache gcc BUILD_CFLAGS = -g3 -O0 -Wall -pipe SRCMAINT = --enable-maintainer-mode --enable-cgen-maint GCCMAINT = --enable-maintainer-mode --enable-checking LIBMAINT = # misc export PATH := $(DESTDIR)/bin:$(PATH) NPROCS := $(shell getconf _NPROCESSORS_ONLN) NJOBS := $(shell expr $(NPROCS) '*' 2) TOUCH = touch MK = make -j $(NJOBS) all: gcclib-make # binutils binutils-configure: mkdir -p $(SRCBUILDDIR) cd $(SRCBUILDDIR) && \ CC="$(BUILD_CC)" CFLAGS="$(BUILD_CFLAGS)" \ $(SRCDIR)/configure --target=$(TARGET) $(SRCMAINT) --prefix=$(DESTDIR) $(TOUCH) $@ binutils-make: binutils-configure $(MK) -C $(SRCBUILDDIR) $(patsubst %,all-%,binutils gas ld sim) $(MK) -C $(SRCBUILDDIR) $(patsubst %,install-%,binutils gas ld sim) $(TOUCH) $@ # initial gcc gccelf-configure: binutils-make mkdir -p $(GCCELFBUILDDIR) cd $(GCCELFBUILDDIR) && \ CC="$(BUILD_CC)" CFLAGS="$(BUILD_CFLAGS)" \ $(GCCDIR)/configure --target=$(TARGET) --prefix=$(DESTDIR) \ --enable-languages=c --disable-libssp --with-newlib $(TOUCH) $@ gccelf-make: gccelf-configure $(MK) -C $(GCCELFBUILDDIR) $(MK) -C $(GCCELFBUILDDIR) install $(TOUCH) $@ # newlib newlib-configure: gccelf-make mkdir -p $(LIBBUILDDIR) cd $(LIBBUILDDIR) && \ CC="$(BUILD_CC)" CFLAGS="$(BUILD_CFLAGS)" \ $(SRCDIR)/configure --target=$(TARGET) $(LIBMAINT) --prefix=$(DESTDIR) $(TOUCH) $@ newlib-make: newlib-configure $(MK) -C $(LIBBUILDDIR) CC_FOR_TARGET=$(TARGET)-gcc \ all-target-newlib all-target-libgloss $(MK) -C $(LIBBUILDDIR) CC_FOR_TARGET=$(TARGET)-gcc \ install-target-newlib install-target-libgloss $(TOUCH) $@ # gcc for newlib gcclib-configure: newlib-make mkdir -p $(GCCLIBBUILDDIR) cd $(GCCLIBBUILDDIR) && \ CC="$(BUILD_CC)" CFLAGS="$(BUILD_CFLAGS)" \ $(GCCDIR)/configure --target=$(TARGET) --prefix=$(DESTDIR) \ --enable-languages=c --disable-libssp --with-newlib \ --with-headers=$(DESTDIR)/$(TARGET)/include $(TOUCH) $@ gcclib-make: gcclib-configure $(MK) -C $(GCCLIBBUILDDIR) $(MK) -C $(GCCLIBBUILDDIR) install $(TOUCH) $@ # run gcc test suite check: gcclib-make $(MK) -C $(GCCLIBBUILDDIR)/gcc check \ RUNTESTFLAGS="--target_board=$(target)-sim $(RUNTESTFLAGS)" tail $(GCCLIBBUILDDIR)/gcc/testsuite/gcc/gcc.log # clean clean: $(RM) -r *-configure *-make $(DESTDIR) $(BUILDROOT) .PHONY: clean all check --------------080409030600000608090109--