On Tue, Oct 6, 2020 at 4:30 AM Thomas Monjalon <tho...@monjalon.net> wrote:
>
> 25/09/2020 15:27, Lance Richardson:
> > Bruce Richardson wrote:
> > > On Thu, Sep 24, 2020 at 12:37:42PM -0400, Lance Richardson wrote:
> > > > Add meson cross files for building i686 targets using gcc on x86_64
> > > > linux hosts.
> > > >
> > > > Uusage example:
> > > >
> > > >     meson --cross-file config/x86/cross-i686-linux-gcc build-i686
> > > >     ninja -C build-i686
> > > >
> > > > Signed-off-by: Lance Richardson <lance.richard...@broadcom.com>
> > > > ---
> > > > Red Hat distros use a different name for the 32-bit pkg-config
> > > > command from most other distros, maybe there is a better way
> > > > to handle this than using separate files.
> > > >
> > > > Others will probably have better naming suggestions for the files.
> > > >
> > > Just to note that rather than using cross-files, building i686 on x86_64
> > > should be possible by just setting environment variables.
> > >
> > > For example, on Ubuntu 20.04, this works for me:
> > >
> > > PKG_CONFIG_LIBDIR=/usr/lib/i386-linux-gnu/pkgconfig CFLAGS='-m32' 
> > > LDFLAGS='-m32' meson --werror build-32bit
> > > ninja -C build-32bit/
> > >
> > > For Fedora or Redhat system the PKG_CONFIG_LIBDIR will be different (I
> > > think just /usr/lib/pkgconfig), but the rest should work identically.
> >
> > Thanks, that does work, although I'll have some trouble remembering it
> > for future
>
> Would it help to have this command in devtools/test-meson-builds.sh ?
>

I think it would help, although using cross-files was suggested when
that was proposed here:
     http://patchwork.dpdk.org/patch/69067/

Having the i686 build command in a document like the GSG might be
helpful as well.

Ideally it seems there should be a consistent way to build for different
architectures using meson, I think we mostly have that now with the
native architecture being used by default and otherwise using a
cross-file found under config/<arch>/.

Thanks,
    Lance

Reply via email to