Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jan 2018 12:04:46 -0500
From:      Shawn Webb <shawn.webb@hardenedbsd.org>
To:        Dimitry Andric <dim@FreeBSD.org>
Cc:        freebsd-toolchain@freebsd.org
Subject:   Re: projects/clang600-import and ld.lld
Message-ID:  <20180112170446.knmihdnrrsqzwyba@mutt-hbsd>
In-Reply-To: <20180112152659.rqkvhzny6hzczv3k@mutt-hbsd>
References:  <20180112143851.wzp373hapbsxyntu@mutt-hbsd> <7D27872B-1FAF-4DCE-AD90-B8F9EB866C75@FreeBSD.org> <20180112152659.rqkvhzny6hzczv3k@mutt-hbsd>

next in thread | previous in thread | raw e-mail | index | archive | help

--miw4ckkvngodbw6t
Content-Type: multipart/mixed; boundary="pumelxrelb6mbmqh"
Content-Disposition: inline


--pumelxrelb6mbmqh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Jan 12, 2018 at 10:26:59AM -0500, Shawn Webb wrote:
> On Fri, Jan 12, 2018 at 04:17:50PM +0100, Dimitry Andric wrote:
> > On 12 Jan 2018, at 15:38, Shawn Webb <shawn.webb@hardenedbsd.org> wrote:
> > >=20
> > > I know it's early in the game, but I thought I'd report this anyways.
> > > I have lld as the default linker (MK_LLD_IS_LD=3Dyes). When lld tries=
 to
> > > link usr.bin/clang/llvm-extract/llvm-extract, lld errors out with some
> > > unresolved symbols. The log is below.
> > >=20
> > > Has anyone else run into this?
> > >=20
> > > /usr/obj/scratch/hbsd-playground/amd64.amd64/tmp/usr/bin/ld: error: u=
ndefined symbol: compressBound
> > >>>> referenced by Compression.cpp:63 (/scratch/hbsd-playground/contrib=
/llvm/lib/Support/Compression.cpp:63)
> > >>>>              Compression.o:(llvm::zlib::compress(llvm::StringRef, =
llvm::SmallVectorImpl<char>&, llvm::zlib::CompressionLevel)) in archive /us=
r/obj/scratch/hbsd-playground/amd64.amd64
> > > /lib/clang/libllvm/libllvm.a
> >=20
> > It links fine for me, and I haven't heard any other reports of this, but
> > can you please try adding a line:
> >=20
> > LIBADD+=3D        z
>=20
> Can do. I'm also using llvm-ar as the default ar and ranlib, llvm-nm
> as the default nm, and llvm-objdump as the default objdump. It might
> be the combination (I kinda suspect llvm-ar) that could be the issue.
> It's possible there's a regression in llvm-ar.
>=20
> >=20
> > to usr.bin/clang/llvm-extract/Makefile locally, and see if that fixes it
> > for you?
>=20
> I'll give that a shot, but it seems the error is within lld itself.
>=20
> >=20
> > At some point I've tried minimizing the number of libraries pulled in,
> > and on my systems llvm-extract didn't use any of the compression
> > functions.  If you compile it differently, it could end up pulling in
> > those functions anyway.
> >=20
> > Do you have any non-default settings in make.conf or src.conf?
>=20
> Nope. This is HardenedBSD's source tree, though, so we do have several
> different WITH_* flags. I'm working on pulling in the retpoline patch
> into a feature branch in the HardenedBSD Playground repo[1].
>=20
> >=20
> > -Dimitry
> >=20
> > P.S. The clang600-import branch should be mostly ready for general
> > consumption, except for a number of ports that are still problematic,
> > see https://bugs.freebsd.org/224669
> >=20
>=20
> Great to hear!
>=20
> [1]: https://github.com/hardenedbsd/hardenedbsd-playground/tree/hardened/=
current/retpoline
>=20
> Thanks for the help. I'll do more investigating and report back. In
> the meantime, if you have any further ideas, please let me know.

I've attached a patch which allows buildworld to succeed on
HardenedBSD's retpoline branch.

Thanks,

--=20
Shawn Webb
Cofounder and Security Engineer
HardenedBSD

