aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard@codesourcery.com>2007-04-26 07:15:41 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2007-04-26 07:15:41 +0000
commita0f8745469c6a00a25ad20aaac0d56aff2767776 (patch)
tree010c4663638f6a5bafb1150041a9a53385dc84a9 /gcc
parent289c40ed97f6048a9e17d592ba4eb165488cfb1d (diff)
downloadgcc-a0f8745469c6a00a25ad20aaac0d56aff2767776.zip
gcc-a0f8745469c6a00a25ad20aaac0d56aff2767776.tar.gz
gcc-a0f8745469c6a00a25ad20aaac0d56aff2767776.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/doc/invoke.texi13
-rw-r--r--gcc/gcc.c25
3 files changed, 47 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6ccb3e3..5dec375 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index fb96076..cc5feb9 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 3d826d9..1046802 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;
+}