summaryrefslogtreecommitdiff
path: root/gcc/genmultilib
diff options
context:
space:
mode:
authorxguo <xguo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-09 11:38:47 +0000
committerxguo <xguo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-09 11:38:47 +0000
commitcec456166b4f52066e208ce4b09b98b42dc68bb2 (patch)
tree3ec1335b8f6ac6a83d76f34c9914dbf08e52b5f5 /gcc/genmultilib
parente74309486d57ffd934f9e0d4f075686666d675b0 (diff)
downloadgcc-cec456166b4f52066e208ce4b09b98b42dc68bb2.tar.gz
* Makefile.in (s-mlib): Add new argument MULTILIB_REQUIRED.
* genmultilib (MULTILIB_REQUIRED): New. * doc/fragments.texi: Document the MULTILIB_REQUIRED. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187325 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genmultilib')
-rw-r--r--gcc/genmultilib43
1 files changed, 41 insertions, 2 deletions
diff --git a/gcc/genmultilib b/gcc/genmultilib
index 270de2b2a2c..02fc2768d45 100644
--- a/gcc/genmultilib
+++ b/gcc/genmultilib
@@ -73,6 +73,17 @@
# the os directory names are used exclusively. Use the mapping when
# there is no one-to-one equivalence between GCC levels and the OS.
+# The optional eighth argument which intends to reduce the effort to write
+# so many MULTILIB_EXCEPTIONS rules. This option defines a series of option
+# combinations that we actually required.
+# For some cases, the generated option combinations are far more than what
+# we need, we have to write a lot of rules to screen out combinations we
+# don't need. If we missed some rules, the unexpected libraries will be built.
+# Now with this argument, one can simply give what combinations are needed.
+# It is pretty straigtforward.
+# This argument can be used together with MULTILIB_EXCEPTIONS and will take
+# effect after the MULTILIB_EXCEPTIONS.
+
# The last option should be "yes" if multilibs are enabled. If it is not
# "yes", all GCC multilib dir names will be ".".
@@ -93,7 +104,7 @@
# genmultilib 'm64/m32 mno-app-regs|mcmodel=medany' '64 32 alt'
# 'mcmodel?medany=mcmodel?medmid' 'm32/mno-app-regs* m32/mcmodel=*'
# '' 'm32/!m64/mno-app-regs m32/!m64/mcmodel=medany'
-# '../lib64 ../lib32 alt' yes
+# '../lib64 ../lib32 alt' '' yes
# This produces:
# ". !m64 !m32 !mno-app-regs !mcmodel=medany;",
# "64:../lib64 m64 !m32 !mno-app-regs !mcmodel=medany;",
@@ -121,7 +132,8 @@ exceptions=$4
extra=$5
exclusions=$6
osdirnames=$7
-enable_multilib=$8
+multilib_required=$8
+enable_multilib=$9
echo "static const char *const multilib_raw[] = {"
@@ -195,6 +207,33 @@ EOF
combinations=`./tmpmultilib2 ${combinations}`
fi
+# If the MULTILIB_REQUIRED list are provided,
+# filter out combinations not in this list.
+if [ -n "${multilib_required}" ]; then
+ cat >tmpmultilib2 <<\EOF
+#!/bin/sh
+# This recursive script weeds out any combination of multilib
+# switches that not in the expected list.
+
+ for opt in $@; do
+ case "$opt" in
+EOF
+
+ for expect in ${multilib_required}; do
+ echo " /${expect}/) echo \${opt};;" >> tmpmultilib2
+ done
+
+cat >>tmpmultilib2 <<\EOF
+ *) ;;
+ esac
+ done
+EOF
+
+ chmod +x tmpmultilib2
+ combinations=`./tmpmultilib2 ${combinations}`
+
+fi
+
# Construct a sed pattern which will convert option names to directory
# names.
todirnames=