From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 801E1A00E6 for ; Thu, 21 Mar 2019 11:13:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D0F6F1B4A2; Thu, 21 Mar 2019 11:13:03 +0100 (CET) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150080.outbound.protection.outlook.com [40.107.15.80]) by dpdk.org (Postfix) with ESMTP id 6C0F01B497 for ; Thu, 21 Mar 2019 11:13:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/u+DOUloUjOTv6O7DEe3H7uZe91z9kgbQKqO5bjk/TE=; b=BMrXVrEI/WStjNVJyxO+3YmlZClbaMu619x6sob4fzm0nI8RZQvygYKAB9S1Oz+qNhtixcmKLaUPrlXgThnVtuiKIYk4Ti71eiYqwXJozaaNDhbpnu30T9FaiNv6sxNJd+VevFcoHaWts8SQxk/yrDvYpn8YIHF5YrN3ZgwZbtI= Received: from DB7PR08MB3385.eurprd08.prod.outlook.com (20.176.238.90) by DB7PR08MB3066.eurprd08.prod.outlook.com (52.134.110.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.13; Thu, 21 Mar 2019 10:13:01 +0000 Received: from DB7PR08MB3385.eurprd08.prod.outlook.com ([fe80::54da:2a4f:adc2:63fe]) by DB7PR08MB3385.eurprd08.prod.outlook.com ([fe80::54da:2a4f:adc2:63fe%5]) with mapi id 15.20.1730.013; Thu, 21 Mar 2019 10:13:01 +0000 From: "Phil Yang (Arm Technology China)" To: "jerinj@marvell.com" , "thomas@monjalon.net" CC: "dev@dpdk.org" , "bruce.richardson@intel.com" , "jerinj@marvell.com" , Pavan Nikhilesh Bhagavatula , nd , nd Thread-Topic: [dpdk-dev] [PATCH v5 1/4] mk: introduce helper to check valid compiler argument Thread-Index: AQHUzGxeZxGXmhofC06TFt/fBiJh8qYWAeKg Date: Thu, 21 Mar 2019 10:13:01 +0000 Message-ID: References: <20190109103915.29210-1-pbhagavatula@marvell.com> <20190224181041.27127-1-jerinj@marvell.com> In-Reply-To: <20190224181041.27127-1-jerinj@marvell.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Phil.Yang@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d8031599-02b5-4a25-d043-08d6ade5ccdc x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR08MB3066; x-ms-traffictypediagnostic: DB7PR08MB3066: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr nodisclaimer: True x-microsoft-antispam-prvs: x-forefront-prvs: 0983EAD6B2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(366004)(396003)(346002)(39860400002)(376002)(136003)(13464003)(189003)(199004)(186003)(55016002)(110136005)(2906002)(9686003)(71190400001)(6116002)(33656002)(6436002)(8936002)(256004)(25786009)(55236004)(54906003)(4326008)(6246003)(53936002)(102836004)(53546011)(14444005)(52536014)(26005)(229853002)(71200400001)(6506007)(7696005)(486006)(74316002)(106356001)(7736002)(11346002)(76176011)(3846002)(2501003)(97736004)(86362001)(476003)(105586002)(5660300002)(305945005)(446003)(316002)(68736007)(8676002)(72206003)(99286004)(478600001)(81156014)(81166006)(14454004)(66066001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR08MB3066; H:DB7PR08MB3385.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: EeDlCiHPRcRqnAIJaAIfdFidcJLK0wXvFeXELmBbvfp9Z+8J+xgpaH2YOro0gkyRigbynZYBX/dm0mcM1UbM4MdruX+WvGA4LFqL7v/cjb/LbFea+nGirhb0JgCuHPjv6EPBxpeeHSiTBktvVEwie7Z38FlFabeZNJpimp6HvcEnN3/5T/kbRY/VIReVuJIlr4R/gKmfW7bY9G5UfuJ90uOYvQqhCIkhn+MAw5wQ6uRX0PsCeDZlfwbhdmdoXLFjwWXtb6k7l1R+35P0EhUcCTHTCVFpma8QNE0m5vkRNx4ohgHa5NJpvPNs8112akOLRoLMN25kuGjCrlOxlC9sXCgPzPVp75/6f8kht74I4UgypEjQ2aTLfNRWakEfujAJSILCtRzrj67HEzJg6EE+ZT0oohSCU1k8eHKqG0tHZXk= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: d8031599-02b5-4a25-d043-08d6ade5ccdc X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Mar 2019 10:13:01.4252 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3066 Subject: Re: [dpdk-dev] [PATCH v5 1/4] mk: introduce helper to check valid compiler argument X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190321101301.j_vhvmQglbqfy6Bd_30eLf2jD5kGgc9Hz_GVtPrwv-I@z> > -----Original Message----- > From: Jerin Jacob Kollanukkaran > Sent: Monday, February 25, 2019 2:11 AM > To: thomas@monjalon.net > Cc: dev@dpdk.org; Phil Yang (Arm Technology China) ; > bruce.richardson@intel.com; jerinj@marvell.com; Pavan Nikhilesh > Bhagavatula > Subject: [dpdk-dev] [PATCH v5 1/4] mk: introduce helper to check valid > compiler argument >=20 > Introduce rte_cc_has_argument() Makefile helper to check a given argument= is > support by the compiler. >=20 > Example Usage: >=20 > include $(RTE_SDK)/mk/rte.helper.mk > MACHINE_CFLAGS +=3D $(call rte_cc_has_argument, -mcpu=3Docteontx2) >=20 > This would allow adding -mcpu=3Docteontx2 in MACHINE_CFLAGS if it is only > supported by the compiler. The use case for such scheme is to enable the > mcpu optimization if the compiler supports else it needs to compile the > source code without any errors. >=20 > This patch also moves inclusion of toolchain's rte.vars.mk to before the > machine's rte.vars.mk inclusion to make correct CC available for the cros= s > compile case. >=20 > Signed-off-by: Jerin Jacob > Signed-off-by: Pavan Nikhilesh > --- >=20 > Change history of this series: >=20 > v2 Changes: > - Add meson build support. >=20 > v3 Changes: > - Squash meson build support into config support for thunderx2/octeontx2= . >=20 > v4 Changes: > - Fix incorrect signoff marrvell -> marvell. >=20 > v5 Changes: > - Fix incorrect meson flag parsing(Phil Yang) > - Squash meson cross build patch(5/5) into configuration update patches = for > thunderx2(3/5) and octeontx2(4/5)(Thomas) > - Changed octeontx2's march as armv8-a and added the extension required > instead of armv8-2a(Phil Yang) > - Improved rte_cc_has_argument() implementaion by removing the temp > file(Thomas) >=20 > --- > mk/rte.helper.mk | 10 ++++++++++ > mk/target/generic/rte.vars.mk | 22 +++++++++++----------- > 2 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 > mk/rte.helper.mk >=20 > diff --git a/mk/rte.helper.mk b/mk/rte.helper.mk new file mode 100644 ind= ex > 000000000..6e7fd03d7 > --- /dev/null > +++ b/mk/rte.helper.mk > @@ -0,0 +1,10 @@ > +# SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Marvell > +International Ltd > + > +# rte_cc_has_argument > +# Usage: MACHINE_CFLAGS +=3D $(call rte_cc_has_argument, -mno-avx512f) # > +Return the argument if the argument is supported by the compiler. > +# > +define rte_cc_has_argument > + $(shell $(CC) -E $(1) -xc /dev/null 1>/dev/null 2>/dev/null && echo > +$(1)) endef > diff --git a/mk/target/generic/rte.vars.mk b/mk/target/generic/rte.vars.m= k > index dd149acc9..25a578ad7 100644 > --- a/mk/target/generic/rte.vars.mk > +++ b/mk/target/generic/rte.vars.mk > @@ -7,6 +7,17 @@ > # executive environment. > # >=20 > +# > +# toolchain: > +# > +# - define CC, LD, AR, AS, ... > +# - define TOOLCHAIN_CFLAGS variable (overridden by cmdline value) > +# - define TOOLCHAIN_LDFLAGS variable (overridden by cmdline value) > +# - define TOOLCHAIN_ASFLAGS variable (overridden by cmdline value) > +# - may override any previously defined variable > +# > +include $(RTE_SDK)/mk/toolchain/$(RTE_TOOLCHAIN)/rte.vars.mk > + > # > # machine: > # > @@ -45,17 +56,6 @@ endif > # > include $(RTE_SDK)/mk/arch/$(RTE_ARCH)/rte.vars.mk >=20 > -# > -# toolchain: > -# > -# - define CC, LD, AR, AS, ... > -# - define TOOLCHAIN_CFLAGS variable (overridden by cmdline value) > -# - define TOOLCHAIN_LDFLAGS variable (overridden by cmdline value) > -# - define TOOLCHAIN_ASFLAGS variable (overridden by cmdline value) > -# - may override any previously defined variable > -# > -include $(RTE_SDK)/mk/toolchain/$(RTE_TOOLCHAIN)/rte.vars.mk > - > # > # exec-env: > # > -- > 2.20.1 Reviewed-by: Phil Yang For this patch set. Thanks, Phil