Re: projects/clang600-import and ld.lld
On 12 Jan 2018, at 18:04, Shawn Webbwrote: > > 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 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&, llvm::zlib::CompressionLevel)) in archive >>> /usr/obj/scratch/hbsd-playground/amd64.amd64 /lib/clang/libllvm/libllvm.a ... > I've attached a patch which allows buildworld to succeed on > HardenedBSD's retpoline branch. Committed in r327918. -Dimitry signature.asc Description: Message signed with OpenPGP
Re: projects/clang600-import and ld.lld
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 Webbwrote: > > > > > > 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&, 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 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" signature.asc Description: PGP signature
Re: projects/clang600-import and ld.lld
On Fri, Jan 12, 2018 at 04:17:50PM +0100, Dimitry Andric wrote: > On 12 Jan 2018, at 15:38, Shawn Webbwrote: > > > > 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&, 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. Thanks again, -- 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 signature.asc Description: PGP signature
Re: projects/clang600-import and ld.lld
On 12 Jan 2018, at 15:38, Shawn Webbwrote: > > 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&, 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 to usr.bin/clang/llvm-extract/Makefile locally, and see if that fixes it for you? 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? -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 signature.asc Description: Message signed with OpenPGP
projects/clang600-import and ld.lld
Hey All, 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&, llvm::zlib::CompressionLevel)) in archive >>> /usr/obj/scratch/hbsd-playground/amd64.amd64 /lib/clang/libllvm/libllvm.a /usr/obj/scratch/hbsd-playground/amd64.amd64/tmp/usr/bin/ld: error: undefined symbol: compress2 >>> referenced by Compression.cpp:66 >>> (/scratch/hbsd-playground/contrib/llvm/lib/Support/Compression.cpp:66) >>> Compression.o:(llvm::zlib::compress(llvm::StringRef, >>> llvm::SmallVectorImpl&, llvm::zlib::CompressionLevel)) in archive >>> /usr/obj/scratch/hbsd-playground/amd64.amd64 /lib/clang/libllvm/libllvm.a /usr/obj/scratch/hbsd-playground/amd64.amd64/tmp/usr/bin/ld: error: undefined symbol: uncompress >>> referenced by Compression.cpp:79 >>> (/scratch/hbsd-playground/contrib/llvm/lib/Support/Compression.cpp:79) >>> Compression.o:(llvm::zlib::uncompress(llvm::StringRef, char*, >>> unsigned long&)) in archive >>> /usr/obj/scratch/hbsd-playground/amd64.amd64/lib/clang/libllvm/libllvm.a /usr/obj/scratch/hbsd-playground/amd64.amd64/tmp/usr/bin/ld: error: undefined symbol: crc32 >>> referenced by Compression.cpp:98 >>> (/scratch/hbsd-playground/contrib/llvm/lib/Support/Compression.cpp:98) >>> Compression.o:(llvm::zlib::crc32(llvm::StringRef)) in archive >>> /usr/obj/scratch/hbsd-playground/amd64.amd64/lib/clang/libllvm/libllvm.a c++: error: linker command failed with exit code 1 (use -v to see invocation) --- llvm-extract.full --- *** [llvm-extract.full] Error code 1 make[5]: stopped in /scratch/hbsd-playground/usr.bin/clang/llvm-extract 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 signature.asc Description: PGP signature