summaryrefslogtreecommitdiff
path: root/gcc/doc/fragments.texi
diff options
context:
space:
mode:
authorxguo <xguo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-13 10:12:07 +0000
committerxguo <xguo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-13 10:12:07 +0000
commit7137cdac42c49af85bc0c00b595913bcda9c8d88 (patch)
treea616ef9bf816a6b420d0becce38f494e52da6fe5 /gcc/doc/fragments.texi
parent9991edd9a5214ee1740cb7350ee1d80a3f5f48ca (diff)
downloadgcc-7137cdac42c49af85bc0c00b595913bcda9c8d88.tar.gz
2013-01-13 Terry Guo <terry.guo@arm.com>
* gcc/Makefile.in (s-mlib): New argument MULTILIB_REUSE. * gcc/doc/fragments.texi: Document MULTILIB_REUSE. * gcc/gcc.c (multilib_reuse): New internal spec. (set_multilib_dir): Also search multilib from multilib_reuse. * gcc/genmultilib (tmpmultilib3): Refactor code. (tmpmultilib4): Ditto. (multilib_reuse): New multilib argument. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195134 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/doc/fragments.texi')
-rw-r--r--gcc/doc/fragments.texi29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/doc/fragments.texi b/gcc/doc/fragments.texi
index a108ab035ba..b9a0c34b690 100644
--- a/gcc/doc/fragments.texi
+++ b/gcc/doc/fragments.texi
@@ -148,6 +148,35 @@ The @code{MULTILIB_REQUIRED} can be used together with
@code{MULTILIB_OPTIONS} will be filtered by @code{MULTILIB_EXCEPTIONS}
and then by @code{MULTILIB_REQUIRED}.
+@findex MULTILIB_REUSE
+@item MULTILIB_REUSE
+Sometimes it is desirable to reuse one existing multilib for different
+sets of options. Such kind of reuse can minimize the number of multilib
+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
+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:
+@smallexample
+@code{MULTILIB_REUSE} = mthumb/march.armv7-r=marm/march.armv7-r
+@end smallexample
+
+Before the advent of @code{MULTILIB_REUSE}, GCC select multilib by comparing command
+line options with options used to build multilib. The @code{MULTILIB_REUSE} is
+complementary to that way. Only when the original comparison matches nothing it will
+work to see if it is OK to reuse some existing multilib.
+
@findex MULTILIB_EXTRA_OPTS
@item MULTILIB_EXTRA_OPTS
Sometimes it is desirable that when building multiple versions of