Commit Graph
100 Commits
Author SHA1 Message Date
Martin Storsjö a914746ab2 Remove the mention of other similar projects
The mentioned differences aren't quite as pronounced any longer.
2018-10-09 11:35:16 +03:00
Martin Storsjö 945845fba2 Make a helper function static in clang-target-wrapper.c 2018-10-08 14:15:25 +03:00
Martin Storsjö 818766d3d4 Use posix shell variable expansion substitution instead of subshells with sed 2018-10-08 14:13:42 +03:00
Martin Storsjö 0ec597b1bb Remove inconsistently used braces
Using braces here is fine in itself, but we write most similar cases
without braces, so change it for consistency.
2018-10-08 14:12:55 +03:00
Martin Storsjö 89c91ecaae windres: Print help and version texts to stdout
meson checks the output from --version, and expects to see it on stdout.
2018-10-08 14:12:55 +03:00
Martin Storsjö b1b6c0ba6f windres: Minor cleanups
Make indentation consistent, define a variable used in printing errors,
remove an unused helper function.
2018-10-08 14:12:54 +03:00
Martin Storsjö 03b99b5144 Do one in-bounds write in clean runs of stacksmash.c 2018-10-07 21:00:30 +03:00
Martin Storsjö 461f889187 Update llvm/clang/lld to the latest version
This avoids warnings about both main and wmain being present when linking,
warnings that appeared in the previous update.
2018-10-06 07:44:33 +03:00
Martin Storsjö 99b6407196 Quote arguments in clang-target-wrapper.c
We quote each passed through argument, and escape quote chars in them.

For cases when the passed through argument ends with a backslash, this
fails though, since whatever is unescaping it doesn't seem to handle
double backslashes for escaping backslashes themselves.
2018-10-05 12:46:11 +03:00
Martin Storsjö 22b5681765 Add $EXEEXT as suffix for the ar/ranlib/nm/strings symlinks 2018-10-05 12:46:10 +03:00
Martin Storsjö 10210478ee Update llvm/clang/lld to the latest version
This fixes cases where llvm built without assertions can hang when
assembling a file that references _GLOBAL_OFFSET_TABLE_ for windows
(which is unsupported; previously this used llvm_unreachable making
it undefined what happens if that really is hit).
2018-10-05 09:07:41 +03:00
Martin Storsjö a62ee10c2d Build clang-target-wrapper.c with -municode for windows 2018-10-03 23:06:22 +03:00
Martin Storsjö ad47efba70 Implement clang-target-wrapper as an executable for windows
This allows non-msys build systems to use the triplet prefixed
compiler frontends on windows.

Keep the old shell script version as well, for easier hackability
on unix platforms.
2018-10-03 22:48:36 +03:00
Martin Storsjö 9f3a4a25f2 Support wrappers named <triplet>-c++ in clang-target-wrapper.sh as well
We currently don't install any such wrapper, but one might want to.
2018-10-02 23:38:19 +03:00
Martin Storsjö fb5c95589c Restructure clang-target-wrapper.sh to set one flag per line 2018-10-02 23:38:19 +03:00
Martin Storsjö 7f98eea889 Mention prebuilt docker images from Docker Hub 2018-10-02 21:34:54 +03:00
Martin Storsjö 9db7f21bcb Make windres --version output the string "GNU windres"
meson might start looking for this string soon, for identifying
the kind of resource compiler.
2018-10-02 21:34:54 +03:00
Martin Storsjö 773c0299c5 Add scripts for crosscompiling the toolchain using an already built native toolchain 2018-10-02 21:34:54 +03:00
Martin Storsjö 8f15532652 Clean up more for windows builds in strip-llvm.sh
On windows, symlinks might be changed into regular copies, so we keep
as few extra symlinks as possible.
2018-10-02 21:34:54 +03:00
Martin Storsjö 47392c5a90 Don't expect that all files exist in strip-llvm.sh
If run multiple times, this removal would try to remove a file named
clang-*, which doesn't exist.
2018-10-02 21:34:54 +03:00
Martin Storsjö 391c93d0d4 Allow strip-llvm.sh to run on files with a potential $EXEEXT suffix 2018-10-02 21:34:54 +03:00
Martin Storsjö 49103cf127 Strip the built widl by passing -Wl,-s to the linker, instead of INSTALL="install -s"
When stripping via "install -s", install invokes the system's
strip tool, which might not support the cross target that we are
building for. This could also be handled by passing
--strip-program=<arch>-w64-mingw32-strip to install though.
2018-10-02 21:34:54 +03:00
Martin Storsjö fb4862b0d6 Split out building widl to a separate shell script
When cross compiling a llvm-mingw toolchain, we need to build widl
for the intended host environment as well.
2018-10-02 21:34:54 +03:00
Martin Storsjö 0c24f99adb Allow setting CC or HOST for install-wrappers.sh
Also allow setting EXEEXT for the executable suffix.
2018-10-02 21:34:54 +03:00
Martin Storsjö bf2ede1537 Add support for crosscompiling llvm 2018-10-02 21:34:54 +03:00
Martin Storsjö 81864b3883 Disable asserts in llvm by default
This gives a 25% speedup. As long as the llvm version has been
reasonably tested, this should hopefully be safe.
2018-10-02 21:34:54 +03:00
Martin Storsjö 784c15f9b9 Allow passing --enable-shared/static to build-libcxx.sh
These are the default already, but by allowing them as options, it becomes
easier to potentially change the default behaviour.
2018-10-02 21:34:54 +03:00
Martin Storsjö d379cc8b21 Allow passing --enable-asserts to build-llvm.sh
This is the default already, but by allowing this as an option, it becomes
easier to potentially change the default behaviour.
2018-10-02 21:34:54 +03:00
Martin Storsjö 6bb0cfca58 Convert TOOLCHAIN_ARCHS from ENV to ARG
This allows overriding it with --build-arg.
2018-10-02 21:34:54 +03:00
Martin Storsjö 0a181a36a3 Use -n instead of != "" in build-llvm.sh 2018-10-02 21:34:54 +03:00
Martin Storsjö a7616d6d23 Add helpful printouts in stacksmash.c 2018-10-02 21:34:54 +03:00
Martin Storsjö a38e52fff5 Build address sanitizer 2018-10-02 14:53:53 +03:00
Martin Storsjö 6d7cef9e9e test: Rename ssp.c to stacksmash.c 2018-10-02 14:53:53 +03:00
Martin Storsjö cea63c570a Update llvm/clang/lld to the latest version
This version allows clang to use address sanitizer for mingw,
adds support for linking against import libraries from GNU tools
and makes the linker provide the __CTOR_LIST__ symbol for better
compatibility with binutils based sysroots, and adds support for
thunks for armv7 (allowing linking armv7 binaries over 16 MB).
2018-10-02 14:53:53 +03:00
Martin Storsjö e26ab372bf Update compiler-rt to the latest version
This version supports building address sanitizer for mingw.
2018-10-02 14:53:53 +03:00
Martin Storsjö 4d110b4508 Update mingw-w64 to the latest version
This fixes a few headers as necessary for building asan, and
fixes cross compiling widl.
2018-10-02 14:53:53 +03:00
Martin Storsjö 47fca28422 Tweak the wording for the comment about exception issues with dwarf for i686 2018-10-01 14:44:32 +03:00
Martin Storsjö f0aa7c4c10 Revert "Use dwarf exceptions on i686 as well"
This reverts commit ca43ab5ccd.

