Commit Graph
100 Commits
Author SHA1 Message Date
Martin Storsjö b434132e04 run-lldb-tests: Clarify the placeholder for the script argument 2022-09-17 14:45:43 +03:00
Martin Storsjö b78082449e github: Run the lldb smoke tests as part of the test-toolchain stage
Run this for both i686 and x86_64, as we only test lldb with the
native architecture of the lldb executable (which is assumed to
be the same as the default architecture of the clang executable).
2022-09-17 00:20:52 +03:00
Martin Storsjö 6dbfbec8ff test: Add a script for running smoke tests of lldb 2022-09-16 20:25:08 +03:00
Martin Storsjö f4f25e241b run-tests: Verify that sanitizers and buffer/stack protections work as they should 2022-09-16 20:23:32 +03:00
Martin Storsjö 516c9779fb test: stacksmash: Make sure to change the value of the written byte
If the low byte of the stack cookie happens to be zero, we
previously wouldn't trigger any error.

This avoids accidentally failing to trigger the stack protector
once per 256 runs, roughly.
2022-09-16 20:23:32 +03:00
Martin Storsjö b395a2f26b run-tests: Build and run crt-test with fortification 2022-09-16 20:23:32 +03:00
Martin Storsjö 83422b6be4 test: crt-test: Add tests for a bunch of string functions
These are functions that, when built with "-D_FORTIFY_SOURCE=2 -O2",
can end up calling the corresponding __<func>_chk functions - thus,
this can be used for testing those functions.
2022-09-16 19:44:32 +03:00
Martin Storsjö 1d8c107d49 test: crt-test: Skip a test for cos(-NAN) == -NAN when optimizing
Both GCC and Clang fail this test if optimizations are enabled.
2022-09-16 19:43:40 +03:00
Martin Storsjö 4c29469eac test: Add a test for fortification of string functions
We currently only run the testcase where it doesn't trigger the
failed checks though.
2022-09-16 19:43:40 +03:00
Martin Storsjö 2013c9c165 run-tests: Swap the nesting of a loop/condition
There's no point in running the whole loop if each iteration is
going to be skipped.
2022-09-16 19:43:40 +03:00
Martin Storsjö 332193b7ec run-tests: Build the ubsan test case with -fno-sanitize-recover=all
This allows easier programmatic checking that the sanitizer actually
caught the tested issue, when triggering the issue.
2022-09-16 19:42:21 +03:00
Martin Storsjö fa02f14aea run-tests: Actually try to run the asan-instrumented test binaries
Previously we would just run the plain version of them.
2022-09-15 13:55:15 +03:00
Martin Storsjö 5456a77fe3 run-tests: Wipe out an older libunwind.dll in the same way as libc++.dll
Ideally we'd wipe the whole test/<arch> directory before running
the tests (we do that if CLEAN is set), but here we only wipe out
the specific ones that can affect how new tests are built and linked.
2022-09-15 13:54:51 +03:00
Martin Storsjö b6429b6632 run-tests: Move resetting of the TESTS_EXTRA variable earlier in the loop
A test that was added to TESTS_EXTRA in
e934c04ef4 wasn't actually ever
executed; this makes it be executed as expected.
2022-09-14 10:03:36 +03:00
Martin Storsjö 263431c101 github: Fix a comment in a printed message
This was missed in 982e43d9c3.
2022-09-12 10:38:23 +03:00
Martin Storsjö 0a980a4f1c build-llvm: Bump to the final 15.0.0 release
Notable changes are:
- Require strict matches for defines for precompiled headers in GCC
  style PCH directories. This fixes some cases of building DLLs and
  static libraries at the same time with libtool, with PCH.
- Support for the new embedded -exclude-symbols: directive in LLD
- Fix LLD crashes if including object files containing export directives
  via the --undefined/-u option
2022-09-06 11:43:45 +03:00
Martin Storsjö 506664a49f build-mingw-w64: Bump to the current version from September 6th
Notable changes:
- Fixed using the strtof() function from UCRT instead of accidentally
  using a wrapper that internally calls strtod()
