[LTP] [PATCH 2/4] INSTALL: Document 32bit and cross-compilation setup

Petr Vorel pvorel@suse.cz
Fri May 15 09:54:04 CEST 2020


Hi Li,

> On Fri, May 15, 2020 at 3:34 AM Petr Vorel <pvorel@suse.cz> wrote:

> > ...

> > > +32 bit build on 64 bit machine
> > > +------------------------------
> > > +You need to set CFLAGS=-m32 LDFLAGS=-m32 and PKG_CONFIG_LIBDIR
> > > +
> > > +* RPM based distributions (openSUSE, Fedora, etc.)
> > > +PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig CFLAGS=-m32 LDFLAGS=-m32
> > ./configure
> > > +
> > > +* Debian / Ubuntu and derivates
> > > +PKG_CONFIG_LIBDIR=/usr/lib/i386-linux-gnu/pkgconfig CFLAGS=-m32
> > LDFLAGS=-m32 ./configure


> I occationally build 32bit LTP on my RHEL8(x86_64) platform
> via: CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32" ./configure, it works for
> me awalys.

> May I ask why we need the PKG_CONFIG_LIBDIR?
To correctly correctly detect 32 bit version of libtirpc-devel and libmnl-devel

If you have libtirpc-devel (64bit version) and don't have 32bit version,
without it it detect 64bit version and fail in link phase
https://linux.die.net/man/1/pkg-config
https://autotools.io/pkgconfig/cross-compiling.html

BTW there other fix for TI-RPC tests (detection of old glibc support)
https://patchwork.ozlabs.org/project/ltp/patch/20200515070022.16407-1-pvorel@suse.cz/


> > I guess, we should set this variable in 32 bit build in travis CI (we have
> > only 1
> > job, which uses Debian). It's not failing now, because it's not a minimal
> > build.
> > Therefore we should have minimal 32 bit build (easiest way is to use
> > openSUSE or
> > Fedora/CentOS as they don't install libtirpc 32bit).


> Good suggestion! I think at least for CentOS/RHEL has no problem with this.
After release I'd propose to add Arch Linux and move CentOS 6 to CentOS 7.
One of them could be 32 bit build.

Kind regards,
Petr


More information about the ltp mailing list