On 5 November 2014 21:57, Eric Botcazou <ebotca...@adacore.com> wrote:
>> 2014-10-25  Anthony Brandon  <anthony.bran...@gmail.com>
>>
>>     PR driver/36312
>>     * diagnostic-core.h: Add prototype for fatal_error.
>>     * diagnostic.c (fatal_error): New function fatal_error.
>>     * gcc.c (store_arg): Remove have_o_argbuf_index.
>>     (process_command): Check if input and output files are the same.
>>     * toplev.c (init_asm_output): Check if input and output files are the
>> same.
>
> This breaks the build of the shared Ada library:

It seems the driver adds as input files all the flags passed to the
linker, things such as "-lm", "-soname" and "libgnat-5.0.so". Very
intuitive, not. At least these fake files are marked with '*', so the
following on top of the patch should work:

Index: gcc.c
===================================================================
--- gcc.c       (revision 217149)
+++ gcc.c       (working copy)
@@ -4051,11 +4051,12 @@ process_command (unsigned int decoded_op

   if (output_file && strcmp (output_file, "-"))
     {
       int i;
       for (i = 0; i < n_infiles; i++)
-       if (canonical_filename_eq (infiles[i].name, output_file))
+       if (infiles[i].language && infiles[i].language[0] != '*'
+           && canonical_filename_eq (infiles[i].name, output_file))
          fatal_error ("output file %s is the same as input file", output_file);
     }

   /* If -save-temps=obj and -o name, create the prefix to use for %b.
      Otherwise just make -save-temps=obj the same as -save-temps=cwd.  */

Testing now.

Cheers,

Manuel.

Reply via email to