It was reported in https://github.com/mstorsjo/llvm-mingw/issues/8 that
the dwarf unwinding on i686 doesn't always work.

This commit adds a testcase for the case that didn't work previously.
2018-10-01 14:28:30 +03:00
Martin Storsjö bc8c9c3a8d windres: Add support for the --preprocessor-arg options 2018-09-29 23:05:25 +03:00
Martin Storsjö f89a85c973 windres: Fix handling of the -c/--codepage options 2018-09-29 23:03:16 +03:00
Martin Storsjö ab1da59a48 Use a single COPY command in dockerfiles for both *.sh and *.c for wrappers 2018-09-14 09:38:44 +02:00
Martin Storsjö 5a70c3cb78 Extend the dll autoimport test to test references to a external variable with offset 2018-09-07 00:02:16 +03:00
Martin Storsjö c8ca4bddd6 Add known issues about the fact that the toolchain by default targets Vista or newer 2018-09-05 13:39:28 +03:00
Martin Storsjö 5386ff8e3d Reindent build-mingw-w64-libraries.sh
This was left inconsistent after 3c1c81f321.
2018-09-05 13:11:26 +03:00
Martin Storsjö a7c2d85bf7 Update the comment about --enable-auto-import in the ld wrapper 2018-09-05 13:08:37 +03:00
Martin Storsjö 28dc4e3589 Remove known issues about a shared libc++ and automatic data imports 2018-09-05 12:28:33 +03:00
Martin Storsjö 523892f626 Adjust run-tests.sh to pick up shared versions of libc++/libunwind/libssp 2018-09-05 12:28:33 +03:00
Martin Storsjö d3ec443f92 Build libssp as a DLL as well
This matches how it is normally available in GCC.
2018-09-05 12:28:33 +03:00
Martin Storsjö aa80a9ecbc Copy the built DLLs into the test output directories 2018-09-05 12:28:33 +03:00
Martin Storsjö 957c34372c Build libunwind and libcxx both as static and dynamic libraries 2018-09-05 12:28:33 +03:00
Martin Storsjö bc0cde364d Skip new/delete definitions in libcxxabi
These are also provided by libcxx, and can conflict if trying to
link a shared library containing both libcxxabi and libcxx.
2018-09-05 12:28:33 +03:00
Martin Storsjö 72c4128a68 Update libcxxabi and libcxx to the latest version
These versions add missing function visibility to __gxx_personality_seh0
for libcxxabi, and fixes including a static libcxxabi in a shared libcxx.
2018-09-05 12:28:33 +03:00
Martin Storsjö 37f8ba8516 Add tests for the autoimport feature 2018-09-05 12:21:46 +03:00
Martin Storsjö 5f12b33177 Update llvm/clang/lld to the latest version from today
This adds support for automatically importing variables from dlls
without using the dllimport attribute.
2018-09-05 11:55:12 +03:00
Martin Storsjö c0246e97db readme: Escape an asterisk 2018-09-05 11:55:12 +03:00
Martin Storsjö 470008f09c Factorize the building of test DLLs in the dockerfile 2018-09-05 11:53:46 +03:00
Martin Storsjö 09567cdc96 Build tlstest-lib.dll in the arch specific output subdirectory as well
This was missed in 0448bd61.
2018-09-05 11:52:57 +03:00
Martin Storsjö 5e295f5c62 Allow building llvm with asserts disabled
Doing that speeds up the built clang by around 25% (which is rather
significant) and reduces the size of the clang executable by almost 30%.

But since the mingw target in clang/llvm is less mature and less widely
tested than other llvm targets, running with assertions allows catching
quite a few issues during build instead of ending up with potentially
broken code.
2018-09-03 09:25:08 +03:00
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