Re: git: 1b85b68da0b2 - main - llvm-readobj: Attach to buildsystem

2021-10-15 Thread Shawn Webb
On Thu, Oct 14, 2021 at 04:19:38PM +, Alex Richardson wrote:
> The branch main has been updated by arichardson:
> 
> URL: 
> https://cgit.FreeBSD.org/src/commit/?id=1b85b68da0b2de80e0e3aefb1ade226bcf3951cb
> 
> commit 1b85b68da0b2de80e0e3aefb1ade226bcf3951cb
> Author: Cameron Katri 
> AuthorDate: 2021-10-14 16:00:27 +
> Commit: Alex Richardson 
> CommitDate: 2021-10-14 16:18:05 +
> 
> llvm-readobj: Attach to buildsystem
> 
> Also install it as readelf when MK_LLVM_BINUTILS is set.
> 
> Reviewed By:dim, arichardson
> Differential Revision: https://reviews.freebsd.org/D32058
> ---
>  lib/clang/libllvm/Makefile|  21 +-
>  tools/build/mk/OptionalObsoleteFiles.inc  |   4 +
>  usr.bin/clang/Makefile|   1 +
>  usr.bin/clang/llvm-readobj/Makefile   |  31 +++
>  usr.bin/clang/llvm-readobj/llvm-readelf.1 | 272 
>  usr.bin/clang/llvm-readobj/llvm-readobj.1 | 403 
> ++
>  6 files changed, 724 insertions(+), 8 deletions(-)
> 
> diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile
> index 7eaedf65dcb3..cb9ab974abc5 100644
> --- a/lib/clang/libllvm/Makefile
> +++ b/lib/clang/libllvm/Makefile
> @@ -148,9 +148,13 @@ SRCS_MIN+=   Analysis/VectorUtils.cpp
>  SRCS_MIN+=   AsmParser/LLLexer.cpp
>  SRCS_MIN+=   AsmParser/LLParser.cpp
>  SRCS_MIN+=   AsmParser/Parser.cpp
> +SRCS_MIN+=   BinaryFormat/AMDGPUMetadataVerifier.cpp
>  SRCS_MIN+=   BinaryFormat/Dwarf.cpp
>  SRCS_MIN+=   BinaryFormat/Magic.cpp
>  SRCS_MIN+=   BinaryFormat/MachO.cpp
> +SRCS_MIN+=   BinaryFormat/MsgPackDocument.cpp
> +SRCS_MIN+=   BinaryFormat/MsgPackDocumentYAML.cpp
> +SRCS_MIN+=   BinaryFormat/MsgPackReader.cpp

Hey Alex,

You'll also want to add BinaryFormat/MsgPackWriter.cpp. Adding that
file fixes the build for HardenedBSD, since we use LTO, CFI, and
SafeStack in base.

Thanks,

-- 
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc


signature.asc
Description: PGP signature


Re: git: 1b85b68da0b2 - main - llvm-readobj: Attach to buildsystem

2021-10-14 Thread Alexander Richardson
On Thu, 14 Oct 2021 at 17:41, Jessica Clarke  wrote:
>
> On 14 Oct 2021, at 17:19, Alex Richardson  wrote:
> >
> > The branch main has been updated by arichardson:
> >
> > URL: 
> > https://cgit.FreeBSD.org/src/commit/?id=1b85b68da0b2de80e0e3aefb1ade226bcf3951cb
> >
> > commit 1b85b68da0b2de80e0e3aefb1ade226bcf3951cb
> > Author: Cameron Katri 
> > AuthorDate: 2021-10-14 16:00:27 +
> > Commit: Alex Richardson 
> > CommitDate: 2021-10-14 16:18:05 +
> >
> >llvm-readobj: Attach to buildsystem
> >
> >Also install it as readelf when MK_LLVM_BINUTILS is set.
> >
> >Reviewed By:dim, arichardson
> >Differential Revision: https://reviews.freebsd.org/D32058
>
> MFC to stable/13 intended like the other MK_LLVM_BINUTILS patches?
>
> Jess
>

Yes indeed, this should be MFC'd.

Alex



Re: git: 1b85b68da0b2 - main - llvm-readobj: Attach to buildsystem

