History log of /freebsd-current/lib/clang/liblldb/Makefile
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 647cbc5d 03-Jan-2024 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-18-init-16003-gfc5f51cf5af4

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-16003-gfc5f51cf5af4.

PR: 276104
MFC after: 1 month


# 5f757f3f 18-Dec-2023 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-18-init-15088-gd14ee76181fb

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-15088-gd14ee76181fb.

PR: 276104
MFC after: 1 month


# 73ff7384 11-Feb-2024 Dimitry Andric <dim@FreeBSD.org>

Optionally create full debuginfo for llvm-related executables

Commit de6feefdb7cfd limited the amount of debuginfo generated for clang
and other llvm-related executables. This was done to save disk space and
memory during building, but it makes debugging any of these executables
much harder.

Add a new src.conf(5) setting, WITH_LLVM_FULL_DEBUGINFO, to generate
full debuginfo instead. This is off by default, but could for example be
enabled for release builds or snapshots, so llvm executables are easier
to debug.

Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43839

# 5c38ea60 27-Jan-2024 Dimitry Andric <dim@FreeBSD.org>

Add libllvm and liblldb source files to enable WITH_ASAN build

This is another part of fixing the WITH_ASAN build. Some additional
source files had to be added to libllvm and liblldb, since the ASan
instrumentation causes symbols in those files to be referenced.

Reported by: markj
PR: 276597
MFC after: 3 days

# 06c3fb27 02-Sep-2023 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-17-init-19304-gd0b54bb50e51

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-17-init-19304-gd0b54bb50e51, the
last commit before the upstream release/17.x branch was created.

PR: 273753
MFC after: 1 month


# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/

# bdd1243d 14-Apr-2023 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-16-init-18548-gb0daacf58f41

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16-init-18548-gb0daacf58f41.

PR: 271047
MFC after: 1 month


# 4dc3b1fa 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Revert "Ensure .inc files are regenerated when llvm/clang tblgen binaries change"

This reverts commit ab80f0b21fbb9c44d40e6f7a99090188f4ed2f71. The intent
of this change was to avoid possible compilation errors when certain
.inc files were not regenerated, but the method turns out to cause way
more rebuilds than anticipated. Another method will have to be found,
and in the mean time, WITH_CLEAN is the solution that always works.

Fixes: ab80f0b21fbb

# d8ed7fa3 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Revert "Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed"

This reverts commit 8f391d9098083044793ff036dff8c96930fb1553. There are
still a bunch of problems, and apparently ${.ALLSRC} does not work as I
expected.

Fixes: 8f391d909808

# 8f391d90 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed

This flag ensures that the tblgen tools do not actually touch the
produced .inc file, if there are no changes to the contents. In turn,
this may prevent a number of rebuilds of files that include such .inc
files, saving build time.

While here, ensure that the shell invocations to locate the used tblgen
binary do not show unnecessary error messages.

Reported by: des
MFC after: 1 week

# ab80f0b2 25-Feb-2023 Dimitry Andric <dim@FreeBSD.org>

Ensure .inc files are regenerated when llvm/clang tblgen binaries change

When doing a fully incremental build (with WITHOUT_CLEAN enabled), from
a commit before llvm 15 was merged (3264f6b88fce), to a commit after
that, a number of .inc files were not regenerated. This could lead to
unexpected compilation errors when these .inc files were included from
llvm-project sources, similar to:

In file included from /usr/src/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp:8268:
/usr/obj/usr/src/amd64.amd64/lib/clang/libclang/clang/Basic/arm_mve_builtin_cg.inc:279:18: error: no matching constructor for initialization of 'clang::CodeGen::Address'
Address Val2 = Address(Val1, CharUnits::fromQuantity(2));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Work around this by making the .inc files dependent on the tblgen binary
used for generating them. E.g., we can relatively safely assume that if
the binary gets updated, the .inc files must also be updated. (Although
this is not 100% optimal, the gain by complicating things even more is
probaby not worth the effort.)

MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D38770

# fcaf7f86 24-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-17485-ga3e38b4a206b

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-17485-ga3e38b4a206b.

PR: 265425
MFC after: 2 weeks


# 753f127f 14-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-16436-g18a6ab5b8d1f

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-16436-g18a6ab5b8d1f.

PR: 265425
MFC after: 2 weeks


# 81ad6265 04-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-15358-g53dc0f10787

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-15358-g53dc0f10787.

PR: 265425
MFC after: 2 weeks


# 04eeddc0 27-Jan-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-17616-g024a1fab5c35

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-17616-g024a1fab5c35.

PR: 261742
MFC after: 2 weeks


# 5e801ac6 20-Nov-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-10223-g401b76fdf2b3

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-10223-g401b76fdf2b3.

PR: 261742
MFC after: 2 weeks


# 0b2d2290 26-Jan-2022 Piotr Kubaj <pkubaj@FreeBSD.org>

powerpc: Enable LLDB on all powerpc architectures

While LLDB on powerpc and powerpcspe builds as-is, on powerpc64 and
powerpc64le it requires adding a couple of additional source files
to build.

Differential review: https://reviews.freebsd.org/D34043
Approved by: dim, imp, emaste

# fe6060f1 22-Aug-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-13-init-16847-g88e66fa60ae5

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13-init-16847-g88e66fa60ae5, the last commit before
the upstream release/13.x branch was created.

PR: 258209
MFC after: 2 weeks


# d409305f 26-Apr-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project 12.0.0 release

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12.0.0-0-gd28af7c654d8, a.k.a. 12.0.0 release.

PR: 255570
MFC after: 6 weeks


# e8d8bef9 13-Jun-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-12-init-17869-g8e464dd76bef

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12-init-17869-g8e464dd76bef, the last commit before the
upstream release/12.x branch was created.

PR: 255570
MFC after: 6 weeks


# 48aaf27b 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Update Makefiles under lib/clang and usr.bin/clang for 11.0.0 builds,
and also bump the version in the mtree files.

# 652a9748 03-Apr-2020 Ed Maste <emaste@FreeBSD.org>

lldb: build and enable lua script bindings

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24266

# f0d060f9 03-Apr-2020 Ed Maste <emaste@FreeBSD.org>

lldb: add rule to generate LLDBWrapLua.cpp

Building lldb's lua/python bindings requires swig, but we do not want to
include it in the FreeBSD base system (as a build tool) because it has
non-trivial dependencies. As a workaround, add a make rule to generate
LLDBWrapLua.cpp, and we will commit the generated file.

Requires the swig30 package.

Reviewed by: brooks
Discussed with: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24265

# f46f1d28 27-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for lldb (MK_LLDB=yes). Also update lldb's generated
Config.h, disable a few more parts in the code we don't use, and add a
pre-generated man page.

# 0b57cec5 20-Dec-2019 Dimitry Andric <dim@FreeBSD.org>

Move all sources from the llvm project into contrib/llvm-project.

This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo". That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

Updating the vendor area to match this layout is next.

# a32f82c2 26-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a build of clang plus lldb (enabled via MK_LLDB).

# 6e3f21a2 22-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Update lldb build glue to make MK_LLDB=yes work.

# 532d8940 02-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build glue to make WITH_LLDB work.

# d1efe516 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Remove SRCS for files that have been deleted upstream.

