Commit Graph
1285 Commits
Author SHA1 Message Date
Martin Storsjö aa9406e06a build-all: Fix the error message when specifying two directories without --pgo or --full-pgo 2025-07-13 23:51:19 +03:00
Martin Storsjö a1f6413e5c build-llvm: Bump to LLVM 20.1.8 2025-07-09 19:50:09 +03:00
Martin Storsjö 007b88af19 build-mingw-w64: Bump to the latest version as of Jul 9th 2025-07-09 19:49:47 +03:00
Martin Storsjö 081b68c2bb github: Include the architecture in the linux-asserts artifact name
This should make it clearer what it is.
2025-06-30 14:13:36 +03:00
Martin Storsjö 8e90268bf3 github: Simplify the if: conditions for all chained jobs
As all the other jobs depend on the "prepare" job, it's enough to
keep the condition within the "prepare" job and remove/simplify
the rest.
2025-06-30 14:13:23 +03:00
Martin Storsjö 6cc02cf854 github: Update a comment to refer to the right job 2025-06-30 14:12:02 +03:00
Martin Storsjö a41085f7d9 build-llvm: Set CMAKE_STRIP when cross compiling with Clang
If using Clang from /usr/bin, this makes it clear to CMake to use
$HOST-strip, as it otherwise may pick plain /usr/bin/strip, which
may not be able to strip the cross built executables.
2025-06-30 14:12:02 +03:00
Martin Storsjö 9d5860a02d build-llvm: Set CMAKE_ASM_COMPILER_TARGET when cross compiling with Clang
CMAKE_ASM_COMPILER is set implicitly from CMAKE_C_COMPILER,
but the target flags aren't implied in the same way.

This fixes cross compiling LLVM with clang for an x86_64 target.

This wasn't an issue when cross compiling LLVM with clang for an
aarch64 target, because the BLAKE3 aarch64 SIMD is in the form
of a C file (with intrinsics), not a standalone .S file.
2025-06-30 14:12:02 +03:00
Martin Storsjö ee2239a2b8 build-llvm: Unset CLEAN in build-llvm for --macos-native-tools
In this case, we want to incrementally build the remaining tools,
not do a full build. In case someone runs build-all.sh with CLEAN
set, the --macos-native-tools invocation of build-llvm.sh shouldn't
wipe the build directory.
2025-06-30 00:18:22 +03:00
Martin Storsjö 6a2d235ffd Revert "build-lldb-mi: Disallow detecting LLVM outside of $LLVM_DIR"
This reverts commit 9e628b0f2d.

If LLVM was built with --disable-dylib, then the individual
LLVM libraries may expose a dependency on zlib. By restricting
the lldb-mi build to detect dependencies outside of $LLVM_DIR,
the build of lldb-mi fails to find zlib, making it impossible to
find all the necessary dependencies, ending up with errors like this:

    CMake Error at llvm-mingw/llvm-project/llvm/build-asserts/lib/cmake/llvm/LLVMExports.cmake:55 (set_target_properties):
      The link interface of target "LLVMSupport" contains:

        ZLIB::ZLIB

      but the target was not found.  Possible reasons include:

        * There is a typo in the target name.
        * A find_package call is missing for an IMPORTED target.
        * An ALIAS target is missing.

Revert this change for now, to allow building lldb-mi against
a non-dylib build of LLVM.
2025-06-26 13:41:05 +03:00
Martin Storsjö 04bc2bc1c5 github: Build the whole multiplatform docker image with Dockerfile.toolchain
This makes the docker image contain a PGO optimized compiler,
without needing to redo all of the PGO build stages in docker.

This reverts commit 8f42112719,
and fixes building the multiplatform image in a simpler way.

Instead of doing two separate builds, with separate Dockerfiles,
just do one multiplatform build of one Dockerfile, which
docker runs serially, for each one of the included architectures,
just packaging the prebuilt toolchains in the docker image.
2025-06-25 11:51:07 +03:00
Martin Storsjö ca34a15634 github: Build the msvcrt toolchains with LTO and PGO 2025-06-25 11:51:07 +03:00
Martin Storsjö 80fad73644 github: Build with PGO
Using Frontend instrumentation rather than IR. This gives less
total speedup, but makes the profile much more usable for cross
other build targets.

