* [PATCH] Pass more options to the assembler.
@ 2007-08-01 17:51 Carlos O'Donell
2007-08-06 3:16 ` Mark Mitchell
0 siblings, 1 reply; 2+ messages in thread
From: Carlos O'Donell @ 2007-08-01 17:51 UTC (permalink / raw)
To: gcc-patches
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Pass more options to the assembler.
2007-08-01 17:51 [PATCH] Pass more options to the assembler Carlos O'Donell
@ 2007-08-06 3:16 ` Mark Mitchell
0 siblings, 0 replies; 2+ messages in thread
From: Mark Mitchell @ 2007-08-06 3:16 UTC (permalink / raw)
To: Carlos O'Donell; +Cc: gcc-patches
Carlos O'Donell wrote:
> 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?
OK.
(It would have been helpful to other readers if you had noted that this
is only done when the assembler is GAS; obviously, for other assemblers,
you cannot make the same kinds of assumptions about flags.)
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-08-06 3:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-01 17:51 [PATCH] Pass more options to the assembler Carlos O'Donell
2007-08-06 3:16 ` Mark Mitchell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).