From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 913641B1F3 for ; Wed, 9 Jan 2019 11:39:54 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x09AYqAn002132; Wed, 9 Jan 2019 02:39:50 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=hYBxSOMNmjj3aHGdWNP0Gh8qwzcisyCtObBXo3sdalw=; b=fGjMQMytG+87XALIenFI31KIltIohjBT6VlbzzCE2mntzAnwrdcmSqTpGrTIRAeiXrye VbxVgFParYc8o8l25Y4Zt4Wm092YmC3XILM+6OlcUUlC+Q0MBmKiS6REnqqpYedSoWRm rt+2Bf8ykwg86AuAbjXfZav7R/tVDIVvPdAemcAg72JH4g8AZ2dxBUL2Dc/hViyH2fNf aHtAGOICrZLIX91W3vdSml00z2BmGNlC0ThXUD9n6zXRiufmbMXXXkDcg4H0PMDFjhbI TzSPJN0pV6etAZLsDMFGXmXFoNYr5noG6iPPErCMkHHAyrMKx5xWDut6MJtDxCtalnO4 sw== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2pvwjq4mrg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 09 Jan 2019 02:39:49 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 9 Jan 2019 02:39:48 -0800 Received: from NAM01-BN3-obe.outbound.protection.outlook.com (104.47.33.53) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 9 Jan 2019 02:39:48 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hYBxSOMNmjj3aHGdWNP0Gh8qwzcisyCtObBXo3sdalw=; b=KUjmT3mjrfvq/K9Ph1nXIxm8q2/5tu2qozAcGE5/3npitiplgmM02UKxvpZBSqMSgjKBnxlCPZdyjobFlVUObHoaKa1izQvaCuv7yKu97x8LRlKWI2d5EnF/nzyL3SefavikaYdQgFYgaZ7cXuTtqb66d3gD6i5BU4gBhWZpzWI= Received: from CY4PR1801MB1863.namprd18.prod.outlook.com (10.171.255.14) by CY4PR1801MB1895.namprd18.prod.outlook.com (10.171.255.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.7; Wed, 9 Jan 2019 10:39:45 +0000 Received: from CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::8d37:71d9:3b0c:ad00]) by CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::8d37:71d9:3b0c:ad00%2]) with mapi id 15.20.1516.010; Wed, 9 Jan 2019 10:39:45 +0000 From: Pavan Nikhilesh Bhagavatula To: Jerin Jacob Kollanukkaran , "Gavin.Hu@arm.com" , "bruce.richardson@intel.com" , "thomas@monjalon.net" CC: "dev@dpdk.org" , Pavan Nikhilesh Bhagavatula Thread-Topic: [dpdk-dev] [PATCH v4 1/5] mk: introduce helper to check valid compiler argument Thread-Index: AQHUqAejilwBefX0wEa4EqBaIqlfug== Date: Wed, 9 Jan 2019 10:39:45 +0000 Message-ID: <20190109103915.29210-1-pbhagavatula@marvell.com> References: <20190106131933.7898-1-jerinj@marvell.com> In-Reply-To: <20190106131933.7898-1-jerinj@marvell.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR01CA0086.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1::26) To CY4PR1801MB1863.namprd18.prod.outlook.com (2603:10b6:910:7a::14) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [49.205.221.51] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR1801MB1895; 20:jN5J1zlwXFbUdw5gvJfu4KinjFvL3AFacVyWZMFrhzjnKkztOS4k6m4iK/f1XQ8+s7KpilOq7l9STH20VVhQkI8ASBsNWraqfN0lq/rMHr73sVTTJOLLkfGRfqb30VkP0cv8yddg/QpcAPf2x+zRN3djR27AF8NOnEwNzfSZR3s= x-ms-office365-filtering-correlation-id: d87d939b-8890-4bb4-cdba-08d6761ec58f x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(2017052603328)(7153060)(7193020); SRVR:CY4PR1801MB1895; x-ms-traffictypediagnostic: CY4PR1801MB1895: x-microsoft-antispam-prvs: x-forefront-prvs: 0912297777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(376002)(136003)(366004)(396003)(189003)(199004)(36756003)(105586002)(106356001)(6116002)(68736007)(3846002)(5660300001)(186003)(26005)(25786009)(4326008)(102836004)(52116002)(76176011)(256004)(6506007)(386003)(486006)(81156014)(81166006)(8676002)(107886003)(2616005)(7736002)(2501003)(476003)(53936002)(6486002)(478600001)(305945005)(8936002)(1076003)(11346002)(446003)(6436002)(97736004)(14454004)(2906002)(110136005)(316002)(6512007)(54906003)(78486014)(2201001)(66066001)(71190400001)(86362001)(71200400001)(99286004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1801MB1895; H:CY4PR1801MB1863.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: XwkJRiUB8Ob/M+fqhjUa16rxtljxA4GWjbXrB12dFVAcww7ZEzSVeRUiWrvetbV9Ekivg6bFUQhEreuSWDIHK4tQNjuxlRgk+a8hTWrY36DhquMY/DTmf2HrhS7kIkWcGMHAxQHh5PAX1a2O5al9FcwVhrrOUasl9lyKLqDKDkpw9o+WmwHxKOiljJt+cCzgz4AUzj1APstMnusfuyLrh2fJC18+8m3jpKkRbIUmpbp5ne3WgEM66Hs9pmXEqjsuDiw0gxWxS81TbvccCcgyaPKER9zb0uVUxPD0jB+v/CyHqn3wlJQMSaip83fk0LKB spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: d87d939b-8890-4bb4-cdba-08d6761ec58f X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jan 2019 10:39:45.7607 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1801MB1895 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-01-09_06:, , signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901090090 Subject: [dpdk-dev] [PATCH v4 1/5] 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: , X-List-Received-Date: Wed, 09 Jan 2019 10:39:55 -0000 From: Jerin Jacob Introduce rte_cc_has_argument() Makefile helper to check a given argument is support by the compiler. Example Usage: include $(RTE_SDK)/mk/rte.helper.mk MACHINE_CFLAGS +=3D $(call rte_cc_has_argument, -mcpu=3Docteontx2) 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. 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 cross compile case. Signed-off-by: Jerin Jacob Signed-off-by: Pavan Nikhilesh --- v2 Changes: - Add meson build support. v3 Changes: - Squash meson build support into config support for thunderx2/octeontx2. v4 Changes: - Fix incorrect signoff marrvell -> marvell. mk/rte.helper.mk | 12 ++++++++++++ mk/target/generic/rte.vars.mk | 22 +++++++++++----------- 2 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 mk/rte.helper.mk diff --git a/mk/rte.helper.mk b/mk/rte.helper.mk new file mode 100644 index 000000000..2c5d5275e --- /dev/null +++ b/mk/rte.helper.mk @@ -0,0 +1,12 @@ +# 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) -Werror $(1) -c -x c /dev/null -o tmp$$ 2> /dev/null && rm = -f tmp$$ && echo $(1) | xargs echo -n) +endef + + diff --git a/mk/target/generic/rte.vars.mk b/mk/target/generic/rte.vars.mk index dd149acc9..25a578ad7 100644 --- a/mk/target/generic/rte.vars.mk +++ b/mk/target/generic/rte.vars.mk @@ -7,6 +7,17 @@ # executive environment. # +# +# 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 -# -# 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