The LLVM Project is a collection of modular and reusable compiler and
toolchain technologies.
This port includes Clang (a C/C++/Objective-C compiler), LLD (a linker),
LLDB (a debugger), an OpenMP runtime library, and the LLVM infrastructure
these are built on.
===> The following configuration options are available for llvm16-16.0.6_15:
BE_AMDGPU=on: AMD GPU backend (required by mesa)
BE_WASM=on: WebAssembly backend (required by firefox via wasi)
CLANG=on: Build clang
COMPILER_RT=on: Sanitizer libraries
DOCS=on: Build and/or install documentation
EXTRAS=on: Extra clang tools
FLANG=off: Flang FORTRAN compiler
LIT=on: Install lit and FileCheck test tools
LLD=on: Install lld, the LLVM linker
MLIR=on: Multi-Level Intermediate Representation
OPENMP=on: Install libomp, the LLVM OpenMP runtime library
POLLY=off: Polyhedral loop and data-locality optimizer
PYCLANG=on: Install python bindings to libclang
STATIC_LIBS=on: Install static libraries (does not effect sanitizers)
====> Options available for the single BACKENDS: you have to select exactly one of them
BE_FREEBSD=off: Backends for FreeBSD architectures
BE_NATIVE=off: Backend(s) for this architecture (X86)
BE_STANDARD=on: All non-experimental backends
===> Use 'make config' to modify these settings
devel/llvm16: Remove the LLDB option and fix plist with DOCS
LLDB's Python script interpreter fails to build with Python 3.13
(_Py_IsFinalizing was removed), which blocks switching the default
Python version to 3.13. Rather than patching an old debugger, remove
the LLDB option as discussed in PR 292105: LLDB remains available
from devel/llvm18 and later and from the base system.
This also drops the swig build dependency and the lua53 and libedit
library dependencies.
While here, fix the plist with DOCS enabled: the openmp HTML
documentation leaves an empty _sources directory behind, and
check-plist fails with an orphaned directory. Remove it, as was
done for devel/llvm12 in a4f732450dd3.
Also drop lldb-tblgen.1 from the installed man pages: it documents
an LLDB tool that is no longer built.
PR: 299425
devel/llvm[14-22]: backport powerpc64le patch from CURRENT
Since 16.0, powerpc64le switches to IEEE long double binary128.
This set of patches backports the change from CURRENT.
LLVM 12 and 13 are omitted, because binary128 handling in those
versions is not finished.
devel/llvm??: remove libxml2 discovery
In commit af979dd126ff4 the dependency on libxml2 was removed. But
libxml2 was still found for LLDB and used if it was present at configure
time.
PR: 295076
Submitted by: laurent
devel/llvm??: Add Mips back to standard backends
I'd forgotten that STANDARD_BACKENDS is includes _FREEBSD_BACKENDS so
Mips dropped out of the list when it was removed from _FREEBSD_BACKENDS.
PR: 295111
Fixes: 2a7c0561200c ("all: drop support for FreeBSD 13, mips and risc64sf")
all: drop support for FreeBSD 13, mips and risc64sf
Reviewed by: many (*)
Differential Revision: https://reviews.freebsd.org/D55624
Differential Revision: https://reviews.freebsd.org/D55642 (merged in from bofh)
many (*)
acm arrowd brooks cmt dch decke dinoex eduardo fluffy fuz gahr garga
jbeich joerg jrm kai kenrap martymac matthew mfechner michaelo mizhka
nobutaka pkubaj se tagattie thj
Anton Saietskii
GenericRikka
Gert Doering
Jan Bramkamp
Oleh Hushchenkov
Oleksandr Kryvulia
Ralf van der Enden
Yamagi
desktop kde python tcltk office
devel/llvm16: fix build with clang 21
Recent versions of clang complain about explicit copy constructors,
leading to errors similar to:
/wrkdirs/usr/ports/devel/llvm16/work-default/llvm-project-16.0.6.src/llvm/tools/sancov/sancov.cpp:521:42:
error: chosen constructor is explicit in copy-initialization
521 | return SpecialCaseList::createOrDie({{ClIgnorelist}},
| ^~~~~~~~~~~~~~
/usr/include/c++/v1/string:1153:64: note: explicit constructor declared here
1153 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit
basic_string(const _Tp& __t) {
| ^
/usr/include/c++/v1/__vector/vector.h:276:91: note: passing argument to
parameter '__il' here
276 | _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
vector(initializer_list<value_type> __il) {
|
^
In this case, `ClIgnorelist` is an instance of `cl::opt`, not a
`std::string` as expected. Use `getValue()` to get the actual
`std::string` value.
PR: 292112
Approved by: brooks (maintainer)
MFH: 2026Q1
devel/llvm1[4567]: keep backport patches local
The patches generated by adding .patch to a github commit URL are
unstable and the output of some of them changed recently. It's
concivable this will be fixed, but they probably won't make any
long term guarantees so store the patches in the ports tree instead of
downloading them.
PR: 292291
MFH: 2026Q1
Sponsored by: DARPA, AFRL
See also: https://github.com/orgs/community/discussions/184094
devel/llvm16: don't build gold plugin when disabled
Disabling the GOLD option didn't actually disable building the plugin,
it just didn't install it in the package. Actually stop traversing into
the directory when the option disabled so we don't end up needing
devel/binutils.
PR: 291247
Sponsored by: DARPA, AFRL
python.mk: rename PYTHON_EXT_SUFFIX to PYTHON_TAG, document, etc
EXT_SUFFIX, according to PEP 3149, refers to the full tag and
extension for compiled extension module objects, eg .cpython-311.so,
.cpython-313t.so, etc. We do not use the correct semantic meaning,
and this usage becomes ambiguous and confusing when tags do not
match between bytecode and compiled extension module objects.
Rename our PYTHON_EXT_SUFFIX to PYTHON_TAG to align with PEP 3147's
specification of a magic tag, which consists of implementation name
and shorthand version only. This is meant for bytecode and other
files containing this tag in their filename that do not depend on
a specific Python ABI for the same version. Chase all existing
consumers.
(Only the first 15 lines of the commit message are shown above )
devel/llvm16: fix backport of llvm19 fixes
There was a missing line in the patch causing part of it to be ignored.
PR: 285195
Submitted by: milios@ccsys.com
Fixes: 9592edb43243 devel/llvm16: backport flang fixes for llvm19
devel/llvm16: Fix !CLANG plist
llvm-debuginfo-analyzer isn't part of Clang, but was matched by the
overly broad pattern `-analyzer`.
Reported by: jrtc27
Sponsored by: DARPA, AFRL
devel/llvm16: backport flang fixes for llvm19
The FLANG option is off by default so this wasn't noted in the llvm19
import. Backport 7bc7672925f81 from upstream LLVM.
The patches to fold-real.cpp and reduction-templates.h were hand
applied.
PR: 283966
Reported by: ohartmann@walstatt.org
devel/llvm*: flip LICENSE_FILE_BSD3CLAUSE setting [NFC]
The location of this license file moved in LLVM 16. Since I'm doing
cleanup in this area and the split of ports is about 50/50, switch to
setting the old location in the older ports so the newer ports set fewer
variables.
Sponsored by: DARPA, AFRL
devel/llvm*: LICENSE_DIR simplification
WRKSRC moved to the top of the source tree with llvm12. As a result,
LICENSE_DIR became ${WRKSRC}/llvm. Given that llvm11 the only port that
wasn't setting LICENSE_DIR, flip the script and default to
${WRKSRC}/llvm with llvm11 overriding.
Sponsored by: DARPA, AFRL
devel/llvm*: Always define LLVM2 license [NFC]
All LLVM ports in the tree use the Apache License 2.0 with LLVM
Exceptions license so cerntralize the definition.
Sponsored by: DARPA, AFRL
devel/llvm16: fix build with libc++ 19
As noted in the libc++ 19 release notes [1], std::char_traits<> is now
only provided for char, char8_t, char16_t, char32_t and wchar_t, and any
instantiation for other types will fail.
This causes devel/llvm16 to fail to compile with clang 19 and libc++
19, resulting in errors similar to:
/usr/include/c++/v1/string:820:42: error: implicit instantiation of
undefined template 'std::char_traits<unsigned char>'
820 | static_assert(is_same<_CharT, typename
traits_type::char_type>::value,
| ^
/wrkdirs/usr/ports/devel/llvm16/work-default/llvm-project-16.0.6.src/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp:636:34:
note: in instantiation of template class 'std::basic_string<unsigned char>'
requested here
636 | std::basic_string<uint8_t> zeros(reg_info.byte_size, '\0');
| ^
(Only the first 15 lines of the commit message are shown above )
devel/llvm*: Remove unnecessary C/CFLAGS definitions
As of 3c5189a0fd4c82addfb659024bf28c5006bf88f7
there's no need to define DNDEBUG manually
PR: 277909
Approved by: portmgr (maintainer timeout, 2+ weeks)
devel/llvm*: Sanitize MANPREFIX
Not bumping as there is no change in PKG. This should have been done in
my previous commit.
Approved by: portmgr (blanket)
devel/llvm14 devel/llvm15 devel/llvm16 devel/llvm17: fix build with clang 18
Clang 18 is more strict in checking inline assembly constraints,
resulting in an error building devel/llvm14, devel/llvm15, devel/llvm16,
and devel/llvm17:
/wrkdirs/usr/ports/devel/llvm14/work-default/llvm-project-14.0.6.src/compiler-rt/lib/asan/asan_rtl_x86_64.S:130:286:
error: displacement 70368744177664 is not within [-2147483648, 2147483647]
This is fixed by two upstream commits:
https://github.com/llvm/llvm-project/commit/b9935bb02a50https://github.com/llvm/llvm-project/commit/966d564e43e6
PR: 276155
Approved by: brooks (maintainer)
MFH: 2024Q1
devel/llvm1[0123456]: Fix build
After the EOL of stable/12 sparc related codes were removed which broke
the build. This patches fixes those builds and also the consumers.
Thanks to dim@ for tha patches.
Approved by: portmgr (blanket)
*/*: Sunset 12.4-RELEASE/12-STABLE from ports tree
- Remove all references to defunct ARCH arm
- Remove all references to defunct ARCH sparc64
- Remove x11-drivers/xf86-video-sunffb which requires defunct sparc64
ARCH
- Remove sysutils/afbinit requires defunct sparc64 ARCH
- Remove all references to bktr driver
- Remove all references to defunct FreeBSD_12
- Remove all references to OSVERSION/OSREL corresponding to 12
- Remove conditionals in Mk/Uses/cabal.mk
- Remove sparc reference from Mk/Uses/qt-dist.mk
- Remove BROKEN_sparc64/NOT_FOR_ARCH=sparc64
- Remove BROKEN_FreeBSD_12* from:
- Remove OpenSSL patches from:
- Remove conditional flags for OSVERSION >= 1300000 to fixed flags.
Also move conditional flags for non sparc64/arm ARCH to fixed flags.
Reviewed by: brooks, jbeich, rene, salvadore
Differential Revision: https://reviews.freebsd.org/D42068
devel/llvm1[234567]: enable qsort sanatizer wrapper
I'd disabled it in 10.0.0 when it was found to be broken. It was then
fixed in LLVM 12, but the patch was never never removed and I propogated
it along for several year.
Reported by: Brad Smith <brad@comstyle.com>
See also: https://github.com/llvm/llvm-project/issues/46176
devel/llvm16: merge backports from FreeBSD src
These upstream LLVM commits have been merged to FreeBSD's source tree
post the 17.0.6 release:
7440e4ed85aa [sanitizer] Add re-execution on FreeBSD when ASLR is detected
(#73439)
989879f8fded [Clang] Allow C++11 style initialisation of SVE types.
9ca395b5ade1 [clang][AST] Propagate the contains-errors bit to DeclRefExpr from
VarDecl's initializer.
While here, be consistant about using 12 digits of commit hash.
devel/llvm16: backport upstream powerpc FP fix
The upstream commit fde5924dcc69 has been merged to llvm in the FreeBSD
main branch so merge it here as well.
Issue: https://github.com/llvm/llvm-project/issues/63542
devel/llvm16: support polyhedral optimizations
The POLLY option enables the Polly optimizer. It is currently disabled
by default to allow a merge to quarterly without added risk. I plan to
enable it when I create devel/llvm17 in a couple weeks.
From the website (https://polly.llvm.org):
Polly is a high-level loop and data-locality optimizer and
optimization infrastructure for LLVM. It uses an abstract mathematical
representation based on integer polyhedra to analyze and optimize the
memory access pattern of a program. We currently perform classical
loop transformations, especially tiling and loop fusion to improve
data-locality. Polly can also exploit OpenMP level parallelism, expose
SIMDization opportunities.
PR: 272400
devel/llvm16: change clang to allow -m32 on arm64
This is a backport from upstream and will be merged to FreeBSD head
soon. See D40943 for more info.
Sponsored by: DARPA
all: remove explicit versions in USES=python for "3.x+"
The logic in USES=python will automatically convert this to 3.8+ by
itself.
Adjust two ports that only had Python 3.7 mentioned but build fine
on Python 3.8 too.
finance/quickfix: mark BROKEN with PYTHON
libtool: compile: c++ -DHAVE_CONFIG_H -I. -I../.. -I -I. -I.. -I../.. -I../C++
-DLIBICONV_PLUG -DPYTHON_MAJOR_VERSION=3 -Wno-unused-variable
-Wno-maybe-uninitialized -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong
-fno-strict-aliasing -DLIBICONV_PLUG -Wall -ansi
-Wno-unused-command-line-argument -Wpointer-arith -Wwrite-strings
-Wno-overloaded-virtual -Wno-deprecated-declarations -Wno-deprecated -std=c++0x
-MT _quickfix_la-QuickfixPython.lo -MD -MP -MF
.deps/_quickfix_la-QuickfixPython.Tpo -c QuickfixPython.cpp -fPIC -DPIC -o
.libs/_quickfix_la-QuickfixPython.o
warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean
'-Wno-uninitialized'? [-Wunknown-warning-option]
QuickfixPython.cpp:175:11: fatal error: 'Python.h' file not found
^~~~~~~~~~
1 warning and 1 error generated.
Reviewed by: portmgr, vishwin, yuri
Differential Revision: <https://reviews.freebsd.org/D40568>
devel/llvm16: backport fix for generate arm_neon.h
Backport db49231: [clang][BFloat] Avoid redefining bfloat16_t in
arm_neon.h.
This fixes builds of FreeBSD/aarch64. The change was merged
to the llvm16 in src prior to commit.
devel/llvm16: update to 16.0.6 release
Change the lite flavor to default to BE_FREEBSD rather than BE_NATIVE to
allow its use in cross-build CI pipelines.
Backport fix for LLVM bug 61396. [0] This fixes miscompilation of gcc
on 32-bit arm.
PR: 271992 [0]
Reported by: jfc@mit.edu [0]
devel/llvm*: Consistently use python:3.7+
llvm12 was inappropriately constrained to 3.6-3.9 breaking the ability
to set 3.10 as the default. llvm11 just specified "python", but there's
no need to keep 2.7 support around. The rest had obsolete 3.6+ entries.
No functional change: This is not expected to change the version of
python used.
PR: 270978
MFH: 2023Q2
Reported by: michael.osipov@siemens.com
Sponsored by: DARPA
devel/llvm16: add a lite FLAVOR
The lite flavor is for when you just need a FreeBSD compiler (e.g., in
CI). By default it includes CLANG and LLD as well as backends required
for FreeBSD and FreeBSD ports (BE_NATIVE, BE_AMDGPU, and BE_WASM).
The lite install is ~350GiB on amd64 vs ~1.9GiB for default and it has
only a single dependency (zstandard). (The goal was no dependencies,
but libzstd is a private lib in base.)
Sponsored by: DARPA
devel/llvm16: add a STATIC_LIBS option
When enabled (default) assorted LLVM componant static libraries are
included in the package. Disabling this option reduces the installed
size by ~1GiB.
Sponsored by: DARPA
devel/llvm16: enable MLIR by default, fix aarch64
Some ports require on MLIR so reenable it by default. This turns it on
for all platforms where it was previously disabled for 32-bit platforms
and pulled in indirectly by FLANG. If this proves to cause too many
user issues we'll disable it for 32-bit again.[0]
Fix a missed 16.0.0->16 change in backend include directories which
broke aarch64 with BE_NATIVE. Also enable the ARM (32-bit) backend on
aarch64 as it's plausiably useful.[1]
PR: 269927 [0]
Reported by: yuri [0], Mark Millard <marklmi@yahoo.com> [1]
devel/llvm16: 16.0.0rc3
Don't enable FLANG by default and stop installing a link from flang-new
to flang. The former has a deliberately obtuse interface intended to
prevent casual use. While the community sorts it self out, just stick
with that to avoid future confusion. See:
https://discourse.llvm.org/t/reviving-rename-flang-new-to-flang
devel/llvm16: copy unchanged from devel/llvm15
This is a copy of llvm15 at 79aeb739c50106148b1b8bf5f84a9b203f4d7fe8.
Copying it unmodifed makes it easy to diff to the source.
Sponsored by: DARPA