This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Pass more options to the assembler.


The driver should pass -w, -I and -v to the gnu assembler. 

If the user requests -w (no warnings), then -W (no warnings) should be
passed to the assembler. The passing of -I options to the assembler
would allow .include and #include to share directories. Lastly, if the
compiler is being verbose, the assembler should list a version string,
so pass -v to the assembler aswell.

Tested on arm-none-eabi, and i686-pc-linux-gnu without regressions.

OK for mainline?

Cheers,
Carlos.
-- 
Carlos O'Donell
CodeSourcery
carlos@codesourcery.com
(650) 331-3385 x716

:ADDPATCH driver:

2007-08-01  Carlos O'Donell  <carlos@codesourcery.com>

	* configure.ac: Define HAVE_GNU_AS if $gas_flag is yes.
	* configure: Regenerate.
	* config.in: Regenerate.
	* gcc.c [HAVE_GNU_AS]: Add "%{v} %{w:-W} %{I*} " to asm_options
	spec string.

Index: configure.ac
===================================================================
--- configure.ac	(revision 127093)
+++ configure.ac	(working copy)
@@ -246,6 +246,9 @@ if test x"${DEFAULT_ASSEMBLER+set}" = x"
 	[Define to enable the use of a default assembler.])
 fi
 
+gnu_as=`if test x"$gas_flag" = x"yes"; then echo 1; else echo 0; fi`
+AC_DEFINE_UNQUOTED(HAVE_GNU_AS, $gnu_as, [Define if using GNU as.])
+
 AC_MSG_CHECKING([whether a default assembler was specified])
 if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then
   if test x"$gas_flag" = x"no"; then
Index: gcc.c
===================================================================
--- gcc.c	(revision 127093)
+++ gcc.c	(working copy)
@@ -824,8 +824,13 @@ static const char *cc1_options =
  %{coverage:-fprofile-arcs -ftest-coverage}";
 
 static const char *asm_options =
-"%{ftarget-help:%:print-asm-header()} \
-%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";
+"%{--target-help:%:print-asm-header()} "
+#if HAVE_GNU_AS
+/* If GNU AS is used, then convert -w (no warnings), -I, and -v
+   to the assembler equivalents.  */
+"%{v} %{w:-W} %{I*} "
+#endif
+"%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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]