As the releases are built (without a surrounding extra container)
on GitHub Actions these days, we don't need to hold the docker
images back to an old version for the sake of compatibility;
instead, updating to a newer version provides more modern tools
for users of the docker image.
The script release.sh, which earlier was used for building releases,
uses docker for doing clean isolated builds, and thus needs to be
updated with the distro version used in the dockerfiles.
CMake 4.0 removed compatibility with CMake versions below 3.5.
Therefore, it errors out on projects with a
cmake_minimum_required() less than 3.5.
(Since CMake 3.31, it already warns that compatibility with versions
below 3.10 is deprecated.)
By passing CMAKE_POLICY_VERSION_MINIMUM=3.5, we indicate that
we are ok with configuring this project with the policies of
CMake 3.5, even if the project files themselves don't state it.
This flag is only recognized by CMake 4.0; older versions will
only warn that the manually specified variable is unused.
Relevant changes in LLVM 20.1.x compared with LLVM 19.x are:
- Don't warn when doing LTO with mixed Rust/C object files, where
the target triples differ in the vendor field
(<arch>-w64-windows-gnu vs <arch>-pc-windows-gnu)
- Fix including LLVM/MSVC style import libraries in libraries linked
with --whole-archive
- Support for files over 2 GB in the libcxx fstream methods
tellg()/seekg()
- Lots of work on improved ARM64EC and ARM64X support in LLVM and LLD
- New linker flags --dependent-load-flag and --functionpadmin, similar
to the corresponding lld-link/MS link.exe flags
- Improvements in address sanitizer, supporting many more x86
instructions
- Changes to address sanitizer, that (unintentionally) makes it fail
harder than before when used together with msvcrt.dll. Using
address sanitizer with msvcrt.dll is unsupported though.
Since 6127724786d581d2653df7420d1f28709288a107 in llvm-project
(Nov 4 2024), this variable no longer is referenced, and it
probably hasn't been needed for much longer than that.
It's enough to check for the _UCRT define these days, as long
as we are including a header that pulls in the base mingw headers.
Since 8b2ece59fccf0a65257b1ba2fe8d67d7e8a2e8c1 in mingw-w64 (May 6th
2019), the mingw-w64 headers define _UCRT. Since
94a28397eec79e54ce5a8354512f43da88f815d2 (committed on the same date),
the mingw-w64 headers use 0xE00 instead of 0x1400 for UCRT.
This reverts commit 490dfffb32.
This is no longer necessary, as we now can build runtimes using
the latest LLVM 19 versions, that support building sanitizers
for all architectures.
Update to using clang-18 from the host system; version 16 or
newer is required for the implicitly selected config files
(which are used since 866d47cced);
that version changed whether the target triples are normalized
before locating config files.
This allows building runtimes with the current versions of LLVM
19.x, rather than needing to select an older version.
This is one of the packages which aren't needed by the toolchain
build itself, but is provided as a convenience to useres of the image.
Many projects that build standalone x86 assembly can use either
nasm or yasm, but lately most projects prefer nasm (which has
support for newer x86 simd extensions).
In Ubuntu 24.04, this package is no longer available.
However, this package probably never actually was needed anyway,
and was probably only provided as a convenience for users of the
docker image.
This is required for building libffi. With ubuntu-22.04 images,
the libltdl-dev package was available out of the box.
Also explicitly install swig, which we rely on - this also seems
to have been available implicitly.
This fixes building on Ubuntu 24.04 (the one currently used by
the github actions ubuntu-latest tag), by including a fix for texinfo
7.0.
Not bumping to ffmpeg 7.x, as some tests there can be flaky at times.
At this point, it is reasonably mature.
There still obviously are projects that won't build with llvm-mingw,
both due to unimplemented features that GCC/binutils have, or for
other reasons, but the toolchain has seen quite a lot of usage
since this paragraph originally was written.
The wrapper script no longer has any purpose on Unix.
Just do a plain symlink to the clang-scan-deps tool.
On Windows, the wrapper executable still is used to inject a
default -target option, if the executable name doesn't contain
a triple.
clang-scan-deps can pick it up automatically from the first argument
now.
For the windows wrapper, keep passing -target, to allow running with
a potentially foreign clang-scan-deps.exe.
Clang only picks up config files implicitly using the normalized
triple form, so use file names with "-windows-gnu" instead of
"-mingw32".
In theory, we could also want to pick up the config file implicitly
by having "<triple>-<mode>" be a symlink directly to the clang
executable. That works for regular mingw32 targets, but for the
mingw32uwp target, there's no distinction in the normalized
triple, so both would end up using the same "-windows-gnu" config
files. So as long as we want to support the mingw32uwp prefixed
tools, we need to use a wrapper.
The wrapper script no longer has any purpose on Unix.
Just do a plain symlink to the clang-scan-deps tool.
On Windows, the wrapper executable still is used to inject a
default -target option, if the executable name doesn't contain
a triple.
clang-scan-deps can pick it up automatically from the first argument
now.
For the windows wrapper, keep passing -target, to allow running with
a potentially foreign clang-scan-deps.exe.
Clang only picks up config files implicitly using the normalized
triple form, so use file names with "-windows-gnu" instead of
"-mingw32".
In theory, we could also want to pick up the config file implicitly
by having "<triple>-<mode>" be a symlink directly to the clang
executable. That works for regular mingw32 targets, but for the
mingw32uwp target, there's no distinction in the normalized
triple, so both would end up using the same "-windows-gnu" config
files. So as long as we want to support the mingw32uwp prefixed
tools, we need to use a wrapper.
If we never set $TARGET, we'd previously miss including $CMD_EXE
in the nested command. (This doesn't happen in actual uses of
the wrapper though, but is included for completeness.)
This matches how the corresponding variable is handled in the C
version of the wrapper.
This is the latest version, minus one commit.
The very latest commit, 20331109d1c90c19a510408ab119a76004bc41ea,
causes issues with compiling VLC; that is a VLC issue (redefining
GUIDs that now are provided by the system headers), but holding
off of that change until VLC is updated to cope with it.
Since 0c391133c9201ef29273554a1505ef855ce17668 in llvm-project
(LLVM 17), the sanitizers can be built for aarch64, and since
5ea9dd8c7076270695a1d90b9c73718e7d95e0bf (backported to
LLVM 19.1.0 RC 4), they can be built for armv7 too.
While they can be built, address sanitizer doesn't work for the
non-x86 architecture, so omit those files from the install,
to make it clear that they aren't expected to work.
Thus, in practice, this builds the ubsan and profile runtimes for
aarch64 and armv7.
This allows using the build-llvm.sh script for doing a cross build
of LLVM, while the same directory may contain a native build
which can be out of sync with the actual source.