Re: elfdump [a forward to toolchain]

2018-01-12 Thread Mark Millard
Johnny Eriksson bygg at cafax.se wrote on
Fri Jan 12 10:59:10 UTC 2018 :

> When parsing a 64-bit big-endian elf file (on a 64-bit X86-64 system),
> the sh_flags entry in the section header is mis-parsed since the routine
> used only reads a 32-bit value.
> 
> *** elfdump.c   Fri Jan 12 10:43:35 2018
> --- elfdump.c.org   Fri Jan 12 10:42:11 2018
> ***
> *** 798,804 
>   v = (char *)sh + i * shentsize;
>   name = elf_get_word(e, v, SH_NAME);
>   type = elf_get_word(e, v, SH_TYPE);
> !   flags = elf_get_size(e, v, SH_FLAGS);
>   addr = elf_get_addr(e, v, SH_ADDR);
>   offset = elf_get_off(e, v, SH_OFFSET);
>   size = elf_get_size(e, v, SH_SIZE);
> --- 798,804 
>   v = (char *)sh + i * shentsize;
>   name = elf_get_word(e, v, SH_NAME);
>   type = elf_get_word(e, v, SH_TYPE);
> !   flags = elf_get_word(e, v, SH_FLAGS);
>   addr = elf_get_addr(e, v, SH_ADDR);
>   offset = elf_get_off(e, v, SH_OFFSET);
>   size = elf_get_size(e, v, SH_SIZE);
> 
> Possibly the (new) call to elf_get_size() should be changed to something
> a little bit more informative.
> 
> --Johnny

===
Mark Millard
markmi at dsl-only.net

___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


Re: projects/clang600-import and ld.lld

2018-01-12 Thread Shawn Webb
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
> > 
> > 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

2018-01-12 Thread Shawn Webb
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
> 
> 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

2018-01-12 Thread Dimitry Andric
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

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

2018-01-12 Thread Shawn Webb
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


[Bug 216080] science/bddsolve: fails to build with lang/gcc6 or later

2018-01-12 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216080

Jan Beich  changed:

   What|Removed |Added

 Blocks||224669

--- Comment #7 from Jan Beich  ---
Clang 6 defaults to C++14, so pkg-fallout@ will complain soon.


Referenced Bugs:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224669
[Bug 224669] [exp-run] Against projects/clang600-import branch
-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"