diff options
author | xguo <xguo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-13 10:12:07 +0000 |
---|---|---|
committer | xguo <xguo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-13 10:12:07 +0000 |
commit | 7137cdac42c49af85bc0c00b595913bcda9c8d88 (patch) | |
tree | a616ef9bf816a6b420d0becce38f494e52da6fe5 /gcc/gcc.c | |
parent | 9991edd9a5214ee1740cb7350ee1d80a3f5f48ca (diff) | |
download | gcc-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/gcc.c')
-rw-r--r-- | gcc/gcc.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c index 8bdb6bc2303..ff0f5845224 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -855,6 +855,7 @@ static const char *multilib_select; static const char *multilib_matches; static const char *multilib_defaults; static const char *multilib_exclusions; +static const char *multilib_reuse; /* Check whether a particular argument is a default argument. */ @@ -1248,6 +1249,7 @@ static struct spec_list static_specs[] = INIT_STATIC_SPEC ("multilib_matches", &multilib_matches), INIT_STATIC_SPEC ("multilib_exclusions", &multilib_exclusions), INIT_STATIC_SPEC ("multilib_options", &multilib_options), + INIT_STATIC_SPEC ("multilib_reuse", &multilib_reuse), INIT_STATIC_SPEC ("linker", &linker_name_spec), INIT_STATIC_SPEC ("linker_plugin_file", &linker_plugin_file_spec), INIT_STATIC_SPEC ("lto_wrapper", <o_wrapper_spec), @@ -6323,6 +6325,13 @@ main (int argc, char **argv) obstack_1grow (&multilib_obstack, 0); multilib_exclusions = XOBFINISH (&multilib_obstack, const char *); + q = multilib_reuse_raw; + while ((p = *q++) != (char *) 0) + obstack_grow (&multilib_obstack, p, strlen (p)); + + obstack_1grow (&multilib_obstack, 0); + multilib_reuse = XOBFINISH (&multilib_obstack, const char *); + need_space = FALSE; for (i = 0; i < ARRAY_SIZE (multilib_defaults_raw); i++) { @@ -7536,6 +7545,12 @@ set_multilib_dir (void) first = 1; p = multilib_select; + + /* Append multilib reuse rules if any. With those rules, we can reuse + one multilib for certain different options sets. */ + if (strlen (multilib_reuse) > 0) + p = concat (p, multilib_reuse, NULL); + while (*p != '\0') { /* Ignore newlines. */ @@ -7552,8 +7567,8 @@ set_multilib_dir (void) if (*p == '\0') { invalid_select: - fatal_error ("multilib select %qs is invalid", - multilib_select); + fatal_error ("multilib select %qs %qs is invalid", + multilib_select, multilib_reuse); } ++p; } |