mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Joe Perches' <joe@perches.com>,
	Matthew Maurer <mmaurer@google.com>,
	Miguel Ojeda <ojeda@kernel.org>,
	Alex Gaynor <alex.gaynor@gmail.com>,
	"Wedson Almeida Filho" <wedsonaf@gmail.com>
Cc: "Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Andreas Hindborg" <a.hindborg@samsung.com>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"rust-for-linux@vger.kernel.org" <rust-for-linux@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] rust: Use awk instead of recent xargs
Date: Fri, 29 Sep 2023 21:36:06 +0000	[thread overview]
Message-ID: <be10d55a785d4d9b983b2dae6ed65942@AcuMS.aculab.com> (raw)
In-Reply-To: <106c8bdb960da1568d0b3879efa76cd2acec032e.camel@perches.com>

From: Joe Perches
> Sent: 28 September 2023 21:33
> 
> On Thu, 2023-09-28 at 20:21 +0000, Matthew Maurer wrote:
> > `awk` is already required by the kernel build, and the `xargs` feature
> > used in current Rust detection is not present in all `xargs` (notably,
> > toybox based xargs, used in the Android kernel build).
> []
> > diff --git a/rust/Makefile b/rust/Makefile
> []
> > @@ -365,8 +365,7 @@ quiet_cmd_exports = EXPORTS $@
> >        cmd_exports = \
> >  	$(NM) -p --defined-only $< \
> >  		| grep -E ' (T|R|D) ' | cut -d ' ' -f 3 \
> > -		| xargs -Isymbol \
> > -		echo 'EXPORT_SYMBOL_RUST_GPL(symbol);' > $@
> > +		| awk 'NF {printf "EXPORT_SYMBOL_RUST_GPL(%s);\n",$$0}' > $@
> 
> Perhaps remove the cut as well and use $$3 instead of $$0 ?
> Maybe integrate the grep as well.

Or keep the grep and use a shell loop?
	grep -E ' (T|R|D) ' | while read val flag symbol; do \
		echo "EXPORT_SYMBOL_RUST_GPL($symbol);"; done

(The grep is typically much faster than a shell conditional.)

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


  reply	other threads:[~2023-09-29 21:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28 20:21 Matthew Maurer
2023-09-28 20:32 ` Joe Perches
2023-09-29 21:36   ` David Laight [this message]
2023-09-29 23:29     ` Joe Perches

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=be10d55a785d4d9b983b2dae6ed65942@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=a.hindborg@samsung.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=gary@garyguo.net \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmaurer@google.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=wedsonaf@gmail.com \
    /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

all inboxes | Powered by JetHome®