http://gcc.gnu.org/bugzilla/show_bug.cgi?id=864

Dave Korn <davek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #20 from Dave Korn <davek at gcc dot gnu.org> 2011-12-07 00:42:31 
UTC ---
And re-reopened.  In the patch applied at comment 10, this code from
Program_Name ...

      if End_Of_Prefix > 1 then
         Start_Of_Suffix := End_Of_Prefix + Prog'Length + 1;
      end if;

... means that it only recognizes a suffix if there is also a prefix, i.e. it
only works for cross-compilers.  The documentation suggests this is deliberate:

   function Program_Name (Nam : String; Prog : String) return String_Access;
   --  In the native compilation case, Create a string containing Nam. In the
   --  cross compilation case, looks at the prefix of the current program being
   --  run and prepend it to Nam. For instance if the program being run is
   --  <target>-gnatmake and Nam is "gcc", the returned value will be a pointer
   --  to "<target>-gcc". In the specific case where AAMP_On_Target is set, the
   --  name "gcc" is mapped to "gnaamp", and names of the form "gnat*" are
   --  mapped to "gnaamp*". This function clobbers Name_Buffer and Name_Len.
   --  Also look at any suffix, e.g. gnatmake-4.1 -> "gcc-4.1". Prog is the
   --  default name of the current program being executed, e.g. "gnatmake",
   --  "gnatlink".

... but why?  The native behaviour is wrong and it seems incorrect to me that
it should have different semantics from the cross-compiler case.

I would also very much like to see the patch in comment 16 applied.  There is
now a second report open at bug 51095, I will mark it as a dup.  Are there
copyright or licensing reasons why it would have to be submitted by RG, or does
posting it in BZ count as an assignment?

Reply via email to