In some cases bazel-native build calls ar with
@<file> - read options from <file>
syntax, where the ar params are generated in *.param file by
separate bazel action before ar is called.
Unfortunately this intercept breaks that syntax by prepending D like:
$ ./ar-intercept @foo
argv before: ['./ar-intercept', '@foo']
argv after: ['./ar-intercept', 'D@foo']
./ar-intercept: invalid option -- '@'
Usage: ./ar-intercept [emulation options] [-]{dmpqrstx}[abcDfilMNoOPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...
./ar-intercept -M [<mri-script]
...
or might trigger 'non-deterministic mode requested' error on false positive:
$ ./ar-intercept @Ufo
argv before: ['./ar-intercept', '@Ufo']
ar: non-deterministic mode requested
argv after: ['./ar-intercept', '@Ufo']
./ar-intercept: invalid option -- '@'
Usage: ./ar-intercept [emulation options] [-]{dmpqrstx}[abcDfilMNoOPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...
./ar-intercept -M [<mri-script]
Don't try to inject D into first line of @<file>, lets assume the caller
uses D already (bazel uses 'rcsD' by default).
* Ar flags for combining object files into archives. If this is not set, it
* defaults to "rcsD".
* TODO(b/
37271982): Remove after blaze with ar action_config release
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>