This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR36312
- From: Anthony Brandon <anthony dot brandon at gmail dot com>
- To: Manuel LÃpez-IbÃÃez <lopezibanez at gmail dot com>
- Cc: Eric Botcazou <ebotcazou at adacore dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>, "manu at gcc dot gnu dot org" <manu at gcc dot gnu dot org>, DJ Delorie <dj at redhat dot com>, janisjo at codesourcery dot com, mikestump at codesourcery dot com, ro at cebitec dot uni-bielefeld dot de, Ian Lance Taylor <iant at google dot com>
- Date: Thu, 6 Nov 2014 21:13:58 +0100
- Subject: Re: [PATCH] PR36312
- Authentication-results: sourceware.org; auth=none
- References: <CALsyMRhctts=EyJhTs4FWNQsKhGYodS_z2wkNBG8nrRyTA+wUg at mail dot gmail dot com> <CAESRpQB7HvOZCE9obhpHuqUj0D_EQPd09M88qJnyRYpidpp-gA at mail dot gmail dot com> <CALsyMRjEvPie12SysH+XtWeObpdDgPTBjj-s8iScMmRt8dtgAQ at mail dot gmail dot com> <2546530 dot ShneSiCpN4 at polaris> <CAESRpQDfSJgm3G9xriCVDgpP4XJYfdDzK1iUygm1SgAtU_S6TA at mail dot gmail dot com>
Sorry, I didn't realize the default didn't build all languages. I will
configure with --enable-languages=all from now on.
On Thu, Nov 6, 2014 at 1:26 AM, Manuel LÃpez-IbÃÃez
<lopezibanez@gmail.com> wrote:
> On 5 November 2014 21:57, Eric Botcazou <ebotcazou@adacore.com> wrote:
>>> 2014-10-25 Anthony Brandon <anthony.brandon@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.
--
Anthony