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 llvm17-17.0.6_13:
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=on: 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/llvm17: 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: 299426
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/llvm17: fix build with clang 21
Recent versions of clang complain about explicit copy constructors,
leading to errors similar to:
/wrkdirs/usr/ports/devel/llvm17/work-default/llvm-project-17.0.6.src/llvm/tools/sancov/sancov.cpp
/wrkdirs/usr/ports/devel/llvm17/work-default/llvm-project-17.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: 292113
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/llvm17: 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/llvm17: 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, 285195
Reported by: ohartmann@walstatt.org
Submitted by: milios@ccsys.com
devel/llvm17: 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/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/llvm[789]: restore arm_bf16.h to ARM backend
arm_bf16.h is generated for both armv7 and aarch64 so move it back to
ARM. We don't support AArch64 without ARM so we can just move it and
not need to worry about duplicate supression (I'd previously fixed the
issue in llvm19 in a more complicated manner so this change removes the
duplicate supression and documents why it's not needed.)
PR: 281179
Reported by: Mark Millard
devel/llvm17: 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/llvm17 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/llvm17/work-default/llvm-project-17.0.6.src/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp:634:34:
note: in instantiation of template class 'std::basic_string<unsigned char>'
requested here
634 | std::basic_string<uint8_t> zeros(reg_info.byte_size, '\0');
| ^
(Only the first 15 lines of the commit message are shown above )
devel/llvm17: install all heaaders with clang
Historically we've been unable to build FreeBSD with the full set due to
conflicts and/or missing features between the compiler provided headers
and FreeBSD's headers. I've verified that I can build world and kernel
on the main, stable/14, and stable/13 branches for amd64 so let's give
it another try in broader testing.
PR: 274542
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/llvm17: aarch64 KASAN and lite flavor fixs
As in the base system, backport:
f577bfb99528 - [sanitizer][msan] fix AArch64 vararg support for KMSAN
Expand STATIC_LIBS (part of the lite flavor) to include cmake bits.
They aren't usable without the .a files they reference.
PR: 271821
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
*/*: 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/llvm17: merge upstream llvm fixes
These fixes were merged to the base LLVM compiler:
158f4f30adb4 [Clang] Do not change the type of captured vars when checking
lambda constraints
3ed9e9e3ace6 [Clang] Add captures to the instantiation scope of lambda call
operators
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/llvm17: remove obsolete powerpc patch
The lines immediatly below the inserted code do the same thing with
more elegance.
Technically this changes the package contents, but there is no
functional change so don't make everyone build with a PORTREVSION bump.
We'll do that soon enough when 17.0.3 comes out.
Reported by: Brad Smith <brad@comstyle.com>
devel/llvm17: update to 17.0.2
For changes in this release see:
https://discourse.llvm.org/t/llvm-17-0-2-released/73840
Fix a duplicate listing of arm_sve.h. It is sufficent to include it only
in the Arm case becaues AArch64 always implies Arm in the port.
devel/llvm17: fix non-aarch64 plist issue
arm_sme_draft_spec_subject_to_change.h is an aarch64-specific header.
Reading the Cmakefiles, it appears arm_bf16.h and arm_sve.h are also
aarch64 not arm specific so move them.
devel/llvm17: fix openmp library depends
Don't link with libffi.
Reformat long or multi-line OPTION_FOO variables.
PR: 273801
Co-authored-by: Ivan Rozhuk <rozhuk.im@gmail.com>
devel/llvm17: Welcome 17.0.1
Welcome the first release of LLVM 17. See the release announcement for
more details: https://discourse.llvm.org/t/llvm-17-0-1-released/73549
(Note that 17.0.0 was tagged, but contained an error so was not
released.)
Fix an issue where libffi would be linked if available by disabling it's
use in OpenMP. [0]
PR: 273801, 273947
Submitted by: Ivan Rozhuk <rozhuk.im@gmail.com> [0]
devel/llvm17: bootstrap from devel/llvm16
Copy llvm16 unchanged except for the exclusion of patches backporting
fixes from upstream LLVM.
This aids diffing to the previous version.