[LTP] [RFC] [PATCH v2] lib32: Add support for linking 32bit programs on 64bit

Richard Palethorpe rpalethorpe@suse.de
Tue May 16 10:38:56 CEST 2017


Hi,

Cyril Hrubis writes:

> This is proof of concept for building 32bit testcases on 64bit platform.
>
> What we do is:
>
> * Configure test if compiler supports -m32
>
> * Configure test if compiler supports atomic operations with -m32
>   (we have to use fallbacks in tst_atomic.h otherwise)
>
> * The directory lib32 contains symlinks of minimal set of sources
>   needed to link newlib testcase + Makefile.
>
> * The testcases.mk builds 32bit library as well if
>   32bit compiler was installed (-m32 configure test was succesful)
>
> * And finally the env_post.mk switches between adding -L path to lib or
>   lib32 depeding on if -m32 was passed in global CFLAGS and/or in the
>   target specific CFLAGS

I'm not sure if this has already been taken into account, but on aarch64
gcc does not recognise the -m32 switch and compilation fails if the test
case has added -m32 to its CFLAGS.

-- 
Thank you,
Richard.


More information about the ltp mailing list