- Range/accuracy improvements for complex trigonometry functions
- Fixed the callback declaration for the EnumPageFiles API
- Fixed the declaration of the addrinfoex structs
- The usual assorted API updates
2022-09-06 11:38:48 +03:00
Martin Storsjö 55db22d242 github: Update the environment used for doing msys2 builds
This should get a patched host compiler for the clang64 environment,
supporting symbol visibility, avoiding exporting too many symbols
from the dylibs.

For the mingw64 build (with GCC, which doesn't support symbol
visibility on Windows), the number of exported symbols
seems to be slightly lower, so we don't hit the limit of exported
symbols quite yet.
2022-09-02 11:38:26 +03:00
Martin Storsjö b6dd40540d github: Install the diffutils package when building on msys2
The configure script of winpthreads tries to execute the "cmp"
command (pulled in via the libtool macros), visible as errors in
the build logs. (The issue doesn't seem to make any practical
difference though.)
2022-09-02 11:34:26 +03:00
Martin Storsjö 982e43d9c3 github: Build two linux toolchains, one with and one without assertions, in scheduled builds
Use the one without assertions for cross-building toolchains, as the
one with assertions is too slow. In practice, one or more of the cross
toolchain builds end up timing out (exceeding the 6 h limit) almost
every day in the scheduled builds, requiring reruns (sometimes
multiple reruns) to complete successfully in time.

(There seems to be a big variation in what actual runner the jobs
end up using; some runners complete the cross builds in around 4 h,
while some are much slower, and seem to require 5-6 hours or more.)

In practice, during the 2 months that I've had scheduled jobs
running on Github Actions, there haven't been any failed asserts
triggered and caught in the cross builds (but once in the cross builds
of ffmpeg, which still keep using a toolchain with asserts enabled).
2022-08-24 13:24:52 +03:00
Martin Storsjö 3b96433cdf build-compiler-rt: Make sure that compiler-rt doesn't pick up an external llvm-config
We normally don't install all tools (including llvm-config), or we might
have stripped them out, but the system distro might have installed a copy
of llvm-config (for a different unrelated installation of llvm).

Some compiler-rt runtimes (such as xray and orc) use this for finding
the main llvm headers.

When building compiler-rt, we really don't want it to pick up any random
version of llvm headers found on the system, but keep using the matching
headers from the monorepo instead.

Adding the include directory of a system provided set of llvm headers
is especially fatal if that directory isn't a subdirectory containing
only llvm headers, but contains other system headers too.

In particular, on msys2, the include directory (pointed at by "llvm-config
--includedir", and also set by including LLVMConfig.cmake which is
pointed at by "llvm-config --cmakedir") is the main system include
directory. Including this can also get headers for a system install
of libc++ headers (for the clang64 msys2 distro) - and using libc++
headers with a second set of libc++ headers in the include path is
fatal (due to include_next not finding the plain C header but finding
a second libc++ header).

Just try to make sure that we don't pick up any unintended headers.
2022-08-15 00:31:28 +03:00
Martin Storsjö 1b216b6fdf github: Disable building lldb-mi in the scheduled cross builds
Latest git llvm-project has switched to requiring C++17, while
lldb-mi still is built in C++14 mode. This makes the scheduled builds
fail. Therefore, disable building lldb-mi for now in the scheduled
builds, until this has been fixed in the latest git main versions
of lldb-mi.
2022-08-12 00:51:56 +03:00
Martin Storsjö 6c2d158270 build-cross-tools: Allow skipping building lldb-mi 2022-08-12 00:48:46 +03:00
Martin Storsjö 11e7485306 build-all: Allow skipping building lldb-mi 2022-08-12 00:48:46 +03:00
Martin Storsjö d2941f58ab build-cross-tools: Generalize the variable with options to build-llvm.sh
This eases future adjustments if we want to pass more options
onwards to build-llvm.sh.
2022-08-12 00:48:46 +03:00
Martin Storsjö f6bad1b607 build-cross-tools: Factorize the option handling, to ease handling more options 2022-08-12 00:48:46 +03:00
Martin Storsjö c9d406e44a strip-llvm: Remove all libLLVM*.a
46efff459a regressed this aspect,
where libLLVM-<version>.{so,dylib,dll} was meant to be kept, but
also ended up keeping libLLVM<name>.a. (This only matters if trying
to strip a build done with --full-llvm.)
2022-08-11 16:00:13 +03:00
Martin Storsjö eccf5de7e7 strip-llvm: Remove more files from full builds 2022-08-11 16:00:13 +03:00
Martin Storsjö 7060e41fc1 Stop manually setting CMAKE_CROSSCOMPILING
This is set implicitly when CMAKE_SYSTEM_NAME is set. According to
the docs, the user isn't supposed to set it manually.
2022-08-03 22:45:24 +03:00
Martin Storsjö 2ea2e1476d build-libcxx: Stop disabling libc++experimental
Since LLVM 15, libc++experimental should work fine with libc++
configured for shared linking, and libc++experimental is enabled
unconditionally, and LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY is
ignored now.
2022-08-03 22:45:24 +03:00
Martin Storsjö c49f3a5953 build-llvm: Reuse the clang-tidy-confusable-chars-gen executable
This avoids needing to run the cmake configure for the nested
native build.

