Commit Graph
100 Commits
Author SHA1 Message Date
Martin Storsjö 8bfc9a18c6 Error out early if trying to compile ada
If we try to do that, clang would end up calling <triplet>-gcc with the
same arguments. In our setup, this recursively ends up calling clang again,
ending up with infinite recursion.
2018-10-10 23:33:19 +03:00
Martin Storsjö 7bca89b53f Adjust clang-target-wrapper.c to closer match the new windres wrapper 2018-10-10 23:33:19 +03:00
Martin Storsjö b611bc1904 Convert the windres wrapper from shell script to C
This allow running windres on windows without a surrounding posix shell.
2018-10-10 23:33:19 +03:00
Martin Storsjö b5deb9fc1f Set a default target in wrapper scripts and executables 2018-10-10 23:33:19 +03:00
Martin Storsjö 1bc3d75a41 For cross-built toolchains, rename the clang executable to clang-$MAJOR.exe 2018-10-10 23:33:19 +03:00
Martin Storsjö fb26be33a1 Correct the escaping of arguments passed through on windows 2018-10-10 23:33:18 +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ö 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ö 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ö 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ö 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ö 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ö a7c2d85bf7 Update the comment about --enable-auto-import in the ld wrapper 2018-09-05 13:08:37 +03:00
Martin Storsjö d951a625bd Switch to SEH exceptions for x86_64 2018-08-08 08:43:05 +03:00
Martin Storsjö 11e04f0466 Support destructors for thread local objects 2018-08-02 23:28:39 +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ö 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 Herkt 2aef445b89 windres-wrapper.sh: actually implement -U 2018-07-11 16:14:22 +02: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ö 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
Josh de Kock 08224169fd Add windres wrapper for LLVM tools 2018-05-05 00:14:45 +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ö f175276aa7 Use native TLS on aarch64 2018-03-14 14:17:48 +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ö 3e61dc4908 Consistently use 4 spaces for indentation in shell scripts 2018-02-26 12:48:18 +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ö 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ö 9925666790 Rename the wrapper script, for consistency 2018-01-10 10:53:02 +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ö 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ö 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ö 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ö 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ö 2cb6a8d390 Set the flags for exception handling model in the clang wrapper 2017-11-21 11:55:26 +02:00
Martin Storsjö bf656d77e7 Update to a LLVM 5.0-ish version from trunk
Using the 5.0 release branch should work equally well except for
aarch64/win support.
2017-08-22 14:10:08 +03:00
Hugo Beauzée-Luyssen 4808f05671 Add an early arm toolchain
This isn't fully functionnal yet
2016-08-04 16:20:17 +02:00