# 62bd6269 13-Jan-2018 Dimitry Andric <dim@FreeBSD.org>

Build llvm-extract with -lz, and add a few objects to liblldb, both of
which turn out to be needed when you don't use -ffunction-sections.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

# 77b0be52 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make lldb build.

# 36cb3905 21-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

First step in updating llvm/clang build glue: make only the clang
executable build.

# 0cc9e150 24-Jul-2017 Dimitry Andric <dim@FreeBSD.org>

Add a few more object files to liblldb, which should solve errors when
linking the lldb executable in some cases. In particular, when the
-ffunction-sections -fdata-sections options are turned off, or
ineffective.

Reported by: Shawn Webb, Mark Millard
MFC after: 2 months
X-MFC-With: r308421

# a580b014 02-Jul-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306956, and update
build glue.


# edd7eadd 27-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306325, and update
build glue.


# 4198293b 16-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r319801 through r320041.


# 5c4e2ac4 13-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Revert r319796 for now, it can cause undefined references when linking
in some circumstances.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

# 834210fa 10-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Remove a few unneeded files from libllvm, libclang and liblldb.

MFC after: 3 days

# 5517e702 16-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303197, and update
build glue.


# f37b6182 03-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302069, and update
build glue (preliminary, not all option combinations work yet).


# b33474c8 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Strip out a few objects from libclang, liblldb and lldb, which are not
referenced due to the selection of tools that we build, and our compile
time options.

# 7c1fda1c 18-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Update objects in liblldb for the MK_LLDB=yes case.

# 629e066c 04-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Update lldb Makefile, and disable some functionality for Windows and
Darwin.

# 09bfd043 03-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Initial updates to llvm/clang build glue.

# 01d8757d 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Centralize where LLVM_SRCS, CLANG_SRCS and LLDB_SRCS are defined.

# e1cd7682 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Use SRCTOP and OBJTOP throughout the llvm/clang/lldb build.

# 986e05bc 26-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Completely revamp the way llvm, clang and lldb are built.

* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.

# 1c3bbb01 03-Jul-2015 Ed Maste <emaste@FreeBSD.org>

Update LLDB snapshot to upstream r241361

Notable upstream commits (upstream revision in parens):

- Add a JSON producer to LLDB (228636)
- Don't crash on bad DWARF expression (228729)
- Add support of DWARFv3 DW_OP_form_tls_address (231342)
- Assembly profiler for MIPS64 (232619)
- Handle FreeBSD/arm64 core files (233273)
- Read/Write register for MIPS64 (233685)
- Rework LLDB system initialization (233758)
- SysV ABI for aarch64 (236098)
- MIPS software single stepping (236696)
- FreeBSD/arm live debugging support (237303)
- Assembly profiler for mips32 (237420)
- Parse function name from DWARF DW_AT_abstract_origin (238307)
- Improve LLDB prompt handling (238313)
- Add real time signals support to FreeBSDSignals (238316)
- Fix race in IOHandlerProcessSTDIO (238423)
- MIPS64 Branch instruction emulation for SW single stepping (238820)
- Improve OSType initialization in elf object file's arch_spec (239148)
- Emulation of MIPS64 floating-point branch instructions (239996)
- ABI Plugin for MIPS32 (239997)
- ABI Plugin for MIPS64 (240123)
- MIPS32 branch emulation and single stepping (240373)
- Improve instruction emulation based stack unwinding on ARM (240533)
- Add branch emulation to aarch64 instruction emulator (240769)


# 1a559761 26-Nov-2014 Ed Maste <emaste@FreeBSD.org>

Update build for LLDB snapshot at upstream rev 216948

Sponsored by: DARPA, AFRL

# e8f1392d 19-Sep-2013 Ed Maste <emaste@FreeBSD.org>

Add LLDB bmake infrastructure

This connects LLDB to the build, but it is disabled by default. Add
WITH_LLDB= to src.conf to build it.

Note that LLDB requires a C++11 compiler so is disabled on platforms
using GCC.

Approved by: re (gjb)
Sponsored by: DARPA, AFRL

# 73ff7384 11-Feb-2024 Dimitry Andric <dim@FreeBSD.org>

Optionally create full debuginfo for llvm-related executables

Commit de6feefdb7cfd limited the amount of debuginfo generated for clang
and other llvm-related executables. This was done to save disk space and
memory during building, but it makes debugging any of these executables
much harder.

Add a new src.conf(5) setting, WITH_LLVM_FULL_DEBUGINFO, to generate
full debuginfo instead. This is off by default, but could for example be
enabled for release builds or snapshots, so llvm executables are easier
to debug.

Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43839


# 5c38ea60 27-Jan-2024 Dimitry Andric <dim@FreeBSD.org>

Add libllvm and liblldb source files to enable WITH_ASAN build

This is another part of fixing the WITH_ASAN build. Some additional
source files had to be added to libllvm and liblldb, since the ASan
instrumentation causes symbols in those files to be referenced.

Reported by: markj
PR: 276597
MFC after: 3 days


# 06c3fb27 02-Sep-2023 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-17-init-19304-gd0b54bb50e51

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-17-init-19304-gd0b54bb50e51, the
last commit before the upstream release/17.x branch was created.

PR: 273753
MFC after: 1 month


# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/

# bdd1243d 14-Apr-2023 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-16-init-18548-gb0daacf58f41

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16-init-18548-gb0daacf58f41.

PR: 271047
MFC after: 1 month


# 4dc3b1fa 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Revert "Ensure .inc files are regenerated when llvm/clang tblgen binaries change"

This reverts commit ab80f0b21fbb9c44d40e6f7a99090188f4ed2f71. The intent
of this change was to avoid possible compilation errors when certain
.inc files were not regenerated, but the method turns out to cause way
more rebuilds than anticipated. Another method will have to be found,
and in the mean time, WITH_CLEAN is the solution that always works.

Fixes: ab80f0b21fbb

# d8ed7fa3 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Revert "Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed"

This reverts commit 8f391d9098083044793ff036dff8c96930fb1553. There are
still a bunch of problems, and apparently ${.ALLSRC} does not work as I
expected.

Fixes: 8f391d909808

# 8f391d90 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed

This flag ensures that the tblgen tools do not actually touch the
produced .inc file, if there are no changes to the contents. In turn,
this may prevent a number of rebuilds of files that include such .inc
files, saving build time.

While here, ensure that the shell invocations to locate the used tblgen
binary do not show unnecessary error messages.

Reported by: des
MFC after: 1 week

# ab80f0b2 25-Feb-2023 Dimitry Andric <dim@FreeBSD.org>

Ensure .inc files are regenerated when llvm/clang tblgen binaries change

When doing a fully incremental build (with WITHOUT_CLEAN enabled), from
a commit before llvm 15 was merged (3264f6b88fce), to a commit after
that, a number of .inc files were not regenerated. This could lead to
unexpected compilation errors when these .inc files were included from
llvm-project sources, similar to:

In file included from /usr/src/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp:8268:
/usr/obj/usr/src/amd64.amd64/lib/clang/libclang/clang/Basic/arm_mve_builtin_cg.inc:279:18: error: no matching constructor for initialization of 'clang::CodeGen::Address'
Address Val2 = Address(Val1, CharUnits::fromQuantity(2));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Work around this by making the .inc files dependent on the tblgen binary
used for generating them. E.g., we can relatively safely assume that if
the binary gets updated, the .inc files must also be updated. (Although
this is not 100% optimal, the gain by complicating things even more is
probaby not worth the effort.)

MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D38770

# fcaf7f86 24-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-17485-ga3e38b4a206b

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-17485-ga3e38b4a206b.

PR: 265425
MFC after: 2 weeks


# 753f127f 14-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-16436-g18a6ab5b8d1f

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-16436-g18a6ab5b8d1f.

PR: 265425
MFC after: 2 weeks


# 81ad6265 04-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-15358-g53dc0f10787

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-15358-g53dc0f10787.

PR: 265425
MFC after: 2 weeks


# 04eeddc0 27-Jan-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-17616-g024a1fab5c35

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-17616-g024a1fab5c35.

PR: 261742
MFC after: 2 weeks


# 5e801ac6 20-Nov-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-10223-g401b76fdf2b3

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-10223-g401b76fdf2b3.

PR: 261742
MFC after: 2 weeks


# 0b2d2290 26-Jan-2022 Piotr Kubaj <pkubaj@FreeBSD.org>

powerpc: Enable LLDB on all powerpc architectures

While LLDB on powerpc and powerpcspe builds as-is, on powerpc64 and
powerpc64le it requires adding a couple of additional source files
to build.

Differential review: https://reviews.freebsd.org/D34043
Approved by: dim, imp, emaste

# fe6060f1 22-Aug-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-13-init-16847-g88e66fa60ae5

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13-init-16847-g88e66fa60ae5, the last commit before
the upstream release/13.x branch was created.

PR: 258209
MFC after: 2 weeks


# d409305f 26-Apr-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project 12.0.0 release

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12.0.0-0-gd28af7c654d8, a.k.a. 12.0.0 release.

PR: 255570
MFC after: 6 weeks


# e8d8bef9 13-Jun-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-12-init-17869-g8e464dd76bef

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12-init-17869-g8e464dd76bef, the last commit before the
upstream release/12.x branch was created.

PR: 255570
MFC after: 6 weeks


# 48aaf27b 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Update Makefiles under lib/clang and usr.bin/clang for 11.0.0 builds,
and also bump the version in the mtree files.

# 652a9748 03-Apr-2020 Ed Maste <emaste@FreeBSD.org>

lldb: build and enable lua script bindings

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24266

# f0d060f9 03-Apr-2020 Ed Maste <emaste@FreeBSD.org>

lldb: add rule to generate LLDBWrapLua.cpp

Building lldb's lua/python bindings requires swig, but we do not want to
include it in the FreeBSD base system (as a build tool) because it has
non-trivial dependencies. As a workaround, add a make rule to generate
LLDBWrapLua.cpp, and we will commit the generated file.

Requires the swig30 package.

Reviewed by: brooks
Discussed with: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24265

# f46f1d28 27-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for lldb (MK_LLDB=yes). Also update lldb's generated
Config.h, disable a few more parts in the code we don't use, and add a
pre-generated man page.

# 0b57cec5 20-Dec-2019 Dimitry Andric <dim@FreeBSD.org>

Move all sources from the llvm project into contrib/llvm-project.

This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo". That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

Updating the vendor area to match this layout is next.

# a32f82c2 26-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a build of clang plus lldb (enabled via MK_LLDB).

# 6e3f21a2 22-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Update lldb build glue to make MK_LLDB=yes work.

# 532d8940 02-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build glue to make WITH_LLDB work.

# d1efe516 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Remove SRCS for files that have been deleted upstream.

# 62bd6269 13-Jan-2018 Dimitry Andric <dim@FreeBSD.org>

Build llvm-extract with -lz, and add a few objects to liblldb, both of
which turn out to be needed when you don't use -ffunction-sections.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

# 77b0be52 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make lldb build.

# 36cb3905 21-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

First step in updating llvm/clang build glue: make only the clang
executable build.

# 0cc9e150 24-Jul-2017 Dimitry Andric <dim@FreeBSD.org>

Add a few more object files to liblldb, which should solve errors when
linking the lldb executable in some cases. In particular, when the
-ffunction-sections -fdata-sections options are turned off, or
ineffective.

Reported by: Shawn Webb, Mark Millard
MFC after: 2 months
X-MFC-With: r308421

# a580b014 02-Jul-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306956, and update
build glue.


# edd7eadd 27-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306325, and update
build glue.


# 4198293b 16-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r319801 through r320041.


# 5c4e2ac4 13-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Revert r319796 for now, it can cause undefined references when linking
in some circumstances.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

# 834210fa 10-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Remove a few unneeded files from libllvm, libclang and liblldb.

MFC after: 3 days

# 5517e702 16-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303197, and update
build glue.


# f37b6182 03-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302069, and update
build glue (preliminary, not all option combinations work yet).


# b33474c8 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Strip out a few objects from libclang, liblldb and lldb, which are not
referenced due to the selection of tools that we build, and our compile
time options.

# 7c1fda1c 18-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Update objects in liblldb for the MK_LLDB=yes case.

# 629e066c 04-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Update lldb Makefile, and disable some functionality for Windows and
Darwin.

# 09bfd043 03-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Initial updates to llvm/clang build glue.

# 01d8757d 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Centralize where LLVM_SRCS, CLANG_SRCS and LLDB_SRCS are defined.

# e1cd7682 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Use SRCTOP and OBJTOP throughout the llvm/clang/lldb build.

# 986e05bc 26-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Completely revamp the way llvm, clang and lldb are built.

* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.

# 1c3bbb01 03-Jul-2015 Ed Maste <emaste@FreeBSD.org>

Update LLDB snapshot to upstream r241361

Notable upstream commits (upstream revision in parens):

- Add a JSON producer to LLDB (228636)
- Don't crash on bad DWARF expression (228729)
- Add support of DWARFv3 DW_OP_form_tls_address (231342)
- Assembly profiler for MIPS64 (232619)
- Handle FreeBSD/arm64 core files (233273)
- Read/Write register for MIPS64 (233685)
- Rework LLDB system initialization (233758)
- SysV ABI for aarch64 (236098)
- MIPS software single stepping (236696)
- FreeBSD/arm live debugging support (237303)
- Assembly profiler for mips32 (237420)
- Parse function name from DWARF DW_AT_abstract_origin (238307)
- Improve LLDB prompt handling (238313)
- Add real time signals support to FreeBSDSignals (238316)
- Fix race in IOHandlerProcessSTDIO (238423)
- MIPS64 Branch instruction emulation for SW single stepping (238820)
- Improve OSType initialization in elf object file's arch_spec (239148)
- Emulation of MIPS64 floating-point branch instructions (239996)
- ABI Plugin for MIPS32 (239997)
- ABI Plugin for MIPS64 (240123)
- MIPS32 branch emulation and single stepping (240373)
- Improve instruction emulation based stack unwinding on ARM (240533)
- Add branch emulation to aarch64 instruction emulator (240769)


# 1a559761 26-Nov-2014 Ed Maste <emaste@FreeBSD.org>

Update build for LLDB snapshot at upstream rev 216948

Sponsored by: DARPA, AFRL

# e8f1392d 19-Sep-2013 Ed Maste <emaste@FreeBSD.org>

Add LLDB bmake infrastructure

