Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jan 2018 10:26:59 -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:  <20180112152659.rqkvhzny6hzczv3k@mutt-hbsd>
In-Reply-To: <7D27872B-1FAF-4DCE-AD90-B8F9EB866C75@FreeBSD.org>
References:  <20180112143851.wzp373hapbsxyntu@mutt-hbsd> <7D27872B-1FAF-4DCE-AD90-B8F9EB866C75@FreeBSD.org>

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

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

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: und=
efined symbol: compressBound
> >>>> referenced by Compression.cpp:63 (/scratch/hbsd-playground/contrib/l=
lvm/lib/Support/Compression.cpp:63)
> >>>>              Compression.o:(llvm::zlib::compress(llvm::StringRef, ll=
vm::SmallVectorImpl<char>&, llvm::zlib::CompressionLevel)) in archive /usr/=
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

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
> to usr.bin/clang/llvm-extract/Makefile locally, and see if that fixes it
> for you?

I'll give that a shot, but it seems the error is within lld itself.

>=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?

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
> -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

Great to hear!

[1]: https://github.com/hardenedbsd/hardenedbsd-playground/tree/hardened/cu=
rrent/retpoline

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.

Thanks again,

--=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

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

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

iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlpY08EACgkQaoRlj1JF
bu7XwxAAvoFpROHxhjS0GKkAY0cvyrQP+kme0C2Kq1FjmcN14pZ02QJR+fWvc7vt
7opyfkJ7eS9KsCJQoCeO8iYsYky70l2rrQGOyUArMQ2+nc+hVuuQDKjtUGQ2lm0/
uedrbx565738dacHPyLjBVT11sjgJExjCAhrUDKk93ZHQvlg99JsdLtrooOyoitq
oajaQOBNT3VzggAYI04n0PfIziVmDHu+GEJjWYVccVQ8FWuDPRB7lYtrguAXxp1F
ZN4qhdIDUCVgvqpkVcLFszOZB9LLuMSKHSKEERODsQbO8pltYupX011dbSfkf+Bt
j1fG7eq2KYlDv2dXwg6QeQ3BbqgnGK/sgvIUMh8lpDbXsfp5JGqzTwFLME7rLR80
1C1nlE4UvGyRNJAQ7u90GdkwaAPAQomF9GAnEy2I8/sfa4oulqLnpXFPP5JCYP0S
uDZvqSPo6mPIPRgg6QSc1l95dccH86KTIAF56zh1OIhecSGyqllGfis9edNW51R2
/2qU4BUx9lmW+WbJnys/Igjiq0Y7M2XCL8FXdi1Q16Rm2JDu5FW0fAP9sNHRmcKd
kNte3YbnovbJyCgMDYxc7lHab0PWdCal7lSUfEAR8Ch01BtsSLet3cia5ykc8xgp
aFksDWyJfn1RI7DeaXiiZ8SUnshgnmsuEGNV4hzogKTBSpcrjic=
=8+ei
-----END PGP SIGNATURE-----

--5reuvyv7mw6kigem--



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