Commit Graph
100 Commits
Author SHA1 Message Date
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
Martin Storsjö 255286eb72 build-llvm: Fix only checking out the source
This is used if calling build-compiler-rt.sh or build-libcxx.sh with
the environment variable SYNC set.
2019-10-23 13:21:56 +00:00
Martin Storsjö c7821ce27d build-llvm, strip-llvm: Include llvm-symbolizer
This is necessary for getting addr2line included.
2019-10-23 13:21:56 +00:00
Martin Storsjö 9f8e5cebd6 windres-wrapper: Implement the -F/--target flag like GNU windres
The values passed to this parameter aren't arch/vendor/os triples, but
bfd target names.
2019-10-08 09:24:50 +03:00
Martin Storsjö 2d1aeef4ac build-mingw-w64-libraries: Add an explicit --libdir parameter
On some distributions, e.g. openSUSE, the libraries for 64 bit
architectures end up stored in <target>/<triplet>/lib64 instead of
plain "lib".

(This is caused by their use of a site script for configure, which
overrides libdir when the host triplet matches 64 bit architecture
names - even if it's a triple for cross compilation for a totally
different OS. This only affects the libraries and not mingw-w64-crt,
as the crt's makefiles manually set the output directory name.)

This fixes https://github.com/mstorsjo/llvm-mingw/issues/51.
2019-09-26 16:25:08 +03:00
Martin Storsjö ef9af0d3ad build-llvm: Update to the 9.0.0 release 2019-09-20 11:27:27 +03:00
Martin Storsjö c2f25a93ad build-llvm: Remove a redundant -b parameter to git clone 2019-09-20 11:27:27 +03:00
Martin Storsjö ecb0824234 build-mingw-w64: Update the mingw-w64 version
This version contains fixes for wchar printf functions in how they
handle %s/%S formats.

This isn't the absolute latest version, as there's other commits further
ahead adding support for _FORTIFY_SOURCE (which has little to no effect
with Clang as it doesn't evaluate __builtin_object_size in inlined
contexts), and the commits for _FORTIFY_SOURCE caused a few regressions,
and things might still be a bit in flux (even though the current master
seems to work fine).
2019-09-20 11:27:27 +03:00
Martin Storsjö cb38ada41c Add llvm-project to the .dockerignore file 2019-09-20 11:27:27 +03:00
Martin Storsjö 3024fbc50f build-llvm: Set LLVM_HOST_TRIPLE when cross compiling
This makes the bare executables know what their default triple
is.
2019-09-17 13:59:59 +03:00
Martin Storsjö d31dc46137 build-llvm: Use symlinks in the llvm/tools directory instead of LLVM_ENABLE_PROJECTS
This makes cmake use relative paths to all source files, allowing ccache
to reuse compilation results from different source trees in different
directories.

Keep using LLVM_ENABLE_PROJECTS on msys, where symlinks aren't supported.
2019-09-12 14:32:14 +03:00
Martin Storsjö 0f9d9f1986 Check out llvm sources using the new llvm git monorepo
This updates compiler-rt, libunwind, libcxxabi and libcxx to a newer
version, matching the compiler.

This will be the official, canonical repo in the future.

For the non-dev Dockerfile build, this means that all the llvm based
subprojects need to be built in one RUN to avoid storing the llvm
checkout in the docker layers.
2019-09-12 13:14:19 +03:00
Martin Storsjö 51da9d154c readme: Fix a typo and clarify a sentence 2019-08-28 13:25:56 +03:00
Martin Storsjö cf76ac237b readme: Clarify the known issue with libtool and linker script 2019-08-14 12:45:41 +03:00
Martin Storsjö 7d904d0df8 readme: Mention the common error when the compiler_rt builtins have been omitted by libtool 2019-08-13 12:55:59 +03:00
Martin Storsjö d4a27dfd80 Stop manually setting CC/AR/RANLIB when building autotools projects
Since we have triplet prefixed wrappers for all tools, and wrappers
named <triplet>-gcc/g++ as well, we don't need to manually provide
them.
2019-08-13 12:51:42 +03:00
Martin Storsjö 6f93f0d618 readme: Include some more known issues wrt lld, linker script and libtool 2019-08-12 13:14:27 +03:00
Martin Storsjö 293f2af9e7 readme: Add more subheadings 2019-08-12 12:55:14 +03:00
Martin Storsjö 89e0891d8f readme: Remove the note about only being tested on macos and linux
It has recently been tested on msys2 as well, with few changes since
the last time it was tested.
2019-08-12 12:54:18 +03:00
Martin Storsjö 00edbd4ec3 crt-test: Test negative zero in a few places 2019-08-01 22:30:45 +03:00
Martin Storsjö f07f6b71fe crt-test: Add tests for many more math functions
This should complete the coverage of all the C99 math functions.
2019-08-01 22:30:45 +03:00
Martin Storsjö e9da355304 crt-test: Test the copysign function on any platform, not only on windows 2019-08-01 22:30:45 +03:00
Martin Storsjö 7347d257ed crt-test: More thoroughly test some math functions
Also check that NaN is propagated properly where possible.
2019-08-01 22:30:45 +03:00
Martin Storsjö 52e7fff7a6 crt-test: Reduce code duplication in tests for math functions 2019-08-01 22:30:45 +03:00
Martin Storsjö 8eea910f47 crt-test: Extend existing tests for NAN to check that input NANs are preserved
Don't check the full NAN in itself, but check that the sign bit appears
correctly.
2019-08-01 22:30:45 +03:00
Martin Storsjö 2e6fa5bca7 crt-test: Wrap parameter expansion in TEST macros in parentheses 2019-08-01 22:30:45 +03:00
Martin Storsjö 70f074b599 crt-test: Restore the rounding direction after testing it 2019-08-01 22:30:45 +03:00
Martin Storsjö da4562be1b Update to the latest version of mingw-w64
This version includes fixes for a lot of c99 math functions.
2019-08-01 22:30:32 +03:00
Martin Storsjö 315e1ab683 Install the needed packages in docker images with --no-install-recommends
This avoids installing a few unneeded ones, but requires manually
picking ca-certificates instead.
2019-08-01 22:30:32 +03:00
Martin Storsjö 4670446157 Install llvm-addr2line 2019-07-01 22:30:24 +03:00
Martin Storsjö a61af72ca9 Write some sort of msys2 build instructions 2019-06-28 23:31:17 +03:00
Martin Storsjö 60609f0716 Reorder the readme, mention prebuilt toolchains first 2019-06-28 00:15:44 +03:00
Martin Storsjö 0933a30500 Avoid printing an error when rerunning build-compiler-rt.sh on msys2 2019-06-28 00:14:32 +03:00
Martin Storsjö 5f70dd1a1f Avoid errors when recreating an existing symlink on msys2
In this environment, symlinks don't exist but are made as copies.
In such cases, the -n option to ln doesn't work for making this
a no-op.

Alternatively, we could append "|| true", which would print an
error but continue.
2019-06-28 00:13:24 +03:00
Martin Storsjö c89799c996 Restore the original path before building widl
When building on windows, the toolchain bin directory contains
prefixless wrappers named "gcc.exe" and "clang.exe", even though
the toolchain isn't functional yet at this stage. Restore the
original path before building widl.

A more complete solution might be to build widl first, before
adding the newly built toolchain to the path.
2019-06-28 00:12:10 +03:00
Martin Storsjö f80d067176 Only make the prefixless widl symlink after compiling widl
When building in msys2, symlinks are plain copies, and one can't
make the symlink in advance.
2019-06-21 22:52:34 +03:00
Martin Storsjö 7edc154d50 wrappers: Unify comments about exception handling methods. 2019-05-28 15:29:08 +03:00
Martin Storsjö 4811c1f489 wrappers: Stop explicitly requesting SEH for AArch64
It is the default exception handling model there now.
2019-05-28 15:27:56 +03:00
Martin Storsjö 9d8339b48d Update mingw-w64 to the latest version
This version fixes deadlocks in winpthreads condvars (in certain
use patterns), uses the _UCRT define to request and signal the
use of UCRT, fixes the UCRT _vsnwprintf function, uses the
CRT's setjmp/longjmp on AArch64 if SEH is in use, and makes the
UCRT set the app type to console properly for such apps.
2019-05-28 13:54:51 +03:00
Martin Storsjö 0d4861fdd3 readme: Document the new implicit pdb output file naming 2019-05-28 00:04:39 +03:00
Martin Storsjö 5623fd232c wrappers: Remove the ld wrapping of --help and -v
The MinGW driver in lld now handle these flags, including the
libtool specific keywords.
2019-05-28 00:04:39 +03:00
Martin Storsjö 0c7aac99ad Update llvm/clang/lld to the latest version
This version adds support for a version of the -pdb option to the MinGW
frontend to lld that can work without a parameter, and implements --help
and -v for the same frontend.
2019-05-28 00:03:05 +03:00
Martin Storsjö d009355b91 build-llvm: Remove the now unnecessary BUILDTARGETS variable 2019-05-09 09:22:26 +03:00
Martin Storsjö 873243acc2 build-llvm: Use the built-in recursive cmake for building llvm-tblgen if necessary
This requires setting a flag to use the system default compiler
for this, instead of the cross compiler.
2019-05-09 09:22:26 +03:00
Martin Storsjö a8829aeebb build-libcxx: Remove cmake flag overrides that no longer are necessary 2019-05-09 09:22:26 +03:00
Martin Storsjö ca329c1cd4 run-tests: Check for the _UCRT define that latest upstream mingw-w64 defines
The __MSVCRT_VERSION__ define has been changed and now is set to
0xE00 for UCRT, but the _UCRT define has been added.
2019-05-07 09:04:06 +03:00
Martin Storsjö 6223a35822 strip-llvm: Remove lld-link on windows 2019-05-06 11:05:25 +03:00
Martin Storsjö c3aeb78576 wrappers: Add a wrapper for running llvm binutils replacements
This saves a lot of diskspace, when symlinks are turned into full
copies of the tools on windows, as the symlinks only point to a small
wrapper instead of to the full tool.
2019-05-06 11:05:25 +03:00
Martin Storsjö 750ab50433 wrappers: Consistently quote all arguments when calling spawn or creating a command line 2019-05-06 11:04:53 +03:00
Martin Storsjö fa88c4ee1e wrappers: Escape the first argument to spawn
This fixes running in paths that contain a space.
2019-05-06 11:04:53 +03:00
Martin Storsjö 97ca0681bc wrappers: Split out shared helpers for native wrapper executables to a header 2019-05-06 11:04:53 +03:00
Martin Storsjö 66055dfe63 wrappers: Take the argv null terminator into account when checking for overflows
When adding the terminator without incrementing arg and checking for
overflows with "arg > max_arg", we need to allocate space for one
extra element for the implicit terminator.
2019-05-06 11:04:27 +03:00
Martin Storsjö 013dfc08e4 windres-wrapper: Check that the number of args isn't exceeded 2019-05-06 11:04:27 +03:00