This connects LLDB to the build, but it is disabled by default. Add
WITH_LLDB= to src.conf to build it.

Note that LLDB requires a C++11 compiler so is disabled on platforms
using GCC.

Approved by: re (gjb)
Sponsored by: DARPA, AFRL

# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/


# bdd1243d 14-Apr-2023 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-16-init-18548-gb0daacf58f41

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16-init-18548-gb0daacf58f41.

PR: 271047
MFC after: 1 month


# 4dc3b1fa 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Revert "Ensure .inc files are regenerated when llvm/clang tblgen binaries change"

This reverts commit ab80f0b21fbb9c44d40e6f7a99090188f4ed2f71. The intent
of this change was to avoid possible compilation errors when certain
.inc files were not regenerated, but the method turns out to cause way
more rebuilds than anticipated. Another method will have to be found,
and in the mean time, WITH_CLEAN is the solution that always works.

Fixes: ab80f0b21fbb

# d8ed7fa3 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Revert "Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed"

This reverts commit 8f391d9098083044793ff036dff8c96930fb1553. There are
still a bunch of problems, and apparently ${.ALLSRC} does not work as I
expected.

Fixes: 8f391d909808

# 8f391d90 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed

This flag ensures that the tblgen tools do not actually touch the
produced .inc file, if there are no changes to the contents. In turn,
this may prevent a number of rebuilds of files that include such .inc
files, saving build time.

While here, ensure that the shell invocations to locate the used tblgen
binary do not show unnecessary error messages.

Reported by: des
MFC after: 1 week

# ab80f0b2 25-Feb-2023 Dimitry Andric <dim@FreeBSD.org>

Ensure .inc files are regenerated when llvm/clang tblgen binaries change

When doing a fully incremental build (with WITHOUT_CLEAN enabled), from
a commit before llvm 15 was merged (3264f6b88fce), to a commit after
that, a number of .inc files were not regenerated. This could lead to
unexpected compilation errors when these .inc files were included from
llvm-project sources, similar to:

In file included from /usr/src/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp:8268:
/usr/obj/usr/src/amd64.amd64/lib/clang/libclang/clang/Basic/arm_mve_builtin_cg.inc:279:18: error: no matching constructor for initialization of 'clang::CodeGen::Address'
Address Val2 = Address(Val1, CharUnits::fromQuantity(2));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Work around this by making the .inc files dependent on the tblgen binary
used for generating them. E.g., we can relatively safely assume that if
the binary gets updated, the .inc files must also be updated. (Although
this is not 100% optimal, the gain by complicating things even more is
probaby not worth the effort.)

MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D38770

# fcaf7f86 24-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-17485-ga3e38b4a206b

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-17485-ga3e38b4a206b.

PR: 265425
MFC after: 2 weeks


# 753f127f 14-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-16436-g18a6ab5b8d1f

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-16436-g18a6ab5b8d1f.

PR: 265425
MFC after: 2 weeks


# 81ad6265 04-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-15358-g53dc0f10787

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-15358-g53dc0f10787.

PR: 265425
MFC after: 2 weeks


# 04eeddc0 27-Jan-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-17616-g024a1fab5c35

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-17616-g024a1fab5c35.

PR: 261742
MFC after: 2 weeks


# 5e801ac6 20-Nov-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-10223-g401b76fdf2b3

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-10223-g401b76fdf2b3.

PR: 261742
MFC after: 2 weeks


# 0b2d2290 26-Jan-2022 Piotr Kubaj <pkubaj@FreeBSD.org>

powerpc: Enable LLDB on all powerpc architectures

While LLDB on powerpc and powerpcspe builds as-is, on powerpc64 and
powerpc64le it requires adding a couple of additional source files
to build.

Differential review: https://reviews.freebsd.org/D34043
Approved by: dim, imp, emaste

# fe6060f1 22-Aug-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-13-init-16847-g88e66fa60ae5

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13-init-16847-g88e66fa60ae5, the last commit before
the upstream release/13.x branch was created.

PR: 258209
MFC after: 2 weeks


# d409305f 26-Apr-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project 12.0.0 release

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12.0.0-0-gd28af7c654d8, a.k.a. 12.0.0 release.

PR: 255570
MFC after: 6 weeks


# e8d8bef9 13-Jun-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-12-init-17869-g8e464dd76bef

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12-init-17869-g8e464dd76bef, the last commit before the
upstream release/12.x branch was created.

PR: 255570
MFC after: 6 weeks


# 48aaf27b 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Update Makefiles under lib/clang and usr.bin/clang for 11.0.0 builds,
and also bump the version in the mtree files.

# 652a9748 03-Apr-2020 Ed Maste <emaste@FreeBSD.org>

lldb: build and enable lua script bindings

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24266

# f0d060f9 03-Apr-2020 Ed Maste <emaste@FreeBSD.org>

lldb: add rule to generate LLDBWrapLua.cpp

Building lldb's lua/python bindings requires swig, but we do not want to
include it in the FreeBSD base system (as a build tool) because it has
non-trivial dependencies. As a workaround, add a make rule to generate
LLDBWrapLua.cpp, and we will commit the generated file.

Requires the swig30 package.

Reviewed by: brooks
Discussed with: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24265

# f46f1d28 27-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for lldb (MK_LLDB=yes). Also update lldb's generated
Config.h, disable a few more parts in the code we don't use, and add a
pre-generated man page.

# 0b57cec5 20-Dec-2019 Dimitry Andric <dim@FreeBSD.org>

Move all sources from the llvm project into contrib/llvm-project.

This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo". That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

Updating the vendor area to match this layout is next.

# a32f82c2 26-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a build of clang plus lldb (enabled via MK_LLDB).

# 6e3f21a2 22-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Update lldb build glue to make MK_LLDB=yes work.

# 532d8940 02-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build glue to make WITH_LLDB work.

# d1efe516 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Remove SRCS for files that have been deleted upstream.

# 62bd6269 13-Jan-2018 Dimitry Andric <dim@FreeBSD.org>

Build llvm-extract with -lz, and add a few objects to liblldb, both of
which turn out to be needed when you don't use -ffunction-sections.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

# 77b0be52 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make lldb build.

# 36cb3905 21-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

First step in updating llvm/clang build glue: make only the clang
executable build.

# 0cc9e150 24-Jul-2017 Dimitry Andric <dim@FreeBSD.org>

Add a few more object files to liblldb, which should solve errors when
linking the lldb executable in some cases. In particular, when the
-ffunction-sections -fdata-sections options are turned off, or
ineffective.

Reported by: Shawn Webb, Mark Millard
MFC after: 2 months
X-MFC-With: r308421

# a580b014 02-Jul-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306956, and update
build glue.


# edd7eadd 27-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306325, and update
build glue.


# 4198293b 16-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r319801 through r320041.


# 5c4e2ac4 13-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Revert r319796 for now, it can cause undefined references when linking
in some circumstances.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

# 834210fa 10-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Remove a few unneeded files from libllvm, libclang and liblldb.

MFC after: 3 days

# 5517e702 16-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303197, and update
build glue.


# f37b6182 03-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302069, and update
build glue (preliminary, not all option combinations work yet).


# b33474c8 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Strip out a few objects from libclang, liblldb and lldb, which are not
referenced due to the selection of tools that we build, and our compile
time options.

