diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-04-21 17:21:57 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-04-21 17:21:57 +0530 |
commit | 61ed2702bf83210d08b4eec9870d081fdedea0fe (patch) | |
tree | 7bbc9096dcac4751cd178e7a1cdb42d793cfebc1 | |
parent | bf2af8b7f1e411cf9be5b7a0c1e432debf70e071 (diff) | |
download | meson-61ed2702bf83210d08b4eec9870d081fdedea0fe.zip meson-61ed2702bf83210d08b4eec9870d081fdedea0fe.tar.gz meson-61ed2702bf83210d08b4eec9870d081fdedea0fe.tar.bz2 |
ninja: Don't use @file.rsp with ArLinker on Windows
We can't use @file.rsp on Windows with ArLinker because llvm-ar and
gcc-ar blindly pass the --plugin argument to `ar` and you cannot pass
options as arguments while using the @file.rsp syntax.
[5/7] cc @mylib@sta/libfile4.c.obj.rsp
[6/7] gcc-ar @libmylib.a.rsp
FAILED: libmylib.a
gcc-ar @libmylib.a.rsp
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ar.exe: invalid option -- @
https://github.com/mesonbuild/meson/pull/1649
https://ci.appveyor.com/project/jpakkane/meson/build/1.0.2330/job/w3hj9jfdasefsqi9
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 3bf840d..db136c7 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1304,7 +1304,11 @@ int dummy; if static_linker is None: return rule = 'rule STATIC%s_LINKER\n' % crstr - if mesonlib.is_windows(): + # We don't use @file.rsp on Windows with ArLinker because llvm-ar and + # gcc-ar blindly pass the --plugin argument to `ar` and you cannot pass + # options as arguments while using the @file.rsp syntax. + # See: https://github.com/mesonbuild/meson/issues/1646 + if mesonlib.is_windows() and not isinstance(static_linker, compilers.ArLinker): command_template = ''' command = {executable} @$out.rsp rspfile = $out.rsp rspfile_content = $LINK_ARGS {output_args} $in |