Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Aug 2017 00:00:06 +0300
From:      Johannes Jost Meixner <johannes@perceivon.net>
To:        Dimitry Andric <dim@FreeBSD.org>, Shawn Webb <shawn.webb@hardenedbsd.org>
Cc:        freebsd-toolchain@freebsd.org
Subject:   Re: Buildfailures with ld.lld
Message-ID:  <6b923837-927b-bf5a-9079-a3bcd33aeaf8@perceivon.net>
In-Reply-To: <F9FE3A89-8949-4CCF-8DC0-D22D2B27CD7C@FreeBSD.org>
References:  <c073d143-ec4c-7a99-e58f-a7c1021193ac@perceivon.net> <20170814164058.dsh3bqg3kwxwv6dg@mutt-hbsd> <9CDB54BE-F695-4F22-AE0B-C6AF8657E86B@FreeBSD.org> <20170814174147.6iexz2fvhp7hl2ul@mutt-hbsd> <F9FE3A89-8949-4CCF-8DC0-D22D2B27CD7C@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <johannes@perceivon.net>
To: Dimitry Andric <dim@FreeBSD.org>, Shawn Webb <shawn.webb@hardenedbsd.org>
Cc: freebsd-toolchain@freebsd.org
Message-ID: <6b923837-927b-bf5a-9079-a3bcd33aeaf8@perceivon.net>
Subject: Re: Buildfailures with ld.lld
References: <c073d143-ec4c-7a99-e58f-a7c1021193ac@perceivon.net>
 <20170814164058.dsh3bqg3kwxwv6dg@mutt-hbsd>
 <9CDB54BE-F695-4F22-AE0B-C6AF8657E86B@FreeBSD.org>
 <20170814174147.6iexz2fvhp7hl2ul@mutt-hbsd>
 <F9FE3A89-8949-4CCF-8DC0-D22D2B27CD7C@FreeBSD.org>
In-Reply-To: <F9FE3A89-8949-4CCF-8DC0-D22D2B27CD7C@FreeBSD.org>

--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 <shawn.webb@hardenedbsd.org> wrote=
:
>>
>> On Mon, Aug 14, 2017 at 07:38:28PM +0200, Dimitry Andric wrote:
>>> On 14 Aug 2017, at 18:40, Shawn Webb <shawn.webb@hardenedbsd.org> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6b923837-927b-bf5a-9079-a3bcd33aeaf8>