From a0f8745469c6a00a25ad20aaac0d56aff2767776 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 26 Apr 2007 07:15:41 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 10 ++++++++++ gcc/doc/invoke.texi | 13 +++++++++++++ gcc/gcc.c | 25 ++++++++++++++++++++++++- 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6ccb3e3db31..5dec3751ec0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2007-04-26 Richard Sandiford + + 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 PR target/31403 diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index fb960760562..cc5feb9c8fb 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -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}@} diff --git a/gcc/gcc.c b/gcc/gcc.c index 3d826d94d68..10468026939 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -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; +} -- 2.30.2