Commit Graph
100 Commits
Author SHA1 Message Date
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
Martin Storsjö 71e3239442 Allow setting CCACHE=1 to wrap all llvm-mingw building in ccache 2018-02-26 12:50:11 +02:00
Martin Storsjö 1c31677a64 Use 4 spaces for indentation in test applications 2018-02-26 12:49:15 +02:00
Martin Storsjö 3e61dc4908 Consistently use 4 spaces for indentation in shell scripts 2018-02-26 12:48:18 +02:00
Martin Storsjö 9167841f5c Update to the latest version of mingw-w64
This avoids some warnings about gnu printf format attributes.
2018-02-21 13:53:09 +02:00
Martin Storsjö 48af4af2c3 Update to the latest version of libunwind
This fixes issues with building libunwind as a DLL with SJLJ
exception handling. (We currently don't build it as a DLL though.)
2018-02-02 09:44:29 +02:00
Martin Storsjö 35e104301f Update to the latest version of llvm/clang/lld
This fixes issues with dllimport of variables in -O0 for aarch64
and fixes an issue with RTTI in C++ for classes exported from DLLs.
2018-02-02 09:42:54 +02:00
Martin Storsjö 5d202dfe4f Update to the latest version of libcxx
This version avoids polluting the namespace of users of the <thread>
header with windows.h.
2018-01-24 12:25:49 +02:00
Martin Storsjö 9c3636a676 Check out the right versions of libunwind/libcxxabi/libcxx before building at all
This makes sure that libunwind and libcxxabi actually get built
against the same headers that are checked out later.
2018-01-24 12:25:21 +02:00
Martin Storsjö 4e201bd42f Update to the latest version of llvm/clang/lld
This version fixes a bug with -O3 optimization for arm.
2018-01-24 10:08:30 +02:00
Martin Storsjö 53be941850 Mention a few more known issues 2018-01-23 11:22:48 +02:00
Martin Storsjö 17ce2b2a05 Update compiler-rt to the latest version
This version fixes the __clear_cache function on aarch64 windows.
2018-01-19 09:36:41 +02:00
Martin Storsjö 592495bb7b Build compiler-rt with optimization enabled 2018-01-18 10:00:05 +02:00
Martin Storsjö 098f6750d7 Automatically extract the clang version number when installing compiler-rt 2018-01-18 10:00:01 +02:00
Martin Storsjö 2e994e681c Add a script for building the test applications and running them 2018-01-15 10:57:02 +02:00
Martin Storsjö fa5b73dc01 Speed up hello-tls.c by running fewer iterations and threads
Also improve a printout.
2018-01-15 10:56:25 +02:00
Martin Storsjö 41370320a6 Use "install -C" in mingw-w64-headers
This avoids touching the target file if the new file to install
matches the previous one. This avoids rebuilding other files later
needlessly, when upgrading an installation.
2018-01-15 10:31:50 +02:00
Martin Storsjö 8c15cb4544 Allow syncing the source to the pinned version by setting SYNC=1 when running the build scripts
This should allow updating an existing build to the desired, pinned
version.
2018-01-15 10:31:50 +02:00
Martin Storsjö 266c2fae6d Pass variables to mingw-w64's configure as parameters instead of inherited via the environment
This makes sure they are remembered if automatically reconfiguring
e.g. due to updated autotools source files.
2018-01-10 14:22:09 +02:00
Martin Storsjö 583baaa612 Make windres output in res format instead of in coff
This makes the output architecture independent, allowing
the x86_64 GNU binutils binary to be used for other
architectures as well, including arm/arm64 which aren't supported
by binutils.
2018-01-10 10:53:02 +02:00
Martin Storsjö 41985ce12e Cheat and pull windres from the normal binutils packages
LLVM does have llvm-rc, which almost does what is needed.
Currently missing features:
- It doesn't run the C preprocessor (which can be wrapped with
  a shellscript easily if necessary)
- It chokes on C structs/typedefs normally found in included
  C headers
