Commit Graph
100 Commits
Author SHA1 Message Date
Martin Storsjö 6bff543bd9 Use libunwind's built-in SEH support instead of libgcc 2018-08-31 12:15:28 +03:00
Martin Storsjö cdd5409cad Update libunwind to the latest version
This version has got built-in support for SEH exceptions for x86_64.
2018-08-31 11:34:37 +03:00
Martin Storsjö 6edb1a60e9 Update to the latest version of mingw-w64
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.
2018-08-23 23:51:01 +03:00
Martin Storsjö ef6fb562d9 Add a missing gitignore and dockerignore for libgcc 2018-08-13 23:52:43 +03:00
Martin Storsjö bf1ac02e82 Silence the svn clone of libgcc and libssp 2018-08-13 23:52:43 +03:00
Martin Storsjö efc60f509a Add dockerignore for outputs from building tests 2018-08-13 23:52:43 +03:00
Martin Storsjö 4a1c91c208 Add a testcase for libssp 2018-08-13 23:50:01 +03:00
Martin Storsjö 0448bd616a Build tests in a separate subdirectory for each arch
This eases cases when testcases contain DLLs, whose names won't
contain the arch name.
2018-08-13 23:49:08 +03:00
Martin Storsjö cef45a8937 Add missing copyright headers to a few new testcases 2018-08-13 09:18:33 +03:00
Martin Storsjö d25e4d5be7 Remove a known issue with debugging x86_64 binaries
With SEH in use now, this is no longer an issue.
2018-08-08 08:43:05 +03:00
Martin Storsjö d951a625bd Switch to SEH exceptions for x86_64 2018-08-08 08:43:05 +03:00
Martin Storsjö e784dc6513 Build unwind-seh.c from libgcc instead of libunwind, if SEH is in use 2018-08-08 08:43:05 +03:00
Martin Storsjö 65859ddf20 Update llvm/clang/lld to the latest version
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.
2018-08-08 08:42:28 +03:00
Martin Storsjö 27b46b855f Update mingw-w64 to the latest version
This version fixes building with the latest version of clang.
2018-08-08 08:40:48 +03:00
Martin Storsjö d8a6254bed Update libunwind to the latest version
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.)
2018-08-08 08:40:48 +03:00
Martin Storsjö d6a9b3b9dc Split the non-dev version of Dockerfile into a few smaller steps
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.
2018-08-03 14:47:33 +03:00
Martin Storsjö 0c85589b93 Limit what parts of llvm are installed in the first place 2018-08-03 11:58:59 +03:00
Martin Storsjö 83fbea8ff1 Keep llvm-pdbutil after stripping
This tool may be of use in a windows toolchain.
2018-08-03 11:58:59 +03:00
Martin Storsjö bbea540de6 Remove dangling symlinks when stripping the llvm installation 2018-08-03 11:58:59 +03:00
Martin Storsjö 917860d0ef Amend the comment about the size of the docker image 2018-08-03 11:58:59 +03:00
Martin Storsjö 92f301f775 Suppress compiler warnings in libunwind/libcxxabi if llvm cmake files are unavailable
The llvm cmake files add a few compiler flags, among them one for
suppressing warnings.
2018-08-03 10:56:49 +03:00
Martin Storsjö ca8ce421cd Strip the llvm installation after building
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.
2018-08-03 10:56:49 +03:00
Martin Storsjö 2739421564 Update compiler-rt/libuwnind/libcxxabi/libcxx to the latest version
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.
2018-08-03 10:56:49 +03:00
Martin Storsjö f92f858ae2 Add gitignores for new files generated by the previous commit 2018-08-03 10:56:49 +03:00
Martin Storsjö 26ab7a4424 Add a test app for thread local variables with destructors 2018-08-03 10:19:50 +03:00
Martin Storsjö 11e04f0466 Support destructors for thread local objects 2018-08-02 23:28:39 +03:00
Martin Storsjö c21fb8356e Update mingw-w64 to the latest version
This version provides __cxa_thread_atexit, for supporting destructors
for TLS objects.
2018-08-02 23:28:39 +03:00
Martin Storsjö 1836ed28dd Test __attribute__((constructor)) and __attribute__((destructor))
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.
2018-08-02 14:28:21 +03:00
Martin Storsjö 1ecc51f84d Clean up some more files installed by current clang 2018-07-25 14:59:31 +03:00
Martin Storsjö 609fe4b81d Use binutils objcopy and strip if available
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.
2018-07-25 00:56:58 +03:00
Martin Storsjö 86d8400cae Update llvm/clang/lld to a version from today
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.
2018-07-25 00:56:40 +03:00
Martin Storsjö ca43ab5ccd Use dwarf exceptions on i686 as well
Now libunwind works properly in this case for dwarf on i686 mingw.
2018-07-17 22:26:58 +03:00
Martin Storsjö 3da8d27a8e Update libunwind to the latest version
This version fixes the issue that caused dwarf exceptions not to work
properly on i686 mingw.
2018-07-17 22:26:44 +03:00
Martin Storsjö 4631869407 Update compiler-rt to the latest version
This adds __chkstk, needed for Windows Store apps for armv7.
2018-07-17 22:22:52 +03:00
Martin Storsjö af4e0b0021 readme: Remove the issue about libunwind vs WinRT
libwinstorecompat now provides a reimplementation of EnumProcessModules,
making libunwind compatible with WinRT.
2018-07-16 23:30:54 +03:00
Martin Storsjö 3c1c81f321 Build the winstorecompat library from mingw-w64-libraries 2018-07-16 23:30:54 +03:00
Martin Storsjö 4981924170 Update mingw-w64 to the latest version
This version has improvements for building for WinRT/UWP.
2018-07-16 23:30:54 +03:00
Martin Storsjö 6e4478b778 Fix overwriting symlinks to directories
This avoids extra misplaced symlinks if rerunning the build scripts.
2018-07-16 23:02:38 +03:00
Martin Storsjö 158b65f7c0 Set LIBUNWIND_STANDALONE_BUILD while building
This avoids accidentally finding an extra copy of libcxc outside
of the source tree.
2018-07-16 14:42:53 +03:00
Martin Storsjö 00d67c0479 Don't set DLLTOOL when building winpthreads
This tool isn't usee while building winpthreads.
2018-07-07 23:59:50 +03:00
Martin Storsjö d12ee1543e Use the windows api sets version of the universal crt 2018-06-28 11:48:39 +03:00
Martin Storsjö 6ba6ac5c52 Upgrade to the latest version of mingw-w64
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.
2018-06-28 11:47:55 +03:00
Martin Storsjö 2372dc03e8 Update to the latest versions of libunwind/libcxxabi/libcxx
These updates help in building these projects on windows in msys.
2018-06-21 11:52:14 +03:00
Martin Storsjö 3506c70451 Remove a stray unicode nbsp 2018-06-20 00:20:23 +03:00
Martin Storsjö 1d3f223d29 Don't error out in install-wrappers.sh if some binary tools are missing
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).
2018-06-19 09:31:57 +03:00
Martin Storsjö 9990dc49f1 Don't error out if unable to create the i386->i686 symlink in build-compiler-rt.sh
If running in MSYS2, this symlink will fail unless the i686-w64-mingw32
directory actually exists.
2018-06-19 09:31:45 +03:00
Martin Storsjö 951796aeb7 extract-docker: Remove leading slashes when removing an earlier copy
If extracting from an absolute path within the image, like
/opt/llvm-mingw, it will still be extracted into opt/llvm-mingw in
the local directory.
2018-06-12 10:04:55 +03:00
Martin Storsjö 86cc330999 Expand the help text in extract-docker.sh 2018-06-10 23:26:44 +03:00
Martin Storsjö 3b3924e4b1 test: Add a testcase for setjmp 2018-06-05 23:40:25 +03:00
Martin Storsjö 024d125611 test: Test the now fixed copysignl function on x86_64 as well 2018-06-04 10:08:47 +03:00
Martin Storsjö fe08750026 test: Test building crt-test.c with -fno-builtin as well 2018-06-04 10:08:47 +03:00
Martin Storsjö 6a3080fa58 test: More clearly print errors in the NAN tests 2018-06-04 10:08:47 +03:00
Martin Storsjö 0e86b1ed49 test: Extend the intrinsics tests 2018-06-04 10:08:47 +03:00
Martin Storsjö 4fe1cb9aad Update mingw-w64 to the latest version
This fixes interlocked intrinsics for arm and arm64, and fixes
the copysignl function for x86_64.
2018-06-04 10:08:47 +03:00
Martin Storsjö b73785af3b Fix a typo in the readme about PDB output 2018-06-02 23:03:42 +03:00
Martin Storsjö 1c73ae0fd1 Mention PDB support in the readme 2018-05-21 14:39:00 +03:00
Martin Storsjö 66d79fd7fe Update to the latest versions of llvm/clang/lld
This fixes an issue with code generation for functions that needed
a stack probe on armv7, improves llvm-rc and adds a few more options
to the mingw lld frontend.
2018-05-16 09:10:01 +03:00
Martin Storsjö cc2d414ea3 windres: Add the input file directory as include path
This fixes building resource files that refer to external files
relative to the source directory, without specifying any directory
via include flags to windres itself. This is needed since llvm-rc
doesn't see the original source file but only sees the preprocessed
one in a temporary directory.

