projects/clang600-import and ld.lld
Shawn Webb
shawn.webb at hardenedbsd.org
Fri Jan 12 17:04:58 UTC 2018
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 at hardenedbsd.org> wrote:
> > >
> > > 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=yes). When lld tries to
> > > link usr.bin/clang/llvm-extract/llvm-extract, lld errors out with some
> > > unresolved symbols. The log is below.
> > >
> > > Has anyone else run into this?
> > >
> > > /usr/obj/scratch/hbsd-playground/amd64.amd64/tmp/usr/bin/ld: error: undefined 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 /usr/obj/scratch/hbsd-playground/amd64.amd64
> > > /lib/clang/libllvm/libllvm.a
> >
> > It links fine for me, and I haven't heard any other reports of this, but
> > can you please try adding a line:
> >
> > LIBADD+= 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.
>
> >
> > 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.
>
> >
> > 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.
> >
> > 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].
>
> >
> > -Dimitry
> >
> > 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
> >
>
> Great to hear!
>
> [1]: https://github.com/hardenedbsd/hardenedbsd-playground/tree/hardened/current/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.
I've attached a patch which allows buildworld to succeed on
HardenedBSD's retpoline branch.
Thanks,
--
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
-------------- next part --------------
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+= API/SBAttachInfo.cpp
SRCS+= API/SBBlock.cpp
SRCS+= API/SBBreakpoint.cpp
SRCS+= API/SBBreakpointLocation.cpp
+SRCS+= API/SBBreakpointOptionCommon.cpp
SRCS+= API/SBBroadcaster.cpp
SRCS+= API/SBCommandInterpreter.cpp
SRCS+= API/SBCommandReturnObject.cpp
@@ -47,6 +48,7 @@ SRCS+= API/SBModule.cpp
SRCS+= API/SBModuleSpec.cpp
SRCS+= API/SBPlatform.cpp
SRCS+= API/SBProcess.cpp
+SRCS+= API/SBProcessInfo.cpp
SRCS+= API/SBQueue.cpp
SRCS+= API/SBQueueItem.cpp
SRCS+= API/SBSection.cpp
diff --git a/usr.bin/clang/llvm-extract/Makefile b/usr.bin/clang/llvm-extract/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= llvm-extract
SRCDIR= tools/llvm-extract
SRCS+= llvm-extract.cpp
+LIBADD+= z
+
.include "../llvm.prog.mk"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-toolchain/attachments/20180112/5a5f8dda/attachment.sig>
More information about the freebsd-toolchain
mailing list