2018-01-10 10:53:02 +02:00
Martin Storsjö 55e8aef024 Provide <triplet>-<tool> wrappers and links to many llvm tools
Provide wrappers named <triplet>-gcc and <triplet>-g++ as well,
to ease cross compilation with e.g. autotools, to allow just
specifying --host=<triplet>.

Provide wrappers for objdump and ld that provide specific output
that autotools look for.

Provide <triplet>-strip as a symlink to /bin/true, since there is
no strip tool available yet (and llvm-objcopy doesn't support
COFF yet).
2018-01-10 10:53:02 +02:00
Martin Storsjö f67075c23c Build the C test apps earlier
This gives easier to read error messages if a simple C program
fails to link.
2018-01-10 10:53:02 +02:00
Martin Storsjö 3eec5baf58 Build widl 2018-01-10 10:53:02 +02:00
Martin Storsjö 9fd181b332 Build mingw defaulting to ucrtbase 2018-01-10 10:53:02 +02:00
Martin Storsjö 58ba889792 Build llvm with ninja, if available
This speeds up incremental builds.
2018-01-10 10:53:02 +02:00
Martin Storsjö 7ae7b57d00 Remove an extra newline at EOF 2018-01-10 10:53:02 +02:00
Martin Storsjö 672182424e Move the test apps to a subdirectory 2018-01-10 10:53:02 +02:00
Martin Storsjö 9925666790 Rename the wrapper script, for consistency 2018-01-10 10:53:02 +02:00
Martin Storsjö f79e7158c9 Rename merge_archives.sh for consistency 2018-01-10 10:53:02 +02:00
Martin Storsjö c1f96ba002 Add -nostdinc++ when building libunwind
If the libcxx headers already have been installed, adding
-I$LIBCXX/include to the include path breaks some C standard
headers. The libcxx installation provides e.g. stdlib.h, which
does an #include_next <stdlib.h>. If the include path includes
both $LIBCXX/include and the libcxx headers installed to the
target sysroot, the #include_next will pick up the same header
from the next include directory. And due to include guards,
the second inclusion of the libcxx version of the header does
nothing at all, instead of doing yet another #include_next for
picking up the real version of the header.

By adding -nostdinc++, we avoid the possibly installed version
of these headers.

This fixes rebuilding libunwind after libcxx has been built
and installed.
2018-01-10 10:50:17 +02:00
Martin Storsjö e56a519fdc Split the building of the toolchain into individual shellscripts
This simplifies building the toolchain outside of docker.
2018-01-10 10:24:48 +02:00
Martin Storsjö 04323b03a5 Stop setting some environment variables at the end
One shouldn't rely on these being set.
2018-01-09 21:38:42 +02:00
Martin Storsjö 4fc70f4a23 Add --sysroot to the compiler invocation
This makes sure the right sysroot is used, even if e.g. a global
system installation of x86_64-w64-mingw32-gcc exists under /usr.
2018-01-09 21:38:42 +02:00
Martin Storsjö 3aa5468357 Make spacing consistent 2018-01-09 21:38:42 +02:00
Martin Storsjö 3f5f2422c1 Remove an unnecessary comment 2018-01-09 21:38:42 +02:00
Martin Storsjö e6a0db1009 Force libcxx to use win32 threads even if pthread.h happens to be available 2018-01-09 00:03:18 +02:00
Martin Storsjö a70eb52fe7 Update to the latest version of mingw-w64 and libcxx
This version of mingw-w64 provides a few more import libraries
for aarch64, and allows using a lot more uncommon stdio functions
with ucrtbase.

