From: martin.jansa@gmail.com
To: openembedded-core@lists.openembedded.org
Cc: hongxu.jia@windriver.com, Martin Jansa <martin.jansa@gmail.com>
Subject: [PATCH] native/cross: ar wrapper: don't prepend 'D' when @<file> is used
Date: Thu, 2 Apr 2026 02:14:58 +0200 [thread overview]
Message-ID: <20260402001458.1717490-1-martin.jansa@gmail.com> (raw)
From: Martin Jansa <martin.jansa@gmail.com>
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>
---
scripts/native-intercept/ar | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/scripts/native-intercept/ar b/scripts/native-intercept/ar
index dcc623e3ed..fd266c19d4 100755
--- a/scripts/native-intercept/ar
+++ b/scripts/native-intercept/ar
@@ -19,6 +19,11 @@ argv = sys.argv
if argv[1].startswith('--'):
# No modifier given
None
+elif argv[1][0] == '@':
+ # Reading parameters from @file, we can try to inject D on the first line as well
+ # but modifying input files seems a bit too far for this intercept, bazel-native
+ # uses it but with rcsD by default
+ None
else:
# remove the optional '-'
if argv[1][0] == '-':
next reply other threads:[~2026-04-02 0:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-02 0:14 martin.jansa [this message]
2026-04-02 0:30 ` Patchtest results for [PATCH] native/cross: ar wrapper: don't prepend 'D' when @<file> is used patchtest
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260402001458.1717490-1-martin.jansa@gmail.com \
--to=martin.jansa@gmail.com \
--cc=hongxu.jia@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox