From owner-freebsd-toolchain@freebsd.org Mon Aug 14 21:01:39 2017 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 55914DE46DB for ; Mon, 14 Aug 2017 21:01:39 +0000 (UTC) (envelope-from johannes@perceivon.net) Received: from mail-lf0-x22f.google.com (mail-lf0-x22f.google.com [IPv6:2a00:1450:4010:c07::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C59D06EC61 for ; Mon, 14 Aug 2017 21:01:38 +0000 (UTC) (envelope-from johannes@perceivon.net) Received: by mail-lf0-x22f.google.com with SMTP id o85so44683178lff.3 for ; Mon, 14 Aug 2017 14:01:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perceivon-net.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to; bh=ZqejgrW+7Ndj8nl3dDx61Aaqc5eYINfi7btjvLaBnR4=; b=EM1rKnZpgZ3DtzjPqxArdeQBcZC8dxSYnzDk4bz4aikC+SMgYwH7NOz1gINdC9t1ZN svUMKOXVhPiCgYSxxXZjzWc1EAIAGD+dmetM6K278OO+bVimFIxl5Cpae6Yn3Jg50CWg 7BQrwPFlrI02QPLYIva5EGVRcrM5xXvmSI2CQ0hAflSx45+dogYU2SEe2B0vnkMV7J/m zuqWpl5oeYCBUrmSMakRq0SeQ+IBwpCJxF35c0yqL0bK60+dPFt2P8Qia0+6Q5l2qBk/ xOGfuhskwU463c5pMlKEykiLy9/mbkn7haXIEmCgVeOsi8HDPh29rx6pVSw5lwVNvWAf BfGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to; bh=ZqejgrW+7Ndj8nl3dDx61Aaqc5eYINfi7btjvLaBnR4=; b=G56an0jB/gYLXiBImkpdtXxchD3bCaQRjBj/ypL+yj6uhmGTeS4S2d5MonSsYuW6Tv 2/GOrEHrP4QIvN73AYNs8bK5OYib/gDPIxuUHBk02z9FXNzFxa/6gQmGBF7fJdvGYPvy KFVKaVds3ytaGUXcodmbjU5/dHg8bHI+na6ozz8Dxj2FnpYIPtPY5MBuI5jF/9ivOitK iu405QrLWhorxatoMjySSpUViTlHrNkk26Z4j2skLkLfmbdiCxba2rui/oFvLlHX56wd z7Ou4sn16HUV/6iJ3VxjJIFvkCzc/1qk+XrKmkzups01IiObruAaTIxvJP7WMyyIXWrh Woiw== X-Gm-Message-State: AHYfb5gj0jjMuy5qxny8Pt6IVoyb0RnIS35+Lw8oqeosUjKAm9v7C3fi +0PHLmhKgp5vBmLSIltUILpCXQtHGtlwHHbbuIC06biO3xXym4T8TubFzB8bHGQqR/zToBH0np/ 4a1d6My1Ge5GT/TKoym+eCGX1XGarioGUYIhG033mB+VpJzgeEoP5ypUPyt9olD9aCqcV X-Received: by 10.25.192.19 with SMTP id q19mr7529012lff.170.1502744495382; Mon, 14 Aug 2017 14:01:35 -0700 (PDT) Received: from mx16 (101.177.50.84.sta.estpak.ee. [84.50.177.101]) by smtp.gmail.com with ESMTPSA id 23sm1626820lfu.23.2017.08.14.14.01.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Aug 2017 14:01:34 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by mx16 (OpenSMTPD) with ESMTP id 46e5bb9e; Tue, 15 Aug 2017 00:00:09 +0300 (EEST) Subject: Re: Buildfailures with ld.lld To: Dimitry Andric , Shawn Webb Cc: freebsd-toolchain@freebsd.org References: <20170814164058.dsh3bqg3kwxwv6dg@mutt-hbsd> <9CDB54BE-F695-4F22-AE0B-C6AF8657E86B@FreeBSD.org> <20170814174147.6iexz2fvhp7hl2ul@mutt-hbsd> From: Johannes Jost Meixner Organization: Perceivon Hosting Inc. Message-ID: <6b923837-927b-bf5a-9079-a3bcd33aeaf8@perceivon.net> Date: Tue, 15 Aug 2017 00:00:06 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="OTCdgMf6KhQ62GaPfHuKVtaxV4H0D2l7R" X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2017 21:01:39 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --OTCdgMf6KhQ62GaPfHuKVtaxV4H0D2l7R Content-Type: multipart/mixed; boundary="IumFmJw3hVG3LgKWO1Ax8hegkESiNjCnc"; protected-headers="v1" From: Johannes Jost Meixner To: Dimitry Andric , Shawn Webb Cc: freebsd-toolchain@freebsd.org Message-ID: <6b923837-927b-bf5a-9079-a3bcd33aeaf8@perceivon.net> Subject: Re: Buildfailures with ld.lld References: <20170814164058.dsh3bqg3kwxwv6dg@mutt-hbsd> <9CDB54BE-F695-4F22-AE0B-C6AF8657E86B@FreeBSD.org> <20170814174147.6iexz2fvhp7hl2ul@mutt-hbsd> In-Reply-To: --IumFmJw3hVG3LgKWO1Ax8hegkESiNjCnc Content-Type: multipart/mixed; boundary="------------9067F3E2FBD027A42F183879" Content-Language: en-US This is a multi-part message in MIME format. --------------9067F3E2FBD027A42F183879 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Now after some more testing it appears that this is due to HardenedBSD setting WITH_LLD_BOOTSTRAP and me setting WITHOUT_LLD_IS_LD=3Dyes, which isn't supported in src/lib/clang/llvm/Makefile in this combination. I've tested that the patch attached builds the bootstrapped lld successfully and fixes the initial errors I saw. Best regards, Johannes Meixner Perceivon O=DC Pikk 7-17 10123 Tallinn tel: +372 5855 1779 web: http://www.perceivon.net On 08/14/2017 21:01, Dimitry Andric wrote: > On 14 Aug 2017, at 19:41, Shawn Webb wrote= : >> >> On Mon, Aug 14, 2017 at 07:38:28PM +0200, Dimitry Andric wrote: >>> On 14 Aug 2017, at 18:40, Shawn Webb wro= te: >>>> >>>> On Mon, Aug 14, 2017 at 07:28:39PM +0300, Johannes Jost Meixner wrot= e: >>>>> I'm seeing a few `undefined references` trying to build recent base= on >>>>> HardenedBSD with clang 5.0.0: >>>>> >>>>> https://dpaste.de/FThb/raw >>>>> >>>>> Would you know what I am missing here? >>>> >>>> Hey Johannes, >>>> >>>> It looks like contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugPubTable.cp= p >>>> isn't included in the Makefile for usr.bin/lld. >>>> >>>> I'm wondering if the lib/DebugInfo/DWARF files should be included in= >>>> usr.bin/lld/Makefile. dim@, could you verify? >>> >>> Those files are already in lib/clang/libllvm/Makefile. How can this >>> particular error be reproduced? I just did a fresh clone of hardened= bsd >>> master, and it built just fine for me, with an empty make.conf and >>> src.conf. >> >> Johannes is trying to build ports-mgmt/pkg in HardenedBSD >> 12-CURRENT/amd64, where MK_LLD_IS_LD is default to yes. If you use the= >> HardenedBSD ports tree, ports-mgmt/pkg is patched to allow a configure= >> argument to enable SafeStack for pkg(8) and pkg-static(8) >> (--enable-safestack). >> >> Reproduction steps: >> >> 1. Install HardenedBSD 12-CURRENT/amd64 >> 2. Fetch HardenedBSD's ports tree >> 3. Attempt to build ports-mgmt/pkg >=20 > I don't see why pkg is trying to build lld? It's just a package > management tool. Or are you building some sort of jail, e.g. in > poudriere? >=20 > For me, it's easiest to have a reproduction scenario where I can build > either FreeBSD head or HardenedBSD master, with some specific src.conf > settings. So maybe MK_LLD_IS_LD would cause this problem? >=20 > -Dimitry >=20 --------------9067F3E2FBD027A42F183879 Content-Type: text/x-patch; name="lld_bootstrap.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="lld_bootstrap.diff" diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile index aa1a3f313b4..dc80968c67f 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -1244,7 +1244,7 @@ SRCS_EXT+=3D Transforms/Vectorize/Vectorize.cpp SRCS_EXT+=3D XRay/InstrumentationMap.cpp =20 SRCS_ALL+=3D ${SRCS_MIN} -.if !defined(TOOLS_PREFIX) || ${MK_LLD_IS_LD} !=3D "no" +.if !defined(TOOLS_PREFIX) || ${MK_LLD_IS_LD} !=3D "no" || ${MK_LLD_BOOT= STRAP} !=3D "no" SRCS_ALL+=3D ${SRCS_MIW} .endif .if ${MK_CLANG_EXTRAS} !=3D "no" --------------9067F3E2FBD027A42F183879-- --IumFmJw3hVG3LgKWO1Ax8hegkESiNjCnc-- --OTCdgMf6KhQ62GaPfHuKVtaxV4H0D2l7R Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIyBAEBCAAdFiEEwY8kko8dNupPoLLvSWqdcGJQ1AIFAlmSD1kACgkQSWqdcGJQ 1AKB1g/2OT/GeYqO2m7fBTPlPxPE8NJ7qsqoguMNtG3i4u/t7c0JNS9DG5v7I9rO nFuEYOr+nriyiQr9uwYAdXhZXdbOV7gGl5V3nmLGSK5eQMFbsj79ByIiqVDM7neB pz2l2Yu5tOm3IJ6Q/xSMUqnzfQgP5kzFJx/ZJb8Y4Li/al5oPnQtndOB07p0lPdR YgEMSZa5mMtuoDekEGWeZy3aFZU6f9tJ5+QOMLpsSGrw1I8PmsGifvOjdsnIqNcR TqwFq73UlwZUPfdTQg07tzj17wcpL4cOga7ck7TW6ozST1K9FU6kPG+JCGfKJlGY WP9/RDTC4nSeWkpM5VM6Ird6wvB57blJO/B6ZYCDrQh6jmYzDLM7+j52lztAozCO mb7b4Url7TIZ8PdRaMaEcxxgvTlF53mzTVqnrGFSlhQJU8eLLpxW7tGWeHZ/4pii tAd2Xll7YLmAQ2yytowk/ws2pjX9vc/sHkWyHI1qvvLgSISHBy7BVmDGDaXogghq kB3HvyfD7bLvhhqs6kOJ3WSgQJ1XXfgloQQ0K8W9DPxbstcucAVrX2OejqC/ie0/ 8lNdzWBbLMh6HABdwwpABkFknQnsNQwKgXWD593MLeAJRX0Z3mDRfUydalwZ4RSq n+Y1nyIJk2zB0R13mX8FcZtb+xrsI2a6wh+EIlhY/TGh/p82yA== =bz+J -----END PGP SIGNATURE----- --OTCdgMf6KhQ62GaPfHuKVtaxV4H0D2l7R--