Hi,

When dealing with Multilib, I find it isn't so easy to come up with a
complete MULTILIB_EXCEPTIONS rules to cover all unnecessary cases,
especially on ARM where the majority of combinations need to be filtered
out. This patch is proposing to consider this thing from another angle:
specifying the needed ones rather than the unneeded ones. A new keyword
MULTILIB_REQUIRED is involved to keep the needed option combinations.

Here is an example to demo the usage of MULTILIB_REQUIRED (based on ARM
options):

MULTILIB_OPTIONS  = marm/mthumb march=armv7-m/march=armv7e-m/march=armv7-r
MULTILIB_OPTIONS += mfloat-abi=softfp/mfloat-abi=hard
MULTILIB_OPTIONS += mfpu=fpv4-sp-d16/mfpu=vfpv3-d16

In order to get following needed libraries:

mthumb/march=armv7-m
mthumb/march=armv7e-m
mthumb/march=armv7e-m/mfloat-abi=softfp/mfpu=fpv4-sp-d16
mthumb/march=armv7e-m/mfloat-abi=hard/mfpu=fpv4-sp-d16
marm/march=armv7-r
mthumb/march=armv7-r
mthumb/march=armv7-r/mfloat-abi=softfp/mfpu=vfpv3-d16
mthumb/march=armv7-r/mfloat-abi=hard/mfpu=vfpv3-d16

we need to figure out all the combinations that we don't need and put them
into MULTILIB_EXCEPTIONS. The regex symbol "*" can be used here to make
things simply but we still have to be careful on "*" to avoid filtering out
the one we need.

But with MULTILIB_REQUIRED, it becomes straightforward, we only need to care
what we need. By putting needed option combinations into MULTILIB_REQUIRED,
the required libraries will be built.

This new keyword can work with MULTILIB_EXCEPTIONS and it takes effect after
the MULTILIB_EXCEPTIONS.

Is it OK to trunk? Any comments are welcome.

BR,
Terry

2012-04-17  Terry Guo  <terry....@arm.com>

        * Makefile.in (s-mlib): Add new argument MULTILIB_REQUIRED.
        * genmultilib (MULTILIB_REQUIRED): New.

Attachment: Add-a-new-term-MULTILIB_REQUIRED.patch
Description: Binary data

Reply via email to