Commit 26e0e97b by Iain Sandoe Committed by Iain Sandoe

Make the gcc-ar,nm, strip tools respond correctly to --help and --version

when there's no plugin built.

gcc/

	PR other/704
	* gcc-ar.c (main): Don’t try to invoke the plug-in if we’re not
	building it.

From-SVN: r263768
parent 7c1dcf50
2018-08-22 Iain Sandoe <iain@sandoe.co.uk> 2018-08-22 Iain Sandoe <iain@sandoe.co.uk>
PR other/704
* gcc-ar.c (main): Don’t try to invoke the plug-in if we’re not
building it.
2018-08-22 Iain Sandoe <iain@sandoe.co.uk>
* config/darwin10.h (LINK_GCC_C_SEQUENCE_SPEC): Adjust to use the * config/darwin10.h (LINK_GCC_C_SEQUENCE_SPEC): Adjust to use the
Darwin10-specific unwinder-shim. Darwin10-specific unwinder-shim.
* config/darwin12.h (LINK_GCC_C_SEQUENCE_SPEC): Remove. * config/darwin12.h (LINK_GCC_C_SEQUENCE_SPEC): Remove.
......
...@@ -126,7 +126,9 @@ int ...@@ -126,7 +126,9 @@ int
main (int ac, char **av) main (int ac, char **av)
{ {
const char *exe_name; const char *exe_name;
#if HAVE_LTO_PLUGIN > 0
char *plugin; char *plugin;
#endif
int k, status, err; int k, status, err;
const char *err_msg; const char *err_msg;
const char **nargv; const char **nargv;
...@@ -177,7 +179,7 @@ main (int ac, char **av) ...@@ -177,7 +179,7 @@ main (int ac, char **av)
break; break;
} }
#if HAVE_LTO_PLUGIN > 0
/* Find the GCC LTO plugin */ /* Find the GCC LTO plugin */
plugin = find_a_file (&target_path, LTOPLUGINSONAME, R_OK); plugin = find_a_file (&target_path, LTOPLUGINSONAME, R_OK);
if (!plugin) if (!plugin)
...@@ -185,6 +187,7 @@ main (int ac, char **av) ...@@ -185,6 +187,7 @@ main (int ac, char **av)
fprintf (stderr, "%s: Cannot find plugin '%s'\n", av[0], LTOPLUGINSONAME); fprintf (stderr, "%s: Cannot find plugin '%s'\n", av[0], LTOPLUGINSONAME);
exit (1); exit (1);
} }
#endif
/* Find the wrapped binutils program. */ /* Find the wrapped binutils program. */
exe_name = find_a_file (&target_path, PERSONALITY, X_OK); exe_name = find_a_file (&target_path, PERSONALITY, X_OK);
...@@ -203,9 +206,11 @@ main (int ac, char **av) ...@@ -203,9 +206,11 @@ main (int ac, char **av)
} }
} }
/* Create new command line with plugin */ /* Create new command line with plugin - if we have one, otherwise just
copy the command through. */
nargv = XCNEWVEC (const char *, ac + 4); nargv = XCNEWVEC (const char *, ac + 4);
nargv[0] = exe_name; nargv[0] = exe_name;
#if HAVE_LTO_PLUGIN > 0
nargv[1] = "--plugin"; nargv[1] = "--plugin";
nargv[2] = plugin; nargv[2] = plugin;
if (is_ar && av[1] && av[1][0] != '-') if (is_ar && av[1] && av[1][0] != '-')
...@@ -213,6 +218,13 @@ main (int ac, char **av) ...@@ -213,6 +218,13 @@ main (int ac, char **av)
for (k = 1; k < ac; k++) for (k = 1; k < ac; k++)
nargv[2 + k] = av[k]; nargv[2 + k] = av[k];
nargv[2 + k] = NULL; nargv[2 + k] = NULL;
#else
if (is_ar && av[1] && av[1][0] != '-')
av[1] = concat ("-", av[1], NULL);
for (k = 1; k < ac; k++)
nargv[k] = av[k];
nargv[k] = NULL;
#endif
/* Run utility */ /* Run utility */
/* ??? the const is misplaced in pex_one's argv? */ /* ??? the const is misplaced in pex_one's argv? */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment