> -----Original Message-----
> From: gcc-ow...@gcc.gnu.org [mailto:gcc-ow...@gcc.gnu.org] On Behalf Of
> Ilya Enkovich
> Sent: Friday, August 09, 2013 8:37 PM
> To: GCC Development
> Subject: How to specify multiple OSDIRNAME suffixes for multilib (Multilib
> usage with MPX)?
> 
> Hi,
> 
> I'm currently trying to create multilib libraries compiled with MPX.
> The main difference with existing multilib variants on i386 target is
> that new targets (32/mpx, 64/mpx) are compatible with old variants
> (32, 64). Also we should not prevent user from using mpx if he does
> not have MPX variants for some libraries - legacy versions should be
> used instead. Thus we need to check several suffixes instead of one.
> E.g. for 64bit MPX binary we should firstly check ../lib64/mpx, then
> check ../lib64 and finally the default one.
> 
> I looked at MULTILIB_REUSE and thought it might solve my problem
> according to documentation: "And for some targets it is better to
> reuse an existing multilib than to fall back to default multilib when
> there is no corresponding multilib." [1]. So I tried following
> declarations:
> 
> MULTILIB_OSDIRNAMES+= m64/fmpx=../lib64/mpx
> MULTILIB_REUSE = m64=m64/fmpx
> 
> But it appeared that only the first entry for some options set counts
> when multilibs are parsed in gcc.c and my reuse here is just ignored.
> 
> Is it a wrong implementation of MULTILIB_REUSE or my wrong
> understanding of this option? Is there a way to implement mpx
> multilibs still allowing legacy ones when some mpx libs are missing?
> 
> [1] http://gcc.gnu.org/onlinedocs/gccint/Target-Fragment.html#Target-
> Fragment
> 
> Thanks,
> Ilya

Hi Ilya,

Sorry for the later response. I am the author of MULTILIB_REUSE. So far this
feature is not flexible enough to meet your requirement. It can't
dynamically decide to choose m64/fmpx if such libraries are there, then
secondly choose m64 if m64/fmpx don't exist. This feature only makes a
static decision. The following statement:
 MULTILIB_REUSE = m64=m64/fmpx
means that when options m64 and fmpx are given, we should reuse libraries
for m64 always. And for this purpose, we also need:
MULTILIB_EXCEPTIONS = m64/fmpx to make sure libraries for "m64 fmpx" won't
be built.

If m64/fmpx isn't excluded, the MULTILIB_REUSE will think the required
libraries are there and no need to reuse.

IMHO, the way used by gcc to select multilib is based on string match rather
than detecting the existence of libraries. So the flexible way like you
wanted isn't supported yet. 

BR,
Terry




Reply via email to