Commit Graph
1073 Commits
Author SHA1 Message Date
Martin Storsjö 340e2e7f0b wrappers: Fix the comparison against max_args in clang-target-wrapper
Since we allocate max_args+1 elements, with one extra for the
null terminator, it's ok if we've used up to max_args elements
already.
2024-04-24 11:36:42 +03:00
Martin Storsjö 9de1bfe8a3 wrappers: Fix a typo 2024-04-24 11:36:31 +03:00
Martin Storsjö 7bd4b284f9 github: Switch the macos build job to macos-14
Currently, the "macos-latest" runners aren't really the latest
version - on the contrary, they're running the oldest HW/OS.

Currently, there are macos-12, macos-13 and macos-14, and macos-latest
are the macos-12 ones.

The macos-14 ones run on Apple Silicon.

Previously, the macos-12 runners have usually managed to run the build
job in less than 3 hours. However, lately, the jobs often end up
taking much longer, over 5 hours, and have ended up exceeding the
6 hour timeout occasionally, even if they still also some times run
in the expected time of less than 3 hours.

Switch to the faster macos-14 runners (which can complete the build
job in around 1 h 40 min), to avoid these timeouts.
2024-04-22 23:40:22 +03:00
Martin Storsjö 6c479581da build-all: Add the option --clean-runtimes
This sets the variable CLEAN=1 after building the tools, which makes
all the builds of the runtime libraries remove old build dirs
before building.

This is similar to, but has a slight different purpose than
the existing --wipe-runtimes, which removes the installed runtime
files. Both are useful when testing various build configurations
and investigating issues, for different testing scenarios.
2024-04-18 13:26:52 +03:00
Martin Storsjö 760b639c20 build-llvm: Bump to LLVM 18.1.4 2024-04-17 10:53:21 +03:00
Martin Storsjö b7577123aa build-mingw-w64: Update to the latest version as of Apr 17th 2024-04-17 10:52:58 +03:00
Norbert Lange 7f8071951c strip-llvm: Retain the clang-scan-dep tool for c++ modules
Compilers and buildsystems have early support for c++ modules,
see [1], [2].
`clang-scan-dep` is necessary for integration in CMake, potentially
other buildsystems in the future.

Using standard modules like from libc++ is still not solved thoroughly,
and module support from libc++ is marked experimental, documentation
how to use them is WIP [3].

[1]: https://www.kitware.com/import-cmake-the-experiment-is-over
[2]: https://cmake.org/cmake/help/latest/manual/cmake-cxxmodules.7.html
[3]: https://github.com/llvm/llvm-project/pull/80601
2024-04-12 22:22:22 +03:00
Martin Storsjö 03948b69d7 build-llvm: Bump to LLVM 18.1.3 2024-04-04 11:25:47 +03:00
Martin Storsjö 536966927b build-mingw-w64: Bump to the latest version as of April 4th 2024-04-04 11:25:47 +03:00
trilader 2312d6ef64 Merge arch headers into LLVM provided include directory
If not building with FULL_LLVM the directory is empty or doesn't exist.
Otherwise it contains the LLVM headers. In either case merge the architecture specific ones into it.
2024-03-29 00:24:45 +02:00
Martin Storsjö 4a60685f51 build-llvm: Bump to LLVM 18.1.2 2024-03-20 09:12:51 +02:00
Martin Storsjö a894be0f60 build-mingw-w64: Bump to the latest version as of Mar 20th 2024-03-20 09:12:11 +02:00
Martin Storsjö 85c0ef1a21 test: Don't build asan/ubsan tests with PDB debug info
The DWARF debug info should work just as well.

Since 8c03f400a837dc9333e54ab371e7904aa2bec43c in llvm-project,
llvm-symbolizer prefers DWARF over PDB if there is a DWARF section
in the inspected executable. Thus, in order to use PDB, one would
have to strip out any remnants of DWARF debug info from the executable,
like in run-lldb-tests.sh (e.g. by -Wl,-s).

For the purposes of this test, simplifying the setup to use DWARF
works just as well.
2024-03-18 09:41:13 +00:00
Martin Storsjö 9c48a7d92c test: Print the reason for failing in test output inspections 2024-03-18 09:38:04 +00:00
Martin Storsjö 8a7c59dc94 test: Avoid the compiler optimizing out the cfguard check call
When calling make_indirect_call with a parameter which is known,
Clang, since the 18.x release, can end up producing a specialized
version of the function which omits the cfguard check call (as the
target is known) and calls the known target directly.

The function is marked with a noinline attribute, to avoid
the compiler optimizing out the cfguard check call when the
target is known, but even with a noinline function, the compiler
apparently can make a separate specialized version of it.

To avoid the compiler doing such optimizations, reference the
target function via a global variable - the compiler can't assume
anything about the contents of them (they could be altered between
initialization and reading them later).

This fixes the cfguard invalid_icall test with Clang 18.x, when
compiled with optimizations enabled.
2024-03-14 23:11:45 +02:00
Martin Storsjö 8a6b022f88 test: Test building another executable in UWP mode
Test building a file that includes windows.h, to catch issues with
e.g. the definition of WINAPI_FAMILY.
2024-03-13 18:19:42 +02:00
Martin Storsjö e39faace92 github: Run toolchain tests in the linux/linux-asserts/macos jobs
Run the plain compilation part, without executing things (in order
not to require wine at this point).
2024-03-13 11:30:14 +02:00
Martin Storsjö 79e51a92c3 build-llvm: Bump to LLVM 18.1.1
The 18.1.0 release accidentally had kept the "rc" suffix on the
version. The 18.1.1 release fixes this, no other changes from 18.1.0.
2024-03-08 23:57:17 +02:00
Martin Storsjö 46884dc037 github: Don't upload the msys2 artifacts along with the release
They weren't intended to be part of the artifacts as part of the
release; the artifacts were added just for testing purposes.
2024-03-08 23:56:13 +02:00
Martin Storsjö 5bf2c94e6f build-llvm: Bump to LLVM 18.1.0 final 2024-03-06 09:45:51 +02:00
Martin Storsjö b330dd8fbb build-mingw-w64: Bump to the latest version as of Mar 6th 2024-03-06 09:45:20 +02:00
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