2021-10-14 Thread Jessica Clarke
On 14 Oct 2021, at 17:19, Alex Richardson  wrote:
> 
> The branch main has been updated by arichardson:
> 
> URL: 
> https://cgit.FreeBSD.org/src/commit/?id=1b85b68da0b2de80e0e3aefb1ade226bcf3951cb
> 
> commit 1b85b68da0b2de80e0e3aefb1ade226bcf3951cb
> Author: Cameron Katri 
> AuthorDate: 2021-10-14 16:00:27 +
> Commit: Alex Richardson 
> CommitDate: 2021-10-14 16:18:05 +
> 
>llvm-readobj: Attach to buildsystem
> 
>Also install it as readelf when MK_LLVM_BINUTILS is set.
> 
>Reviewed By:dim, arichardson
>Differential Revision: https://reviews.freebsd.org/D32058

MFC to stable/13 intended like the other MK_LLVM_BINUTILS patches?

Jess




git: 1b85b68da0b2 - main - llvm-readobj: Attach to buildsystem

2021-10-14 Thread Alex Richardson
The branch main has been updated by arichardson:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=1b85b68da0b2de80e0e3aefb1ade226bcf3951cb

commit 1b85b68da0b2de80e0e3aefb1ade226bcf3951cb
Author: Cameron Katri 
AuthorDate: 2021-10-14 16:00:27 +
Commit: Alex Richardson 
CommitDate: 2021-10-14 16:18:05 +

llvm-readobj: Attach to buildsystem

Also install it as readelf when MK_LLVM_BINUTILS is set.

Reviewed By:dim, arichardson
Differential Revision: https://reviews.freebsd.org/D32058
---
 lib/clang/libllvm/Makefile|  21 +-
 tools/build/mk/OptionalObsoleteFiles.inc  |   4 +
 usr.bin/clang/Makefile|   1 +
 usr.bin/clang/llvm-readobj/Makefile   |  31 +++
 usr.bin/clang/llvm-readobj/llvm-readelf.1 | 272 
 usr.bin/clang/llvm-readobj/llvm-readobj.1 | 403 ++
 6 files changed, 724 insertions(+), 8 deletions(-)

diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile
index 7eaedf65dcb3..cb9ab974abc5 100644
--- a/lib/clang/libllvm/Makefile
+++ b/lib/clang/libllvm/Makefile
@@ -148,9 +148,13 @@ SRCS_MIN+= Analysis/VectorUtils.cpp
 SRCS_MIN+= AsmParser/LLLexer.cpp
 SRCS_MIN+= AsmParser/LLParser.cpp
 SRCS_MIN+= AsmParser/Parser.cpp
+SRCS_MIN+= BinaryFormat/AMDGPUMetadataVerifier.cpp
 SRCS_MIN+= BinaryFormat/Dwarf.cpp
 SRCS_MIN+= BinaryFormat/Magic.cpp
 SRCS_MIN+= BinaryFormat/MachO.cpp
+SRCS_MIN+= BinaryFormat/MsgPackDocument.cpp
+SRCS_MIN+= BinaryFormat/MsgPackDocumentYAML.cpp
+SRCS_MIN+= BinaryFormat/MsgPackReader.cpp
 SRCS_MIN+= BinaryFormat/Wasm.cpp
 SRCS_MIN+= BinaryFormat/XCOFF.cpp
 SRCS_MIN+= Bitcode/Reader/BitReader.cpp
@@ -434,14 +438,14 @@ SRCS_MIN+=DebugInfo/CodeView/CVTypeVisitor.cpp
 SRCS_MIN+= DebugInfo/CodeView/CodeViewError.cpp
 SRCS_MIN+= DebugInfo/CodeView/CodeViewRecordIO.cpp
 SRCS_MIN+= DebugInfo/CodeView/ContinuationRecordBuilder.cpp
-SRCS_EXT+= DebugInfo/CodeView/DebugChecksumsSubsection.cpp
+SRCS_MIN+= DebugInfo/CodeView/DebugChecksumsSubsection.cpp
 SRCS_EXT+= DebugInfo/CodeView/DebugCrossExSubsection.cpp
 SRCS_EXT+= DebugInfo/CodeView/DebugCrossImpSubsection.cpp
