Commit Graph
1052 Commits
Author SHA1 Message Date
Martin Storsjö eda1a47ce0 build-llvm: Bump to LLVM 18.1.0 RC 4 2024-02-27 23:34:35 +02:00
Martin Storsjö 188015866f build-mingw-w64: Bump to the latest version as of Feb 27th 2024-02-27 23:34:10 +02:00
Martin Storsjö 8f42112719 github: Build the multiplatform docker image in two steps
6b6b1240e2 tried to build a
multiplatform image, by building two images separately and pushing
them one at a time, with the same name (but with a different platform).

This doesn't work as expected; the last push for the image name
replaces earlier pushes. So depending on which push finishes
last, we'd end up with either an amd64 or arm64 image, but not
one that supports both.

Instead, push two separate images just with push-by-digest, and
then create the actual tag with "docker buildx imagetools create".

Alternatively, we could build all platform variants of the main
image with Dockerfile.toolchain, simplifying the setup significantly.
The contents of such a build is marginally different though, so
keep the amd64 image as it was, for now, compiled in that environment.
2024-02-27 23:31:00 +02:00
Martin Storsjö ed5fd4c6a0 github: Add a manual job for testing installing with a system clang 2024-02-26 00:22:14 +02:00
Martin Storsjö 9f819214f9 Add a dockerfile for testing installation with a system clang distribution 2024-02-26 00:22:14 +02:00
Norbert Lange a1e0579bad if using an existing clang, test if cfguard is available 2024-02-26 00:22:14 +02:00
Norbert Lange 47355937ad support using an existing clang installation
add an option --host-clang which will skip building llvm,
and instead provide symlinks and wrappers for clang and
llvm tools.

Currently the clang version is detected, but it does not
affect the llvm version that will be downloaded and used.
2024-02-26 00:22:14 +02:00
Martin Storsjö da480f0100 github: Don't build with dylibs enabled in the msys2 mingw64 environment
The total number of exported symbols in this build configuration has
now reached the limit for the number of exported symbols in a DLL,
with the latest version of llvm-project from git.

This isn't an issue when building with Clang, as it marks many
symbols as excluded from auto-export.
2024-02-24 22:08:16 +02:00
Martin Storsjö 908f88f7e5 github: Don't set the load flag to docker/build-push-action if push is set
With buildx, both push and load flags can't be set at the same time.
2024-02-21 17:20:31 +02:00
Martin Storsjö 489a96cc70 build-llvm: Bump to LLVM 18.1.0 RC 3
This adds the following:
- LLD now uses the SOURCE_DATE_EPOCH env variable for setting the
  COFF header timestamp
- LLD now also supports --lto-emit-asm and -plugin-opt=emit-llvm
  in the mingw linker interface
