diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1996-03-24 07:28:21 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1996-03-24 07:28:21 -0500 |
commit | bb9da76848e29fe692ecc455db9cc5b2a94a67a6 (patch) | |
tree | 86453af677d78450537df2239aa1b8d7e28847a1 /gcc/gcc.c | |
parent | 4498659c93d3b347a8d34000c7371ef5facebab4 (diff) | |
download | gcc-bb9da76848e29fe692ecc455db9cc5b2a94a67a6.zip gcc-bb9da76848e29fe692ecc455db9cc5b2a94a67a6.tar.gz gcc-bb9da76848e29fe692ecc455db9cc5b2a94a67a6.tar.bz2 |
(process_command): Instead of hardcoding non-empty switches_need_spaces to turn on "o" and "L"...
(process_command): Instead of hardcoding non-empty
switches_need_spaces to turn on "o" and "L", make the string contain
the switches that need the spaces.
From-SVN: r11609
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -502,8 +502,8 @@ proper position among the other output files. */ "%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}" #endif -/* config.h can define SWITCHES_NEED_SPACES to control passing -o and -L. - Make the string nonempty to require spaces there. */ +/* config.h can define SWITCHES_NEED_SPACES to control which options + require spaces between the option and the argument. */ #ifndef SWITCHES_NEED_SPACES #define SWITCHES_NEED_SPACES "" #endif @@ -2946,11 +2946,15 @@ process_command (argc, argv) /* Null-terminate the vector. */ switches[n_switches].args[j] = 0; } - else if (*switches_need_spaces != 0 && (c == 'o' || c == 'L')) + else if (index (switches_need_spaces, c)) { - /* On some systems, ld cannot handle -o or -L without space. - So split the -o or -L from its argument. */ - switches[n_switches].part1 = (c == 'o' ? "o" : "L"); + /* On some systems, ld cannot handle some options without + a space. So split the option from its argument. */ + char *part1 = (char *) xmalloc (2); + part1[0] = c; + part1[1] = '\0'; + + switches[n_switches].part1 = part1; switches[n_switches].args = (char **) xmalloc (2 * sizeof (char *)); switches[n_switches].args[0] = xmalloc (strlen (p)); strcpy (switches[n_switches].args[0], &p[1]); |