This tool (part of clang-tools-extra) is new in LLVM 15.0.0
(and the cmake setting for specifying the binary was backported
after the 15.x branch was made, but before rc1 was tagged).
2022-08-03 10:06:49 +03:00
Martin Storsjö 3d4e36806a Avoid using the nonstandard "which" command
This command isn't a standard tool; different distributions have
different implementations, and e.g. Fedora doesn't ship it by
default.

Settle on using "command -v $tool >/dev/null" for tests about whether
a tool is available. (We could also use "hash $tool 2>/dev/null" as we
already had in build-all.sh, but settling on using "command -v"
everywhere, for consistency and simplicity.)
2022-08-02 15:17:24 +03:00
Martin Storsjö f2ebd644ae build-llvm: Stop setting -DCROSS_TOOLCHAIN_FLAGS_NATIVE=
Since 93010544a813dfbfa64dd7cee68785f572f974d1 in llvm-project
(Jun 22nd), this no longer is needed for being able to build
native tools with a nested cmake in a cross build. (If building in
the same tree as a previous native build, build-llvm tries to pick
up the tblgen tools from there, so in such cases, this doesn't
make any difference and the nested native cmake invocation never
was executed.)
2022-07-31 01:08:30 +03:00
Martin Storsjö c6c5b137ed build-llvm: Use a precompiled clang-pseudo-gen tool when cross compiling
This avoids needing to run the cmake configure for the nested
native build.

This tool (part of clang-tools-extra) is new in LLVM 15.0.0.
2022-07-31 01:08:30 +03:00
Martin Storsjö 5ecaf6ce2c wrappers: Update the comment about what unwind method is used on armv7
Since fcb784db496137fa29a11b7e106efe89c7550e11 in llvm-project
(Jun 6th), the armv7 target uses SEH.
2022-07-31 01:08:30 +03:00
Martin Storsjö 6b9e0b1dbd build-libcxx: Build both static and shared libc++ in one single cmake build
Since bedf657d0f4c54ffe9ef4303382657a74296b544 in llvm-project
(May 18th), a static libc++ built at the same time as a shared one
no longer contain dllexport directives, making that library actually
usable.

Since dfa88927ae1411ccc3b248b7e624f2acf623d947 (Jun 6th), the
libc++ headers no longer have dllimport attributes, making the headers
installed from a build containing a shared library usable both
for the shared and static library, without the user having to set
any specific defines.

These two changes allow removing the manual build workarounds of
building the libraries in separate CMake invocations in a specific
order.
2022-07-31 01:08:30 +03:00
Martin Storsjö 5cc13adcc3 build-llvm: Update to llvm 15.0.0 RC1
Notable changes are:
- Fix stripping Rust executables with .rmeta sections
- Implemented support for SEH unwind info on the armv7 target
- Fix compiling files specified with an absolute \\?\C:\... style path
- Implemented support for the --disable-reloc-section option in lld
- Lots of improvements in LLDB on Windows (thanks to Alvin Wong!)
 - Support for GNU debuglink
 - Fix loading DLLs from a ramdisk
 - Fix starting executables without including the '.exe' suffix
 - Fixed crashes on getting nested exceptions
 - Use the right C++ ABI for mingw environments