# 7c1fda1c 18-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Update objects in liblldb for the MK_LLDB=yes case.

# 629e066c 04-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Update lldb Makefile, and disable some functionality for Windows and
Darwin.

# 09bfd043 03-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Initial updates to llvm/clang build glue.

# 01d8757d 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Centralize where LLVM_SRCS, CLANG_SRCS and LLDB_SRCS are defined.

# e1cd7682 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Use SRCTOP and OBJTOP throughout the llvm/clang/lldb build.

# 986e05bc 26-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Completely revamp the way llvm, clang and lldb are built.

* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.

# 1c3bbb01 03-Jul-2015 Ed Maste <emaste@FreeBSD.org>

Update LLDB snapshot to upstream r241361

Notable upstream commits (upstream revision in parens):

- Add a JSON producer to LLDB (228636)
- Don't crash on bad DWARF expression (228729)
- Add support of DWARFv3 DW_OP_form_tls_address (231342)
- Assembly profiler for MIPS64 (232619)
- Handle FreeBSD/arm64 core files (233273)
- Read/Write register for MIPS64 (233685)
- Rework LLDB system initialization (233758)
- SysV ABI for aarch64 (236098)
- MIPS software single stepping (236696)
- FreeBSD/arm live debugging support (237303)
- Assembly profiler for mips32 (237420)
- Parse function name from DWARF DW_AT_abstract_origin (238307)
- Improve LLDB prompt handling (238313)
- Add real time signals support to FreeBSDSignals (238316)
- Fix race in IOHandlerProcessSTDIO (238423)
- MIPS64 Branch instruction emulation for SW single stepping (238820)
- Improve OSType initialization in elf object file's arch_spec (239148)
- Emulation of MIPS64 floating-point branch instructions (239996)
- ABI Plugin for MIPS32 (239997)
- ABI Plugin for MIPS64 (240123)
- MIPS32 branch emulation and single stepping (240373)
- Improve instruction emulation based stack unwinding on ARM (240533)
- Add branch emulation to aarch64 instruction emulator (240769)


# 1a559761 26-Nov-2014 Ed Maste <emaste@FreeBSD.org>

Update build for LLDB snapshot at upstream rev 216948

Sponsored by: DARPA, AFRL

# e8f1392d 19-Sep-2013 Ed Maste <emaste@FreeBSD.org>

Add LLDB bmake infrastructure

This connects LLDB to the build, but it is disabled by default. Add
WITH_LLDB= to src.conf to build it.

Note that LLDB requires a C++11 compiler so is disabled on platforms
using GCC.

Approved by: re (gjb)
Sponsored by: DARPA, AFRL

# 4dc3b1fa 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Revert "Ensure .inc files are regenerated when llvm/clang tblgen binaries change"

This reverts commit ab80f0b21fbb9c44d40e6f7a99090188f4ed2f71. The intent
of this change was to avoid possible compilation errors when certain
.inc files were not regenerated, but the method turns out to cause way
more rebuilds than anticipated. Another method will have to be found,
and in the mean time, WITH_CLEAN is the solution that always works.

Fixes: ab80f0b21fbb


# d8ed7fa3 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Revert "Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed"

This reverts commit 8f391d9098083044793ff036dff8c96930fb1553. There are
still a bunch of problems, and apparently ${.ALLSRC} does not work as I
expected.

Fixes: 8f391d909808


# 8f391d90 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed

This flag ensures that the tblgen tools do not actually touch the
produced .inc file, if there are no changes to the contents. In turn,
this may prevent a number of rebuilds of files that include such .inc
files, saving build time.

While here, ensure that the shell invocations to locate the used tblgen
binary do not show unnecessary error messages.

Reported by: des
MFC after: 1 week


# ab80f0b2 25-Feb-2023 Dimitry Andric <dim@FreeBSD.org>

Ensure .inc files are regenerated when llvm/clang tblgen binaries change

When doing a fully incremental build (with WITHOUT_CLEAN enabled), from
a commit before llvm 15 was merged (3264f6b88fce), to a commit after
that, a number of .inc files were not regenerated. This could lead to
unexpected compilation errors when these .inc files were included from
llvm-project sources, similar to:

In file included from /usr/src/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp:8268:
/usr/obj/usr/src/amd64.amd64/lib/clang/libclang/clang/Basic/arm_mve_builtin_cg.inc:279:18: error: no matching constructor for initialization of 'clang::CodeGen::Address'
Address Val2 = Address(Val1, CharUnits::fromQuantity(2));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Work around this by making the .inc files dependent on the tblgen binary
used for generating them. E.g., we can relatively safely assume that if
the binary gets updated, the .inc files must also be updated. (Although
this is not 100% optimal, the gain by complicating things even more is
probaby not worth the effort.)

MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D38770


# fcaf7f86 24-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-17485-ga3e38b4a206b

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-17485-ga3e38b4a206b.

PR: 265425
MFC after: 2 weeks


# 753f127f 14-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-16436-g18a6ab5b8d1f

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-16436-g18a6ab5b8d1f.

PR: 265425
MFC after: 2 weeks


# 81ad6265 04-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-15358-g53dc0f10787

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-15358-g53dc0f10787.

PR: 265425
MFC after: 2 weeks


# 04eeddc0 27-Jan-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-17616-g024a1fab5c35

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-17616-g024a1fab5c35.

PR: 261742
MFC after: 2 weeks


# 5e801ac6 20-Nov-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-10223-g401b76fdf2b3

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-10223-g401b76fdf2b3.

PR: 261742
MFC after: 2 weeks


# 0b2d2290 26-Jan-2022 Piotr Kubaj <pkubaj@FreeBSD.org>

powerpc: Enable LLDB on all powerpc architectures

While LLDB on powerpc and powerpcspe builds as-is, on powerpc64 and
powerpc64le it requires adding a couple of additional source files
to build.

Differential review: https://reviews.freebsd.org/D34043
Approved by: dim, imp, emaste

# fe6060f1 22-Aug-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-13-init-16847-g88e66fa60ae5

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13-init-16847-g88e66fa60ae5, the last commit before
the upstream release/13.x branch was created.

PR: 258209
MFC after: 2 weeks


# d409305f 26-Apr-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project 12.0.0 release

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12.0.0-0-gd28af7c654d8, a.k.a. 12.0.0 release.

PR: 255570
MFC after: 6 weeks


# e8d8bef9 13-Jun-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-12-init-17869-g8e464dd76bef

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12-init-17869-g8e464dd76bef, the last commit before the
upstream release/12.x branch was created.

PR: 255570
MFC after: 6 weeks


# 48aaf27b 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Update Makefiles under lib/clang and usr.bin/clang for 11.0.0 builds,
and also bump the version in the mtree files.

# 652a9748 03-Apr-2020 Ed Maste <emaste@FreeBSD.org>

lldb: build and enable lua script bindings

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24266

# f0d060f9 03-Apr-2020 Ed Maste <emaste@FreeBSD.org>

lldb: add rule to generate LLDBWrapLua.cpp

Building lldb's lua/python bindings requires swig, but we do not want to
include it in the FreeBSD base system (as a build tool) because it has
non-trivial dependencies. As a workaround, add a make rule to generate
LLDBWrapLua.cpp, and we will commit the generated file.

Requires the swig30 package.

Reviewed by: brooks
Discussed with: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24265

