Commit Graph
100 Commits
Author SHA1 Message Date
Martin Storsjö 92bb096468 build-libcxx: Avoid warnings when building latest libcxxabi 2020-11-11 10:57:39 +02:00
Martin Storsjö 10ac7a59dd build-libcxx: Don't explicitly disable libc++ std::filesystem
It's currently disabled by default for windows targets; rely on this.
If it's enabled automatically upstream later, take it into use.
2020-11-11 10:57:40 +02:00
Martin Storsjö d334f83671 docker: Install curl and less in the base test images
Having less available should make debugging in the docker images a bit
more accessible.

Curl is a nice-to-have at the moment, while we also have wget available
from before.
2020-11-03 14:04:21 +02:00
Martin Storsjö 2af44c5a56 Use -n "$()" instead of "$()" != "" 2020-11-03 14:00:45 +02:00
Martin Storsjö fcafcacc58 build-compiler-rt: Signal that sanitizers should use libc++ for the cxxabi parts
This fixes building with the latest master version of compiler-rt,
that uses the itanium cxxabi bits for resolving type info.
2020-11-03 11:16:38 +02:00
Martin Storsjö f231314da7 build-libcxx: Remove some hardcoded flags for libcxxabi
These are included properly from libcxx's __config (or __config_site)
now.
2020-10-23 13:13:02 +03:00
Martin Storsjö ea3ff51d2c build-libcxx: Configure libcxx and generate headers before building libcxxabi
This fixes building with the latest versions, where the headers
strictly need __config_site to be available.
2020-10-23 12:22:13 +03:00
Martin Storsjö 2377f1a839 test: Explicitly test linking the C++ runtime statically 2020-10-23 12:17:35 +03:00
Martin Storsjö 0e3600182d build-mingw-w64: Update to the latest master version
This version includes a few minor fixes on top of the v8.0.0 release.
2020-10-20 23:01:13 +03:00
Martin Storsjö f91258a722 build-libcxx: Explicitly enable LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS
This used to be the default before, but has changed in the
latest master version of libcxx.

Previously, both libcxx and libcxxabi enabled it by default, but
we used to explicitly disable it on the libcxxabi side (and rely
on the default for libcxx). Instead explicitly set the intended
configuration state for both parts.
2020-10-20 23:01:13 +03:00
Martin Storsjö 5dd6b4a705 build-cross-tools: Update to using build-mingw-w64-tools
This was missed in 3fd3e58979.
2020-10-15 23:35:58 +03:00
Martin Storsjö 9031eb6791 Build the OpenMP runtime in docker based builds
LLVM's OpenMP implementation only supports Windows on x86, and it
requires a MASM-compatible assembler to build it. Build UASM
for this purpose, for now. (UASM isn't available packaged in
debian/ubuntu repos.) In the future, llvm-ml should be able
to handle it instead, but it's not currently mature enough.

Not including it in the regular build-all.sh for now, as UASM
isn't generally available.
2020-10-15 23:23:05 +03:00
Martin Storsjö d5d30fae23 build-llvm: If cross compiling, look for llvm-tblgen with an exe suffix
If cross compiling on MSYS, the native llvm-tblgen needs this suffix.
2020-10-15 23:20:32 +03:00
Martin Storsjö 1ca647f2c1 release: Build toolchains that target msvcrt in addition to ucrt 2020-10-13 14:27:44 +03:00
Martin Storsjö f2b389e6a7 test: Change hello-exception.cpp to print to stderr
Also flush after each printout, since not all configurations (in
particular, wine) flush stderr implicitly.

This is often useful when debugging unwinding.
2020-10-13 12:24:15 +03:00
Martin Storsjö 42297caad3 test: Add an option to hello-exception.cpp for causing crashes
This is useful for testing the debugger.
2020-10-13 12:20:25 +03:00
Martin Storsjö 8a60836d87 test: Remove unnecessary bits of hello-exception.cpp
These bits are tested by hello-cpp.cpp.
2020-10-13 12:19:46 +03:00
Martin Storsjö 06cf71558e build-llvm: Update to the 11.0.0 release of llvm
Notable changes since LLVM 10.0.0:

