From owner-svn-src-head@freebsd.org Mon Nov 5 23:11:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25F93110EC3C; Mon, 5 Nov 2018 23:11:07 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-yb1-f194.google.com (mail-yb1-f194.google.com [209.85.219.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F26379892; Mon, 5 Nov 2018 23:11:06 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-yb1-f194.google.com with SMTP id p144-v6so4551020yba.11; Mon, 05 Nov 2018 15:11:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NGrxXg0Anvg53pzLtnskP714IMUqT0nxGP/nbj9eoCM=; b=tN2LNL41sySd38A0r1VuycGeyzjNsN6q1eer/PmTN2y+eMrAwOmYDSBHl71PuWlqO1 1P7E/R5QDn3D/Zn9HHASxh9+b4WIyBZbV16f6LxW8uVzcqrPOmO6XPGkvc37E0FyRXsn T5JX3zzL5b7zaimPgnIF61dxx0SH6vKSnF7DFRU0+ROE6ppKdliVPeWeHjeqN6EOcCK4 KOYqmCEnW9Js+Jdq+foNSN2aaI8QXqi7m91CDjIWl94WxWMgn36orAyCa8v1K37zMJLj guxKSySbJ3loUim1SzqUv3Ss/jV6d89XJU2I2Y7c6BvGloh/iKkVTWHZJRRsql3X+Woz OS1w== X-Gm-Message-State: AGRZ1gL+wGkImhpuKt28REv9VYFoGweScx+g/Q8VazPTPgmpr7f0CEat myKyty8LlEz41cHLgbY+M+8AfWSOdQSC8A== X-Google-Smtp-Source: AJdET5fMzhPfa3o7HAKLOM6zqJpxcbgqP2bpO3lGOwSAd0Qe154vwfko2G7B3Il/iYc79me/yVLrnw== X-Received: by 2002:a25:e6d3:: with SMTP id d202-v6mr23587676ybh.466.1541459460215; Mon, 05 Nov 2018 15:11:00 -0800 (PST) Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com. [209.85.219.182]) by smtp.gmail.com with ESMTPSA id r18-v6sm22278875ywa.16.2018.11.05.15.10.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 15:11:00 -0800 (PST) Received: by mail-yb1-f182.google.com with SMTP id i78-v6so4574986ybg.0; Mon, 05 Nov 2018 15:10:59 -0800 (PST) X-Received: by 2002:a25:6d44:: with SMTP id i65-v6mr22958668ybc.454.1541459459598; Mon, 05 Nov 2018 15:10:59 -0800 (PST) MIME-Version: 1.0 References: <201810230631.w9N6VPR4008554@repo.freebsd.org> <9612d267-91dc-b1ee-7530-284376f08f08@FreeBSD.org> In-Reply-To: <9612d267-91dc-b1ee-7530-284376f08f08@FreeBSD.org> From: Alexander Richardson Date: Mon, 5 Nov 2018 23:10:48 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r339636 - in head: . share/mk To: bdrewery@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 7F26379892 X-Spamd-Result: default: False [-3.91 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(-1.01)[ipnet: 209.85.128.0/17(-3.68), asn: 15169(-1.33), country: US(-0.06)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.88)[-0.884,0]; RCVD_IN_DNSWL_NONE(0.00)[194.219.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[arichardson@freebsd.org,arichardsonkde@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[194.219.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[arichardson@freebsd.org,arichardsonkde@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:11:07 -0000 On Mon, 5 Nov 2018 at 23:00, Bryan Drewery wrote: > > On 10/22/2018 11:31 PM, Alex Richardson wrote: > > Author: arichardson > > Date: Tue Oct 23 06:31:25 2018 > > New Revision: 339636 > > URL: https://svnweb.freebsd.org/changeset/base/339636 > > > > Log: > > Only compute the X_COMPILER_*/X_LINKER_* variables when needed > > > > When building CheriBSD we have to set XLD/XCC/XCFLAGS on the command line. > > This triggers the $XCC != $CC case in bsd.compiler.mk (and the same for LD > > in bsd.linker.mk) which causes it to call ${XCC} --version and > > ${XLD} --version (plus various awk+sed+echo calls) in every subdirectory. > > For incremental builds and stages that only walk the source tree this is > > often the majority of the time spent in that directory. > > > ... > > > By only computing the value of the X_COMPILER_*/X_LINKER_* variables if > > _WANT_TOOLCHAIN_CROSS_VARS is set we can reduce the number of cc/ld calls > > to once per build stage instead of once per recursive make. > > This sounds wrong. bsd.compiler.mk *already* handles that kind of thing > by exporting its computations. Adding a second hack for a similar > problem isn't the right solution. > I added debug .info statements for every time bsd.compiler.mk was running cc --version and it was always running it for $XCC during make buildworld. As far as I can tell this happens because $CC and $XCC no longer match. I believe the problem is that the toplevel makefile runs the cross stages with CC="${XCC} ${XCFLAGS}" so if you have XCFLAGS set in your environment $CC will never be equal to $XCC. This also means there is not cached variable for $XCC since it was computed for "${XCC} ${XCFLAGS}" rather than $XCC . This patch massively reduced the incremental build time for CheriBSD but if you can suggest I better fix that would be great. Alex