public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] gnatlink "--GCC=gcc -xxx"
@ 2008-05-23 14:07 Arnaud Charlet
  0 siblings, 0 replies; only message in thread
From: Arnaud Charlet @ 2008-05-23 14:07 UTC (permalink / raw)
  To: gcc-patches; +Cc: Vincent Celier

[-- Attachment #1: Type: text/plain, Size: 871 bytes --]

When gnatlink was invoked with --GCC= that specified the expected
executable (gcc or <prefix>-gcc) with additional switches, the scanning
of the ALI file to get the back end switches was inhibited. This patch
corrects this: the scanning of the ALI file occurs.

The test for this is to invoke gnatlink with "--GCC=gcc -gnatv" -v and
to check that the binder generated source is compiled with the back end
switches from the ALI file (such as -O2).

Tested on i686-pc-linux-gnu, committed on trunk

2008-05-23  Vincent Celier  <celier@adacore.com>

	* gnatlink.adb (Process_Args): Do not disable scanning of ALI file for
	back end switches when executable specified with --GCC= is same as
	default, even if there are additional options.

	* gnat_ugn.texi:
	Document when the back end switches from the ALI file are taken into
	account when gnatlink is invoked with --GCC=


[-- Attachment #2: difs --]
[-- Type: text/plain, Size: 1754 bytes --]

Index: gnat_ugn.texi
===================================================================
--- gnat_ugn.texi	(revision 135797)
+++ gnat_ugn.texi	(working copy)
@@ -8597,7 +8597,11 @@ use @code{foo -x -y} as your compiler. N
 inserted after your command name. Thus in the above example the compiler
 command that will be used by @command{gnatlink} will be @code{foo -c -x -y}.
 A limitation of this syntax is that the name and path name of the executable
-itself must not include any embedded spaces. If several
+itself must not include any embedded spaces. If the compiler executable is
+different from the default one (gcc or <prefix>-gcc), then the back-end
+switches in the ALI file are not used to compile the binder generated source.
+For example, this is the case with @option{--GCC="foo -x -y"}. But the back end
+switches will be used for @option{--GCC="gcc -gnatv"}. If several
 @option{--GCC=compiler_name} are used, only the last @var{compiler_name}
 is taken into account. However, all the additional switches are also taken
 into account. Thus,
Index: gnatlink.adb
===================================================================
--- gnatlink.adb	(revision 135797)
+++ gnatlink.adb	(working copy)
@@ -521,8 +521,10 @@ procedure Gnatlink is
                                                  (Arg (7 .. Arg'Last));
 
                   begin
-                     Gcc := new String'(Program_Args.all (1).all);
-                     Standard_Gcc := False;
+                     if Program_Args.all (1).all /= Gcc.all then
+                        Gcc := new String'(Program_Args.all (1).all);
+                        Standard_Gcc := False;
+                     end if;
 
                      --  Set appropriate flags for switches passed
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-23 13:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-23 14:07 [Ada] gnatlink "--GCC=gcc -xxx" Arnaud Charlet

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).