re PR driver/31107 (--target-help doesn't say which options are compiler, assembler or linker options)

gcc/
	PR driver/31107
	* doc/invoke.texi (%:print-asm-header): Document.
	* gcc.c (asm_options): Use %:print-asm-header() for --target-help
	and -ftarget-help.
	(static_spec_functions): Add print-asm-header.
	(main): Print a banner before the --target-help linker options.
	(print_asm_header_spec_function): New function.

From-SVN: r124175
This commit is contained in:
Richard Sandiford 2007-04-26 07:15:41 +00:00 committed by Richard Sandiford
parent 289c40ed97
commit a0f8745469
3 changed files with 47 additions and 1 deletions

View File

@ -1,3 +1,13 @@
2007-04-26 Richard Sandiford <richard@codesourcery.com>
PR driver/31107
* doc/invoke.texi (%:print-asm-header): Document.
* gcc.c (asm_options): Use %:print-asm-header() for --target-help
and -ftarget-help.
(static_spec_functions): Add print-asm-header.
(main): Print a banner before the --target-help linker options.
(print_asm_header_spec_function): New function.
2007-04-25 Kaz Kojima <kkojima@gcc.gnu.org>
PR target/31403

View File

@ -7663,6 +7663,19 @@ is a small example of its usage:
%@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
@end smallexample
@item @code{print-asm-header}
The @code{print-asm-header} function takes no arguments and simply
prints a banner like:
@smallexample
Assember options
================
Use "-Wa,OPTION" to pass "OPTION" to the assembler.
@end smallexample
It is used to separate compiler options from assembler options
in the @option{--target-help} output.
@end table
@item %@{@code{S}@}

View File

@ -361,6 +361,7 @@ static const char *if_exists_else_spec_function (int, const char **);
static const char *replace_outfile_spec_function (int, const char **);
static const char *version_compare_spec_function (int, const char **);
static const char *include_spec_function (int, const char **);
static const char *print_asm_header_spec_function (int, const char **);
/* The Specs Language
@ -821,7 +822,8 @@ static const char *cc1_options =
%{coverage:-fprofile-arcs -ftest-coverage}";
static const char *asm_options =
"%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";
"%{ftarget-help:%:print-asm-header()} \
%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";
static const char *invoke_as =
#ifdef AS_NEEDS_DASH_FOR_PIPED_INPUT
@ -1617,6 +1619,7 @@ static const struct spec_function static_spec_functions[] =
{ "replace-outfile", replace_outfile_spec_function },
{ "version-compare", version_compare_spec_function },
{ "include", include_spec_function },
{ "print-asm-header", print_asm_header_spec_function },
#ifdef EXTRA_SPEC_FUNCTIONS
EXTRA_SPEC_FUNCTIONS
#endif
@ -6708,6 +6711,13 @@ main (int argc, char **argv)
putenv_from_prefixes (&exec_prefixes, "COMPILER_PATH", false);
putenv_from_prefixes (&startfile_prefixes, LIBRARY_PATH_ENV, true);
if (print_subprocess_help == 1)
{
printf (_("\nLinker options\n==============\n\n"));
printf (_("Use \"-Wl,OPTION\" to pass \"OPTION\""
" to the linker.\n\n"));
fflush (stdout);
}
value = do_spec (link_command_spec);
if (value < 0)
error_count = 1;
@ -7883,3 +7893,16 @@ include_spec_function (int argc, const char **argv)
return NULL;
}
/* %:print-asm-header spec function. Print a banner to say that the
following output is from the assembler. */
static const char *
print_asm_header_spec_function (int arg ATTRIBUTE_UNUSED,
const char **argv ATTRIBUTE_UNUSED)
{
printf (_("Assember options\n================\n\n"));
printf (_("Use \"-Wa,OPTION\" to pass \"OPTION\" to the assembler.\n\n"));
fflush (stdout);
return NULL;
}