Commit Graph
1086 Commits
Author SHA1 Message Date
Martin Storsjö 51cb479cb4 build-all: Fix a comment typo 2024-05-30 12:37:27 +03:00
Martin Storsjö f2ca758fcd build-llvm: Bump to LLVM 18.1.6 2024-05-19 00:24:40 +03:00
Martin Storsjö 5ca3fc332f build-mingw-w64: Bump to the version as of May 18th
This version fixes some cases of duplicate time.h related symbols,
in some build configurations (an issue only present in the
previous snapshot). This version also uses the right format attributes
for printf/scanf functions for Clang, enabling format string warnings
when using e.g. the mingw ansi stdio routines.
2024-05-19 00:23:15 +03:00
Martin Storsjö 6c748d21dd test: Test the clang-scan-deps wrapper 2024-05-02 20:03:56 +03:00
Martin Storsjö 334794b40d test: Do a minimal test to try to build the libcxx std c++ module 2024-05-02 20:03:56 +03:00
Martin Storsjö 74e45715e3 wrappers: Provide the unprefixed clang-scan-deps as a wrapper, on Windows
When setting up wrappers for Windows, rename clang-scan-deps.exe to
clang-scan-deps-real.exe, make clang-scan-deps.exe a wrapper, and
configure the wrapper to target executing clang-scan-deps-real.exe.

This makes sure that we always pass in crucial options like
-stdlib=libc++.

By default, our Clang executables are built with that option
hardcoded, configured with CLANG_DEFAULT_CXX_STDLIB=libc++
when built for Windows. However, we generally don't rely on this;
we assume the tools could be plain default executables, so we
try to provide wrappers on all common access paths.
2024-05-02 20:03:56 +03:00
Martin Storsjö 06bd759e50 wrappers: Add a wrapper for clang-scan-deps
This picks the architecture by looking for a triple prefix in the
nested command, and passes it as an explicit flag, to let
clang-scan-deps find it.

We also pass -stdlib=libc++, to let it find the libc++ headers
as expected.
2024-05-02 20:03:56 +03:00
Martin Storsjö 5ba9e1e402 prepare-cross-toolchain: Copy the libc++ module sources 2024-05-02 20:03:56 +03:00
Martin Storsjö 97862552f5 build-libcxx: Install the libc++ module in a shared directory
By default these files would be installed into
${CMAKE_INSTALL_PREFIX}/share/libc++/v1, where
${CMAKE_INSTALL_PREFIX} is equal to ${PREFIX}/${arch}-w64-mingw32.

However, to avoid duplicating these files for each architecture,
install them into ${PREFIX}/share/libc++/v1 instead.

While the files aren't very large (currently weighing in at around
612 KB), they're architecture independent files (and they're
more than a few; they're currently 135 files), so we should
share them if possible.
2024-05-02 20:03:56 +03:00
Norbert Lange 34e14d3c50 Install libc++ module definitions 2024-05-02 20:03:56 +03:00
Martin Storsjö c08b8780a0 build-llvm: Bump to LLVM 18.1.5
This version has a fix for building the libcxx std module for
mingw targets.
2024-05-02 10:10:54 +03:00
Martin Storsjö a81143c23a build-mingw-w64: Bump to the latest version as of May 2nd
This version contains fixes for building the libcxx std C++ module
with the mingw-w64 headers.
2024-05-02 10:10:11 +03:00
Martin Storsjö 88bad0dddd build-llvm: Allow setting CMAKE_<LANG>_COMPILER_LAUNCHER via an env variable 2024-04-24 11:36:57 +03:00
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