diff options
author | Ben Collins <bcollins@debian.org> | 2000-03-06 18:05:52 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2000-03-06 19:05:52 +0100 |
commit | 0a8d66180c7acc2e53e62127c2de2a9a0a53dce2 (patch) | |
tree | 222bb1ec57e5b5560e626764100e5afd5f9e13f5 /gcc/gcc.c | |
parent | fd05eb8097447db2163a7900a2db30be7aaf9851 (diff) | |
download | gcc-0a8d66180c7acc2e53e62127c2de2a9a0a53dce2.zip gcc-0a8d66180c7acc2e53e62127c2de2a9a0a53dce2.tar.gz gcc-0a8d66180c7acc2e53e62127c2de2a9a0a53dce2.tar.bz2 |
Makefile.in: Pass a new MULTILIB_EXCLUSIONS option as the sixth argument to genmultilib.
* Makefile.in: Pass a new MULTILIB_EXCLUSIONS option as the sixth
argument to genmultilib.
* genmultilib: accept new MULTILIB_EXCLUSIONS option and output
the contents into the multilib.h header.
* gcc.c: Declare multilib_exclusions for the specs file.
(set_multilib_dir): Use it.
(print_multilib_info): Likewise.
* t-linux64: Declare arguments for new MULTILIB_EXCLUSIONS option
to pass to genmultilib.
From-SVN: r32365
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 189 |
1 files changed, 175 insertions, 14 deletions
@@ -511,6 +511,7 @@ static struct obstack multilib_obstack; static char *multilib_select; static char *multilib_matches; static char *multilib_defaults; +static char *multilib_exclusions; #include "multilib.h" /* Check whether a particular argument is a default argument. */ @@ -1143,6 +1144,7 @@ static struct spec_list static_specs[] = { INIT_STATIC_SPEC ("multilib_defaults", &multilib_defaults), INIT_STATIC_SPEC ("multilib_extra", &multilib_extra), INIT_STATIC_SPEC ("multilib_matches", &multilib_matches), + INIT_STATIC_SPEC ("multilib_exclusions", &multilib_exclusions), INIT_STATIC_SPEC ("linker", &linker_name_spec), }; @@ -5083,6 +5085,13 @@ main (argc, argv) obstack_1grow (&multilib_obstack, 0); multilib_matches = obstack_finish (&multilib_obstack); + q = multilib_exclusions_raw; + while ((p = *q++) != (char *) 0) + obstack_grow (&multilib_obstack, p, strlen (p)); + + obstack_1grow (&multilib_obstack, 0); + multilib_exclusions = obstack_finish (&multilib_obstack); + need_space = FALSE; for (i = 0; i < sizeof (multilib_defaults_raw) / sizeof (multilib_defaults_raw[0]); @@ -5929,23 +5938,82 @@ default_arg (p, len) return 0; } -/* Work out the subdirectory to use based on the - options. The format of multilib_select is a list of elements. - Each element is a subdirectory name followed by a list of options - followed by a semicolon. gcc will consider each line in turn. If - none of the options beginning with an exclamation point are - present, and all of the other options are present, that - subdirectory will be used. */ +/* Work out the subdirectory to use based on the options. The format of + multilib_select is a list of elements. Each element is a subdirectory + name followed by a list of options followed by a semicolon. The format + of multilib_exclusions is the same, but without the preceding + directory. First gcc will check the exclusions, if none of the options + beginning with an exclamation point are present, and all of the other + options are present, then we will ignore this completely. Passing + that, gcc will consider each multilib_select in turn using the same + rules for matching the options. If a match is found, that subdirectory + will be used. */ static void set_multilib_dir () { - char *p = multilib_select; + char *p; int this_path_len; char *this_path, *this_arg; int not_arg; int ok; + p = multilib_exclusions; + while (*p != '\0') + { + /* Ignore newlines. */ + if (*p == '\n') + { + ++p; + continue; + } + + /* Check the arguments. */ + ok = 1; + while (*p != ';') + { + if (*p == '\0') + abort (); + + if (! ok) + { + ++p; + continue; + } + + this_arg = p; + while (*p != ' ' && *p != ';') + { + if (*p == '\0') + abort (); + ++p; + } + + if (*this_arg != '!') + not_arg = 0; + else + { + not_arg = 1; + ++this_arg; + } + + ok = used_arg (this_arg, p - this_arg); + if (not_arg) + ok = ! ok; + + if (*p == ' ') + ++p; + } + + if (ok) + { + return; + } + + ++p; + } + + p = multilib_select; while (*p != '\0') { /* Ignore newlines. */ @@ -6037,7 +6105,8 @@ set_multilib_dir () matches. The options are print without a leading dash. There are no spaces to make it easy to use the information in the shell. Each subdirectory is printed only once. This assumes the ordering - generated by the genmultilib script. */ + generated by the genmultilib script. Also, we leave out ones that match + the exclusions. */ static void print_multilib_info () @@ -6049,6 +6118,7 @@ print_multilib_info () while (*p != '\0') { + skip = 0; /* Ignore newlines. */ if (*p == '\n') { @@ -6065,12 +6135,103 @@ print_multilib_info () ++p; } - /* If this is a duplicate, skip it. */ - skip = (last_path != 0 && p - this_path == last_path_len - && ! strncmp (last_path, this_path, last_path_len)); + /* Check for matches with the multilib_exclusions. We don't bother + with the '!' in either list. If any of the exclusion rules match + all of its options with the select rule, we skip it. */ + { + char *e = multilib_exclusions; + char *this_arg; + + while (*e != '\0') + { + int m = 1; + /* Ignore newlines. */ + if (*e == '\n') + { + ++e; + continue; + } + + /* Check the arguments. */ + while (*e != ';') + { + char *q; + int mp = 0; + + if (*e == '\0') + abort (); + + if (! m) + { + ++e; + continue; + } + + this_arg = e; + + while (*e != ' ' && *e != ';') + { + if (*e == '\0') + abort (); + ++e; + } + + q = p + 1; + while (*q != ';') + { + char *arg; + int len = e - this_arg; + + if (*q == '\0') + abort (); + + arg = q; + + while (*q != ' ' && *q != ';') + { + if (*q == '\0') + abort (); + ++q; + } - last_path = this_path; - last_path_len = p - this_path; + if (! strncmp(arg, this_arg, (len < q - arg) ? q - arg : len) || + default_arg(this_arg, e - this_arg)) + { + mp = 1; + break; + } + + if (*q == ' ') + ++q; + + } + + if (! mp) + m = 0; + + if (*e == ' ') + ++e; + } + if (m) + { + skip = 1; + break; + } + + if (*e != '\0') + ++e; + } + } + + if (! skip) + { + /* If this is a duplicate, skip it. */ + skip = (last_path != 0 && p - this_path == last_path_len + && ! strncmp (last_path, this_path, last_path_len)); + + last_path = this_path; + last_path_len = p - this_path; + } /* If this directory requires any default arguments, we can skip it. We will already have printed a directory identical to |