The wrapper script no longer has any purpose on Unix.
Just do a plain symlink to the clang-scan-deps tool.
On Windows, the wrapper executable still is used to inject a
default -target option, if the executable name doesn't contain
a triple.
clang-scan-deps can pick it up automatically from the first argument
now.
For the windows wrapper, keep passing -target, to allow running with
a potentially foreign clang-scan-deps.exe.
Clang only picks up config files implicitly using the normalized
triple form, so use file names with "-windows-gnu" instead of
"-mingw32".
In theory, we could also want to pick up the config file implicitly
by having "<triple>-<mode>" be a symlink directly to the clang
executable. That works for regular mingw32 targets, but for the
mingw32uwp target, there's no distinction in the normalized
triple, so both would end up using the same "-windows-gnu" config
files. So as long as we want to support the mingw32uwp prefixed
tools, we need to use a wrapper.
The wrapper script no longer has any purpose on Unix.
Just do a plain symlink to the clang-scan-deps tool.
On Windows, the wrapper executable still is used to inject a
default -target option, if the executable name doesn't contain
a triple.
clang-scan-deps can pick it up automatically from the first argument
now.
For the windows wrapper, keep passing -target, to allow running with
a potentially foreign clang-scan-deps.exe.
Clang only picks up config files implicitly using the normalized
triple form, so use file names with "-windows-gnu" instead of
"-mingw32".
In theory, we could also want to pick up the config file implicitly
by having "<triple>-<mode>" be a symlink directly to the clang
executable. That works for regular mingw32 targets, but for the
mingw32uwp target, there's no distinction in the normalized
triple, so both would end up using the same "-windows-gnu" config
files. So as long as we want to support the mingw32uwp prefixed
tools, we need to use a wrapper.
If we never set $TARGET, we'd previously miss including $CMD_EXE
in the nested command. (This doesn't happen in actual uses of
the wrapper though, but is included for completeness.)
This matches how the corresponding variable is handled in the C
version of the wrapper.
This is the latest version, minus one commit.
The very latest commit, 20331109d1c90c19a510408ab119a76004bc41ea,
causes issues with compiling VLC; that is a VLC issue (redefining
GUIDs that now are provided by the system headers), but holding
off of that change until VLC is updated to cope with it.
Since 0c391133c9201ef29273554a1505ef855ce17668 in llvm-project
(LLVM 17), the sanitizers can be built for aarch64, and since
5ea9dd8c7076270695a1d90b9c73718e7d95e0bf (backported to
LLVM 19.1.0 RC 4), they can be built for armv7 too.
While they can be built, address sanitizer doesn't work for the
non-x86 architecture, so omit those files from the install,
to make it clear that they aren't expected to work.
Thus, in practice, this builds the ubsan and profile runtimes for
aarch64 and armv7.
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.
If nothing was built and installed, the installation merging command
fails with an error like this:
cp: cannot stat '/tmp/tmp.OAj9E7UBhI/install/.': No such file or directory
Therefore, skip this step if nothing really was built and installed.
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.
These days, it seems to be installed out of the box already on the
runner images, and installing it triggers very visible warnings
about it already being installed.