Other changes that simplify how to build the toolchain:
- Improvements to how libcxx/libcxxabi/libunwind are built for Windows
  (and in particular mingw), allowing building both shared and static
  libraries in the same cmake build
- Avoids needing to set an empty CROSS_TOOLCHAIN_FLAGS_NATIVE when
  cross compiling LLVM
2022-07-31 01:08:30 +03:00
Martin Storsjö 9daf8a9b84 build-python: Update to the latest version of cpython-mingw 3.10.5 2022-07-31 01:08:30 +03:00
Martin Storsjö fffe23a549 build-mingw-w64: Update to a newer version
Notable changes are:
- Fix building for armv7 with SEH enabled
- Implement _set_com_error_handler and _com_raise_error in comdef.h
- Add import libraries for older msvcrXX.dll versions
- Redirect access() to __mingw_access() on UCRT
- Assorted updates to Windows APIs
2022-07-31 01:08:27 +03:00
Martin Storsjö 62914fcd2d build-llvm: Set CMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY when cross compiling
This avoids picking up a host cmake config file for zstd, in the github
actions CI, in the current git main version of llvm.
2022-07-21 21:53:07 +03:00
Martin Storsjö badbd89806 github: Disable zstd in the macos github actions build
Zstd is available and gets autodetected, but it's only available in
native form, not in arm64 form.

Also, for the existing workaround, instead of entirely disabling lldb,
one could pass -DLLDB_ENABLE_PYTHON=OFF instead.
2022-07-21 21:52:22 +03:00
Martin Storsjö bc1691262b build-llvm: Allow prepopulating CMAKEFLAGS
This allows passing options without proper command line flags.
2022-07-21 21:48:56 +03:00
Martin Storsjö 98f3380bec build-python: Bump to cpython-mingw 3.10.5
This is the version that msys2 currently ships.
2022-06-19 23:10:14 +03:00
Martin Storsjö 577e25b821 build-llvm: Avoid hardcoding the python version number in this script
This eases updating the build to a newer version of python.
2022-06-19 23:10:14 +03:00
Martin Storsjö ca2bc90bf3 github: Fix a typo in the workflows file 2022-06-18 23:05:04 +03:00
Martin Storsjö 24b8efd236 Add GitHub Actions builds
Test building the toolchain on all supported platforms for building
it (linux, macOS, msys2). Produce cross-built standalone toolchains
that run on Windows for all 4 supported architectures.

Run scheduled builds (daily), built with the latest git versions of
most components. For scheduled builds, the linux toolchain is built
with assertions enabled, as latest git version of llvm occasionally
can have regressions, and many such are caught by having assertions
enabled and building enough code that exercise many code generation
cases.
2022-06-16 10:36:10 +03:00
Martin Storsjö 050b4ef701 build-all: Allow passing many common build-llvm/build-mingw-w64 options via this script 2022-06-15 17:25:32 +03:00
Martin Storsjö e56fb975e9 build-all: Move a call to strip-llvm.sh into build-all.sh
This is the usual build configuration that most people would use.
2022-06-12 23:06:53 +03:00
Martin Storsjö eac1db1c0d prepare-cross-toolchain: Simplify code using "clang --print-resource-dir" 2022-06-12 23:06:24 +03:00
Martin Storsjö eb365d8eee build-compiler-rt: Simplify referring to the clang resource directory 2022-06-12 23:06:14 +03:00
Martin Storsjö 4b8ef36d94 install-wrappers: Don't install cross-prefixed cc/c99/c11 tools
A regular GCC install doesn't provide tools like <triple>-{cc,c99,c11},
so there's probably not much need to include them.

Some distributions of tools may provide tools with the names "cc",
"c99" and "c11" though, as custom frontends or symlinks to the
regular compiler. Therefore, keep the unprefixed tools with these
names.
2022-06-08 23:12:40 +03:00
Martin Storsjö 52d7bee3a8 wrappers: Set the right -std= arguments when invoked as c99/c11 2022-06-08 23:11:40 +03:00
Martin Storsjö 966f88e3da build-llvm: Improve code for checking for preexisting native tools when cross compiling
Check for the prescence of the llvm-tblgen binary in addition to just
checking whether the llvm/build or llvm/build-asserts directories
exist.