# f46f1d28 27-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for lldb (MK_LLDB=yes). Also update lldb's generated
Config.h, disable a few more parts in the code we don't use, and add a
pre-generated man page.

# 0b57cec5 20-Dec-2019 Dimitry Andric <dim@FreeBSD.org>

Move all sources from the llvm project into contrib/llvm-project.

This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo". That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

Updating the vendor area to match this layout is next.

# a32f82c2 26-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a build of clang plus lldb (enabled via MK_LLDB).

# 6e3f21a2 22-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Update lldb build glue to make MK_LLDB=yes work.

# 532d8940 02-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build glue to make WITH_LLDB work.

# d1efe516 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Remove SRCS for files that have been deleted upstream.

# 62bd6269 13-Jan-2018 Dimitry Andric <dim@FreeBSD.org>

Build llvm-extract with -lz, and add a few objects to liblldb, both of
which turn out to be needed when you don't use -ffunction-sections.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

# 77b0be52 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make lldb build.

# 36cb3905 21-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

First step in updating llvm/clang build glue: make only the clang
executable build.

# 0cc9e150 24-Jul-2017 Dimitry Andric <dim@FreeBSD.org>

Add a few more object files to liblldb, which should solve errors when
linking the lldb executable in some cases. In particular, when the
-ffunction-sections -fdata-sections options are turned off, or
ineffective.

Reported by: Shawn Webb, Mark Millard
MFC after: 2 months
X-MFC-With: r308421

# a580b014 02-Jul-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306956, and update
build glue.


# edd7eadd 27-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306325, and update
build glue.


# 4198293b 16-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r319801 through r320041.


# 5c4e2ac4 13-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Revert r319796 for now, it can cause undefined references when linking
in some circumstances.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

# 834210fa 10-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Remove a few unneeded files from libllvm, libclang and liblldb.

MFC after: 3 days

# 5517e702 16-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303197, and update
build glue.


# f37b6182 03-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302069, and update
build glue (preliminary, not all option combinations work yet).


# b33474c8 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Strip out a few objects from libclang, liblldb and lldb, which are not
referenced due to the selection of tools that we build, and our compile
time options.

# 7c1fda1c 18-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Update objects in liblldb for the MK_LLDB=yes case.

# 629e066c 04-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Update lldb Makefile, and disable some functionality for Windows and
Darwin.

# 09bfd043 03-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Initial updates to llvm/clang build glue.

# 01d8757d 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Centralize where LLVM_SRCS, CLANG_SRCS and LLDB_SRCS are defined.

# e1cd7682 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Use SRCTOP and OBJTOP throughout the llvm/clang/lldb build.

# 986e05bc 26-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Completely revamp the way llvm, clang and lldb are built.

* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.

# 1c3bbb01 03-Jul-2015 Ed Maste <emaste@FreeBSD.org>

Update LLDB snapshot to upstream r241361

Notable upstream commits (upstream revision in parens):

- Add a JSON producer to LLDB (228636)
- Don't crash on bad DWARF expression (228729)
- Add support of DWARFv3 DW_OP_form_tls_address (231342)
- Assembly profiler for MIPS64 (232619)
- Handle FreeBSD/arm64 core files (233273)
- Read/Write register for MIPS64 (233685)
- Rework LLDB system initialization (233758)
- SysV ABI for aarch64 (236098)
- MIPS software single stepping (236696)
- FreeBSD/arm live debugging support (237303)
- Assembly profiler for mips32 (237420)
- Parse function name from DWARF DW_AT_abstract_origin (238307)
- Improve LLDB prompt handling (238313)
- Add real time signals support to FreeBSDSignals (238316)
- Fix race in IOHandlerProcessSTDIO (238423)
- MIPS64 Branch instruction emulation for SW single stepping (238820)
- Improve OSType initialization in elf object file's arch_spec (239148)
- Emulation of MIPS64 floating-point branch instructions (239996)
- ABI Plugin for MIPS32 (239997)
- ABI Plugin for MIPS64 (240123)
- MIPS32 branch emulation and single stepping (240373)
- Improve instruction emulation based stack unwinding on ARM (240533)
- Add branch emulation to aarch64 instruction emulator (240769)


# 1a559761 26-Nov-2014 Ed Maste <emaste@FreeBSD.org>

Update build for LLDB snapshot at upstream rev 216948

Sponsored by: DARPA, AFRL

# e8f1392d 19-Sep-2013 Ed Maste <emaste@FreeBSD.org>

Add LLDB bmake infrastructure

This connects LLDB to the build, but it is disabled by default. Add
WITH_LLDB= to src.conf to build it.

Note that LLDB requires a C++11 compiler so is disabled on platforms
using GCC.

Approved by: re (gjb)
Sponsored by: DARPA, AFRL

# 04eeddc0 27-Jan-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-17616-g024a1fab5c35

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-17616-g024a1fab5c35.

PR: 261742
MFC after: 2 weeks


# 5e801ac6 20-Nov-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-10223-g401b76fdf2b3

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-10223-g401b76fdf2b3.

PR: 261742
MFC after: 2 weeks


# 0b2d2290 26-Jan-2022 Piotr Kubaj <pkubaj@FreeBSD.org>

powerpc: Enable LLDB on all powerpc architectures

While LLDB on powerpc and powerpcspe builds as-is, on powerpc64 and
powerpc64le it requires adding a couple of additional source files
to build.

Differential review: https://reviews.freebsd.org/D34043
Approved by: dim, imp, emaste

# fe6060f1 22-Aug-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-13-init-16847-g88e66fa60ae5

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13-init-16847-g88e66fa60ae5, the last commit before
the upstream release/13.x branch was created.

PR: 258209
MFC after: 2 weeks


# d409305f 26-Apr-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project 12.0.0 release

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12.0.0-0-gd28af7c654d8, a.k.a. 12.0.0 release.

PR: 255570
MFC after: 6 weeks


# e8d8bef9 13-Jun-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-12-init-17869-g8e464dd76bef

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12-init-17869-g8e464dd76bef, the last commit before the
upstream release/12.x branch was created.

PR: 255570
MFC after: 6 weeks


# 48aaf27b 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Update Makefiles under lib/clang and usr.bin/clang for 11.0.0 builds,
and also bump the version in the mtree files.

# 652a9748 03-Apr-2020 Ed Maste <emaste@FreeBSD.org>

lldb: build and enable lua script bindings

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24266

# f0d060f9 03-Apr-2020 Ed Maste <emaste@FreeBSD.org>

lldb: add rule to generate LLDBWrapLua.cpp

Building lldb's lua/python bindings requires swig, but we do not want to
include it in the FreeBSD base system (as a build tool) because it has
non-trivial dependencies. As a workaround, add a make rule to generate
LLDBWrapLua.cpp, and we will commit the generated file.

Requires the swig30 package.

Reviewed by: brooks
Discussed with: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24265

# f46f1d28 27-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for lldb (MK_LLDB=yes). Also update lldb's generated
Config.h, disable a few more parts in the code we don't use, and add a
pre-generated man page.

# 0b57cec5 20-Dec-2019 Dimitry Andric <dim@FreeBSD.org>

Move all sources from the llvm project into contrib/llvm-project.

This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo". That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

Updating the vendor area to match this layout is next.

