When using the just built compiler, we need to use the build CMark
runtime as it is executing on the build. This used to work when host and
build were guaranteed to be identical (i.e. no cross-compilation). This
is now needed to support cross-compiling ARM64.
Fix some indentation issues.
Change `build-script-impl` to make `build-linux-static` a positive argument.
Fix documentation for `--linux-archs` and `--linux-static-archs` (the options
are comma separated for `build-script`, but semicolon separated for
`build-script-impl`).
Set the default for `linux-static-archs` to `x86_64, aarch64` so that we
install the expected content in the toolchain.
Add missing default for `test_linux_static`.
Make sure to pass down `--skip-build-linux` and `--build-linux-static`.
Factor out config file generation and call it from the install step in `llvm.py`
as well as from the build step.
rdar://123503470
The early swift driver build would switch the Dispatch and Foundation
build used while building between an initial clean build and an
incremental rebuild. The early swift driver should consistently use the
same Foundation and Dispatch for each build.
This change tells the early swift driver stops build-script from telling
the early driver build to use the Foundation and Dispatch that it built.
Declare a new `LINUX_STATIC` SDK and configure it.
Add options to set the build architectures for the `LINUX` and
`LINUX_STATIC` SDKs, similar to what we have for Darwin, because
we'll be cross-compiling.
Also add an option to point the build system at the sources for
the musl C library, which we're using for `LINUX_STATIC`.
rdar://123503470
`unitest.assertEquals` is deprecated in Python 3.2 and finally removed in
Python 3.12 [1]. Due to this, this test files in recent Linux distros,
like Ubuntu 24.04 or Fedora 38+. This patch replaces the deprecated
function with `assertEqual`.
[1] https://docs.python.org/3/whatsnew/3.12.html
When printing an argument that contains ';', add back
the quotes that are normally stripped.
I regularly waste half a day building Swift only to find that I built
the wrong thing because everything after the semicolon is dropped from
the build script when it contains arguments like this:
'--llvm-install-components=libclang;libclang-headers'
Ideally, split-cmdline would just preserve the original quotes. But
this quick fix solves the problem in the cases that I care about.
Future work to enable Android SDKs requires fetching additional
dependencies (e.g. Android NDK). Refactor the fetch dependencies method
to allow us to share the download logic rather than replicating it for
each piece. This will also allow us to fetch the Python dependency for
the ARM64 toolchain cross-compilation.
The stdlib build for wasm target is failing on Darwin host due to
default values of some CMake options on Darwin host. We need to
explicitly define these options to make the build pass.