In cases where having multiple build directories around, where some
are older than others, it's now possible to clarify which one to use
for tools by just removing the llvm-tblgen binary from the other ones.

Also check for the prescenece of each individual tool before setting
it; this fixes builds where the native build might not have all
components enable as as enabled in the cross build.
2022-06-07 00:53:03 +03:00
Martin Storsjö 83d84ab79b build-mingw-w64: Fix installing COPYING files on macOS
The install(1) tool on macOS doesn't support the -D option for
creating directories at the same time while installing files.
Therefore, run a separate step for creating directories. Doing that
with "mkdir -p", even if install(1) also could do that with the -d
option (likewise with a separate command).

Also stop specifying the destination file name, when it's equal to
the source files, now that we know that the destination directory
already exists.
2022-04-08 13:13:56 +03:00
Martin Storsjö 192a734b71 build-llvm: Stop looking for a build directory called build-noasserts
We stopped creating such a directory in 2018 in
81864b3883.
2022-04-08 09:44:56 +03:00
Martin Storsjö 00abcdbe6a run-tests: Remove is-ucrt.c after testing 2022-04-08 09:44:56 +03:00
Martin Storsjö 0a23956f1a strip-llvm: Keep the lldb-vscode tool 2022-03-24 13:22:31 +02:00
Martin Storsjö 8009a236b8 build-llvm: Bump to the final 14.0.0 release
Compared with RC2, the only notable change for mingw targets is
that sections named .debug_* are sorted to the very end of the
image, after any other discardable sections, avoiding leaving gaps
if stripping such executables. (This can affect rust binaries with
a .rmeta section.)
2022-03-23 13:07:39 +02:00
Martin Storsjö 3debb07f0f build-python: Bump to the latest version on the mingw-v3.9.10 branch 2022-03-23 13:07:39 +02:00
Martin Storsjö 222e4bff34 build-mingw-w64: Bump to the current version from March 23rd
This fixes the v*scanf functions when using msvcrt.dll, if using more
than 30 format conversions, fixes error handling in the btowc
function in libmingwex, and adds a missing (void) in a function
prototype in winpthreads, adds the fwpuclnt import library for aarch64,
plus other assorted header/interface updates.
2022-03-23 13:07:39 +02:00
Martin Storsjö 5ae5b1aa37 build-llvm: Build clang-tools-extra
This installs a bunch of new tools in the bin dir, namely the following:
clang-apply-replacements
clang-change-namespace
clang-doc
clang-include-fixer
clang-move
clang-query
clang-reorder-fields
clang-tidy
clangd
find-all-symbols
modularize
pp-trace
run-clang-tidy

These are stripped out by strip-llvm, but clangd and clang-tidy
are kept.
2022-03-23 13:07:39 +02:00
Martin Storsjö 0dbd9baba3 build-llvm: Allow disabling building lldb
While lldb can be used as a cross debugger, it's probably mostly
used when run on the same target as the code is executed on.
Since it's a mostly optional component in the toolchain, allow
passing --disable-lldb to build-llvm.sh to skip it.
2022-03-23 13:07:39 +02:00
Martin Storsjö b3f63b4ac8 build-llvm: Default to using LLVM_ENABLE_PROJECTS even on unix
Allow setting up the projects with symlinks by passing --symlink-projects
to the build script.

The setup with symlinks is mostly useful in development setups, where
one wants to share ccache across multiple checkouts.
2022-03-23 13:07:39 +02:00
Martin Storsjö 0cffa112e0 build-llvm: Avoid unnecessary repeated git fetches if SYNC=1 is set
If the SYNC variable is set when running build-all.sh, all the
individual scripts will try to check out the intended version
before building. All scripts that build projects from llvm-project
(build-libcxx.sh, build-compiler-rt.sh, build-openmp.sh) call
build-llvm.sh with CHECKOUT_ONLY=1 to make sure the right version
is checked out (as one can call the scripts individually too).

If the llvm-project directory was a full (non-shallow) checkout,
the repeated fetch was quick as git knew that it had the fetched
reference already. But in a shallow clone, a new shallow fetch
would refetch the whole object tree for the targeted reference.