# a32f82c2 26-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a build of clang plus lldb (enabled via MK_LLDB).

# 6e3f21a2 22-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Update lldb build glue to make MK_LLDB=yes work.

# 532d8940 02-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build glue to make WITH_LLDB work.

# d1efe516 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Remove SRCS for files that have been deleted upstream.

# 62bd6269 13-Jan-2018 Dimitry Andric <dim@FreeBSD.org>

Build llvm-extract with -lz, and add a few objects to liblldb, both of
which turn out to be needed when you don't use -ffunction-sections.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

# 77b0be52 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make lldb build.

# 36cb3905 21-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

First step in updating llvm/clang build glue: make only the clang
executable build.

# 0cc9e150 24-Jul-2017 Dimitry Andric <dim@FreeBSD.org>

Add a few more object files to liblldb, which should solve errors when
linking the lldb executable in some cases. In particular, when the
-ffunction-sections -fdata-sections options are turned off, or
ineffective.

Reported by: Shawn Webb, Mark Millard
MFC after: 2 months
X-MFC-With: r308421

# a580b014 02-Jul-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306956, and update
build glue.


# edd7eadd 27-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306325, and update
build glue.


# 4198293b 16-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r319801 through r320041.


# 5c4e2ac4 13-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Revert r319796 for now, it can cause undefined references when linking
in some circumstances.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

# 834210fa 10-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Remove a few unneeded files from libllvm, libclang and liblldb.

MFC after: 3 days

# 5517e702 16-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303197, and update
build glue.


# f37b6182 03-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302069, and update
build glue (preliminary, not all option combinations work yet).


# b33474c8 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Strip out a few objects from libclang, liblldb and lldb, which are not
referenced due to the selection of tools that we build, and our compile
time options.

# 7c1fda1c 18-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Update objects in liblldb for the MK_LLDB=yes case.

# 629e066c 04-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Update lldb Makefile, and disable some functionality for Windows and
Darwin.

# 09bfd043 03-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Initial updates to llvm/clang build glue.

# 01d8757d 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Centralize where LLVM_SRCS, CLANG_SRCS and LLDB_SRCS are defined.

# e1cd7682 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Use SRCTOP and OBJTOP throughout the llvm/clang/lldb build.

# 986e05bc 26-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Completely revamp the way llvm, clang and lldb are built.

* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.

# 1c3bbb01 03-Jul-2015 Ed Maste <emaste@FreeBSD.org>

Update LLDB snapshot to upstream r241361

Notable upstream commits (upstream revision in parens):

- Add a JSON producer to LLDB (228636)
- Don't crash on bad DWARF expression (228729)
- Add support of DWARFv3 DW_OP_form_tls_address (231342)
- Assembly profiler for MIPS64 (232619)
- Handle FreeBSD/arm64 core files (233273)
- Read/Write register for MIPS64 (233685)
- Rework LLDB system initialization (233758)
- SysV ABI for aarch64 (236098)
- MIPS software single stepping (236696)
- FreeBSD/arm live debugging support (237303)
- Assembly profiler for mips32 (237420)
- Parse function name from DWARF DW_AT_abstract_origin (238307)
- Improve LLDB prompt handling (238313)
- Add real time signals support to FreeBSDSignals (238316)
- Fix race in IOHandlerProcessSTDIO (238423)
- MIPS64 Branch instruction emulation for SW single stepping (238820)
- Improve OSType initialization in elf object file's arch_spec (239148)
- Emulation of MIPS64 floating-point branch instructions (239996)
- ABI Plugin for MIPS32 (239997)
- ABI Plugin for MIPS64 (240123)
- MIPS32 branch emulation and single stepping (240373)
- Improve instruction emulation based stack unwinding on ARM (240533)
- Add branch emulation to aarch64 instruction emulator (240769)


# 1a559761 26-Nov-2014 Ed Maste <emaste@FreeBSD.org>

Update build for LLDB snapshot at upstream rev 216948

Sponsored by: DARPA, AFRL

# e8f1392d 19-Sep-2013 Ed Maste <emaste@FreeBSD.org>

Add LLDB bmake infrastructure

This connects LLDB to the build, but it is disabled by default. Add
WITH_LLDB= to src.conf to build it.

Note that LLDB requires a C++11 compiler so is disabled on platforms
using GCC.

Approved by: re (gjb)
Sponsored by: DARPA, AFRL

# 0b2d2290 26-Jan-2022 Piotr Kubaj <pkubaj@FreeBSD.org>

powerpc: Enable LLDB on all powerpc architectures

While LLDB on powerpc and powerpcspe builds as-is, on powerpc64 and
powerpc64le it requires adding a couple of additional source files
to build.

Differential review: https://reviews.freebsd.org/D34043
Approved by: dim, imp, emaste


# fe6060f1 22-Aug-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-13-init-16847-g88e66fa60ae5

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13-init-16847-g88e66fa60ae5, the last commit before
the upstream release/13.x branch was created.

PR: 258209
MFC after: 2 weeks


# d409305f 26-Apr-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project 12.0.0 release

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12.0.0-0-gd28af7c654d8, a.k.a. 12.0.0 release.

PR: 255570
MFC after: 6 weeks


# e8d8bef9 13-Jun-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-12-init-17869-g8e464dd76bef

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12-init-17869-g8e464dd76bef, the last commit before the
upstream release/12.x branch was created.

PR: 255570
MFC after: 6 weeks


# 48aaf27b 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Update Makefiles under lib/clang and usr.bin/clang for 11.0.0 builds,
and also bump the version in the mtree files.

# 652a9748 03-Apr-2020 Ed Maste <emaste@FreeBSD.org>

lldb: build and enable lua script bindings

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24266

# f0d060f9 03-Apr-2020 Ed Maste <emaste@FreeBSD.org>

lldb: add rule to generate LLDBWrapLua.cpp

Building lldb's lua/python bindings requires swig, but we do not want to
include it in the FreeBSD base system (as a build tool) because it has
non-trivial dependencies. As a workaround, add a make rule to generate
LLDBWrapLua.cpp, and we will commit the generated file.

Requires the swig30 package.

Reviewed by: brooks
Discussed with: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24265

# f46f1d28 27-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for lldb (MK_LLDB=yes). Also update lldb's generated
Config.h, disable a few more parts in the code we don't use, and add a
pre-generated man page.

# 0b57cec5 20-Dec-2019 Dimitry Andric <dim@FreeBSD.org>

Move all sources from the llvm project into contrib/llvm-project.

This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo". That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

Updating the vendor area to match this layout is next.

# a32f82c2 26-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a build of clang plus lldb (enabled via MK_LLDB).

# 6e3f21a2 22-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Update lldb build glue to make MK_LLDB=yes work.

# 532d8940 02-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build glue to make WITH_LLDB work.

# d1efe516 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Remove SRCS for files that have been deleted upstream.

# 62bd6269 13-Jan-2018 Dimitry Andric <dim@FreeBSD.org>

Build llvm-extract with -lz, and add a few objects to liblldb, both of
which turn out to be needed when you don't use -ffunction-sections.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

# 77b0be52 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make lldb build.

# 36cb3905 21-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

First step in updating llvm/clang build glue: make only the clang
executable build.

# 0cc9e150 24-Jul-2017 Dimitry Andric <dim@FreeBSD.org>