Build the full Linux toolchain in stage1; this avoids needing to
rebuild runtimes for doing the profiling in stage2, and avoids
needing to wait for stage3 to complete before cross building
for Windows.
2025-06-25 11:51:07 +03:00
Martin Storsjö 05625eaf62 github: Build the linux full toolchain already in stage1
This makes a cross compiler available before doing the full second
stage.
2025-06-25 11:51:07 +03:00
Martin Storsjö bc8eea6fc0 github: Build all second stage toolchains with thinlto 2025-06-25 11:51:07 +03:00
Martin Storsjö eb3cb9c31d github: Build macOS and Linux toolchains with a stage1 Clang 2025-06-25 11:51:07 +03:00
Martin Storsjö 7dcff8f89f build-all: Add support for PGO builds
Allow both doing one single stage at a time, or driving the
full build with three stages all in one command.
2025-06-25 11:51:07 +03:00
Martin Storsjö d3c7a1b06f build-all: Add an --llvm-only option 2025-06-25 11:51:07 +03:00
Martin Storsjö 37daec78ac build-all: Allow passing more options through to build-llvm.sh 2025-06-25 11:51:07 +03:00
Martin Storsjö c6001d3056 build-cross-tools: Allow passing LTO and PGO options to build-llvm.sh 2025-06-25 11:51:06 +03:00
Martin Storsjö 9e628b0f2d build-lldb-mi: Disallow detecting LLVM outside of $LLVM_DIR
Do the same as when cross compiling; disallow detecting dependencies
outside of the given CMAKE_FIND_ROOT_PATH. Don't export LLVM_DIR
as we no longer need to pass it implicitly that way.

This makes the errors clearer, if LLVM isn't found where expected,
instead of misdetecting it from a different installation of LLVM
in the system.