Using "git cat-file -e" we can check whether a specific object
exists in the local checkout, avoiding needlessly refetching
everything.

However, when fetching a tag using shallow fetch (git fetch
--depth 1 origin "$LLVM_VERSION"), it would only fetch the
commit object for that tag, not the tag itself. By specifying
'tag "$LLVM_VERSION"' in this case, we get the tag object itself,
so that we later can check whether "$LLVM_VERSION" exists in the
local checkout. But this requires guessing whether a specific
"$LLVM_VERSION" is a tag or a commit.
2022-03-23 13:07:39 +02:00
Martin Storsjö 58cfd46b25 build-llvm: Remove a special case, allow using lld for stage2 builds on macOS
In the currently targeted version of LLVM, lld is usable enough
for targeting macOS.
2022-03-23 13:07:38 +02:00
Martin Storsjö 67b61cfb22 release-macos: Remove a leftover listing of a nonexistent argument 2022-03-23 11:30:18 +02:00
Martin Storsjö 3fa0e8906b license: Fix a typo 2022-03-14 22:54:12 +02:00
Martin Storsjö e9e53d581d test: Remove a workaround for an old clang version 2022-03-14 11:36:32 +02:00
Martin Storsjö 7ff4a34668 Revert "build-libcxx: Build with -ffunction-sections -fdata-sections"
This reverts commit bd9e16f732.

It turns out this actually isn't needed; since switching to
building via the llvm-project/runtimes directory (in
7b1d05f545), the cmake build
pulls in HandleLLVMOptions.cmake, which checks for and adds
-ffunction-sections and -fdata-sections if supported. Therefore,
we don't need to specify it manually at all.
2022-03-10 13:48:08 +02:00
Martin Storsjö faa0a22955 Revert "wrappers: Force the default dwarf version back to 4"
This reverts commit e384109cbf.

This workaround no longer is necessary after LLVM 14.0.0 RC2.
2022-03-03 22:58:32 +02:00
Martin Storsjö c837cd6806 build-llvm: Bump to llvmorg-14.0.0-rc2
Notable changes include:

- Default to DWARF 4 instead of 5 for the mingw target
- Fix the section name encoding in llvm-objcopy/llvm-strip, if the output
  binary has more than 10^6 bytes of string table
2022-03-02 13:14:16 +02:00
Martin Storsjö 26dd3e46fe Add a script for building releases for macOS 2022-02-09 15:49:43 +02:00
Martin Storsjö e384109cbf wrappers: Force the default dwarf version back to 4
Clang's general default dwarf version was raised from 4 to 5 in
d3b26dea16108c427b19b5480c9edc76edf8f5b4 in llvm-project (Jan 23
2022) before the 14.0.0 branch, but dwarf 5 on Windows seems to not
work with either LLDB or GDB.

