Commit Graph
100 Commits
Author SHA1 Message Date
Martin Storsjö a89f6c58f4 build-libcxx: Enable -D__USE_MINGW_ANSI_STDIO=1 for libcxx on x86
This ensures correctly formatted long doubles.

This fixes issue #545.
2026-03-03 10:52:42 +02:00
Martin Storsjö dc9837d908 test: Add the original test case for atomic loads of varying sizes
This covers the original testcase from
https://github.com/mstorsjo/llvm-mingw/issues/538.
2026-02-25 12:13:08 +02:00
Martin Storsjö 49afca5984 test: Add a test for atomic load/store of large integers
Test atomically loading/storing 128 bit integers on 64 bit, and
64 bit integers on 32 bit.

This test case covers the root cause of
https://github.com/mstorsjo/llvm-mingw/issues/538.
2026-02-25 12:13:08 +02:00
Martin Storsjö 9610c61240 build-llvm: Bump to LLVM 22.1.0 final 2026-02-24 10:26:41 +02:00
Martin Storsjö 1d8aa59fbf build-mingw-w64: Bump to the latest version as of Feb 24th 2026-02-24 10:26:00 +02:00
Martin Storsjö 98684ab807 github: Try to test openmp through the runtimes directory
Since 6295b8e763503644961f9087382f80965b98d466 in llvm-project,
one no longer can configure the openmp project entirely standalone,
one has to do it through the runtimes directory.

However, in practice, this currently leads to no tests being
executed at all, as the runtimes build setup doesn't support
pointing to an external FileCheck executable - it currently has
to be part of a full bootstrapping build.
2026-02-19 23:37:10 +02:00
Martin Storsjö f415e25b3e build-openmp: Switch to building through the runtimes directory
Since 6295b8e763503644961f9087382f80965b98d466 in llvm-project,
it's no longer possible to build openmp entirely standalone;
now one has to build it through the runtimes directory.
2026-02-19 23:32:42 +02:00
Martin Storsjö 5da3d4b11b build-llvm: Bump to LLVM 22.1.0 RC 3 2026-02-10 10:07:25 +02:00
Martin Storsjö a68d8c0421 build-mingw-w64: Bump to the latest version as of Feb 10th 2026-02-10 10:07:07 +02:00
Martin Storsjö 498cc00a1d build-llvm: Bump to LLVM 22.1.0 RC 2 2026-01-27 13:33:36 +02:00
Martin Storsjö d1b94a9da6 build-mingw-w64: Bump to the latest version as of Jan 27th 2026-01-27 13:33:14 +02:00
Martin Storsjö bfb0715614 build-mingw-w64, build-busybox: Bump to a newer version
This version of mingw-w64 includes the function "mkdtemp", which
breaks building the previously pinned version of busybox-w32 on i686.

Update both projects in sync, so that builds with newer nightly
versions of mingw-w64 also succeed.
2026-01-19 23:24:28 +02:00
Martin Storsjö 1ea8bbae4e build-busybox: Don't error out if reinstalling into an existing directory 2026-01-19 13:24:59 +02:00
Martin Storsjö f25f2fb3aa build-python: Update to Python 3.13.11 2026-01-19 00:00:37 +02:00
Martin Storsjö 1032736a4c build-llvm: Bump to LLVM 22.1.0 RC 1
Some notable changes since LLVM 21.x related to mingw:

- Handle an uncommon error code in libcxx's std::filesystem,
  avoiding spurious test failures if running the libcxx test suite
  (noted at least occasionally on Github Actions)
- Reinstate x86 stack probe functions in compiler-rt, that we earlier
  beleived weren't used - but turned out to be used by GCC in i386
  mode
- Fix interpretation of a few corner case aarch64 SEH unwind opcodes
- Support for FAT LTO (compile with -ffat-lto-objects, link with
  -Wl,--fat-lto-objects)
- llvm-objcopy: Support the -p option for COFF targets
- llvm-readobj: A new option --coff-pseudoreloc for dumping information
  and symbols for mingw runtime pseudo relocations
- Lots of various fixes for the cygwin target
- Improve linking a custom CRT with binutils ld (by passing the custom
  CRT -l option at the same place as the original default -lmsvcrt)
- Make lld use the right mingw specific DLL entry point implicitly,
  improving some Rust use cases
- Fix running the libcxx tests with optimization for mingw targets,
  allowing more test coverage of the code generation paths
