Commit Graph
100 Commits
Author SHA1 Message Date
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
Martin Storsjö 0f0863b010 Define the list of architectures to build for in a variable
This simplifies reducing the build to fewer architectures
(e.g. to speed up testing).
2017-11-28 22:19:44 +02:00
Martin Storsjö 03f1fd6c65 Use dwarf exceptions on armv7 and aarch64
Dwarf is also the default in clang on i686, but libunwind currently
has an issue relating to unwinding dwarf exceptions on i686 on
windows (and less easily reproducible on other platforms),
see https://reviews.llvm.org/D38680.

This enables exceptions on aarch64, where they previously were
avoided/disabled.

When linking to a statically linked libunwind with support for
dwarf, one (currently) has to link in -lpsapi.
2017-11-28 18:06:46 +02:00
Martin Storsjö a30166a84f Restructure the readme wrt the use of docker 2017-11-28 16:19:03 +02:00
Martin Storsjö 7c91fd6120 Avoid unnecessary absolute references to the root build directory 2017-11-28 16:10:36 +02:00
Martin Storsjö c457ec980f Add a comment about git-svn rebase 2017-11-28 16:09:19 +02:00
Martin Storsjö 8e2d3e2c2b Add an initial readme for github 2017-11-28 15:26:53 +02:00
Martin Storsjö 8c1647099f Add a script for extracting a part of the built docker image 2017-11-28 14:45:39 +02:00
Martin Storsjö b82a138b79 Clean up the dockerfile wrt use outside of videolan 2017-11-28 11:59:42 +02:00
Martin Storsjö 98b6049fc5 Remove an unnecessary makefile 2017-11-28 11:59:30 +02:00
Martin Storsjö 2cb6a8d390 Set the flags for exception handling model in the clang wrapper 2017-11-21 11:55:26 +02:00
Martin Storsjö d4dbd66d2e Remove the -flto-visibility-public-std workaround for implicit dllimport for cxxabi functions 2017-11-20 14:59:01 +02:00
Martin Storsjö 1ee6d578b2 Don't manually mkdir the prefix directory
Doing "make install" will make the directory implicitly anyway.
2017-11-20 14:58:44 +02:00
Martin Storsjö e98f0ac6cc Update llvm/clang/lld/mingw-w64/compiler-rt/libunwind to the latest versions 2017-11-20 14:54:52 +02:00
Martin Storsjö 18904a3cda Make indentation more consistent in the dockerfile 2017-11-04 22:46:14 +02:00
Martin Storsjö 69348a747d Build libcxx with threads
This is required for e.g. C++ atomics.

This requires all code including libcxx headers to be built with
_WIN32_WINNT >= 0x600.
2017-11-04 22:35:46 +02:00
Martin Storsjö c34e06a3b4 Update mingw-w64 to a version allowing setting the default win32 version 2017-11-04 22:35:46 +02:00
Martin Storsjö d8261ac0fb Don't rely on AR/RANLIB env variables during the toolchain build
Instead manually specify the tools to be used in all of these steps.
2017-11-03 16:45:07 +02:00
Martin Storsjö 968e574272 Don't set LD=lld
Using lld directly like that doesn't work, and will mess up building
some projects that use autotools.
2017-11-03 16:43:55 +02:00
Martin Storsjö 6eba8f7259 Update all components to their latest version
This includes fixes for (among other) issues with dllexport of
function names starting with an underscore (including C++ symbols)
in lld.
2017-10-24 12:06:11 +03:00
Martin Storsjö f849f47859 Define LIBCXX_USE_COMPILER_RT while building libcxx
This makes a lot more libcxx cmake configure tests work as intended,
which makes a lot more -W* options added, resulting in much more build
warnings.
2017-10-19 11:23:43 +03:00
Martin Storsjö a53599c175 Stop setting -D_LIB*_DISABLE_VISIBILITY_ANNOTATIONS while building user code
This actually gets set by default by the installed config headers,
depending on how the libraries were configured.

Also, the -Xclang -flto-visibility-public-std workaround doesn't
seem to be necessary while building these test apps (but it might
potentially be necessary if building more complicated apps).
2017-10-19 11:10:43 +03:00
Martin Storsjö fe547b6317 Get rid of trailing whitespace 2017-10-19 10:49:35 +03:00
Martin Storsjö e8a4085954 Stop building libav as test application
This works reliably and only adds build time when testing.
2017-10-19 10:29:35 +03:00
Martin Storsjö 8596d83d1a Set the exceptions option properly for libcxx
Apparently this built fine even with the flag set to on even though
it's intended to be disabled though.
2017-10-18 16:57:17 +03:00
Martin Storsjö f8837d209c Update to the latest llvm/clang/lld
These contain fixes relevant for arm64.
2017-10-12 10:07:06 +03:00
Martin Storsjö 7730f5952e Enable threads when building libunwind
The thread local SjLj context pointers are only flagged properly
as thread local when building with threads enabled.
2017-10-09 22:58:11 +03:00
Martin Storsjö 1c770a278a Update to the latest version of mingw-w64 2017-10-09 13:43:21 +03:00
Martin Storsjö 2260db1904 Build llvm with assertions
This makes sure none of the tested codepaths do anything unexpected;
it's enabled by default in debug builds, but we still want an optimized
build.
2017-10-07 00:12:59 +03:00
Martin Storsjö 1f848ff6d4 Update mingw-w64, compiler-rt, libcxx, libcxxabi and libunwind to the latest versions 2017-10-04 09:34:24 +03:00
Martin Storsjö ed1d1497a7 Build libunwind, enable exceptions in libcxxabi and libcxx
This requires manually enabling sjlj exceptions, since libunwind
doesn't support the other exception handling mechanisms on windows
(yet).