Thus force the default back to 4 here as a temporary workaround, and try
to set the default back to 4 for mingw targets in Clang for later
releases (https://reviews.llvm.org/D119326).
2022-02-09 15:39:43 +02:00
Martin Storsjö 977df0d83e wrappers: Fix an incorrect check for the max number of arguments in clang-target-wrapper.c 2022-02-09 15:39:43 +02:00
Martin Storsjö bd9e16f732 build-libcxx: Build with -ffunction-sections -fdata-sections
This allows shrinking binaries somewhat, if linking the runtimes
statically and using the -Wl,--gc-sections option.
2022-02-09 14:02:20 +02:00
Martin Storsjö ee6caf31cf Allow building a redistributable package for macOS
This includes building universal binaries (for arm64 and x86_64)
and targeting an older minimum deployment target.

(Before 1919720fdd348ca568b235bf3f1357c198eccd15 in llvm-project,
Jan 2022, building lldb's debugserver failed, if building for macOS
for multiple architectures, or for an architecture other than the
current host.)
2022-02-09 14:02:20 +02:00
Martin Storsjö 14db168cd6 wrappers: Use --{start,end}-no-unused-arguments instead of -Qunused-arguments
This makes warnings for other unused arguments visible to the user.

This requires a version of llvm-project past
50ec1306d060e46e0d53c9f5d8a052e1b0d10d3b (Jan 2022) which added these
new options.
2022-02-09 14:02:20 +02:00
Martin Storsjö 7b1d05f545 build-libcxx: Build libunwind+libcxxabi+libcxx with one single cmake build
This simplifies their interdependencies quite a bit.
2022-02-09 14:02:20 +02:00
Martin Storsjö 89af3e6a71 Remove the workaround with the initial, dummy empty libunwind.a
This reverts parts of commit e35ef3b7d7.

This is now handled better upstream, since
7af584ed87cc6eddb6adbc451c90fb8867469e06 in llvm-project
(November 5th 2021).
2022-02-09 14:02:20 +02:00
Martin Storsjö 81c39dda6a Build libunwind before mingw-w64-libraries
When --unwindlib=libunwind is implicit, we need to build libunwind
to have a complete working C compiler too. Currently this is worked
around by initially creating a dummy, empty libunwind.a, but with
the current version of libcxx/libunwind, we can get rid of that
workaround if we build it as soon as possible.
2022-02-09 14:02:20 +02:00
Martin Storsjö 56d0ef7900 wrappers: Remove hacks for filtering the stdout from clang
Since df0ba47c36f6bd0865e3286853b76d37e037c2d7 in llvm-project
(November 5th 2021), clang built with mingw defaults to producing
paths with forward slashes - thus, this hack no longer is needed.
2022-02-09 14:02:20 +02:00
Martin Storsjö 73f7c4ceca build-libcxx: Stop hardcoding LIBCXX_HAS_WIN32_THREAD_API
Since a8d15a926689c126c4d316788786e0160cfc1d5d in llvm-project
(October 5th), libcxx stopped autodetecting pthreads on mingw,
making pthreads opt-in instead of opt-out.
2022-02-09 14:02:20 +02:00
Martin Storsjö 77d293e95f test: Add tests for conversions between int128 and floats
These require a newer version of LLVM, past
d6216e2cd1a5e07f8509215ee5422ff5ee358da8 in llvm-project (September
29th).
2022-02-09 14:02:20 +02:00
Martin Storsjö ee1b52812a build-mingw-w64: Update to the current version from February 9th
Among lots of other changes, this now includes import libraries for
OpenGL for arm targets, and also hooks up timespec_get for UCRT.
2022-02-09 14:02:20 +02:00
Martin Storsjö 45cc868505 build-lldb-mi: Update to the latest version as of February 9th 2022-02-09 14:02:20 +02:00
Martin Storsjö 578afb1a6d build-python: Bump to the latest version on the mingw-v3.9.7 branch
This makes the armv7 build of python work correctly.
2022-02-09 14:02:20 +02:00
Martin Storsjö 9f5b66197f build-llvm: Bump to llvmorg-14.0.0-rc1
Notable changes include:

- LLVM can be configured to prefer forward slashes on Windows, avoiding
  the need to manually filter the Clang output in a wrapper for some
  commands.
- New Clang options for silencing warnings about unused arguments,
  avoiding the need to turn off the warning altogether. This makes
  llvm-mingw produce warnings about unused arguments among the user
  provided arguments, which never were seen before.
- Improvements to building libunwind/libcxxabi/libcxx, allowing
  simplifying the build a lot.

- Fixed generated calls to support routines for converting 128 bit integers
  from/to floats on x86_64.
- Fixed the -m32 flag, to let it figure out the right i386/arm
  architecture variant (where it previously looked for a sysroot named
  e.g. i386-*, which wasn't found).
- Fixed code generation for AArch64 in large object files (over 1 MB of
  code), where relocations against temporary symbols (jump tables,
  constant pools etc) were broken.
- Fixed continuing from breakpoints and singlestepping in LLDB on
  ARM/AArch64
- Fixed unwind info for overridden weak symbols (e.g. if overriding
  operator new with a statically linked libc++, and unwinding an exception
  through the operator).
- Set proper COFF symbol types for function aliases (e.g. for some C++
  constructors), making GNU ld export all of the correctly as the right
  type, when linking a DLL.
- Improved code generation for ARM, by assuming less strict alignment
  requirements for some instructions.
2022-02-09 14:01:53 +02:00
Martin Storsjö f3b6f0fa45 test: Don't use std::chrono_literals, fix building hello-exception in C++11 mode
std::chrono_literals require C++14.

This simplifies building hello-exception on macOS, where current
Apple Clang still default to C++11.
2021-12-03 11:42:11 +02:00
Martin Storsjö e3866b9df2 test: Fix a symbol collision when building hello-exception on macOS
On macOS, the included headers end up including sys/wait.h, which
declares a different symbol "wait".
2021-12-03 11:39:31 +02:00
Martin Storsjö 6f30aabe97 build-llvm: Set more variables for cross compiling LLDB with Python
These are needed with the latest version from git main since
November 2021.
2021-11-19 13:12:03 +02:00
Martin Storsjö 9eac155de2 build-llvm: Stop setting Python3_EXECUTABLE
This is the build host python, run during the build/install,
not to be run on the target device. LLVM's build system itself
detects the python to use for that and overwrites the
Python3_EXECUTABLE variable anyway, so it's value isn't currently
used.
2021-11-19 00:59:18 +02:00
Martin Storsjö 7e7344281d build-python: Discard local changes before checking out a new revision
Even if we don't patch cpython-mingw any longer, we still run
autoreconf on it (and libffi), which can cause changes to
committed files. If trying to check out a different version of
the source, this would fail unless the local changes have been
discarded.
2021-11-16 12:37:59 +02:00
Martin Storsjö 4b34c42cbc build-libcxx: Set CMAKE_CXX_COMPILER_TARGET when building
LLVM's default host detection doesn't always work (cmake doesn't
detect and provide the target architecture, but it provides the
bitness, thus LLVM's GetHostTriple.cmake guesses on the same
architecture as running the build), thus pass it manually.

This didn't use to matter, as the tests for whether --target=<target>
works used to fail, as the toolchain isn't complete at that point.

But since 7af584ed87cc6eddb6adbc451c90fb8867469e06 in llvm-project
(November 5th 2021), the libunwind cmake tests for --target do
succeed (without noticing that linking actually will fail), and thus
can end up using the incorrectly guessed compiler target.

Thus, this fixes building the runtimes with current git main
versions of llvm-project.
2021-11-05 14:38:38 +02:00
Martin Storsjö fe57d608de test: Add tests for conversion between 64 bit integers and long double 2021-10-14 12:34:00 +03:00
Martin Storsjö 13d48841a0 build-libcxx: Stop specifying a number of build settings that are set to their defaults 2021-10-14 12:33:22 +03:00
Martin Storsjö 378525eb9b build-mingw-w64: Update to the current version from October 1st 2021-10-01 22:27:39 +03:00
Martin Storsjö 214b775065 build-lldb-mi: Update to the latest upstream version
This fixes a bunch of build warnings in some setups.
2021-10-01 22:22:53 +03:00
Martin Storsjö 0adff0df7d build-libcxx: Stop manually specifying -lunwind
Specifying -lunwind isn't needed if building a version of libcxx
after 5f9be2c3e37c0428ba56876dd84af04b8d9d8915 (Feb 2021); then
libcxx is built with -nostdlib++ which keeps automatically linking
in -lunwind if -unwindlib=libunwind is used.
2021-10-01 12:32:47 +03:00
Martin Storsjö e35ef3b7d7 Use -unwindlib=libunwind instead of merging libunwind into libc++
This makes the build of libcxx a bit cleaner, and simplifies later
building and testing of libcxx.
2021-10-01 12:31:51 +03:00
Martin Storsjö e40ff6ab49 build-llvm: Bump to llvmorg-13.0.0
In addition to the changes in 13.0.0 RC1 (listed in
9188cce153), the following changes
relevant to llvm-mingw were made:

- Allow specifying language to llvm-rc with an 0x prefix
- Let the last specified option of -mconsole/-mwindows take effect
- Support both "--opt value" and "--opt=value" for more options in lld
- Add support for the --disable-dynamicbase option spelling in lld,
  in addition to the old existing --no-dynamicbase
- Fix linking with when enabling profiling
2021-10-01 12:25:25 +03:00