2026-01-16 13:09:06 +02:00
Martin Storsjö f06d2218d6 build-mingw-w64: Bump to the current version as of Jan 16th 2026-01-16 12:48:50 +02:00
Martin Storsjö f5335a4479 github: Run test-toolchain using busybox rather than msys2 2026-01-08 11:34:24 +02:00
Martin Storsjö 8220db557f run-tests: Use mingw32-make in busybox
This is the make tool we'd expect to use in such a setup.
2026-01-08 11:34:24 +02:00
Martin Storsjö 98a14ed36f test: Support mingw32-make running with a proper sh.exe 2026-01-08 11:34:24 +02:00
Martin Storsjö 90633bc87b run-tests: Add busybox specific logic for figuring out what architectures we can execute 2026-01-08 11:34:24 +02:00
Martin Storsjö e2a64961c6 release.sh: Enable WITH_BUSYBOX 2026-01-08 11:34:24 +02:00
Martin Storsjö 17864b5274 github: Build busybox in the windows toolchains 2026-01-08 11:34:24 +02:00
Martin Storsjö 64363c14db build-busybox: Disable make, copy mingw32-make.exe as make.exe
The built-in make is a POSIX make tool, which doesn't support
GNU make features.

As we do have GNU make, insert that as "make.exe" in the busybox
directory. Don't do that in the main llvm-mingw bin directory,
which can be used with other environments (e.g. msys2), where the
native make is to be preferred.
2026-01-08 11:34:00 +02:00
Martin Storsjö 1c87f45543 dockerfile: Add an option for building busybox 2026-01-08 11:32:12 +02:00
Martin Storsjö e4bee5bfa4 build-cross-tools: Add an option for building busybox 2026-01-08 11:32:12 +02:00
Martin Storsjö 15659f926b build-busybox: Disable CONFIG_FEATURE_FAIL_IF_UTF8_MANIFEST_UNSUPPORTED
This allows running the built busybox on older versions of
Windows that don't support the utf8 manifest. (The utf8 manifest
is supported since Windows 10 update 1903.)
2026-01-08 11:32:12 +02:00
Martin Storsjö 49aa05c5bc build-busybox: Disable building the AR applet
When building with mingw32-make, it prefers executing commands
through "sh.exe" if it is available.

When busybox sh.exe executes "ar", it prefers executing its own
internal tool over a potential external tool found in $PATH.

(This can be avoided by setting 'export BB_OVERRIDE_APPLETS="ar"',
but as this build of busybox is expected to be used with llvm-mingw,
disable the built-in "ar" tool outright.)
2026-01-08 11:32:12 +02:00
Martin Storsjö 8fb8fb4b05 build-busybox: Add a script for building busybox for Windows 2026-01-08 11:32:12 +02:00
Martin Storsjö 4a02966e4b build-make: Install the license file 2026-01-08 11:31:52 +02:00
Martin Storsjö 0b6cd54c4f build-mingw-w64-tools: Add a .txt suffix on the COPYING files 2026-01-08 11:31:38 +02:00
Martin Storsjö 9e00ce96c7 build-python: Install the license files for libffi and python 2026-01-08 11:26:44 +02:00
Martin Storsjö 83a3ca8e09 build-llvm: Disable LLVM_ENABLE_BINDINGS
According to https://github.com/mstorsjo/llvm-mingw/issues/533,
if OCaml support is detected and the LLVM OCaml bindings are built,
they are attempted to be installed in a path that require root access.
2025-12-26 00:35:35 +02:00
Martin Storsjö 6465b7f2ca github: Cache the gnu make tarball in the msvcrt build too
This applies the changes from b0bbde0073
to the msvcrt toolchain build as well.
2025-12-17 13:48:30 +02:00
Martin Storsjö 88f330fefc build-llvm: Bump to LLVM 21.1.8 2025-12-16 15:15:59 +02:00
Martin Storsjö ecabce6cc3 build-mingw-w64: Bump to the latest version as of Dec 16th 2025-12-16 15:15:28 +02:00
Martin Storsjö 322c941069 run-tests: Use "uname" instead of "uname -s"
"-s" is the default option if none is specified.

