From d313a1b6bc336a4061de1c19e9903daa125a6561 Mon Sep 17 00:00:00 2001 From: Vincent Celier Date: Fri, 23 May 2008 15:28:41 +0200 Subject: [PATCH] gnatlink.adb (Process_Args): Do not disable scanning of ALI file for back end switches when... 2008-05-23 Vincent Celier * 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= From-SVN: r135804 --- gcc/ada/gnat_ugn.texi | 6 +++++- gcc/ada/gnatlink.adb | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 4d9abacfa5f..a14afdeeb8c 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -8597,7 +8597,11 @@ use @code{foo -x -y} as your compiler. Note that switch @option{-c} is always 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 -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, diff --git a/gcc/ada/gnatlink.adb b/gcc/ada/gnatlink.adb index 3a1ef9b4dd7..256504bf6eb 100644 --- a/gcc/ada/gnatlink.adb +++ b/gcc/ada/gnatlink.adb @@ -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 -- 2.30.2