Alternatively, the preprocessed file could be placed in the same
directory as the source file, but when building e.g. outside of the
source tree, writing files (even temporary ones) inside the source
tree isn't generally expected.
2018-05-11 09:48:07 +03:00
Martin Storsjö ecdb6647b7 windres: Remove the rc filtering in the wrapper shell script
llvm-rc does this filtering internally now.
2018-05-11 09:48:07 +03:00
Martin Storsjö da4d3df5da Update to the latest version of llvm/clang/lld
This version improves llvm-rc to support more rc script features
and features built-in filtering of CPP output in llvm-rc. It also
improves the handling of some def features in llvm-dlltool, allows
producing codeview debug information when targeting mingw and adds
handling of a few more ARM64 relocations in lld.
2018-05-11 09:48:07 +03:00
Martin Storsjö d3d57c2890 Fix conversion from res to coff in the new windres wrapper 2018-05-08 12:44:39 +03:00
Martin Storsjö 5899f4f536 Add the installation bin directory to the path internally in wrapper scripts
This allows invoking the script frontends via an explicit path,
without adding the directory to the PATH environment variable before
calling them.
2018-05-07 10:24:24 +03:00
Martin Storsjö fa08e722ed Don't use bashisms for finding the script directory
Posix sh and $0 should be good enough in most cases.
2018-05-07 09:49:48 +03:00
Martin Storsjö ce282cdf5d Use --driver-mode=g++ instead of invoking clang++
This avoids needing the clang++ symlink. On platforms without symlinks
(i.e. windows), clang.exe and clang++.exe are two separate but identical
executables. This allows getting rid of the latter, saving size.
2018-05-07 09:49:34 +03:00
Martin Storsjö fd71e83e2d Update to the latest version of mingw-w64
This version includes fixes for building winpthreads for arm and arm64.
2018-05-07 09:45:38 +03:00
Martin Storsjö decfd0030b Update README.md about using llvm-rc instead of GNU binutils windres 2018-05-07 09:44:41 +03:00
Martin Storsjö 37e0a35aa5 Update to the latest version of llvm/clang/lld
This version contains improvements and fixes for llvm-rc and llvm-cvtres.
2018-05-03 14:51:26 +03:00
Martin Storsjö 35c2028e50 Define _LIBCPP_HAS_THREAD_API_WIN32 while building libcxxabi
When building libcxx, this is also already enabled via the cmake
option -DLIBCXX_HAS_WIN32_THREAD_API=ON.

