Commit Graph
75 Commits
Author SHA1 Message Date
Martin Storsjö 64d39428b6 Quote uses of $PREFIX in the build script, to improve support for installing into a path that contains spaces
For build-mingw-w64.sh to succeed when installing to such a path,
the mingw-w64 version has to be updated to the latest git master.

build-mingw-w64-libraries.sh still fails in this case, as libtool
fails to properly quote $LD in a test for whether the linker is GNU ld.
2019-12-03 21:49:53 +02:00
Martin Storsjö ce7d3ec874 windres-wrapper: Short options joined with the option value doesn't use an equals character
This makes options like "-iinput.rc -ooutput.o" work properly.
2019-11-21 08:10:52 +02:00
Martin Storsjö 9f8e5cebd6 windres-wrapper: Implement the -F/--target flag like GNU windres
The values passed to this parameter aren't arch/vendor/os triples, but
bfd target names.
2019-10-08 09:24:50 +03:00
Martin Storsjö 7edc154d50 wrappers: Unify comments about exception handling methods. 2019-05-28 15:29:08 +03:00
Martin Storsjö 4811c1f489 wrappers: Stop explicitly requesting SEH for AArch64
It is the default exception handling model there now.
2019-05-28 15:27:56 +03:00
Martin Storsjö 5623fd232c wrappers: Remove the ld wrapping of --help and -v
The MinGW driver in lld now handle these flags, including the
libtool specific keywords.
2019-05-28 00:04:39 +03:00
Steve Lhomme 4f5134fb25 wrappers: fix PATH not working when there are spaces in them 2019-05-17 12:36:00 +03:00
Michael Hept a959509701 Fix out of bound array access in native-wrappers.h 2019-05-09 14:58:38 +03:00
Martin Storsjö c3aeb78576 wrappers: Add a wrapper for running llvm binutils replacements
This saves a lot of diskspace, when symlinks are turned into full
copies of the tools on windows, as the symlinks only point to a small
wrapper instead of to the full tool.
2019-05-06 11:05:25 +03:00
Martin Storsjö 750ab50433 wrappers: Consistently quote all arguments when calling spawn or creating a command line 2019-05-06 11:04:53 +03:00
Martin Storsjö fa88c4ee1e wrappers: Escape the first argument to spawn
This fixes running in paths that contain a space.
2019-05-06 11:04:53 +03:00
Martin Storsjö 97ca0681bc wrappers: Split out shared helpers for native wrapper executables to a header 2019-05-06 11:04:53 +03:00
Martin Storsjö 66055dfe63 wrappers: Take the argv null terminator into account when checking for overflows
When adding the terminator without incrementing arg and checking for
overflows with "arg > max_arg", we need to allocate space for one
extra element for the implicit terminator.
2019-05-06 11:04:27 +03:00
Martin Storsjö 013dfc08e4 windres-wrapper: Check that the number of args isn't exceeded 2019-05-06 11:04:27 +03:00
Martin Storsjö f9ce17774e Switch i686 exception handling back to dwarf
The code generation bug in llvm has been fixed now.
2019-05-04 07:55:04 +03:00
Martin Storsjö 3deb039b62 Use SEH exceptions on aarch64
The SEH support for aarch64 should be pretty stable now.
2019-04-19 00:07:17 +03:00
Martin Storsjö 0e7e0fe397 clang-target-wrapper: Properly separate arguments for UWP in the C wrapper 2019-04-18 14:31:14 +03:00
Steve Lhomme cd73ed8308 wrappers: link with the Windows Store specific runtime for UWP 2019-04-18 12:35:25 +03:00
Steve Lhomme a270bc3cad wrappers: force linking with mincore for UWP targets
it's not needed for regular win32 so shouldn't be either for these targets
2019-04-18 12:23:38 +03:00
Steve Lhomme ca44a11660 Add wrappers that target Universal Windows 2019-04-18 11:28:05 +03:00
Martin Storsjö 4b537369ca Add more proper references to dwarf issues on i686 2019-03-01 10:28:00 +02:00
Martin Storsjö 62b208aee2 Use llvm-objcopy/llvm-strip instead of a shell script wrapper and binutils 2019-01-24 10:58:20 +02:00
Martin Storsjö ae2a98efba windres: Ignore the --use-temp-file option
This option seems to be used occasionally by projects to work around
various issues with popen in GNU windres.

Our windres wrapper always uses a temp file for the preprocessing
output, so for us the option is a no-op.
2018-11-13 00:35:53 +02:00
Martin Storsjö 8002486c84 clang-target-wrapper: Filter the output from "clang -v" on windows
Convert paths with backslashes to forward slashes.

libtool tries to parse this output in order to find object files and
libraries that always should be linked in, but libtool can't handle
paths with backslashes (and quotes) which clang currently outputs.

This is a quick and ugly workaround until clang can be made to
output paths with forward slashes on windows, see
https://reviews.llvm.org/D53066 for progress on that matter.
2018-11-02 12:31:41 +02:00
Martin Storsjö 643d9c1645 windres: Fix handling of -D/-U options with a space between the option and the name of the define 2018-10-19 09:23:30 +03:00
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