2024-02-21 09:04:04 +02:00
Martin Storsjö 336895a8a3 build-mingw-w64: Bump to the latest version as of Feb 21st
This removes uses of __DATE__ and -Werror from mingw-w64-tools,
and updates winpthreads (mostly for compatibility with MSVC).
2024-02-21 09:02:48 +02:00
Martin Storsjö 373c32f91a docker: Bump the base images to Ubuntu 22.04
This raises the versions of bundled software, providing e.g.
autoconf 2.71, which is needed for Python 3.12.

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.
2024-02-20 14:33:13 +02:00
Martin Storsjö 4dbd39ecbf github: Properly propagate BUILD_DATE to BUILD_DATE_UNIX
Previously, when echoing the definition of BUILD_DATE to
$GITHUB_OUTPUT, that doesn't make it available as an environment
variable. (And if it would be echoed to $GITHUB_ENV, it still
wouldn't take effect until the next step within the same job either.)

Therefore, this previously set BUILD_DATE to $(date -d "" +%s),
which seems to produce a timestamp corresponding to the start of
the current day.
2024-02-13 15:48:27 +02:00
Martin Storsjö 3ed3b66ea3 release-macos: Don't assume that gtar is available on macOS 2024-02-13 10:13:54 +02:00
Norbert Lange 8caf3767a4 attempt to use reproducible timestamps
This sets SOURCE_DATE_EPOCH to the commit timestamp, toolchains
should pick up timestamps from this variable.
The same sources ideally would produce the same binary, see
https://reproducible-builds.org.

Set the timestamps within the tar archives to the start of the
CI pipeline.

Sort the archive contents.
2024-02-13 10:13:54 +02:00
Norbert Lange 45ad09642f improve tar packaging
The generated tar archives contain the uid/gid of the builder,
if unpacked as root on another system those will denote nothing
or an unexpected user/group.

The expectation would be uid/gid = 0.

Use a simple enough tar format as well.

The Mac version of tar (bsdtar?) does not support those flags,
for CI the separate gnu-tar is installed.
2024-02-13 10:13:54 +02:00
Dmitry Tretyakov 6b6b1240e2 docker: build linux/arm64 images (#398) 2024-02-09 23:28:09 +02:00
Martin Storsjö 6775203bde build-llvm: Bump to LLVM 18.1.0 RC 2
This gets rid of extra, unused __chkstk symbols in compiler-rt
builtins, that could cause conflicts when building Wine.
2024-02-07 09:34:56 +02:00
Martin Storsjö d1d7309583 build-mingw-w64: Bump to the latest version as of Feb 7th
This fixes the availability of __cpuidex for Clang 18.
2024-02-07 09:34:07 +02:00
Martin Storsjö 1e08d1adc5 github: Bump the docker actions to the latest version
The previous ones used Node 16, which is deprecated.
2024-02-06 12:23:45 +02:00
Martin Storsjö c2a38eb71b build-python: Bump to Python 3.11.7 2024-01-31 00:16:10 +02:00
Martin Storsjö cb52ece411 build-llvm: Fix the selection of python import library
Since cpython-mingw v3.11 (see cpython-mingw commit
8aeb46d09c068a1228e83b29101c17bf1ff0612a), the versionless, stable
ABI libpython3.dll gets installed, along with libpython3.dll.a.

Ideally we would use this, which gets us better flexibility, but
in practice, LLDB fails to link against this, as it doesn't expose
enough of the symbols we use and need.

Previously, we ended up with PYTHON_LIB containing two path names,
which caused CMake to print warnings about ignoring extra paths
on the command line.

This fixes issue #396.
2024-01-31 00:16:05 +02:00
Martin Storsjö f26412b8ef github: Upgrade missed deprecated actions to newer ones
These were missed in ad30b74173.

The mismatch between upload-artifact and download-artifact in
ad30b74173 makes the later steps
fail to download the artifacts from previous steps.
2024-01-30 17:14:00 +02:00
Martin Storsjö f4f78cd984 build-mingw-w64: Bump to the latest version as of Jan 30th 2024-01-30 10:39:33 +02:00
Martin Storsjö 021af31c8d run-lldb-tests: Skip the separate strip step when using PDB files
Since 7dcd8ef135147de1576c2863b963ec929a15e8cb in llvm-project
(Dec 15th), LLD can strip out the bundled DWARF debug info directly
when linking, while creating a PDB file, simplifying this test case.
2024-01-30 10:39:33 +02:00
Martin Storsjö 1d276f5300 build-llvm: Bump to LLVM 18.1.0 RC 1
Relevant changes/fixes since the last version:
- Added the new Clang option -fno-auto-import, affecting both code
  generation (avoiding generating .refptr stubs) and linking
  (passing --disable-auto-import, to avoid subtle runtime errors,
  which could happen if code built without .refptr stubs would
  autoimport symbols anyway)
- Fix issues with running the toolchain, or building sources on,
  network mounts. Previously, there were issues with VirtualBox
  shared folders or Remote Desktop shared folders.
- Pass LTO options from the compiler driver to the linker
- Support more LTO options in the linker
- LLD now implements the --icf=safe option properly
- Support using the -S/-s flags in LLD, to strip out DWARF debug
  info and symbol table, while producing a PDB file
- Fix LTO issues around __imp_ symbols, making it support building
  the base mingw-w64-crt files with LTO
- LLD now doesn't try to detect/add MSVC library directories when
  linking in MinGW mode
- Fix building compiler-rt sanitizers, when libcxx is available only
  in static form
- Fix building a standalone libclang_rt.atomic_dynamic for MinGW
  targets
- Support for the MENUEX resource type in llvm-windres
- llvm-windres now supports referencing filenames in .rc files,
  constructed from multiple concatenated string literals
- Various fixes for the llvm-windres option --preprocessor, including
  the breaking change to match the new GNU windres behaviour from
  binutils 2.36
- Don't look for a GCC in path when Clang is installed next to
  a suitable sysroot (mostly relevant for MSYS2)
- Avoid exposing unprefixed mmap symbols in the profiling runtime,
  which could lead to misdetections in user code
- Support for reading Windows thread names in LLDB
2024-01-30 10:39:16 +02:00
Martin Storsjö ad30b74173 github: Upgrade deprecated actions to newer ones
The previous ones use Node 16 which now is deprecated.
2024-01-29 23:17:42 +02:00
Martin Storsjö 1139164bf6 github: Stop setting TEST_IS_EXECUTED_IN_A_SLOW_ENVIRONMENT and large_tests=False
The default free github runners have been sized up now, so the
tests now run fine without these settings.
2024-01-29 23:17:14 +02:00
Martin Storsjö cfe2ac2783 build-llvm: Set CMAKE_SYSTEM_PROCESSOR when cross compiling
Normally there's nothing in the LLVM build that strictly requires
this, but some fringe parts of the build may use it. Set it
for consistency.
2024-01-24 09:11:40 +02:00
Martin Storsjö ac3c8bfe35 test: Add a testcase for atomic helpers 2024-01-24 09:11:40 +02:00
Martin Storsjö c6f48859d8 build-compiler-rt: Include atomics helpers in the builtins library
These helpers are statically linked into each DLL/EXE that uses
them.

They are primarily used for atomic access to variables that are
larger than what the platform natively can support - i.e. primarily
for accessing atomic variables larger than 8 bytes.

The fallback implementations rely on explicit locks (spinlocks
in practice).

As the locks are statically linked into each module that uses the
atomic variable, any concurrent access to such an atomic variable
from two different DLLs/EXEs wouldn't actually end up being
properly atomic.

However cross-module atomic variables (larger than 8 bytes) is
very rare so this isn't deemed to be much of a practical issue.

In GCC based toolchains, the corresponding helpers reside in
a separate shared library, libatomic-1.dll (although it can also
be linked statically).
2024-01-24 09:11:40 +02:00
Martin Storsjö 7bbbf7c65f strip-llvm: Inspect the --host= argument for the kind of triple
Don't assume that any host argument indicates cross compiling for
Windows.

Update build-all to pass --host arguments to strip-llvm as well,
for consistency.
2024-01-12 11:06:54 +02:00
Martin Storsjö f5c5c72a88 github: Include the missing build tag for the msys2 artifacts 2024-01-09 11:29:38 +02:00
Martin Storsjö a815d6557a test: Add a smoke test for resource files and windres 2023-12-12 16:10:37 +02:00
Andarwinux e2a03722ac build-llvm: enable nvptx
Used to enable CUDA filter support for FFmpeg without relying on another Clang.
2023-12-12 13:53:26 +02:00
Martin Storsjö 3becea478f github: Upload artifacts from the MSYS2 build too
They aren't expected to be used much, but can be useful for
inspecting the output of a build.
2023-12-07 13:33:56 +02:00
Martin Storsjö 4555fcebc9 github: Bundle dependencies from MSYS2 into the output toolchain
This makes the built toolchain usable outside of MSYS2 too.

For running tests, this has another very subtle effect.

If the toolchain is built in the MSYS2 clang64 environment, the
compiler binary depends on libc++.dll. This DLL is found in $PATH,
in /clang64/bin.

When building/running tests, the current working directory will be
e.g. llvm-mingw/test/x86_64. At some point while building/running
tests, the test makefile will copy the llvm-mingw toolchain's
runtime DLLs into this directory in order to be able to execute those
newly built binaries. This also includes another, different libc++.dll.

When a libc++.dll exists in the current directory, this is preferred
over the one found further back in $PATH in /clang64/bin. As this
file is copied in parallel with other build jobs that might be
doing compilation, those compilation processes may end up loading
this other DLL. If fully copied it probably shouldn't be an issue,
but if not fully copied yet, who knows what might happen.

By making sure that there is a libc++.dll in the same directory as
the toolchain executables (rather than expecting it to be found
further back in $PATH), we ensure that this DLL is loaded and used
instead of the one in the current directory.

This should fix stray errors when running tests in the clang64
environment.
2023-12-07 13:33:53 +02:00
Martin Storsjö d2512dde21 build-python: Bump to the latest version of cpython-mingw
This version fixes a race condition in the build, which in most
cases was benign but in rare cases could successfully build a Python
that would crash at runtime.
2023-12-07 13:33:53 +02:00
Martin Storsjö 13827fe666 build-python: Install a versionless python.exe in addition to python3.exe
This can make it marginally easier to use it, even if the embedded
Python installation isn't that much meant to be used for various
external purposes.
2023-12-07 13:33:53 +02:00
Martin Storsjö 5000bc4c97 github: Update the branch of python used for scheduled builds 2023-12-07 13:33:53 +02:00
Martin Storsjö 387bfba3cb build-llvm: Bump to LLVM 17.0.6 2023-11-28 13:19:45 +02:00
Martin Storsjö 5c50839423 build-mingw-w64: Bump to the latest version as of Nov 28th 2023-11-28 13:19:26 +02:00
Martin Storsjö 81a72d5762 build-llvm: Use a faster linker for native building, if available
Use lld or gold, if available - they are significantly faster than
ld.bfd on Linux.
2023-11-28 00:02:50 +02:00
Martin Storsjö 0f24a65373 build-python: Bump to the latest version of Python 3.11.6 from msys2 2023-11-28 00:02:44 +02:00
Martin Storsjö 5700ed3e85 build-lldb-mi: Bump to the latest version from git 2023-11-27 11:29:48 +02:00
Martin Storsjö 57298c1a93 build-llvm: Bump to LLVM 17.0.5 2023-11-14 12:42:27 +02:00
Martin Storsjö eeffd71064 build-mingw-w64: Bump to the latest version as of Nov 14th 2023-11-14 12:42:08 +02:00
Martin Storsjö ceb97dadc3 strip-llvm: Include the lldb-dap tool
In LLVM 18, the lldb-vscode tool has been renamed to lldb-dap.
2023-11-10 13:44:33 +02:00
Martin Storsjö c70261f922 github: Compile i686 libcxx tests with an x86_64 build of the compiler
Some tests in the libcxx testsuite require more than 2 GB of memory
to compile currently.
2023-11-03 11:23:48 +02:00
Martin Storsjö 845805bcfe github: Set the test parameter large_tests=False for the libcxx tests
This skips test that use a lot of memory. In particular, there's
one test that would use up to 6.8 GB of memory, while the GitHub
Actions runners only have 8 GB of memory available.

This parameter was added in 122064a6303eb9c06e0af231f5a4ce145d9a2e67
in the llvm-project main branch, and backported to 17.x in
aa03fba83b17bbfcd9ed869efed2818b503875d6.
2023-10-31 11:05:52 +02:00