Commit Graph
199 Commits
Author SHA1 Message Date
Martin Storsjö fd7848ea84 build-llvm: Bump to LLVM 21.1.0 RC 2 2025-07-30 10:38:30 +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ö 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ö a1f6413e5c build-llvm: Bump to LLVM 20.1.8 2025-07-09 19:50:09 +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ö 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ö 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ö 28748c4b2d build-llvm: Bump to LLVM 20.1.7 2025-06-13 09:56:49 +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ö 40ccfd163e build-llvm: Bump to LLVM 20.1.6 2025-05-28 23:03:14 +03:00
Martin Storsjö 5609c66213 build-llvm: Bump to LLVM 20.1.5 2025-05-14 22:25:18 +03:00
Martin Storsjö 4c82a47afb build-llvm: Bump to LLVM 20.1.4 2025-04-30 12:07:34 +03:00
Martin Storsjö c608b57a2e build-llvm: Bump to LLVM 20.1.3 2025-04-17 14:56:18 +03:00
Martin Storsjö c2b534c206 build-llvm: Bump to LLVM 20.1.2
This version adds support for the --identify flag in llvm-dlltool.
2025-04-02 11:47:31 +03:00
Martin Storsjö 4ba1178755 build-llvm: Bump to LLVM 20.1.1 2025-03-19 11:18:31 +02:00
Martin Storsjö dc3e0ecbe6 build-llvm: Bump to LLVM 20.1.0 final 2025-03-05 09:48:25 +02:00
Martin Storsjö d3ba074621 build-llvm: Bump to LLVM 20.1.0 RC 3 2025-02-27 14:02:22 +02:00
Steve Lhomme 990ad67759 build-llvm: Install and keep llvm-lib
It's an equivalent to MSVC lib.exe [^1].

It is used by meson to find the DLL name from a .lib/.dll.a [^2].
The other option is dlltool, which is not the same as llvm-dlltool.

[^1] https://llvm.org/docs/CommandGuide/llvm-lib.html
[^2] https://github.com/mesonbuild/meson/blob/1e986554ef2071f59fb796cda5e66c448bde6ac9/mesonbuild/scripts/symbolextractor.py#L209
2025-02-13 12:03:26 +02:00
Martin Storsjö 73e313146e build-llvm: Bump to LLVM 20.1.0 RC 2
Relevant changes in LLVM 20.1.x compared with LLVM 19.x are:

- Don't warn when doing LTO with mixed Rust/C object files, where
  the target triples differ in the vendor field
  (<arch>-w64-windows-gnu vs <arch>-pc-windows-gnu)
- Fix including LLVM/MSVC style import libraries in libraries linked
  with --whole-archive
- Support for files over 2 GB in the libcxx fstream methods
  tellg()/seekg()
- Lots of work on improved ARM64EC and ARM64X support in LLVM and LLD
- New linker flags --dependent-load-flag and --functionpadmin, similar
  to the corresponding lld-link/MS link.exe flags
- Improvements in address sanitizer, supporting many more x86
  instructions
- Changes to address sanitizer, that (unintentionally) makes it fail
  harder than before when used together with msvcrt.dll. Using
  address sanitizer with msvcrt.dll is unsupported though.
2025-02-12 11:09:34 +02:00
Martin Storsjö e3a808fec6 build-llvm: Bump to LLVM 20.1.0 RC 1 2025-02-03 15:02:29 +02:00
Martin Storsjö 0087c59c17 build-llvm: Bump to LLVM 19.1.7 2025-01-14 17:55:21 +02:00
Martin Storsjö 8400557f2b build-llvm: Bump to LLVM 19.1.6 2024-12-17 17:35:57 +02:00
Martin Storsjö f84079bb71 macos: Bump the minimum deployment target to macOS 10.12
Since https://github.com/llvm/llvm-project/pull/117252 and
https://github.com/llvm/llvm-project/commit/186fac33d08b34be494caa58fe63972f69c6d6ab,
part of the latest git main branch, LLDB uses std::shared_mutex.

On macOS, std::shared_mutex is only available since macOS 10.12.

