Doing that speeds up the built clang by around 25% (which is rather
significant) and reduces the size of the clang executable by almost 30%.
But since the mingw target in clang/llvm is less mature and less widely
tested than other llvm targets, running with assertions allows catching
quite a few issues during build instead of ending up with potentially
broken code.
This makes sure that exiting by calling _exit or ExitProcess doesn't
run global objects' destructors, which happened since starting to use
__cxa_atexit since 11e04f0466.
This fixes LLD built for windows with this toolchain.
This version fixes issues with linking mingw-style SEH data (making
sure all unwind info is included), adds support for assembler
directives like .rva, which often is used in SEH contexts, and
updates clang's unwind.h to match the libgcc ABI for SEH unwinding.
This fixes potential pointer truncation on 64 bit windows.
(Existing tests have ran fine in practice; either these are codepaths
not exercised in current setups, or potential codepaths that could
be triggered with more extensive tests.)
Now that we can build compiler-rt and libunwind with a stripped
llvm install, we can build things in a few smaller steps without
ending up with a larger docker image than before.
This still inflates the docker image chain since it's done in
a separate RUN command though.
This tests that one still can (re)build
compiler-rt/libunwind/libcxxabi/libcxx after stripping down the llvm
installation.
For compiler-rt and libunwind, this makes them build successfully even
if llvm-config and the llvm cmake files aren't available.
For libcxxabi, this brings in support for using SEH exceptions.
For libcxx, this removes a few build time warnings.
When using a global C++ object, the destructor isn't handled via
the .dtors section, but the destructor is set up with atexit() once
the constructor has been called.
For x86 architectures, binutils objcopy and strip can be used as
such.
For armv7 and aarch64, binutils doesn't recognize the architectures
and refuse to touch the files. For most/everything that objcopy/strip
do, the actual architecture doesn't really matter though. Therefore,
provide a wrapper script and a minimal tool for editing PE executables,
that change the architecture from armv7 and aarch64 to i686 and x86_64
respectively before invoking binutils, and change it back afterwards.
In case the binutils tools are missing, just return a successful result
without doing anything for stripping operations (previously, we had the
<triplet>-strip tool symlinked to /bin/true, so this isn't any worse than
before) and fail for other objcopy operations.
This allows using GNU binutils strip and objcopy on executables with
dwarf debug info linked by lld.
This also improves clang's handling of detecting known libraries
that override default libraries to link.
This version includes the windows api sets version of the universal
crt, fixes a few other functions when used with the universal crt,
and fixes the widl tool when running on macos.
If installing on top of a prebuilt win32 release of llvm instead of
building from source, the nm and strings executables are missing,
and MSYS2 errors out when creating a symlink to a file that doesn't
exist (since it does a copy instead of making an actual symlink).