Commit Graph
95 Commits
Author SHA1 Message Date
Martin Storsjö ea46c8d98f build-openmp.sh: Use llvm-ml instead of uasm 2021-08-09 12:08:16 +03:00
Martin Storsjö 459e37f03f wrappers: Convert dlltool-wrapper to a native executable
This allows running it on windows from processes other than msys
based ones.
2021-06-14 11:44:06 +03:00
Martin Storsjö b34e1cd82b windres-wrapper: Don't leave the .preproc.rc behind if producing .res 2021-04-09 13:42:29 +03:00
Martin Storsjö c3529a6b9b windres-wrapper: Implement support for the --preprocessor option 2021-03-10 10:22:06 +02:00
Martin Storsjö d5cda17953 wrappers: Return 0 when printing help in the windres wrapper 2020-11-21 21:34:50 +02:00
Russell Haley 5497454d16 Update windres-wrapper --version to return 0
modified:   wrappers/windres-wrapper.c - print_version now passes 0 to
exit function.
2020-11-21 21:33:14 +02:00
Martin Storsjö 9031eb6791 Build the OpenMP runtime in docker based builds
LLVM's OpenMP implementation only supports Windows on x86, and it
requires a MASM-compatible assembler to build it. Build UASM
for this purpose, for now. (UASM isn't available packaged in
debian/ubuntu repos.) In the future, llvm-ml should be able
to handle it instead, but it's not currently mature enough.

Not including it in the regular build-all.sh for now, as UASM
isn't generally available.
2020-10-15 23:23:05 +03:00
Martin Storsjö 41f4f3fac6 wrappers: Filter backslashes into forward slashes for --print-search-dirs similarly to -v 2020-08-20 13:29:44 +03:00
Martin Storsjö ab4220fd2a wrappers: Remove a misplaced, unnecessary pair of braces 2020-08-20 12:56:39 +03:00
Martin Storsjö d7e5858a60 wrappers: Fix the output filtering for clang -v
This makes the code actually do what was intended, for cases with
multiple consecutive backslashes, each escaped to double backslashes.
2020-08-20 12:51:40 +03:00
Martin Storsjö 30f252f157 windres-wrapper: Add support for the language option
llvm-rc got support for this option on Jun 23rd [1], so the currently
pinned version of llvm-project doesn't support it - but earlier
versions just silently ignore the option, so it should be safe
to include in the wrapper now already.

[1] https://github.com/llvm/llvm-project/commit/f36f8b41beb9cc0353d5624934406d39b78753e0
2020-06-23 13:29:53 +03:00
Martin Storsjö 68b9eb60fa wrappers: Use -lucrtapp instead of -lvcruntime140_app
Passing -lucrt* to the clang driver inhibits the implicit default
-lmsvcrt, so this ends up only using libucrtapp.a instead of libucrt.a.

This still requires that the default crt was ucrt, as the prebuilt
libc++.a needs to have been built for the right crt.
2020-06-16 11:32:17 +03:00
Steve Lhomme 26e56ed5f6 Update the mingw32uwp wrapper libraries
- windowsapp is the preferred library when targeting Windows 10
https://docs.microsoft.com/en-us/uwp/win32-and-com/win32-apis

- _UCRT ensures we use the Universal C runtime
2020-06-04 00:19:33 +03:00
Martin Storsjö 8507ee6023 windres-wrapper: Do the format name comparisons case insensitively 2020-03-14 12:58:18 +02:00
Martin Storsjö 96b149eb72 native-wrapper: Make static functions inline, to avoid warnings if unused 2020-03-14 12:58:18 +02:00
Martin Storsjö c1882530c3 Add copyright and license headers to all shell script files, for clarity 2020-03-05 11:31:31 +02:00
Martin Storsjö b1e19e7ebb wrappers: Relicense windres-wrapper.c from Unlicense to ISC
This is done with permission from Josh de Kock, see
https://github.com/mstorsjo/llvm-mingw/pull/4 for discussion.
2020-03-05 11:31:31 +02:00
Anton Mitrofanov 130bbed695 windres-wrapper: Fix --target=pe-i386 2020-02-09 23:43:40 +02:00
Martin Storsjö ee894b6f63 windres: Accept the abbreviated form --include in addition to --include-dir
As GNU binutils windres uses getopt for option parsing, it accepts
any unique abbreviation of the long options. For now just look
for this particular abbreviation instead of any potential one,
as there's at least one existing use in the wild of --include:

https://github.com/tcltk/tcl/blob/fe69f643609d633facf249c9c963ce121153a8ff/win/tcl.m4#L640
2020-01-05 22:09:31 +02:00
Martin Storsjö bc6df720ce wrappers: Stop specifying -fuse-cxa-atexit
Since clang 9.0.0 (34ec6929a1fb33716d0035dc0f1f164d7568b4dc
in llvm-project), it's no longer necessary to set this to be able
to use __cxa_thread_atexit (for TLS destructors). This brings the
behaviour closer to GCC, and reduces the amount of non-default
options used.
2019-12-20 23:18:41 +02:00
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