From owner-freebsd-toolchain@freebsd.org Thu Nov 12 21:55:10 2015 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8069CA2D630 for ; Thu, 12 Nov 2015 21:55:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 614951A8B for ; Thu, 12 Nov 2015 21:55:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: by mailman.ysv.freebsd.org (Postfix) id 5EBEBA2D62F; Thu, 12 Nov 2015 21:55:10 +0000 (UTC) Delivered-To: toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D5D9A2D62E for ; Thu, 12 Nov 2015 21:55:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 3E7C11A87; Thu, 12 Nov 2015 21:55:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 3079C1FD9; Thu, 12 Nov 2015 21:55:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id E098514DBE; Thu, 12 Nov 2015 21:55:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id UdWgm2TFcflw; Thu, 12 Nov 2015 21:55:07 +0000 (UTC) Subject: Meta mode toolchain bootstrapping [was Re: FreeBSD targets/ out-of-date] DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 0B8E714DB7 To: "Simon J. Gerraty" , brooks@FreeBSD.org, imp@FreeBSD.org, emaste@FreeBSD.org References: <55E769EF.7090908@FreeBSD.org> <4924.1441306006@chaos> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc X-Enigmail-Draft-Status: N1110 Organization: FreeBSD Cc: toolchain@FreeBSD.org Message-ID: <56450AB8.90402@FreeBSD.org> Date: Thu, 12 Nov 2015 13:55:04 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <4924.1441306006@chaos> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="N0iSo68wTUxs2ADJAbjPufdr3QNtEgL1Q" X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 21:55:10 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --N0iSo68wTUxs2ADJAbjPufdr3QNtEgL1Q Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 9/3/2015 11:46 AM, Simon J. Gerraty wrote: > Anyway, bootstrap-toolchain leverages src/Makefile.inc1 to build an > initial set of tools. It then attempts to use that to build toolchain > for MACHINE=3Dhost which is currently failing because in-tree libelf an= d > libdwarf are needed and libelf needs sys/sys/elf_common.h but but that > doesn't currently get staged for host (we try to minimize what we put i= n > host stage tree). Using the special hack you came up with for lib/libelf, and a lot of other fixes for replacing binutils with elftoolchain, I've managed to get the targets/pseduo/bootstrap-tools build working again. I will commit this likely today or tomorrow. However... >=20 > It may be better to simply skip targets/pseudo/toolchain.host > that will work so long as we set TOOLSDIR to point to the stuff built b= y > Makefile.inc1=20 >=20 > Depending on where we are with external toolchian support that would > make sense - might be able to skip bootstrap-toolchain completely > which would be nice. I think this is more right because there's many more people thinking about, testing daily, and maintaining the bootstrap logic in Makefile.inc1. The way targets/pseudo/bootstrap-tools works currently lead to bitrot and breakage with the elftoolchain replacement. It will very easily happen again. Right now the targets/pseduo/bootstrap-tools target builds legacy,build-tools,cross-tools from Makefile.inc1 for everything but the compiler and toolchain, and then building the toolchain itself. There's a subtle problem with this in that we end up building clang in targets/pseudo/toolchain with -nostdinc (from local.init.mk) which leads to a missing header (which actually is staged, just lacks a -I or --sysroot to be captured). But really there's no reason to do this work since Makefile.inc1 does it fine and is maintained well to handle it. There's another subtle thing here, because we set CC=3DHOST_CC=3D/usr/bin= /cc when calling cross-tools from the pseudo/targets/bootstrap-tools build, it invokes the external compiler support in Makefile.inc1 which avoids building the bootstrap clang and some of the toolchain, leading us to have to do it from pseudo/targets/toolchain. I actually extended this logic to pass HOST_AS to avoid *more* redundant toolchain building in Makefile.inc1 from our own targets/pseduo/toolchain, before realizing thi= s. What I plan to do is make pseudo/targets/bootstrap-tools always build all of cross-tools,etc, from Makefile.inc1 respecting its own internal logic for when to bootstrap the compiler (without us telling it to skip the bootstrap compiler) and then add pseudo/targets/bootstrap-tools as a global DIRDEP. Given the use of cookies, this will only be done once per meta build, but it at least won't be a manual step anymore. For the record, I do plan to extend .MAKE.MODE=3Dmeta to buildworld and its bootstrapping as well, which will give a lot of incremental build improvements to it. This means that the meta build will then default to bootstrapping the compiler, which we really must do to build the source tree reliably. There's really no reason the meta build should default to not bootstrapping the compiler. Setting WITHOUT_CROSS_COMPILER or WITHOUT_CLANG_BOOTSTRAP will avoid this and use just the host compiler as the meta build does now. So there's no real problem for those people who want to skip the clang bootstrap. Then, I will work on the project of "building clang less" which will avoid building the bootstrap compiler for both the meta mode build and the buildworld build (and universe eventually) if /usr/bin/cc satisfies the needs (can cross compile the TARGET and is "new enough" compared to the version we want). This is not trivial but I think it is possible and it will make everyone happy! Related tidbit, using WITHOUT_CROSS_COMPILER (or WITHOUT_*_BOOTSTRAP) with buildworld leads to a broken build currently since it is the user basically asking to use their default external toolchain of /usr/bin/*, but the logic does not kick in to use --sysroot against WORLDTMP. I plan to fix this soon as well. --=20 Regards, Bryan Drewery --N0iSo68wTUxs2ADJAbjPufdr3QNtEgL1Q Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWRQq4AAoJEDXXcbtuRpfP2s4IAKz8U0Txtx135Kn9Dy6Zkgsv Inx/9ocZQGtJdvD/XX8AglIVUTXTqbEXK9KbtsHualD1UDdLkEtGA+w1aZ+j9L5V NZQ6XMJj35tNqyGPIkjHHFRtm68bZzGz7CZf7w0B/bz1EdhiS43ktbR7h3aBC6GE VF85rYQr9+IxLafj7v4u8PGWdPr2isLZz3W8AnZlruYUXVhDdf4B7lk7gwIGiYhM /zw4xjKLU/mA+9AISmFnVSpPYsUlcaAAjSFvIFi5Ozg0jGpF/Z3pU0ZKw+xt19gu UXgCAsoQxPWVmWGCbNdmjIui7zKm4sl0wcZtTgDGCzbn+DFeFctnwt2R1Oaa/18= =B3Vn -----END PGP SIGNATURE----- --N0iSo68wTUxs2ADJAbjPufdr3QNtEgL1Q--