Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp8186rdb; Fri, 29 Sep 2023 14:38:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHOYFh5W/sSy1p7mORN9QxEDKCgdm7eFk1j6alPT30Vb4p9uxQ9v4PHjeH4X3hVnFFy3q8j X-Received: by 2002:a05:6870:438d:b0:1b0:5bf7:3bb6 with SMTP id r13-20020a056870438d00b001b05bf73bb6mr5952151oah.28.1696023527359; Fri, 29 Sep 2023 14:38:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696023527; cv=none; d=google.com; s=arc-20160816; b=uZ3MQxSbyug+o6usQ1I6U1qu9WFipkAizw6+HyRFpp2H8MLAungQs18DGJA2m3h7BU ELVtZjBZM9jKxLx4ZI0H+xPxkSiRN3uNaUopaWq9OWL7/6XHi66v+pj8CE+WxEpqhGIB 37K41QcrxGUhTfFz7s/O1pXhTSwjdXvOzi5AXa7kv8vV0YSh4qKY6eYRTGpCf4YhS9an V82grwr3NSSikh2II8WMRODAK1LSQakyF3vvMcHuCJeQ8ZkjzyBVIcURfx1mYbJBzcas 5ydunz/vdoX/9quhaikykaaTXy/H430JviCjCi80pkwOO3oxzJMwLU+jRn4ZszBlJxmQ 7sSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=E5MnlcCwxnXA66TgVOo1HVz4P1WJ630r9taYVFrW0lQ=; fh=kGy9Yl6iRcqbZV+rzDPCI5B54Zb+lUu1+66LU4MibUg=; b=amDrYwSs+W3WIqzvqX5OpsPd5FW6K8VOd24jgzjOVQdN7P85kY8yEQI4que9bFrNdK S08ZWmF2xuARCUckW/q9+3k8Ne1+iEU4yP9uRK69mva3GelOSWV8dqMeXsezhcUXFUEP yIdWE9U5MMTMF58izAsgAE0MwpJt9SQNuf2Lp83KiWL2swPSAAKUs3zGsVwIsZKDJWG1 ZGdpX8uKVYVSLGp233qJtKVFEEKBDcP+Ylq6VgPiwkXkzPFgD5lr1g0C5qUrrPtAoNz9 iXU8Tqx/5YhOpSagd5yi2UxDhNX+XAiAXTpxcbxS0pHPkAD4TAtUiWNqWBkIG7FRc3g9 eKHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id y72-20020a638a4b000000b00578e98deca3si21919856pgd.37.2023.09.29.14.38.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 14:38:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 374FC8228826; Fri, 29 Sep 2023 14:36:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233326AbjI2VgO convert rfc822-to-8bit (ORCPT + 99 others); Fri, 29 Sep 2023 17:36:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbjI2VgN (ORCPT ); Fri, 29 Sep 2023 17:36:13 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE2861AB for ; Fri, 29 Sep 2023 14:36:11 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-95-t2b_ZynWOe24ksn49Kg4FA-1; Fri, 29 Sep 2023 22:36:08 +0100 X-MC-Unique: t2b_ZynWOe24ksn49Kg4FA-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Fri, 29 Sep 2023 22:36:06 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Fri, 29 Sep 2023 22:36:06 +0100 From: David Laight To: 'Joe Perches' , Matthew Maurer , Miguel Ojeda , Alex Gaynor , "Wedson Almeida Filho" CC: Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , "Alice Ryhl" , "rust-for-linux@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] rust: Use awk instead of recent xargs Thread-Topic: [PATCH] rust: Use awk instead of recent xargs Thread-Index: AQHZ8kr/VXhkUs4M10WbSSTh7+OPhLAyVEjw Date: Fri, 29 Sep 2023 21:36:06 +0000 Message-ID: References: <20230928202116.2298150-1-mmaurer@google.com> <106c8bdb960da1568d0b3879efa76cd2acec032e.camel@perches.com> In-Reply-To: <106c8bdb960da1568d0b3879efa76cd2acec032e.camel@perches.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 29 Sep 2023 14:36:36 -0700 (PDT) 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)