Commit Graph
102 Commits
Author SHA1 Message Date
Martin Storsjö e384109cbf wrappers: Force the default dwarf version back to 4
Clang's general default dwarf version was raised from 4 to 5 in
d3b26dea16108c427b19b5480c9edc76edf8f5b4 in llvm-project (Jan 23
2022) before the 14.0.0 branch, but dwarf 5 on Windows seems to not
work with either LLDB or GDB.

Thus force the default back to 4 here as a temporary workaround, and try
to set the default back to 4 for mingw targets in Clang for later
releases (https://reviews.llvm.org/D119326).
2022-02-09 15:39:43 +02:00
Martin Storsjö 977df0d83e wrappers: Fix an incorrect check for the max number of arguments in clang-target-wrapper.c 2022-02-09 15:39:43 +02:00
Martin Storsjö 14db168cd6 wrappers: Use --{start,end}-no-unused-arguments instead of -Qunused-arguments
This makes warnings for other unused arguments visible to the user.

This requires a version of llvm-project past
50ec1306d060e46e0d53c9f5d8a052e1b0d10d3b (Jan 2022) which added these
new options.
2022-02-09 14:02:20 +02:00
Martin Storsjö 56d0ef7900 wrappers: Remove hacks for filtering the stdout from clang
Since df0ba47c36f6bd0865e3286853b76d37e037c2d7 in llvm-project
(November 5th 2021), clang built with mingw defaults to producing
paths with forward slashes - thus, this hack no longer is needed.
2022-02-09 14:02:20 +02:00
Martin Storsjö e35ef3b7d7 Use -unwindlib=libunwind instead of merging libunwind into libc++
This makes the build of libcxx a bit cleaner, and simplifies later
building and testing of libcxx.
2021-10-01 12:31:51 +03:00
Martin Storsjö 42d2eb7346 wrappers: Remove the dlltool wrapper
Since LLVM 13, llvm-dlltool can imply the target architecture from
a triple prefix on the tool name, so there's no more need for a
wrapper.

The *-dlltool tools are now symlinks to the main llvm-dlltool
executable. In the Windows distribution, the *-dlltool.exe used to be
copies of dlltool-wrapper.exe (which is small; 15 KB). Now they
will instead be copies of llvm-dlltool.exe. Luckily, thanks to
building with -DLLVM_LINK_LLVM_DYLIB=ON by default, llvm-dlltool.exe
is only a mere 65 KB, while it used to be much larger, e.g. around
11 MB in older releases.
2021-09-17 11:09:35 +03:00
Martin Storsjö 8915db817c wrappers: Remove windres-wrapper; llvm-windres is available since LLVM 13.0.0 2021-08-09 12:08:16 +03:00
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