Tor-ified Signal:    +1 443-546-8752
GPG Key ID:          0x6A84658F52456EEE
GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE

--pumelxrelb6mbmqh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="clang600.patch.txt"
Content-Transfer-Encoding: quoted-printable

diff --git a/lib/clang/liblldb/Makefile b/lib/clang/liblldb/Makefile
index 9c99507acf9..ca6ce80a060 100644
--- a/lib/clang/liblldb/Makefile
+++ b/lib/clang/liblldb/Makefile
@@ -19,6 +19,7 @@ SRCS+=3D		API/SBAttachInfo.cpp
 SRCS+=3D		API/SBBlock.cpp
 SRCS+=3D		API/SBBreakpoint.cpp
 SRCS+=3D		API/SBBreakpointLocation.cpp
+SRCS+=3D		API/SBBreakpointOptionCommon.cpp
 SRCS+=3D		API/SBBroadcaster.cpp
 SRCS+=3D		API/SBCommandInterpreter.cpp
 SRCS+=3D		API/SBCommandReturnObject.cpp
@@ -47,6 +48,7 @@ SRCS+=3D		API/SBModule.cpp
 SRCS+=3D		API/SBModuleSpec.cpp
 SRCS+=3D		API/SBPlatform.cpp
 SRCS+=3D		API/SBProcess.cpp
+SRCS+=3D		API/SBProcessInfo.cpp
 SRCS+=3D		API/SBQueue.cpp
 SRCS+=3D		API/SBQueueItem.cpp
 SRCS+=3D		API/SBSection.cpp
diff --git a/usr.bin/clang/llvm-extract/Makefile b/usr.bin/clang/llvm-extra=
ct/Makefile
index 6079e1c0006..cc356a060c4 100644
--- a/usr.bin/clang/llvm-extract/Makefile
+++ b/usr.bin/clang/llvm-extract/Makefile
@@ -5,4 +5,6 @@ PROG_CXX=3D	llvm-extract
 SRCDIR=3D		tools/llvm-extract
 SRCS+=3D		llvm-extract.cpp
=20
+LIBADD+=3D	z
+
 .include "../llvm.prog.mk"

--pumelxrelb6mbmqh--

--miw4ckkvngodbw6t
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlpY6qsACgkQaoRlj1JF
bu64SQ//b5ZxKajjoUvxgZgo0RFnY3JfsOI8V1X24oEbvZOhjwU2svSzzUsmiIR+
y0yKxrt2BGzwqGeqHcSjEMUz8iPX7bgCgIPo1WrckNCzCYRatJ7N2MOT1uQkq6Xq
4TOI0JAPO9TC5d2FuMMuBpjATAtULVRrO7hLCxUtFkZaw7dnGo6zYGYN0fsQhaBM
cNTWUUfwFXmBBSIs6dpqOECoNVSH+z4SSd+ghkpgo+xG+LL8gvipCTgj5fNO18aq
h/XugmEuyR2zlHlp4VHefw0sKgTg4koVeaUq21Yd30CXgUXeZO5WB1XPgaNquLOm
DCLMlaL8DI5NMWS/OtNXTjk7DsdeGMpdS1bOJ4FrDhXl0H5ijhJbF/8IL1KiECt3
2us8kIjE8n9REPEkbeEjrVq2zJmVXX6mBRIR+PHF0rVArc8m7Jby/tT7pL5pKmuU
tCwx1bcJoaAerKBuBtRSqNKSMHy3gqzxdQ4yR8Z+eJSk5g9GMQbh8Io2Qoj04mCe
dmIKq3pJpelog6WcCc2jCy18sVW3qwUMEdu91eCNCsSsOldFo2I7YEZ9eQzwz3dZ
WtGIzFbNrRLJWnZfIqlqHSPMlX/Kalj1R87nmmWvBpkwgsHIOzOH3yATmt7oapmN
V4sgRN3YrETbbXTbn5f2tfz1eHAwr1PezHbpl/6k/nhvNTQVSmk=
=3YgX
-----END PGP SIGNATURE-----

--miw4ckkvngodbw6t--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180112170446.knmihdnrrsqzwyba>