- Enable -mms-bitfields by default (like GCC), don't produce errors
  if the -mms-bitfields option is used together with non-trivial C++
  classes
- Support for more linker flags in LLD (--disable-auto-import,
  --disable-runtime-pseudo-reloc, --file-alignment, --section-alignment),
  and fixed the handling of the --no-seh flag
- Clearly error out on unsupported relocation types in aarch64 assembly
- Proper support for __attribute__((weak))
- Minor improvements to details in llvm-rc
- Fixed a regression in LLD about exporting symbols containing periods ('.')
  with a def file
2020-10-12 14:21:41 +03:00
Martin Storsjö 6ae2bfa3ad crt-test: Add a testcase for a case where a broken optimization in LLVM broke the compiler builtin division helpers
https://reviews.llvm.org/D88783 caused this to break.
2020-10-12 14:20:49 +03:00
Martin Storsjö 4e039a622f Remove old leftover entries from .dockerignore/.gitignore 2020-10-12 00:54:48 +03:00
Martin Storsjö bf40eb86fc strip-llvm: Simplify stripping out the executable suffix 2020-10-09 20:51:11 +03:00
Martin Storsjö 5fc9728420 strip-llvm: Fix name mangling of tools that contain $EXEEXT
This makes sure that llvm-exegesis is handled correctly (i.e.
stripped out) if build-llvm.sh was invoked with --full-llvm when
building for windows.
2020-10-09 15:55:58 +03:00
Martin Storsjö 66eb0af305 strip-llvm: Remove include/lldb if stripping a full install
If llvm is built with build-llvm.sh --full-llvm, we need to remove
this directory to end up with the same set of installed files as if
without --full-llvm, after stripping the install.
2020-10-09 12:37:37 +03:00
Martin Storsjö ccff9e4106 test: Update the conditions for skipping global-terminate.cpp on aarch64
Our pinned version of mingw-w64 is new enough already, and
latest wine has implemented __C_specific_handler for aarch64,
so this makes the test be bypassed with current pinned clang (10.0.0)
and the soon to be released clang 11.0.0, but is executed with
clang 12.0.0 (where current versions has got this implemented properly).
2020-09-28 15:11:10 +03:00
Martin Storsjö 4176511d24 build-mingw-w64: Update to the v8.0.0 release of mingw-w64 2020-09-22 11:45:25 +03:00
Martin Storsjö c82a6f2340 test: Add a testcase for the global termminate handler 2020-09-16 00:07:46 +03:00
Martin Storsjö fd763f4a43 build-mingw-w64-tools: Add widl symlinks with the mingw32uwp name 2020-09-16 00:04:13 +03:00
Martin Storsjö c9ae57f3d0 build-mingw-w64-tools: Only install an unprefixed widl if the native arch is one of the target archs 2020-09-16 00:04:18 +03:00
Martin Storsjö 00c95e73ef build-mingw-w64-tools: Add some comments 2020-09-16 00:04:13 +03:00
Martin Storsjö d067b4909b build-mingw-w64-tools: Only build one single widl binary 2020-09-16 00:03:57 +03:00
Martin Storsjö 5c83b904bd build-mingw-w64-tools: Pick the first arch as the one to target, instead of hardcoding x86_64 2020-09-16 00:03:57 +03:00
Martin Storsjö 3fd3e58979 build-mingw-w64: Split out building tools to a separate script
This simplifies build-mingw-w64.sh. When building on native
windows (where we also provide unprefixed tools, we can't have
the yet incomplete compiler toolchain in $PATH when building
the mingw-w64 tools. (Logically, build-mingw-w64-tools belong
with build-llvm and install-wrappers; using the original system
compiler to build tools that are supposed to run on the current
machine, as opposed to the cross target, like when building the
runtimes.)
2020-09-16 00:03:57 +03:00
Martin Storsjö 57b7ffd84d build-mingw-w64: Add a CHECKOUT_ONLY codepath 2020-09-16 00:03:57 +03:00
Martin Storsjö 308f7227c5 test: Add an idl testcase 2020-09-16 00:03:57 +03:00
Martin Storsjö 63add77368 run-tests: Run exception tests on wine on aarch64 as well
Current git versions of wine can handle the exception unwinding
properly.
2020-09-16 00:03:57 +03:00
Martin Storsjö e9708b38a6 install-wrappers: Install <triple>-as as a symlink to clang 2020-08-24 15:34:26 +03:00
Martin Storsjö 41f4f3fac6 wrappers: Filter backslashes into forward slashes for --print-search-dirs similarly to -v 2020-08-20 13:29:44 +03:00
Martin Storsjö ab4220fd2a wrappers: Remove a misplaced, unnecessary pair of braces 2020-08-20 12:56:39 +03:00
Martin Storsjö d7e5858a60 wrappers: Fix the output filtering for clang -v
This makes the code actually do what was intended, for cases with
multiple consecutive backslashes, each escaped to double backslashes.
2020-08-20 12:51:40 +03:00
Martin Storsjö 0fc16eb24d build-libcxx: Set LLVM_PATH when building libcxx
This is necessary since 8bc62db27244803 (Jun 26, 2020) in llvm-project.

Also setting it for libcxxabi and libunwind, in case it becomes
needed there as well.
2020-07-02 00:01:30 +03:00
Martin Storsjö 8b7d3bab1c build-libcxx: Remove a leftover variable
It became unused in 7c891a036.
2020-06-27 10:03:07 +03:00
Martin Storsjö 30f252f157 windres-wrapper: Add support for the language option
llvm-rc got support for this option on Jun 23rd [1], so the currently
pinned version of llvm-project doesn't support it - but earlier
versions just silently ignore the option, so it should be safe
to include in the wrapper now already.

[1] https://github.com/llvm/llvm-project/commit/f36f8b41beb9cc0353d5624934406d39b78753e0
2020-06-23 13:29:53 +03:00
Martin Storsjö e934c04ef4 run-tests: Execute the uwp test executables now that they don't rely on vcruntime140_app 2020-06-16 11:32:17 +03:00
Martin Storsjö 68b9eb60fa wrappers: Use -lucrtapp instead of -lvcruntime140_app
Passing -lucrt* to the clang driver inhibits the implicit default
-lmsvcrt, so this ends up only using libucrtapp.a instead of libucrt.a.

This still requires that the default crt was ucrt, as the prebuilt
libc++.a needs to have been built for the right crt.
2020-06-16 11:32:17 +03:00
Martin Storsjö da9b3b472b build-mingw-w64: Update to the latest version from git
This version includes libucrtapp.a, which doesn't require linking to
vcruntime140_app for avoiding api-ms-win-crt-private-*.dll.
2020-06-12 13:41:18 +03:00
Martin Storsjö d8aefd7b1a build-llvm: Fix a typo in the flags for disabling external libs
These aren't strictly necessary any longer, as the external libs
are used automatically if found (instead of erroring out if not
found, unless explicitly disabled as before).

Still keeping the explicit disables, to avoid potential issues if
e.g. the libs are found but exist in an incompatible version.
2020-03-27 13:29:25 +02:00
Martin Storsjö 8e461131cf Clean the build dirs before building, if the env var CLEAN is set 2020-03-25 23:24:31 +02:00
Martin Storsjö 36fc0f6432 build-compiler-rt, build-libcxx: Use ninja for building, if available 2020-03-25 00:29:07 +02:00
Martin Storsjö 92f5caa918 build-compiler-rt: Move CMake generator selection further out in the script 2020-03-25 00:29:07 +02:00
Martin Storsjö b89cdef107 build-llvm: Generalize the build command 2020-03-25 00:29:07 +02:00
Martin Storsjö 13e441d60e build-llvm: Only pass -j to ninja if CORES was set originally
If CORES was unset, let ninja pick the core count (which normally
is set higher than the number of cores).
2020-03-25 00:29:07 +02:00
Martin Storsjö ca303864ba Dockerfile.cross: Download a newer version of cmake than what the base distribution has
When building lldb for windows with the llvm 10.0.0 version,
cmake 3.13 is required. (Ubuntu 18.04 comes with cmake 3.10.2.)
2020-03-25 00:24:26 +02:00
Martin Storsjö 2c1a4645d9 Update the base distro used for dockerfiles and linux releases to Ubuntu 18.04
There's probably not much need for binaries based on 16.04 any longer.
2020-03-25 00:24:26 +02:00
Martin Storsjö 91c1339222 Only use the newer form for disabling LLDB's external dependencies
Also pass the new form properly when cross compiling LLDB.
2020-03-25 00:19:49 +02:00
Martin Storsjö efec56e495 build-mingw-w64: Update to the latest master version
- Fixed the dinput/dinput8 libraries for armv7/aarch64
- Provide libcfgmgr32.a for aarch64
- Fix cases of duplicate definitions of snprintf/vsnprintf when using
  msvcrt as crt, when building C++ code
- Fix cases where mftransform.h would undefine EXTERN_C, turning other
  variables declared as EXTERN_C into actual definitions
2020-03-24 23:15:10 +02:00
Martin Storsjö 68280abd1a build-llvm: Update to the 10.0.0 release of llvm
Notable changes since the previously pinned (early December 2019)
version:
- Implicitly add the .exe suffix if not provided in the clang
  -o argument, when running on windows (to match GCC's behaviour)
- Fixes for accesses to TLS variables in another object file
- Fixes for accessing weak functions that may be undefined, on ARM and AArch64
  (x86 was fixed earlier)
- Fixed many instances of locale handling in libcxx
2020-03-24 23:07:21 +02:00
Martin Storsjö 353af4ba24 readme: Add a note about incompatibility with object files and static libraries from other toolchains 2020-03-14 13:51:30 +02:00
Martin Storsjö 8507ee6023 windres-wrapper: Do the format name comparisons case insensitively 2020-03-14 12:58:18 +02:00
Martin Storsjö 96b149eb72 native-wrapper: Make static functions inline, to avoid warnings if unused 2020-03-14 12:58:18 +02:00
Martin Storsjö c994e9cb92 build-mingw-w64: Update to the latest version
This fixes a regression in the previously pinned version, where
the asprintf function produced undefined references when using UCRT.
2020-03-09 22:52:58 +02:00
Martin Storsjö ad3d710c9a build-libssp: Fetch the libssp source from gcc's github mirror
The GCC svn repo is no longer available, and fetching the whole GCC
git repo at around 1 GB is a bit wasteful, when we just need libssp
(which is less than 1 MB), but github provides svn access to git repos,
allowing us to fetch just this subdirectory.
2020-03-09 11:25:37 +02:00
Martin Storsjö 3110e27f64 run-tests: Transfer all tested files in one go
This should speed up testing a bit, especially if $COPY has a long
startup overhead.
2020-03-05 16:00:06 +02:00
Martin Storsjö 20d3b32b30 run-tests: Silence errors from trying to build uwp-error which intentionally should fail in certain configurations 2020-03-05 15:39:30 +02:00
Martin Storsjö 551b046498 run-tests: Don't build all tests for mingw32uwp, restrict it to the specific uwp-error test
Build one single test to verify that building generic code for mingw32uwp
works, but skip building all of the tests for this target.

Keep building the uwp-error test for all targets, to verify that it
builds successfully for mingw32 but fails for mingw32uwp.

This reduces the runtime for the tests by around a third.
2020-03-05 15:39:30 +02:00
Martin Storsjö 6b9b4ef1e3 Add a LICENSE.txt file explaining the licensing of the build files and of the built toolchain 2020-03-05 11:32:08 +02:00
Martin Storsjö 93d8fb4a8b build-llvm: Install the LLVM license 2020-03-05 11:31:31 +02:00
Martin Storsjö c1882530c3 Add copyright and license headers to all shell script files, for clarity 2020-03-05 11:31:31 +02:00
Martin Storsjö b1e19e7ebb wrappers: Relicense windres-wrapper.c from Unlicense to ISC
This is done with permission from Josh de Kock, see
https://github.com/mstorsjo/llvm-mingw/pull/4 for discussion.
2020-03-05 11:31:31 +02:00
Martin Storsjö 4f16aa8277 build-mingw-w64: Update to the latest version
This contains a minor assortment of fixes, but also fixes building
widl on BSD.
2020-03-05 11:31:20 +02:00
Martin Storsjö f4272deea5 test: Avoid a warning about a cast to a smaller integer type on 64 bit architectures 2020-03-04 14:01:26 +02:00
Martin Storsjö 3e35338ab3 Add make-* to .dockerignore 2020-02-29 23:00:14 +02:00
Martin Storsjö 39f7bf5e6e strip-llvm: Inclue lldb-argdumper and lldb-instr
These can be useful for integrating with an IDE such as VS Code.
This should fix issue #83.
2020-02-17 09:59:25 +02:00
Martin Storsjö ee894b6f63 windres: Accept the abbreviated form --include in addition to --include-dir
As GNU binutils windres uses getopt for option parsing, it accepts
any unique abbreviation of the long options. For now just look
for this particular abbreviation instead of any potential one,
as there's at least one existing use in the wild of --include:

https://github.com/tcltk/tcl/blob/fe69f643609d633facf249c9c963ce121153a8ff/win/tcl.m4#L640
2020-01-05 22:09:31 +02:00
Martin Storsjö 6513708aff build-llvm: Use more cmake variables for disbling python and other lldb external libs
These defines were renamed in lldb git master, soon after the current
pinned version.

This fixes building with a later version of llvm than the pinned one.
2020-01-05 21:59:37 +02:00
Martin Storsjö de510f07b5 build-llvm: Enable building LLDB 2019-12-28 13:59:42 +02:00
Martin Storsjö 0d08c6ab18 build-mingw-w64: Use make install-strip instead of building with -Wl,-s
These days, we have a working strip tool, so we can do a slightly
more straightforward procedure here.

In build-make.sh we still build with -Wl,-s, as we call a less
obvious install target there, in order to only install mingw32-make.sh,
not some header files and documentation.
2019-12-28 00:24:50 +02:00
Martin Storsjö c8d181fa90 Build a mingw32-make.exe when cross building toolchains
This can be used e.g. for building Qt without any MSYS installation,
and should also work for cmake, if using the mingw makefiles
generator.
2019-12-23 19:47:11 +02:00
Martin Storsjö 57c4f47db3 Add the --host flag to the help output in the individual build scripts 2019-12-21 00:04:47 +02:00
Martin Storsjö bc6df720ce wrappers: Stop specifying -fuse-cxa-atexit
Since clang 9.0.0 (34ec6929a1fb33716d0035dc0f1f164d7568b4dc
in llvm-project), it's no longer necessary to set this to be able
to use __cxa_thread_atexit (for TLS destructors). This brings the
behaviour closer to GCC, and reduces the amount of non-default
options used.
2019-12-20 23:18:41 +02:00
Martin Storsjö 7f2171d587 test: Simplify the hello.c test app 2019-12-20 09:43:39 +02:00
Martin Storsjö f023c3416f run-tests: Test building and running crt-test with -D__USE_MINGW_ANSI_STDIO=1 2019-12-20 09:39:08 +02:00
Martin Storsjö 4e9072aef0 crt-test: Add tests for large values in functions that do rounding and similar operations
Some of these functions earlier were using integer intermediates,
where the range easily is exhausted.
2019-12-20 09:38:32 +02:00
Martin Storsjö 7f7d2f9852 crt-test: Add tests for sscanf with double/long double outputs 2019-12-20 09:38:32 +02:00
Martin Storsjö 056c1f5cd2 build-llvm: Update to a recent git master version of llvm
Notable changes since the previous version are:
- Added a lld option for requesting delay loading libraries
- Allowing using custom .edata from input object files in lld (for Wine)
- Fixed llvm-dlltool with symbol renaming with stdcall decorations
- Supporting merging resources from more than one resource object file in lld
- Improved error messages for duplicate or undefined symbols in lld
  (including demangling C++ symbols and printing source locations
  where possible)
- Made lld look for for more library name patterns, matching GNU ld
- Brushed up support for using LLDB for, and building on, mingw
- Implemented initial support for armv7 and aarch64 windows in LLDB
2019-12-19 23:09:29 +02:00
Martin Storsjö 8bf82393b1 build-mingw-w64: Update to the latest version
This contains new declarations that the latest version of llvm
requires, when building llvm for windows on aarch64.

Notable changes are:
- Fixed compatibility fallbacks for running libc++ on Windows 7
- Improved handling of multibyte functions with UCRT
- Fixed installing mingw-w64-crt and widl in paths that contain spaces
- Fixed sscanf with double output on arm/aarch64
- Improved math functions, in particular for arm/aarch64
2019-12-19 22:38:47 +02:00
Martin Storsjö cd8e71d0e7 Make it possible to override the default win32 target version and mingw-w64 via environment variables
This makes it easier to change the default win32 target when using
build-all.sh, and also makes it possible to change the version of
mingw-w64 that is used, which wasn't possible at all before.
2019-12-19 22:21:02 +02:00
Martin Storsjö f7fd04dd42 run-tests: Print a message if all tests ran successfully 2019-12-18 11:32:31 +02:00
Martin Storsjö 348d1f18df test: Remove an unused, leftover variable 2019-12-18 11:27:50 +02:00
Martin Storsjö 5938c12227 readme: Recommend installing python3 instead of python2
Nowadays msys2 provides python 3.8 in the python3 package, so the
previous bug regarding running subprocesses in python3 is fixed.
2019-12-09 23:40:39 +02:00
Martin Storsjö bcfb883687 build-compiler-rt.sh: Don't make the i386-w64-mingw32 symlink if not building i686 2019-12-03 23:31:08 +02:00
Martin Storsjö af1099048a Fix building only certain architectures when building on windows
On windows, we rename clang.exe to clang-$MAJOR.exe, and later
install clang.exe as a wrapper for the default architecture. But
if only building certain architectures, and the host architecture
isn't one of them, we shouldn't install any unprefixed clang.exe at
all.
2019-12-03 23:31:01 +02:00
Martin Storsjö 64d39428b6 Quote uses of $PREFIX in the build script, to improve support for installing into a path that contains spaces
For build-mingw-w64.sh to succeed when installing to such a path,
the mingw-w64 version has to be updated to the latest git master.

build-mingw-w64-libraries.sh still fails in this case, as libtool
fails to properly quote $LD in a test for whether the linker is GNU ld.
2019-12-03 21:49:53 +02:00
Martin Storsjö ee555b9013 Fix building when $PATH contains spaces 2019-11-30 10:37:19 +02:00
Martin Storsjö 4a4cc16393 build-libcxx: Stop manually linking to -lpsapi
Since the default _WIN32_WINNT now is for Windows 7, psapi.h
redirects to PSAPI version 2, which is available in kernel32.dll
with a "K32" prefix on the function names (K32EnumProcessModules).
2019-11-26 12:17:51 +02:00
Martin Storsjö 3d13aefc70 Bump the default _WIN32_WINNT to 0x0601, i.e. Windows 7
Since the C++ libraries require Windows 7, there's little point in
keeping the default target for C at Vista.
2019-11-26 12:16:38 +02:00
Martin Storsjö ce7d3ec874 windres-wrapper: Short options joined with the option value doesn't use an equals character
This makes options like "-iinput.rc -ooutput.o" work properly.
2019-11-21 08:10:52 +02:00
Martin Storsjö f1168d3016 Don't rely on EXEEXT as an env variable, infer it from --host instead 2019-11-13 12:59:53 +02:00
Martin Storsjö 577400a5f7 Pass $HOST to individual script with a --host parameter
This avoids ambiguity on distributions (such as openSUSE) where the
HOST environment variable already is set, to the hostname.
2019-11-13 12:55:39 +02:00
Martin Storsjö b5ae2b5cc7 Allow overriding the default crt in dockerfiles with --build-arg DEFAULT_CRT=msvcrt 2019-11-13 12:39:30 +02:00
Martin Storsjö dcf34a9a35 readme: The minimum Windows version that libc++ runs on is Windows 7
It uses TryAcquireSRWLockExclusive which didn't exist until Windows 7,
unlike the rest of the SRWLock APIs that appeared in Vista.
2019-10-28 13:49:24 +02:00