Add a few more object files to liblldb, which should solve errors when
linking the lldb executable in some cases. In particular, when the
-ffunction-sections -fdata-sections options are turned off, or
ineffective.

Reported by: Shawn Webb, Mark Millard
MFC after: 2 months
X-MFC-With: r308421

# a580b014 02-Jul-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306956, and update
build glue.


# edd7eadd 27-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306325, and update
build glue.


# 4198293b 16-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r319801 through r320041.


# 5c4e2ac4 13-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Revert r319796 for now, it can cause undefined references when linking
in some circumstances.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

# 834210fa 10-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Remove a few unneeded files from libllvm, libclang and liblldb.

MFC after: 3 days

# 5517e702 16-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303197, and update
build glue.


# f37b6182 03-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302069, and update
build glue (preliminary, not all option combinations work yet).


# b33474c8 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Strip out a few objects from libclang, liblldb and lldb, which are not
referenced due to the selection of tools that we build, and our compile
time options.

# 7c1fda1c 18-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Update objects in liblldb for the MK_LLDB=yes case.

# 629e066c 04-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Update lldb Makefile, and disable some functionality for Windows and
Darwin.

# 09bfd043 03-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Initial updates to llvm/clang build glue.

# 01d8757d 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Centralize where LLVM_SRCS, CLANG_SRCS and LLDB_SRCS are defined.

# e1cd7682 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Use SRCTOP and OBJTOP throughout the llvm/clang/lldb build.

# 986e05bc 26-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Completely revamp the way llvm, clang and lldb are built.

* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.

# 1c3bbb01 03-Jul-2015 Ed Maste <emaste@FreeBSD.org>

Update LLDB snapshot to upstream r241361

Notable upstream commits (upstream revision in parens):

- Add a JSON producer to LLDB (228636)
- Don't crash on bad DWARF expression (228729)
- Add support of DWARFv3 DW_OP_form_tls_address (231342)
- Assembly profiler for MIPS64 (232619)
- Handle FreeBSD/arm64 core files (233273)
- Read/Write register for MIPS64 (233685)
- Rework LLDB system initialization (233758)
- SysV ABI for aarch64 (236098)
- MIPS software single stepping (236696)
- FreeBSD/arm live debugging support (237303)
- Assembly profiler for mips32 (237420)
- Parse function name from DWARF DW_AT_abstract_origin (238307)
- Improve LLDB prompt handling (238313)
- Add real time signals support to FreeBSDSignals (238316)
- Fix race in IOHandlerProcessSTDIO (238423)
- MIPS64 Branch instruction emulation for SW single stepping (238820)
- Improve OSType initialization in elf object file's arch_spec (239148)
- Emulation of MIPS64 floating-point branch instructions (239996)
- ABI Plugin for MIPS32 (239997)
- ABI Plugin for MIPS64 (240123)
- MIPS32 branch emulation and single stepping (240373)
- Improve instruction emulation based stack unwinding on ARM (240533)
- Add branch emulation to aarch64 instruction emulator (240769)


# 1a559761 26-Nov-2014 Ed Maste <emaste@FreeBSD.org>

Update build for LLDB snapshot at upstream rev 216948

Sponsored by: DARPA, AFRL

# e8f1392d 19-Sep-2013 Ed Maste <emaste@FreeBSD.org>

Add LLDB bmake infrastructure

This connects LLDB to the build, but it is disabled by default. Add
WITH_LLDB= to src.conf to build it.

Note that LLDB requires a C++11 compiler so is disabled on platforms
using GCC.

Approved by: re (gjb)
Sponsored by: DARPA, AFRL

# 48aaf27b 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Update Makefiles under lib/clang and usr.bin/clang for 11.0.0 builds,
and also bump the version in the mtree files.


# 652a9748 03-Apr-2020 Ed Maste <emaste@FreeBSD.org>

lldb: build and enable lua script bindings

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24266


# f0d060f9 03-Apr-2020 Ed Maste <emaste@FreeBSD.org>

lldb: add rule to generate LLDBWrapLua.cpp

Building lldb's lua/python bindings requires swig, but we do not want to
include it in the FreeBSD base system (as a build tool) because it has
non-trivial dependencies. As a workaround, add a make rule to generate
LLDBWrapLua.cpp, and we will commit the generated file.

Requires the swig30 package.

Reviewed by: brooks
Discussed with: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24265


# f46f1d28 27-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for lldb (MK_LLDB=yes). Also update lldb's generated
Config.h, disable a few more parts in the code we don't use, and add a
pre-generated man page.


# 0b57cec5 20-Dec-2019 Dimitry Andric <dim@FreeBSD.org>

Move all sources from the llvm project into contrib/llvm-project.

This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo". That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

Updating the vendor area to match this layout is next.


# a32f82c2 26-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a build of clang plus lldb (enabled via MK_LLDB).


# 6e3f21a2 22-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Update lldb build glue to make MK_LLDB=yes work.


# 532d8940 02-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build glue to make WITH_LLDB work.


# d1efe516 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Remove SRCS for files that have been deleted upstream.


# 62bd6269 13-Jan-2018 Dimitry Andric <dim@FreeBSD.org>

Build llvm-extract with -lz, and add a few objects to liblldb, both of
which turn out to be needed when you don't use -ffunction-sections.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>


# 77b0be52 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make lldb build.


# 36cb3905 21-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

First step in updating llvm/clang build glue: make only the clang
executable build.


# 0cc9e150 24-Jul-2017 Dimitry Andric <dim@FreeBSD.org>

Add a few more object files to liblldb, which should solve errors when
linking the lldb executable in some cases. In particular, when the
-ffunction-sections -fdata-sections options are turned off, or
ineffective.

Reported by: Shawn Webb, Mark Millard
MFC after: 2 months
X-MFC-With: r308421


# 5c4e2ac4 13-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Revert r319796 for now, it can cause undefined references when linking
in some circumstances.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>


# 834210fa 10-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Remove a few unneeded files from libllvm, libclang and liblldb.

MFC after: 3 days


# b33474c8 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Strip out a few objects from libclang, liblldb and lldb, which are not
referenced due to the selection of tools that we build, and our compile
time options.


# 7c1fda1c 18-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Update objects in liblldb for the MK_LLDB=yes case.


# 629e066c 04-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Update lldb Makefile, and disable some functionality for Windows and
Darwin.


# 09bfd043 03-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Initial updates to llvm/clang build glue.


# 01d8757d 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Centralize where LLVM_SRCS, CLANG_SRCS and LLDB_SRCS are defined.


# e1cd7682 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Use SRCTOP and OBJTOP throughout the llvm/clang/lldb build.


# 986e05bc 26-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Completely revamp the way llvm, clang and lldb are built.

* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.


# 1a559761 26-Nov-2014 Ed Maste <emaste@FreeBSD.org>

Update build for LLDB snapshot at upstream rev 216948

Sponsored by: DARPA, AFRL


# e8f1392d 19-Sep-2013 Ed Maste <emaste@FreeBSD.org>

Add LLDB bmake infrastructure

This connects LLDB to the build, but it is disabled by default. Add
WITH_LLDB= to src.conf to build it.

Note that LLDB requires a C++11 compiler so is disabled on platforms
using GCC.

Approved by: re (gjb)
Sponsored by: DARPA, AFRL