This fixes building libcxxabi if pthreads are available.
2018-05-03 14:50:43 +03:00
Martin Storsjö ef5cbfd947 Use "which" to find the location of the dummy "true" executable
On macOS, this is in /usr/bin instead of in /bin.
2018-04-27 09:29:17 +03:00
Martin Storsjö f018ca81fe Add libssp to dockerignore as well 2018-04-26 16:18:40 +03:00
Martin Storsjö 579aa616b4 Fix strip-llvm.sh after updating to the latest version of clang
In this version, the binary actually is named clang-7 instead of
clang-7.0. This requires extending the test a little for keeping such
binaries but removing other clang-foo tools.
2018-04-26 13:15:53 +03:00
Martin Storsjö c9db1e06b5 Build libssp from gcc
gcc/libssp's configure script runs checks for flags that clang doesn't
implement. We actually just need to set a few HAVE defines and compile
the .c sources, so just check out this subdirectory using svn and build
it using a custom makefile.
2018-04-23 00:26:05 +03:00
Martin Storsjö 61eaf3a0de Stop manually setting the sysroot
Since clang SVN r330244, the one next to clang is preferred, even
if a similar mingw gcc exists in the path.
2018-04-19 00:52:35 +03:00
Martin Storsjö 6b5651a4a3 Stop adding the toplevel c++ include symlink
As long as we pass --sysroot explicitly in clang-target-wrapper.sh,
this isn't necessary. And since clang SVN r329946. it's no longer
necessary when not specifying the sysroot (and having it is in
fact harmful).
2018-04-19 00:35:45 +03:00
Martin Storsjö f13e8da487 Update to the latest version of llvm/clang/lld
This version improves the handling of mingw cross sysroots
and the libc++ include paths.
2018-04-18 20:44:22 +03:00
Martin Storsjö c47bc66093 Update to the latest version of mingw-w64
This version fixes a few issues for arm and arm64.
2018-04-15 23:21:58 +03:00
Martin Storsjö e2c1dcac2b Mention strip-llvm.sh in the readme 2018-04-02 16:40:21 +03:00
Martin Storsjö 9557db98f9 Remove a few unnecessary sentences of the readme 2018-04-02 16:40:21 +03:00
Martin Storsjö e835141ce2 Tweak the wording in the readme 2018-04-02 16:40:21 +03:00
Martin Storsjö e9975fabab Squash all build steps in the dockerfile, producing a much smaller image
Keep the old dockerfile with a different file name, for easier
testing/debugging (where later steps can be tweaked without
rebuilding everything).
2018-04-02 16:00:27 +03:00
Martin Storsjö f856480113 Clean up properly after installing packages 2018-04-01 23:30:12 +03:00
Martin Storsjö d3ff718bd1 Remove unnecessary llvm files at the end
This doesn't help reduce the docker image size since it's done
in a separate RUN step than the one that added the files. (compiler-rt
and libunwind currently fail to build after stripping the llvm
installation though.)
2018-04-01 23:27:21 +03:00
Martin Storsjö 60af9e29e1 Strip the built widl 2018-04-01 22:45:30 +03:00
Martin Storsjö 172b2974dd Strip llvm on install 2018-04-01 22:45:30 +03:00
Martin Storsjö 93e7810749 Share one include directory between all archs 2018-04-01 22:45:30 +03:00
Martin Storsjö 511222e6b5 Skip a redundant subdirectory in the docker image 2018-04-01 22:45:30 +03:00
Martin Storsjö 166a2bab65 Install the toolchain to /opt/llvm-mingw, in the docker image 2018-04-01 22:45:30 +03:00
Martin Storsjö 6dc488eca7 Remove an unnecessary command from the end of a step in the dockerfile 2018-04-01 22:45:30 +03:00
Martin Storsjö cacdf723fa Add ISC licenses to the test programs 2018-03-21 11:09:55 +02:00
Martin Storsjö 7297bb65a5 Add a more thorough test case, testing various CRT features
Simplify building of the test cases at the same time; stop building
hello-cpp with -fno-exceptions.
2018-03-20 12:00:56 +02:00
Martin Storsjö 421b7f671c Rename hello.cpp to hello-cpp.cpp 2018-03-20 11:51:33 +02:00
Martin Storsjö d7d80f084a Rename the hello subdirectory to test 2018-03-20 11:08:32 +02:00
Martin Storsjö ee480fec72 Update to the latest version of mingw-w64
This version compeletes some aarch64 specific structs in winnt.h
and provides libodbc32.a for aarch64.
2018-03-20 10:55:56 +02:00
Martin Storsjö 28ac526c42 Update to the latest version of llvm/clang/lld
This version fixes issues with long double math functions on x86_64
(and some mingw-w64 float/double math functions are implemented with
a long double function internally), and adds support for the --kill-at
flag in lld.
2018-03-20 09:57:21 +02:00
Martin Storsjö 7c069cf6b1 Allow running tests remotely for armv7/aarch64 2018-03-17 23:17:28 +02:00
Martin Storsjö 010854bb20 Update to the latest version of mingw-w64
This fixes a few issues with math functions on i686.
2018-03-14 18:00:41 +02:00
Martin Storsjö f175276aa7 Use native TLS on aarch64 2018-03-14 14:17:48 +02:00
Martin Storsjö 363be40cca Update to the latest versions of llvm/clang/lld
This adds support for native TLS on aarch64, and fixes an issue
with stack probing on x86_64 when using dwarf exceptions.
2018-03-14 14:17:41 +02:00
Martin Storsjö 681071d08b Update to the latest version of llvm/clang/lld
This fixes issues with -mms-bitfields together with "long double"
on i686, and allows using the -static flag while building DLLs
(to link dependent libraries statically), and implements stack
probing for alloca calls on aarch64.
2018-02-27 21:59:04 +02:00
Martin Storsjö 5348f86a3f Provide dlltool via a shell script wrapper that sets the default architecture 2018-02-27 13:42:34 +02:00