This improves consistency with other uses of "uname" in the
scripts.
2025-12-16 11:50:36 +02:00
Martin Storsjö 309cdd5690 run-tests: Improve a comment 2025-12-16 11:50:23 +02:00
Martin Storsjö 1ce1cf7c3d build-llvm: Allow overriding the llvm repo url through LLVM_REPOSITORY
This matches the existing LLVM_VERSION env variable.
2025-12-08 14:50:42 +02:00
Martin Storsjö b0bbde0073 github: Cache the gnu make tarball
This avoids breaking the build if the gnu download server is
unavailable.
2025-12-02 13:56:12 +02:00
Martin Storsjö 06e91d01b0 github: Fix passing arguments to lit for the openmp tests
The previous parameter wasn't used.
2025-12-02 13:38:47 +02:00
Martin Storsjö 1c915916c7 build-llvm: Bump to LLVM 21.1.7 2025-12-02 11:29:17 +02:00
Martin Storsjö 3b2ce1d0d0 build-mingw-w64: Bump to the latest version as of Dec 2nd 2025-12-02 11:28:35 +02:00
Martin Storsjö 259cd18db3 build-llvm: Bump to LLVM 21.1.6 2025-11-18 14:40:09 +02:00
Martin Storsjö ac41e524f3 build-mingw-w64: Bump to the latest version as of Nov 18th 2025-11-18 14:39:53 +02:00
Martin Storsjö 466fbcb68f build-llvm: Bump to LLVM 21.1.5 2025-11-04 11:47:32 +02:00
Martin Storsjö 18964a2b0b build-mingw-w64: Bump to the latest version as of Nov 4th 2025-11-04 11:47:09 +02:00
Martin Storsjö 09aac5c121 strip-llvm: Extend patterns to remove "offload-arch" and "yaml2macho-core" 2025-10-25 21:56:24 +03:00
Martin Storsjö e6cbbe9a35 test: Add a test for catching pointers by reference
This test should make sure that
https://github.com/mstorsjo/llvm-mingw/issues/522 doesn't
regress again.
2025-10-21 22:20:19 +03:00
Martin Storsjö 035a464964 build-llvm: Bump to LLVM 21.1.4
This version fixes catching pointer data types by reference in C++.

This version also fixes throwing C++ exceptions on aarch64 with
a debugger attached to the process.