Don't enable exceptions on aarch64 yet, since no exception handling
mechanism is implemented for windows on aarch64 yet.
2017-10-04 09:14:02 +03:00
Martin Storsjö 1767090a94 Update to the latest llvm/clang/lld
This version of llvm has got working SjLj exception handling
on x86, x86_64 and arm.
2017-10-04 08:16:47 +03:00
Martin Storsjö b1a39b7fa4 Drop an old workaround
This probably isn't necessary when we now use the proper llvm-dlltool
instead of genlib.
2017-09-25 16:50:09 +03:00
Martin Storsjö d9347135b6 Update to the latest version of llvm/clang/lld
This includes support for a few more mingw lld features.
2017-09-13 10:31:33 +03:00
Martin Storsjö c571ff004e Update to the latest version of libcxx
This version can do without the two patches we carried locally.
2017-09-13 09:58:00 +03:00
Martin Storsjö 403cbade55 Update to the latest version of llvm/clang/lld
This allows getting rid of the local patches to lld.
2017-09-12 14:20:04 +03:00
Martin Storsjö 1d0c75addf Update to the latest version of mingw-w64
This version supports setjmp on arm and arm64.
2017-09-11 15:50:18 +03:00
Martin Storsjö 82dfb17318 Simplify the cmake configuration for llvm
Most of these parameters were redundant, or doesn't serve any purpose
as far as I can see.
2017-09-08 11:29:24 +03:00
Martin Storsjö 0dba17c5bf Clean up some commented out parts 2017-09-08 11:24:26 +03:00
Martin Storsjö 4ec04722ef Update llvm/clang/lld/mingw-w64/libcxx to newer versions
These versions contain fixes relevant to mingw/clang.

Do the svn rebase (only necessary for getting sensible llvm/clang
version numbers in clang --version) before checking out the specific
version, otherwise we always end up at the latest master version.
2017-09-06 14:22:58 +03:00
Martin Storsjö 2d5bf52883 Add || exit 1 for exiting loops immediately on failures 2017-08-31 13:37:15 +03:00
Martin Storsjö 961868b9f2 Update llvm/clang/lld/libcxx to the latest upstream versions
llvm and clang have got new patches that are relevant for mingw
and arm64/win.

compiler-rt has changed things, so we can't ask it to build builtins
for i686 any longer, but need to request it for i386 instead - and
clang will expect it to be named i386 even though we're invoking it
with an i686 target.
2017-08-31 13:37:15 +03:00
Martin Storsjö 1feb7a262c Remove some unnecessarily set build parameters 2017-08-30 23:08:37 +03:00
Martin Storsjö 7194894b4a Build C++ things for arm64 as well
This requires updating to the latest version of mingw-w64.
2017-08-28 23:02:36 +03:00
Martin Storsjö 3fc98d9d8a Remove a leftover --depth=1
That obviously doesn't work when wanting to check out a specific,
possibly older, revision.
2017-08-28 13:50:52 +03:00
Martin Storsjö f3c9eabe72 Build libcxx and hello-cpp for x86_64 and i686 as well 2017-08-26 23:23:25 +03:00
Martin Storsjö 2a6f7a0715 Remove setting of an unnecessary cmake flag 2017-08-26 23:13:04 +03:00
Martin Storsjö 6417a74596 Factorize code for building mingw-w64-crt and compiler-rt for multiple archs 2017-08-26 23:10:58 +03:00
Martin Storsjö 728046d5ea Add a lld patch that makes more cmake tests with lld pass 2017-08-25 23:59:18 +03:00
Martin Storsjö 9dcdca1563 Update to the latest version of mingw-w64 with the local patches merged 2017-08-25 23:59:18 +03:00
Martin Storsjö ed96326423 Build libcxx and libcxxabi statically for armv7 and test building a C++ hello world 2017-08-25 14:21:45 +03:00
Martin Storsjö 43906e77d6 Stop autoreconfiguring mingw-w64-crt
We don't patch the makefiles at the moment.
2017-08-25 14:16:53 +03:00