If lldb-mi would try to find other optional dependencies, they would
no longer be found; this was already the case when cross compiling
though.
2025-06-25 11:51:06 +03:00
Martin Storsjö d69ccd33a7 build-lldb-mi: Fix finding the build directory
As build-llvm now can create a larger variety of build dir names,
enumerating all possible suffixes becomes problematic (especially
as they don't necessarily appear in one canonical order).

Instead, iterate over potential matches. If cross compiling, it
is easy as we can require the directory to contain the expected
suffix. If not cross compiling, we have no explicit suffix to look
for, but we can check that the directory doesn't match common
cross compilation triples.
2025-06-25 11:51:06 +03:00
Martin Storsjö 839b37219e pgo-training: Add a script for doing PGO training of a toolchain
Use a makefile for running a set of commands in parallel.
2025-06-25 11:51:06 +03:00
Martin Storsjö 6d31f358d8 build-llvm: Add options for doing PGO builds
Passing --instrumented=IR or --instrumented=Frontend builds
instrumented tool binaries. After running them and merging the
output profile files, run build-llvm.sh with
--profile=profile.profdata.
2025-06-25 11:51:06 +03:00
Martin Storsjö 454962132a build-compiler-rt: Add an option for compiling runtimes for the native OS 2025-06-25 11:51:06 +03:00
Martin Storsjö 19f1c90a15 build-llvm: Add a --macos-native-tools option
This augments the result of an earlier build, with tools required
for building for macOS with the tools built with build-llvm.sh.
2025-06-25 11:51:06 +03:00
Martin Storsjö f5d8121ea2 build-llvm: Use llvm-libtool-darwin if doing LTO macOS builds with a custom clang 2025-06-25 11:51:06 +03:00
Martin Storsjö efb8b34932 build-llvm: Support using --with-clang in a --host cross build
When cross compiling with llvm-mingw, we already implicitly use
clang and lld, but we don't need to specify these options as they
are set implicitly via the llvm-mingw wrappers.
2025-06-25 11:51:06 +03:00
Martin Storsjö 5f28a085f5 build-llvm: Change the (unused) --stage2 option into --with-clang
Don't use tools from $PREFIX/bin automatically; this can be
confusing and problematic. If running with $PREFIX/bin in path,
the build at this stage gets reconfigured if rebuilding after
installing clang.

For multistage builds, install into separate toolchain
directories and add the right one to $PATH before invoking
build-llvm.sh. If one really wants to use the tools from $PREFIX
for a new build into the same directory, one has to add that
directory to the path manually.
2025-06-25 11:51:06 +03:00
Martin Storsjö 07c6640a17 build-all: Merge handling of trivial options passed to build-llvm.sh 2025-06-25 11:51:06 +03:00
Martin Storsjö 28748c4b2d build-llvm: Bump to LLVM 20.1.7 2025-06-13 09:56:49 +03:00
Martin Storsjö 42760d8e0e build-mingw-w64: Bump to the latest version as of Jun 13th 2025-06-13 09:56:04 +03:00
Martin Storsjö fc13a3a5b1 build-llvm: Implicitly set LLVM_USE_RELATIVE_PATHS_IN_FILES when using ccache
This is an option I set outside of this script in a number of
build cases where I build with ccache; move this into the script.

In practice it has little effect though; one has to set
CCACHE_BASEDIR anyway in order to be able to share a ccache
between build directories.

If enabling ccache by adding e.g. /usr/lib/ccache to the front of
PATH, without using the COMPILER_LAUNCHER variable, this won't
get enabled.
2025-06-11 16:48:03 +03:00
Martin Storsjö 9633e7501c github: Use dawidd6/action-download-artifact with the new ref: option
This allows specifying either a commit or a branch in the same
field, allowing simplifying both the workflow inputs, and
the expressions for passing commit/branch to both
dawidd6/action-download-artifact and actions/checkout.

This new option is available since
https://github.com/dawidd6/action-download-artifact/pull/329.
2025-06-03 16:36:12 +03:00
Martin Storsjö 5110f3da62 github: Update a comment about the homebrew libraries' architectures 2025-05-31 00:01:36 +03:00
Martin Storsjö c299805bc7 build-all: Don't mention a nonexistent --with-python option
This was added in 050b4ef701, but
such an option never existed in build-all.sh, only in
build-cross-tools.sh.
2025-05-29 17:33:48 +03:00
Martin Storsjö 718a31ef1a github: Run the test-llvm and test-libcxx jobs scheduled on Sundays
In this case, run with the artifacts from the latest scheduled job.
2025-05-29 17:27:53 +03:00
Martin Storsjö 7b53b4af23 github: Fix specifying a commit rather than a branch for manual jobs
As the branch field has a default value "master", this default
not only applies when the dialog box for starting the manual
workflow is presented. But even if the prefilled branch field
is cleared, the default value also gets substituted when submitting.

In this case, when the commit and branch fields are mutually
exclusive, we can't easily have a default. Instead change the
uses of the fields, ignoring the branch field if the commit field
is filled.

If the dawidd6/action-download-artifact action would support
specifying either a commit or a branch in the same field, like
actions/checkout does, we wouldn't need this distinction at all;
this request is tracked upstream at
https://github.com/dawidd6/action-download-artifact/issues/242.
2025-05-29 17:27:53 +03:00
Martin Storsjö 093d8edefb strip-llvm: Keep clang-scan-deps-wrapper too
If strip-llvm.sh is (re)run after install-wrappers.sh, we don't
want it to remove any of the files installed by install-wrappers.sh.
2025-05-29 17:27:53 +03:00
Martin Storsjö 40ccfd163e build-llvm: Bump to LLVM 20.1.6 2025-05-28 23:03:14 +03:00
Martin Storsjö 1d097013b0 build-mingw-w64: Bump to the latest version as of May 28th 2025-05-28 23:02:55 +03:00
Martin Storsjö 20ea49c91e github: Build test-libcxx with __USE_MINGW_ANSI_STDIO=0 on arm
On arm, we don't need to use the mingw custom printfs for long
doubles.
2025-05-25 16:00:55 +03:00
Martin Storsjö 38847df515 github: Use msys instead of mingw64 for running test-toolchain 2025-05-25 12:08:21 +03:00
Martin Storsjö e20f0e3acd github: Stop manually installing ninja
Since https://github.com/actions/runner-images/pull/11706,
https://github.com/actions/runner-images/pull/11707 and
https://github.com/actions/runner-images/pull/11737, ninja is
preinstalled in the Ubuntu, macOS and x86 Windows runner images.
(See https://github.com/actions/runner-images/issues/11391 for the
overall issue where this was finally agreed to be installed.)

It is still missing in the windows-11-arm images though, so keep
installing it in any jobs running on Windows.
2025-05-24 23:46:55 +03:00
Martin Storsjö 2eebbd670e build-make: Prefer downloading with curl over wget
Curl produces less log output while downloading.
2025-05-23 21:55:08 +03:00
Martin Storsjö 16b3ddfbfc github: Use "check-runtimes" rather than individual "check-cxx" etc
This makes sure to run all three testsuites, even if there are
failures in one of them.
2025-05-23 14:54:42 +03:00
Martin Storsjö a453b3c9b3 test: Skip inline x86_64 assembly on arm64ec 2025-05-18 22:30:20 +03:00
Martin Storsjö 9f59c26011 test: Fix the test-scan-deps test for arm64ec
Add a separate arm64ec arch case, skip the x86_64 one.
2025-05-18 22:29:52 +03:00
Martin Storsjö 1b781e898e build-mingw-w64: Use --enable-libarm64 for arm64ec 2025-05-18 22:28:25 +03:00
Jacek Caban 486d72ff9e Merge aarch64 and arm64ec compiler-rt libs
Clang expects the aarch64 compiler-rt name on ARM64EC. While this could be adjusted
in Clang, the current approach mirrors MSVC, where the core CRT is provided as
archives containing both EC and native support. Ideally, the LLVM build system would
handle this automatically, but for now we can merge it here.
2025-05-18 22:28:25 +03:00