-SRCS_EXT+= DebugInfo/CodeView/DebugFrameDataSubsection.cpp
-SRCS_EXT+= DebugInfo/CodeView/DebugInlineeLinesSubsection.cpp
-SRCS_EXT+= DebugInfo/CodeView/DebugLinesSubsection.cpp
-SRCS_EXT+= DebugInfo/CodeView/DebugStringTableSubsection.cpp
-SRCS_EXT+= DebugInfo/CodeView/DebugSubsection.cpp
+SRCS_MIN+= DebugInfo/CodeView/DebugFrameDataSubsection.cpp
+SRCS_MIN+= DebugInfo/CodeView/DebugInlineeLinesSubsection.cpp
+SRCS_MIN+= DebugInfo/CodeView/DebugLinesSubsection.cpp
+SRCS_MIN+= DebugInfo/CodeView/DebugStringTableSubsection.cpp
+SRCS_MIN+= DebugInfo/CodeView/DebugSubsection.cpp
 SRCS_EXT+= DebugInfo/CodeView/DebugSubsectionRecord.cpp
 SRCS_EXT+= DebugInfo/CodeView/DebugSubsectionVisitor.cpp
 SRCS_EXT+= DebugInfo/CodeView/DebugSymbolRVASubsection.cpp
@@ -449,9 +453,9 @@ SRCS_EXT+=  DebugInfo/CodeView/DebugSymbolsSubsection.cpp
 SRCS_MIN+= DebugInfo/CodeView/EnumTables.cpp
 SRCS_MIN+= DebugInfo/CodeView/Formatters.cpp
 SRCS_MIN+= DebugInfo/CodeView/GlobalTypeTableBuilder.cpp
-SRCS_EXT+= DebugInfo/CodeView/LazyRandomTypeCollection.cpp
+SRCS_MIN+= DebugInfo/CodeView/LazyRandomTypeCollection.cpp
 SRCS_MIN+= DebugInfo/CodeView/Line.cpp
-SRCS_EXT+= DebugInfo/CodeView/MergingTypeTableBuilder.cpp
+SRCS_MIN+= DebugInfo/CodeView/MergingTypeTableBuilder.cpp
 SRCS_MIN+= DebugInfo/CodeView/RecordName.cpp
 SRCS_MIN+= DebugInfo/CodeView/RecordSerialization.cpp
 SRCS_MIN+= DebugInfo/CodeView/SimpleTypeSerializer.cpp
@@ -889,6 +893,7 @@ SRCS_MIN+=  Support/APSInt.cpp
 SRCS_MIN+= Support/ARMAttributeParser.cpp
 SRCS_MIN+= Support/ARMBuildAttrs.cpp
 SRCS_MIN+= Support/ARMTargetParser.cpp
+SRCS_MIN+= Support/ARMWinEH.cpp
 SRCS_MIN+= Support/Allocator.cpp
 SRCS_MIN+= Support/BinaryStreamError.cpp
 SRCS_MIN+= Support/BinaryStreamReader.cpp
diff --git a/tools/build/mk/OptionalObsoleteFiles.inc 
b/tools/build/mk/OptionalObsoleteFiles.inc
index b6a32c18a12d..57f8ac63e2de 100644
--- a/tools/build/mk/OptionalObsoleteFiles.inc
+++ b/tools/build/mk/OptionalObsoleteFiles.inc
@@ -1226,6 +1226,8 @@ OLD_FILES+=usr/bin/llvm-nm
 OLD_FILES+=usr/bin/llvm-objcopy
 OLD_FILES+=usr/bin/llvm-objdump
 OLD_FILES+=usr/bin/llvm-ranlib
+OLD_FILES+=usr/bin/llvm-readelf
+OLD_FILES+=usr/bin/llvm-readobj
 OLD_FILES+=usr/bin/llvm-size
 OLD_FILES+=usr/bin/llvm-strings
 OLD_FILES+=usr/bin/llvm-symbolizer
@@ -1234,6 +1236,8 @@ OLD_FILES+=usr/share/man/man1/llvm-ar.1.gz
 OLD_FILES+=usr/share/man/man1/llvm-nm.1.gz
 OLD_FILES+=usr/share/man/man1/llvm-objcopy.1.gz
 OLD_FILES+=usr/share/man/man1/llvm-ranlib.1.gz
+OLD_FILES+=usr/share/man/man1/llvm-readelf.1.gz
+OLD_FILES+=usr/share/man/man1/llvm-readobj.1.gz