aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2016-08-30 17:53:17 +0200
committerYvan Roux <yvan.roux@linaro.org>2016-09-07 22:08:19 +0200
commit8e5b519d3bde51da6ab781f004a43e1aeee9cf9a (patch)
tree079cbfcd7d1c1701dd6a9f4415c1e85d87a1fb7c
parentf338ee907d3dbd6321645bca86c91c3018b34b8a (diff)
gcc/
Backport from trunk r239733. 2016-08-24 Thomas Preud'homme <thomas.preudhomme@arm.com> * config/arm/t-aprofile (MULTILIB_MATCHES): Add mapping for -mcpu=cortex-a7, -mfpu=neon-fp16, -mfpu=fpv5-d16 and -mfpu=fp-armv8. Fix typo in -mfpu=vfpv3-d16-fp16 mapping. (MULTILIB_REUSE): Remove reuse rules for option set including -mfpu=fp-armv8 and -mfpu=vfpv4 gcc/ Backport from trunk r239734. 2016-08-24 Thomas Preud'homme <thomas.preudhomme@arm.com> * doc/fragments.texi (MULTILIB_REUSE): Mention that only options in MULTILIB_OPTIONS should be used. Small wording fixes. * genmultilib: Memorize set of all option combinations in combination_space. Detect if RHS of MULTILIB_REUSE uses an option not found in MULTILIB_OPTIONS by checking if option set is listed in combination_space. Output new and existing error message to stderr. Change-Id: Icde28653fb6dc296e8c2f2f8b1745759b067b621
-rw-r--r--gcc/config/arm/t-aprofile22
-rw-r--r--gcc/doc/fragments.texi19
-rw-r--r--gcc/genmultilib22
3 files changed, 29 insertions, 34 deletions
diff --git a/gcc/config/arm/t-aprofile b/gcc/config/arm/t-aprofile
index 1b34b5444aa..0d91006d4ef 100644
--- a/gcc/config/arm/t-aprofile
+++ b/gcc/config/arm/t-aprofile
@@ -81,6 +81,7 @@ MULTILIB_EXCEPTIONS += *march=armv7ve/*mfpu=neon-fp-armv8*
MULTILIB_MATCHES += march?armv7-a=mcpu?cortex-a8
MULTILIB_MATCHES += march?armv7-a=mcpu?cortex-a9
MULTILIB_MATCHES += march?armv7-a=mcpu?cortex-a5
+MULTILIB_MATCHES += march?armv7ve=mcpu?cortex-a7
MULTILIB_MATCHES += march?armv7ve=mcpu?cortex-a15
MULTILIB_MATCHES += march?armv7ve=mcpu?cortex-a12
MULTILIB_MATCHES += march?armv7ve=mcpu?cortex-a17
@@ -108,8 +109,11 @@ MULTILIB_MATCHES += march?armv8-a=march?armv8.1-a+crc
# FPU matches
MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?vfpv3
MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?vfpv3-fp16
-MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?vfpv3-fp16-d16
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?vfpv3-d16-fp16
+MULTILIB_MATCHES += mfpu?neon=mfpu?neon-fp16
MULTILIB_MATCHES += mfpu?vfpv4-d16=mfpu?vfpv4
+MULTILIB_MATCHES += mfpu?vfpv4-d16=mfpu?fpv5-d16
+MULTILIB_MATCHES += mfpu?vfpv4-d16=mfpu?fp-armv8
MULTILIB_MATCHES += mfpu?neon-fp-armv8=mfpu?crypto-neon-fp-armv8
@@ -127,10 +131,6 @@ MULTILIB_REUSE += march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.hard=march.armv8
MULTILIB_REUSE += march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.softfp=march.armv8-a/mfpu.vfpv3-d16/mfloat-abi.softfp
MULTILIB_REUSE += march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.hard=march.armv7-a/mfpu.vfpv4-d16/mfloat-abi.hard
MULTILIB_REUSE += march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.softfp=march.armv7-a/mfpu.vfpv4-d16/mfloat-abi.softfp
-MULTILIB_REUSE += march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.hard=march.armv7-a/mfpu.fp-armv8/mfloat-abi.hard
-MULTILIB_REUSE += march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.softfp=march.armv7-a/mfpu.fp-armv8/mfloat-abi.softfp
-MULTILIB_REUSE += march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.hard=march.armv7-a/mfpu.vfpv4/mfloat-abi.hard
-MULTILIB_REUSE += march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.softfp=march.armv7-a/mfpu.vfpv4/mfloat-abi.softfp
MULTILIB_REUSE += march.armv7-a/mfpu.neon/mfloat-abi.hard=march.armv7ve/mfpu.neon/mfloat-abi.hard
@@ -143,10 +143,6 @@ MULTILIB_REUSE += march.armv7-a/mfpu.neon/mfloat-abi.hard=march.armv7-a/mf
MULTILIB_REUSE += march.armv7-a/mfpu.neon/mfloat-abi.softfp=march.armv7-a/mfpu.neon-fp-armv8/mfloat-abi.softfp
-MULTILIB_REUSE += march.armv7ve/mfpu.vfpv4-d16/mfloat-abi.hard=march.armv7ve/mfpu.fp-armv8/mfloat-abi.hard
-MULTILIB_REUSE += march.armv7ve/mfpu.vfpv4-d16/mfloat-abi.softfp=march.armv7ve/mfpu.fp-armv8/mfloat-abi.softfp
-MULTILIB_REUSE += march.armv7ve/mfpu.vfpv4-d16/mfloat-abi.hard=march.armv8-a/mfpu.vfpv4/mfloat-abi.hard
-MULTILIB_REUSE += march.armv7ve/mfpu.vfpv4-d16/mfloat-abi.softfp=march.armv8-a/mfpu.vfpv4/mfloat-abi.softfp
MULTILIB_REUSE += march.armv7ve/mfpu.vfpv4-d16/mfloat-abi.hard=march.armv8-a/mfpu.vfpv4-d16/mfloat-abi.hard
MULTILIB_REUSE += march.armv7ve/mfpu.vfpv4-d16/mfloat-abi.softfp=march.armv8-a/mfpu.vfpv4-d16/mfloat-abi.softfp
@@ -166,10 +162,6 @@ MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.hard=mthu
MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.softfp=mthumb/march.armv8-a/mfpu.vfpv3-d16/mfloat-abi.softfp
MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.hard=mthumb/march.armv7-a/mfpu.vfpv4-d16/mfloat-abi.hard
MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.softfp=mthumb/march.armv7-a/mfpu.vfpv4-d16/mfloat-abi.softfp
-MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.hard=mthumb/march.armv7-a/mfpu.fp-armv8/mfloat-abi.hard
-MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.softfp=mthumb/march.armv7-a/mfpu.fp-armv8/mfloat-abi.softfp
-MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.hard=mthumb/march.armv7-a/mfpu.vfpv4/mfloat-abi.hard
-MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.softfp=mthumb/march.armv7-a/mfpu.vfpv4/mfloat-abi.softfp
MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.neon/mfloat-abi.hard=mthumb/march.armv7ve/mfpu.neon/mfloat-abi.hard
@@ -182,10 +174,6 @@ MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.neon/mfloat-abi.hard=mthumb/ma
MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.neon/mfloat-abi.softfp=mthumb/march.armv7-a/mfpu.neon-fp-armv8/mfloat-abi.softfp
-MULTILIB_REUSE += mthumb/march.armv7ve/mfpu.vfpv4-d16/mfloat-abi.hard=mthumb/march.armv7ve/mfpu.fp-armv8/mfloat-abi.hard
-MULTILIB_REUSE += mthumb/march.armv7ve/mfpu.vfpv4-d16/mfloat-abi.softfp=mthumb/march.armv7ve/mfpu.fp-armv8/mfloat-abi.softfp
-MULTILIB_REUSE += mthumb/march.armv7ve/mfpu.vfpv4-d16/mfloat-abi.hard=mthumb/march.armv8-a/mfpu.vfpv4/mfloat-abi.hard
-MULTILIB_REUSE += mthumb/march.armv7ve/mfpu.vfpv4-d16/mfloat-abi.softfp=mthumb/march.armv8-a/mfpu.vfpv4/mfloat-abi.softfp
MULTILIB_REUSE += mthumb/march.armv7ve/mfpu.vfpv4-d16/mfloat-abi.hard=mthumb/march.armv8-a/mfpu.vfpv4-d16/mfloat-abi.hard
MULTILIB_REUSE += mthumb/march.armv7ve/mfpu.vfpv4-d16/mfloat-abi.softfp=mthumb/march.armv8-a/mfpu.vfpv4-d16/mfloat-abi.softfp
diff --git a/gcc/doc/fragments.texi b/gcc/doc/fragments.texi
index f4e6636fb95..f5d8e8d6890 100644
--- a/gcc/doc/fragments.texi
+++ b/gcc/doc/fragments.texi
@@ -156,15 +156,16 @@ variants. 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.
This can be done by adding reuse rules to @code{MULTILIB_REUSE}.
-A reuse rule is comprised of two parts connected by equality sign. The left part
-is option set used to build multilib and the right part is option set that will
-reuse this multilib. The order of options in the left part matters and should be
-same with those specified in @code{MULTILIB_REQUIRED} or aligned with order in
-@code{MULTILIB_OPTIONS}. There is no such limitation for options in right part
-as we don't build multilib from them. But the equality sign in both parts should
-be replaced with period.
-
-The @code{MULTILIB_REUSE} is different from @code{MULTILIB_MATCHES} in that it
+A reuse rule is comprised of two parts connected by equality sign. The left
+part is the option set used to build multilib and the right part is the option
+set that will reuse this multilib. Both parts should only use options
+specified in @code{MULTILIB_OPTIONS} and the equality signs found in options
+name should be replaced with periods. The order of options in the left part
+matters and should be same with those specified in @code{MULTILIB_REQUIRED} or
+aligned with the order in @code{MULTILIB_OPTIONS}. There is no such limitation
+for options in the right part as we don't build multilib from them.
+
+@code{MULTILIB_REUSE} is different from @code{MULTILIB_MATCHES} in that it
sets up relations between two option sets rather than two options. Here is an
example to demo how we reuse libraries built in Thumb mode for applications built
in ARM mode:
diff --git a/gcc/genmultilib b/gcc/genmultilib
index 083259aa82c..eb5f661a5fd 100644
--- a/gcc/genmultilib
+++ b/gcc/genmultilib
@@ -186,7 +186,8 @@ fi
EOF
chmod +x tmpmultilib
-combinations=`initial=/ ./tmpmultilib ${options}`
+combination_space=`initial=/ ./tmpmultilib ${options}`
+combinations="$combination_space"
# If there exceptions, weed them out now
if [ -n "${exceptions}" ]; then
@@ -472,14 +473,19 @@ for rrule in ${multilib_reuse}; do
# in this variable, it means no multilib will be built for current reuse
# rule. Thus the reuse purpose specified by current rule is meaningless.
if expr "${combinations} " : ".*/${combo}/.*" > /dev/null; then
- combo="/${combo}/"
- dirout=`./tmpmultilib3 "${combo}" "${todirnames}" "${toosdirnames}" "${enable_multilib}"`
- copts="/${copts}/"
- optout=`./tmpmultilib4 "${copts}" "${options}"`
- # Output the line with all appropriate matches.
- dirout="${dirout}" optout="${optout}" ./tmpmultilib2
+ if expr "${combination_space} " : ".*/${copts}/.*" > /dev/null; then
+ combo="/${combo}/"
+ dirout=`./tmpmultilib3 "${combo}" "${todirnames}" "${toosdirnames}" "${enable_multilib}"`
+ copts="/${copts}/"
+ optout=`./tmpmultilib4 "${copts}" "${options}"`
+ # Output the line with all appropriate matches.
+ dirout="${dirout}" optout="${optout}" ./tmpmultilib2
+ else
+ echo "The rule ${rrule} contains an option absent from MULTILIB_OPTIONS." >&2
+ exit 1
+ fi
else
- echo "The rule ${rrule} is trying to reuse nonexistent multilib."
+ echo "The rule ${rrule} is trying to reuse nonexistent multilib." >&2
exit 1
fi
done