This change raises the deployment target from 10.9 to 10.12.
2024-12-13 09:51:58 +02:00
Martin Storsjö 14dad0c971 build-llvm: Bump to LLVM 19.1.5 2024-12-03 15:09:48 +02:00
Martin Storsjö 9128fa8dba build-llvm: Bump to LLVM 19.1.4 2024-11-19 15:21:30 +02:00
Martin Storsjö 531adeb304 build-llvm: Don't hardcode default choices of linker/stdlib on Windows
This should help with using clangd for other mingw toolchain
installs.
2024-11-06 11:40:31 +02:00
Martin Storsjö 0ebb52ae0e build-llvm: Bump to LLVM 19.1.3 2024-10-30 15:41:58 +02:00
Martin Storsjö 7851e99345 build-llvm: Bump to LLVM 19.1.2 2024-10-15 15:02:57 +03:00
Martin Storsjö e0964ce24c Revert use of Clang config files
This reverts commit 49db4a3a15,
9f1f0104f1,
4f95c14adf,
c34dc64028,
570fdcd251,
4bff0298c5 and
6939aee0c0.

When relying on Clang config files, two issues appeared:

- Running the compiler-rt tests fails, because the compiler-rt tests
  disable any default config files, breaking the compiler
  in this case:
  https://github.com/llvm/llvm-project/blob/llvmorg-19.1.1/compiler-rt/test/lit.common.cfg.py#L983

- Wine fails to build using llvm-mingw as cross compiler, because
  Wine adds the --no-default-config flag to Clang while compiling,
  if supported:
  https://gitlab.winehq.org/wine/wine/-/blob/wine-9.19/configure.ac?ref_type=tags#L866-868
  This causes llvm-mingw to omit the -rtlib=compiler-rt option
  (specified in a config file), making the compiler look for libgcc
  instead. Doing a check to see that linking succeeds doesn't necessarily
  help here - such a check already exists, but it tests linking with
  -nostdlib -nodefaultlibs:
  https://gitlab.winehq.org/wine/wine/-/blob/wine-9.19/aclocal.m4?ref_type=tags#L193-L206
2024-10-14 16:35:17 +03:00
Martin Storsjö 49db4a3a15 build-llvm: Don't hardcode default choices of linker/stdlib on Windows
This should help with using clangd for other mingw toolchain
installs.
2024-10-02 16:06:06 +03:00
Martin Storsjö d9d46de5f3 build-llvm: Bump to LLVM 19.1.1 2024-10-01 16:34:57 +03:00
Martin Storsjö b4c2760100 build-llvm: Bump to LLVM 19.1.0 final 2024-09-17 14:49:31 +03:00
Martin Storsjö b6b58d96d9 build-llvm: Add an option --no-llvm-tool-reuse
This allows using the build-llvm.sh script for doing a cross build
of LLVM, while the same directory may contain a native build
which can be out of sync with the actual source.
2024-09-06 12:24:40 +03:00
Martin Storsjö a7f4cf9670 build-llvm: Bump to LLVM 19.1.0 RC 4 2024-09-03 18:45:45 +03:00
Martin Storsjö c5d169f1dc build-llvm: Bump to LLVM 19.1.0 RC 3 2024-08-20 11:30:25 +03:00
Martin Storsjö bab9e279e3 build-llvm: Bump to LLVM 19.1.0 RC 2 2024-08-05 14:37:21 +03:00
Martin Storsjö 27c551ddb1 build-llvm: Bump to LLVM 19.1.0 RC 1
The main changes for mingw targets since 18.x is primarily
minor bug fixes. llvm-dlltool has also been improved to handle
cases of renamed imports, where the target of the rename doesn't
exist as a normal import.
2024-07-26 16:56:24 +03:00
Martin Storsjö e3e9f97fab build-llvm: Bump to LLVM 18.1.8 2024-06-19 12:56:40 +03:00
Martin Storsjö ab7e195ef3 build-llvm: Bump to LLVM 18.1.7 2024-06-06 10:57:03 +03:00
Martin Storsjö f2ca758fcd build-llvm: Bump to LLVM 18.1.6 2024-05-19 00:24:40 +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ö 88bad0dddd build-llvm: Allow setting CMAKE_<LANG>_COMPILER_LAUNCHER via an env variable 2024-04-24 11:36:57 +03:00
Martin Storsjö 760b639c20 build-llvm: Bump to LLVM 18.1.4 2024-04-17 10:53:21 +03:00
Martin Storsjö 03948b69d7 build-llvm: Bump to LLVM 18.1.3 2024-04-04 11:25:47 +03:00
Martin Storsjö 4a60685f51 build-llvm: Bump to LLVM 18.1.2 2024-03-20 09:12:51 +02:00