From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH v6 6/7] build: fix the meson cross compile error Date: Thu, 14 Jun 2018 11:42:51 +0100 Message-ID: <20180614104250.GD17264@bricha3-MOBL.ger.corp.intel.com> References: <1527590616-28299-1-git-send-email-gavin.hu@arm.com> <20180614095127.16245-1-gavin.hu@arm.com> <20180614095127.16245-7-gavin.hu@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, stable@dpdk.org To: Gavin Hu Return-path: Content-Disposition: inline In-Reply-To: <20180614095127.16245-7-gavin.hu@arm.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Jun 14, 2018 at 05:51:26PM +0800, Gavin Hu wrote: > The following error hits if host cc compiler is clang(default one in most > linux distributions) and the cross compiler is gcc. > > The root cause is: the hybride compilers add the warning options to the > meson project as project arguments, which apply for both host compiling and > cross compiling. But some options such as '-Wno-format-truncation' are not > supported nor recognized by clang, so they have to be removed from the > project arguments for the host compiler to run smoothily and added back as > cflags for the cross compiler to compile for cross source files. > > The fix is remove unrecognized warning options from the meson project > arguments shared by gcc and clang, as add them specifically for gcc or > clang as cflags. > > [265/893] Compiling C object > 'buildtools/pmdinfogen/pmdinfogen@exe/pmdinfogen.c.o'. warning: unknown > warning option '-Wno-format-truncation' [-Wunknown-warning-option] > > Fixes: a55277a788 ("devtools: add test script for meson builds") > Cc: stable@dpdk.org > > Signed-off-by: Gavin Hu > Reviewed-by: Phil Yang > Reviewed-by: Song Zhu > Reviewed-by: Steve Capper > --- Yes, I think this solution works. A cleaner fix might be to move away from having these flags as meson project arguments, and instead manage them directly in our files as arrays of native and cross cflags, but that can be a job for later. As it is: Acked-by: Bruce Richardson