The new libcxx version allows forcing using win32 threads even
if pthread.h exists.
2018-01-09 00:03:18 +02:00
Martin Storsjö abdc20fb41 Remove some commented out build commands 2018-01-08 23:35:59 +02:00
Martin Storsjö 7837c52041 Remove some unnecessary packages from the base ubuntu setup 2018-01-08 23:09:05 +02:00
Martin Storsjö 2292a091cf Make the number of parallel make jobs configurable 2017-12-20 11:52:45 +02:00
Martin Storsjö 89afcc42f6 Clarify other branches with content of value 2017-12-20 11:43:08 +02:00
Martin Storsjö 0a00556c73 Install idl files along with the headers 2017-12-20 11:23:37 +02:00
Martin Storsjö b08f71e33d Update to the latest version of llvm/lld/compiler-rt
This adds support for stack probing on arm64 and fixes
some issues with data symbols in DLLs on arm.
2017-12-20 11:21:32 +02:00
Martin Storsjö 4a4a9fd0e3 Update to the latest version of mingw-w64
This fixes a number of issues in ucrtbase, and makes the headers
compatible with widl again.
2017-12-19 23:10:57 +02:00
Martin Storsjö a9651f45f3 Do git svn rebase on lld as well
The version number is printed in "ld.lld -v".
2017-12-15 12:27:06 +02:00
Martin Storsjö 68b8f014a0 Skip unnecessary braces for consistency 2017-12-15 12:07:53 +02:00
Martin Storsjö 2a0172efd4 Provide the clang wrapper as a symlink to the script instead of duplicating the script 2017-12-15 12:07:23 +02:00
Martin Storsjö a52d13b639 Update to the latest versions of llvm/mingw/lld
The previous pinned version of llvm miscompiled some files for
ARM, fixed in SVN r319652.
2017-12-09 23:55:35 +02:00
Martin Storsjö 0ce2f55a89 Use native TLS on all architectures except aarch64
Update mingw-w64 to the latest version, where native TLS works
with LLVM/LLD.
2017-12-04 14:31:42 +02:00
Martin Storsjö edcf22bec4 Build a test program for testing TLS support 2017-12-04 13:53:44 +02:00
Martin Storsjö 634ae81950 Pass -femulated-tls to the compiler by default
The MinGW CRT wrapping has a few minor issues that makes native
TLS fail at the moment.

LLVM doesn't support native TLS on windows/aarch64, but emulated
TLS is supported now.
2017-12-04 13:49:32 +02:00
Martin Storsjö 9e070797a3 Update llvm/clang/lld and mingw-w64 to the latest version
This allows using -femulated-tls on arm and aarch64, and adds a few
more import libraries for aarch64.
2017-12-04 11:15:41 +02:00
Martin Storsjö 44ebb5949e Remove superfluous mkdir statements 2017-12-02 23:52:10 +02:00
Martin Storsjö 68ba1b90d8 Update to the latest version of mingw-w64
This version fixes running constructors with a non-default priority,
when built with clang/lld.
2017-11-30 10:04:10 +02:00
Martin Storsjö a3324bfb07 Use dwarf exceptions on x86_64 as well
SEH is the default on x86_64, but libcxxabi lacks support for it.
2017-11-30 09:04:32 +02:00
Martin Storsjö bceb7bc463 Update to the latest versions of llvm/clang/lld
This includes support for a -fdwarf-exceptions flag in clang,
allowing to choose that exception handling model on architectures
where it isn't the default.
2017-11-30 09:01:06 +02:00
Martin Storsjö 26bba774fe Merge libpsapi.a into libunwind.a
This avoids having to manually add -lpsapi when linking in libc++.a.

This requires using a new script to merge libraries using ar -M
with a small MRI script.

The script merge_archives.py in libcxx does the merge by manually
extracting all object files and creating a new archive out of them.
The import libraries created by LLVM have more than one object file
with the same file name (just like MSVC tools do), so extracting
them doesn't work as intended - but merging using a MRI script works.
2017-11-28 22:56:42 +02:00
Martin Storsjö c06aca2432 Build libunwind before libcxxabi
This is the correct layering/ordering.

This requies setting forcing CXX_SUPPORTS_CXX11=TRUE in cmake,
since it tries linking to see whether the C++ environment works,
but we haven't built libcxx yet.

Manually add the libcxx include directory to the include path
(since libunwind does use some C++ headers but doesn't require
linking to C++ libraries).
2017-11-28 22:56:42 +02:00