summaryrefslogtreecommitdiff
path: root/gcc/genmultilib
diff options
context:
space:
mode:
authorthopre01 <thopre01@138bc75d-0d04-0410-961f-82ee72b054a4>2016-08-24 09:51:35 +0000
committerthopre01 <thopre01@138bc75d-0d04-0410-961f-82ee72b054a4>2016-08-24 09:51:35 +0000
commitf0ef556e5e8d6e6cd2654da9c11c32b6f92eb3ba (patch)
tree0e9dc988dd575b0468e4b36381ffe55f0cf5b672 /gcc/genmultilib
parent64cd75f7cd4d0736270a8554173bfd3f85b630c9 (diff)
downloadgcc-f0ef556e5e8d6e6cd2654da9c11c32b6f92eb3ba.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239734 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genmultilib')
-rw-r--r--gcc/genmultilib22
1 files changed, 14 insertions, 8 deletions
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