[dpdk-dev] [PATCH v2] devtools: fix 32-bits build

Thomas Monjalon thomas at monjalon.net
Mon Nov 9 17:14:24 CET 2020


09/11/2020 16:44, Bruce Richardson:
> On Mon, Nov 09, 2020 at 04:28:16PM +0100, Thomas Monjalon wrote:
> > 09/11/2020 15:55, Ferruh Yigit:
> > > If the 'PKG_CONFIG_PATH' is set in the environment before script run,
> > > 32 bit still uses that value for 64-bits libraries.
> > > 
> > > From the build log:
> > > 
> > > "
> > > Using DPDK_TARGET i386-pc-linux-gnu
> > > meson  -Dexamples=l3fwd --buildtype=debugoptimized --werror
> > > -Dc_args=-m32 -Dc_link_args=-m32
> > > /tmp/dpdk_maintain/self/dpdk/devtools/.. ./build-32b
> > > ...
> > > Using 'PKG_CONFIG_PATH' from environment with value:
> > > '/usr/local/lib64/pkgconfig/
> > > "
> > > 
> > > This causes build error when linking with the found libraries.
> > > 
> > > Reproduced with 'librte_bpf' which only has 64 bit installed but still
> > > enables building 'af_xdp' and link fails.
> > > 
> > > To fix this, using default 'PKG_CONFIG_PATH' variable unless
> > > 'CUSTOM_PKG_CONFIG_PATH' set, and set the 'CUSTOM_PKG_CONFIG_PATH' for
> > > 32 bit build.
> > > 
> > > Fixes: 9b83106d8784 ("devtools: test 32-bit build")
> > > 
> > > Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
> > > ---
> > > Cc: Bruce Richardson <bruce.richardson at intel.com>
> > > Cc: Thomas Monjalon <thomas at monjalon.net>
> > > 
> > > v2:
> > > * Enable overwriting default 'PKG_CONFIG_PATH' value
> > 
> > It was not my conclusion.
> > I think we can just reset all env vars.
> > 
> 
> Perhaps, but I think that may cause more problems for people who want
> custom CFLAGS and LDFLAGS for building with extra 3rd-party packages.
> While this can be done using the config script that is sourced in, I
> suspect most of us do not use such a script.
> 
>  Therefore I'd suggest rather than clearing the env vars globally, we just
> override them temporarily for the 32-bit, using CFLAGS32, LDFLAGS32,
> PKG_CONFIG_PATH32 instead. That allows someone to have a 32-bit and 64-bit
> version of e.g. libbpf installed, with a PKG_CONFIG_PATH pointing to each.

So you want to duplicate all vars just to avoid writing them cleanly in a file?
And what happens for other targets?

I'm tending to nack this approach.
There is no problem in using a clean config file.




More information about the dev mailing list