History log of /freebsd-current/usr.bin/clang/clang.prog.mk
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 83771b19 09-Nov-2023 Andrew Turner <andrew@FreeBSD.org>

llvm: Reduce overlinking with the minimal llvm

We only need to link against libz and libzstd when linking against the
fill libllvm, libllvmminimal doesn't use either library. Move adding
libz and libzstd to the list of libraries to link against to where
we decide to use the full libllvm.

Reported by: Cristian Marussi <Cristian.Marussi@arm.com>
Reported by: Colin S. Gordon <csgordon@fastmail.com>
Reviewed by: dim
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D42528


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

Remove $FreeBSD$: one-line sh pattern

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


# f5761726 23-Jul-2023 Dimitry Andric <dim@FreeBSD.org>

Move LIBADD lines from usr.bin/clang/*/Makefile one level up

Some utilities under usr.bin/clang were only linked to libz, while most
others were linked to libz and libzstd. Make this consistent, and remove
repetition, by moving these LIBADD lines to usr.bin/clang/clang.prog.mk
and usr.bin/clang/clang.prog.mk.

MFC after: 3 days


# 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


# 31ba4ce8 02-Aug-2021 Alex Richardson <arichardson@FreeBSD.org>

Allow bootstrapping llvm-tblgen on macOS and Linux

This is needed in order to build various LLVM binutils (e.g. addr2line)
as well as clang/lld/lldb.

Co-authored-by: Jessica Clarke <jrtc27@FreeBSD.org>
Test Plan: Compiles on ubuntu 18.04 and macOS 11.4
Reviewed By: dim
Differential Revision: https://reviews.freebsd.org/D31057

# 4014a71f 23-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a minimal build of the clang executable.

# 8930262b 28-Nov-2016 Dimitry Andric <dim@FreeBSD.org>

Fix packaging for clang, lldb and lld 3.9.0

During the upgrade of clang/llvm etc to 3.9.0 in r309124, the PACKAGE
directive in the usr.bin/clang/*.mk files got dropped accidentally.

Restore it, with a few minor changes and additions:
* Correct license in clang.ucl to NCSA
* Add PACKAGE=clang for clang and most of the "ll" tools
* Put lldb in its own package
* Put lld in its own package

Reviewed by: gjb, jmallett
X-MFC-With: 309124
Differential Revision: https://reviews.freebsd.org/D8666

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

Centralize where LLVM_SRCS, CLANG_SRCS and LLDB_SRCS are defined.

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

Missed one .mk file where OBJTOP can be used.

# 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.

# 7d2c986e 05-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Fix mis-merged LDADD/DPADD

Sponsored by: The FreeBSD Foundation

# b626f5a7 04-Jan-2016 Glen Barber <gjb@FreeBSD.org>

MFH r289384-r293170

Sponsored by: The FreeBSD Foundation


# eacae6dc 03-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix LDADD/DPADD that should be LIBADD.

Sponsored by: EMC / Isilon Storage Division

# 9be27fdc 09-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# cc38b640 23-Jun-2015 Dimitry Andric <dim@FreeBSD.org>

Update llvm/clang build glue.

# 9067d508 16-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Move clang binaries into FreeBSD-clang package

# 9268022b 18-Nov-2014 Simon J. Gerraty <sjg@FreeBSD.org>

Merge from head@274682


# 5608fd23 19-Aug-2014 Bryan Drewery <bdrewery@FreeBSD.org>

Revert r267233 for now. PIE support needs to be reworked.

1. 50+% of NO_PIE use is fixed by adding -fPIC to INTERNALLIB and other
build-only utility libraries.
2. Another 40% is fixed by generating _pic.a variants of various libraries.
3. Some of the NO_PIE use is a bit absurd as it is disabling PIE (and ASLR)
where it never would work anyhow, such as csu or loader. This suggests
there may be better ways of adding support to the tree. Many of these
cases can be fixed such that -fPIE will work but there is really no
reason to have it in those cases.
4. Some of the uses are working around hacks done to some Makefiles that are
really building libraries but have been using bsd.prog.mk because the code
is cleaner. Had they been using bsd.lib.mk then NO_PIE would not have
been needed.

We likely do want to enable PIE by default (opt-out) for non-tree consumers
(such as ports). For in-tree though we probably want to only enable PIE
(opt-in) for common attack targets such as remote service daemons and setuid
utilities. This is also a great performance compromise since ASLR is expected
to reduce performance. As such it does not make sense to enable it in all
utilities such as ls(1) that have little benefit to having it enabled.

Reported by: kib

# ee7b0571 19-Aug-2014 Simon J. Gerraty <sjg@FreeBSD.org>

Merge head from 7/28


# 80189b3b 17-Jul-2014 Brooks Davis <brooks@FreeBSD.org>

Replace all uses of libncurses and libtermcap with their wide character
variants. This allows usable file system images (i.e. those with both a
shell and an editor) to be created with only one copy of the curses library.

Exp-run: antoine
PR: 189842
Discussed with: bapt
Sponsored by: DARPA, AFRL

# 864c53ea 08-Jun-2014 Bryan Drewery <bdrewery@FreeBSD.org>

In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.

This is currently an opt-in build flag. Once ASLR support is ready and stable
it should changed to opt-out and be enabled by default along with ASLR.

Each application Makefile uses opt-out to ensure that ASLR will be enabled by
default in new directories when the system is compiled with PIE/ASLR. [2]

Mark known build failures as NO_PIE for now.

The only known runtime failure was rtld.

[1] http://www.bsdcan.org/2014/schedule/events/452.en.html
Submitted by: Shawn Webb <lattera@gmail.com>
Discussed between: des@ and Shawn Webb [2]

# 9ac5c14c 16-May-2014 Simon J. Gerraty <sjg@FreeBSD.org>

Pay attention to MK_SHARED_TOOLCHAIN

# f785676f 16-Feb-2014 Dimitry Andric <dim@FreeBSD.org>

Upgrade our copy of llvm/clang to 3.4 release. This version supports
all of the features in the current working draft of the upcoming C++
standard, provisionally named C++1y.

The code generator's performance is greatly increased, and the loop
auto-vectorizer is now enabled at -Os and -O2 in addition to -O3. The
PowerPC backend has made several major improvements to code generation
quality and compile time, and the X86, SPARC, ARM32, Aarch64 and SystemZ
backends have all seen major feature work.

Release notes for llvm and clang can be found here:
<http://llvm.org/releases/3.4/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.4/tools/clang/docs/ReleaseNotes.html>

MFC after: 1 month


# 5ea2b3b5 23-Aug-2012 Dimitry Andric <dim@FreeBSD.org>

Sprinkle a bit of style.Makefile(5) across various clang Makefiles. No
functional changes.

MFC after: 3 days

# 47c832c3 09-Jun-2010 Roman Divacky <rdivacky@FreeBSD.org>

Import the build makefiles for clang/LLVM.

Approved by: ed (mentor)

# 31ba4ce8 02-Aug-2021 Alex Richardson <arichardson@FreeBSD.org>

Allow bootstrapping llvm-tblgen on macOS and Linux

This is needed in order to build various LLVM binutils (e.g. addr2line)
as well as clang/lld/lldb.

Co-authored-by: Jessica Clarke <jrtc27@FreeBSD.org>
Test Plan: Compiles on ubuntu 18.04 and macOS 11.4
Reviewed By: dim
Differential Revision: https://reviews.freebsd.org/D31057


# 4014a71f 23-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a minimal build of the clang executable.


# 8930262b 28-Nov-2016 Dimitry Andric <dim@FreeBSD.org>

Fix packaging for clang, lldb and lld 3.9.0

During the upgrade of clang/llvm etc to 3.9.0 in r309124, the PACKAGE
directive in the usr.bin/clang/*.mk files got dropped accidentally.

Restore it, with a few minor changes and additions:
* Correct license in clang.ucl to NCSA
* Add PACKAGE=clang for clang and most of the "ll" tools
* Put lldb in its own package
* Put lld in its own package

Reviewed by: gjb, jmallett
X-MFC-With: 309124
Differential Revision: https://reviews.freebsd.org/D8666


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

Centralize where LLVM_SRCS, CLANG_SRCS and LLDB_SRCS are defined.


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

Missed one .mk file where OBJTOP can be used.


# 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.


# 7d2c986e 05-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Fix mis-merged LDADD/DPADD

Sponsored by: The FreeBSD Foundation


# eacae6dc 03-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix LDADD/DPADD that should be LIBADD.

Sponsored by: EMC / Isilon Storage Division


# cc38b640 23-Jun-2015 Dimitry Andric <dim@FreeBSD.org>

Update llvm/clang build glue.


# 9067d508 16-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Move clang binaries into FreeBSD-clang package


# 5608fd23 19-Aug-2014 Bryan Drewery <bdrewery@FreeBSD.org>

Revert r267233 for now. PIE support needs to be reworked.

1. 50+% of NO_PIE use is fixed by adding -fPIC to INTERNALLIB and other
build-only utility libraries.
2. Another 40% is fixed by generating _pic.a variants of various libraries.
3. Some of the NO_PIE use is a bit absurd as it is disabling PIE (and ASLR)
where it never would work anyhow, such as csu or loader. This suggests
there may be better ways of adding support to the tree. Many of these
cases can be fixed such that -fPIE will work but there is really no
reason to have it in those cases.
4. Some of the uses are working around hacks done to some Makefiles that are
really building libraries but have been using bsd.prog.mk because the code
is cleaner. Had they been using bsd.lib.mk then NO_PIE would not have
been needed.

We likely do want to enable PIE by default (opt-out) for non-tree consumers
(such as ports). For in-tree though we probably want to only enable PIE
(opt-in) for common attack targets such as remote service daemons and setuid
utilities. This is also a great performance compromise since ASLR is expected
to reduce performance. As such it does not make sense to enable it in all
utilities such as ls(1) that have little benefit to having it enabled.

Reported by: kib


# 80189b3b 17-Jul-2014 Brooks Davis <brooks@FreeBSD.org>

Replace all uses of libncurses and libtermcap with their wide character
variants. This allows usable file system images (i.e. those with both a
shell and an editor) to be created with only one copy of the curses library.

Exp-run: antoine
PR: 189842
Discussed with: bapt
Sponsored by: DARPA, AFRL


# 864c53ea 08-Jun-2014 Bryan Drewery <bdrewery@FreeBSD.org>

In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.

This is currently an opt-in build flag. Once ASLR support is ready and stable
it should changed to opt-out and be enabled by default along with ASLR.

Each application Makefile uses opt-out to ensure that ASLR will be enabled by
default in new directories when the system is compiled with PIE/ASLR. [2]

Mark known build failures as NO_PIE for now.

The only known runtime failure was rtld.

[1] http://www.bsdcan.org/2014/schedule/events/452.en.html
Submitted by: Shawn Webb <lattera@gmail.com>
Discussed between: des@ and Shawn Webb [2]


# 9ac5c14c 16-May-2014 Simon J. Gerraty <sjg@FreeBSD.org>

Pay attention to MK_SHARED_TOOLCHAIN


# 5ea2b3b5 23-Aug-2012 Dimitry Andric <dim@FreeBSD.org>

Sprinkle a bit of style.Makefile(5) across various clang Makefiles. No
functional changes.

MFC after: 3 days


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 47c832c3 09-Jun-2010 Roman Divacky <rdivacky@FreeBSD.org>

Import the build makefiles for clang/LLVM.

Approved by: ed (mentor)