Finally, this version fixes delayimport calling of C++ methods that
return structs on aarch64.
2025-10-21 11:30:59 +03:00
Martin Storsjö 84abc5e88a build-mingw-w64: Bump to the latest version as of Oct 21st 2025-10-21 11:30:11 +03:00
Martin Storsjö 6f078940a3 build-llvm: Bump to LLVM 21.1.3 2025-10-07 22:33:31 +03:00
Martin Storsjö ec3b6109a3 build-mingw-w64: Bump to the latest version as of Oct 7th 2025-10-07 22:33:13 +03:00
Martin Storsjö 796122a107 build-llvm: Bump to LLVM 21.1.2 2025-09-24 09:42:54 +03:00
Martin Storsjö 2de90b4f70 build-mingw-w64: Bump to the latest version as of Sep 24th 2025-09-24 09:42:38 +03:00
Martin Storsjö 3766326dbb github: Stop specifying CMAKE_CXX_COMPILER_TARGET
The preinstalled CMake on the ARM64 runners now should be a native
ARM64 CMake, which allows autodetecting CMAKE_CXX_COMPILER_TARGET
correctly.
2025-09-23 14:00:00 +03:00
Martin Storsjö adcf12dae0 github: Stop building in the mingw64 environment in msys2
These builds fail regularly, under mysterious circumstances.
("The hosted runner lost communication with the server. Anything
in your workflow that terminates the runner process, starves it
for CPU/Memory, or blocks its network access can cause this error.")

This usually seems to happen around the build-libcxx.sh step.
2025-09-22 12:25:27 +03:00
Martin Storsjö 81e6861ff6 run-tests: Skip running emulated x86 binaries on aarch64, when targeting msvcrt
In this configuration, one test in crt-test.c fails, both for
i686 and x86_64, when running emulated on aarch64.
2025-09-14 00:04:55 +03:00
Martin Storsjö 2ec690d08e Revert "run-tests: Skip testing arm64ec in msvcrt builds"
This reverts commit 056dd7329b.

In the current versions of mingw-w64, it is possible to build
the tests for arm64ec with msvcrt.dll as well.
2025-09-11 15:49:27 +03:00
Martin Storsjö 1afe639326 build-llvm: Bump to LLVM 21.1.1 2025-09-10 11:45:56 +03:00
Martin Storsjö fec1656c93 build-mingw-w64: Bump to the latest version as of Sep 10th 2025-09-10 11:45:36 +03:00
Martin Storsjö e455d4c3cb build-llvm: Add an option --use-linker=
This allows overriding which linker to use.

Currently, building LLVM on Ubuntu 25.10 with these scripts fails,
if LLD is available. This, because the GCC on that distribution
produces object files that LLD (and gold) rejects during linking - see
https://github.com/llvm/llvm-project/issues/156667 for details.

By building with --use-linker=bfd, linking does succeed in that
configuration.

Also pass the same option through from build-all.sh.
2025-09-04 23:24:42 +03:00
Martin Storsjö 9347c21f74 build-llvm: Print a warning if we get more than one catch-all option
In this case it's usually an option that wasn't recognized
(although the misrecognized option may have been an earlier
option and the current one may be the intended prefix).
2025-09-04 15:38:08 +03:00
Martin Storsjö ebde75f350 build-llvm: Simplify handling of the --pgo=<file> option
These variable expansions/modifications work the same if the
option "--pgo" is specified - so either we can simplify the
stripping of the "--pgo=" prefix, or we can just skip the check,
similar to the case above with --instrumented.
2025-09-04 15:08:17 +03:00
Martin Storsjö a57c32023b test: Waive frexp failures on msvcrt.dll on arm64ec, similar to on aarch64
Building crt-test for arm64ec msvcrt.dll doesn't work currently,
but if mingw-w64 is tweaked so that it works, this test does
need to be waived.
2025-09-02 16:01:52 +03:00
Martin Storsjö 1a25a0ff74 github: Switch macos jobs to macos-14 runners explicitly
For some unknown reason, macos-15 runners (which macos-latest
resolves to currently) seem to be consistently 25-40% slower than
macos-14 runners; the "macos" job (doing an universal binary build
for 2 architectures, with LTO) often take over 5 hours, and have
reached the 6 hour timeout once.

Switch this back to macos-14 to speed it up and reduce the risk of
hitting the timeout.

In the future, if/when the macos-14 runners are phased out, and if
the performance reduction in macos-15 runners remains, we'd need to
switch to building each architecture in a separate job, and merge
them together separately if we still want to provide universal
binaries.
2025-08-30 23:03:55 +03:00
Martin Storsjö 096033f443 build-llvm: Bump to LLVM 21.1.0 final 2025-08-26 22:37:10 +03:00
Martin Storsjö 747a6cd27a build-mingw-w64: Bump to the latest version as of Aug 26th 2025-08-26 22:36:18 +03:00
Martin Storsjö a96bbc0c7f build-make: Download from ftpmirror.gnu.org rather than directly from ftp.gnu.org
Direct access from ftp.gnu.org has been slow lately, and using
a mirror is more considerate in general.
2025-08-26 16:00:23 +03:00
Martin Storsjö 5c5a462dd1 github: Stop manually installing ninja on Windows
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.
Thanks to that, redundant installs of ninja on Unix were removed
in e20f0e3acd.

As noted in https://github.com/actions/partner-runner-images/issues/96,
ninja now also seems to be available on the Windows on ARM
images - thus remove redundant installs of ninja on Windows.
2025-08-21 00:13:51 +03:00
Martin Storsjö 9abe6a8f31 build-llvm, build-cross-tools: Include --no-llvm-tool-reuse in the help listings 2025-08-13 13:36:56 +03:00
Martin Storsjö ccbccc774f build-cross-tools: Fix a help string typo 2025-08-13 13:27:45 +03:00
Martin Storsjö 5bade09998 build-llvm: Bump to LLVM 21.1.0 RC 3 2025-08-12 13:37:27 +03:00
Martin Storsjö 9ae76cfbe0 build-mingw-w64: Bump to the latest version as of Aug 12th 2025-08-12 13:37:12 +03:00
Martin Storsjö 58ee158be2 pgo-training: Pass ARCHS to the makefile
If ARCHS itself was set by the caller, it would already have been
implicitly passed to the makefile - but if the caller set
TOOLCHAIN_ARCHS instead, that wasn't acted upon by the makefile.

As the shell script already has the logic for initializing this
(in the same fashion as all other shell scripts), just use that
and pass the value on to the makefile.
2025-08-07 13:11:24 +03:00
Martin Storsjö 4ae8f04ed6 pgo-training: Remove the accidental executable bit on the makefile 2025-08-07 13:05:42 +03:00
Martin Storsjö 2e938d2b66 prepare-cross-toolchain-unix: Remove the linux/macOS runtimes
This matches what is done in build-all.sh for the PGO step; this
removes rather large (~50 MB) libraries that mostly are needed
for compiling for the host unix platforms. (On Linux it's needed
if building with profiling, on macOS it's needed for the builtin
functions for platform version availability too.)
2025-08-03 00:21:03 +03:00
Martin Storsjö fd7848ea84 build-llvm: Bump to LLVM 21.1.0 RC 2 2025-07-30 10:38:30 +03:00
Martin Storsjö 45c0dc4112 build-mingw-w64: Bump to the latest version as of Jul 30th 2025-07-30 10:38:07 +03:00
Martin Storsjö 2324d8354f github: Simplify running the msvcrt workflow on push, for testing
Only pick parameters from "inputs" if we were invoked through a
"workflow_dispatch" event.
2025-07-29 22:40:34 +03:00
Martin Storsjö 0681c739aa github: Run tests directly after cross compiling the msvcrt runtimes
This matches what is done for the regular builds; we run (build-only)
tests already with the first cross compiler toolchains, not needing
to wait for the cross compiled toolchains to run on Windows.
2025-07-29 22:39:28 +03:00
Martin Storsjö 67827c9569 github: Switch the condition for inputs vs defaults for test-llvm and test-libcxx
This makes it easier to run these workflows through a push (by
adding an "on:push:" at the start of the files.
2025-07-29 22:38:54 +03:00
Martin Storsjö 848bf53fe0 github: Pass -D__USE_MINGW_ANSI_STDIO=1 for test-llvm on x86
This is required for properly formatting long doubles on x86
with UCRT (which doesn't use the mingw builtin printfs by default).

This fixes running the LLVM testsuite on x86 after commit
9bf7d04c4386daf1ef0acf95782a59855c98474a in llvm-project.
2025-07-29 22:38:25 +03:00
Martin Storsjö 39f4179af6 build-llvm: Fix using a relative PREFIX path
This fixes a regression from
6d31f358d8, which shows up as
"./strip-llvm.sh: 129: cd: can't cd to share" when running
build-all.sh, fixing
https://github.com/mstorsjo/llvm-mingw/issues/509, and the root
issue behind https://github.com/mstorsjo/llvm-mingw/pull/507.
2025-07-29 22:25:29 +03:00
Martin Storsjö 0d59f0f827 github: Skip the stage1 artifacts when making a release
The linux stage1 artifacts were uploaded, while the macos ones
weren't (as they didn't match the *-toolchain glob pattern).
2025-07-19 11:21:19 +03:00
Martin Storsjö 056dd7329b run-tests: Skip testing arm64ec in msvcrt builds
It is currently known to fail to link some tests.
2025-07-18 19:47:28 +03:00
Martin Storsjö 087c11746a dockerfile: Skip the openmp tests for arm64ec
This was missed in 4700b4f7bb.
2025-07-18 19:47:28 +03:00
Martin Storsjö 09c5a4e822 github: Fix the use of dawidd6/action-download-artifact in msvcrt.yml
The older version doesn't support the ref parameter.
2025-07-18 19:47:04 +03:00
Martin Storsjö 4a6030a850 run-tests: Execute arm64ec tests on Windows 11 on aarch64 2025-07-17 22:49:10 +03:00
Martin Storsjö 4700b4f7bb test: Skip building the ubsan and openmp tests for arm64ec
Also unset RUN for arm64ec, instead of accidentally inheriting the
earlier value.
2025-07-17 22:49:10 +03:00
Martin Storsjö cb92de78e7 Include arm64ec in the lists of all architectures
Since LLVM 21.x, the upstream support for ARM64EC in LLD and
compiler-rt is complete enough for us to be able to build it.
2025-07-17 22:48:39 +03:00
Martin Storsjö ae0357758c build-llvm: Bump to LLVM 21.1.0 RC 1
Relevant changes include:
- Lots of work for supporting ARM64EC and ARM64X
- LLD now produces more compact string tables in executables (only
  relevant when including debug symbols)
- llvm-rc now supports multiplication/division expressions, like GNU
  windres
- Improved support for armv7 and aarch64 in libunwind (for Itanium
  ABI "forced unwinding", which I'm not aware of being used in
  practice anywhere)
- Made the libunwind, libcxxabi, libcxx and compiler-rt tests pass on
  armv7 and aarch64 mingw
- Made the llvm/clang tests pass on aarch64 mingw
2025-07-17 22:22:24 +03:00
Martin Storsjö 2844cfd336 build-mingw-w64: Bump to the latest version as of Jul 17th 2025-07-17 22:21:45 +03:00
Martin Storsjö f5a90414dd github: Stop running armv7 binaries
The ARM github actions runners now run on Windows 11 10.0.26100,
which no longer support executing armv7 binaries. (Previously they
were running Windows 11 10.0.22631.)
2025-07-16 09:58:18 +03:00
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