From patchwork Thu Nov 6 00:26:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TWFudWVsIEzDs3Blei1JYsOhw7Fleg==?= X-Patchwork-Id: 407218 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 92ECE14007D for ; Thu, 6 Nov 2014 11:26:34 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; q=dns; s=default; b=jRITRekoqws6nru bxyIRY6ugfYfBSMBAp4PSaJ1KyXGewF6iWqhzTK5znZgpkz7g9UKwGQSLR8jRh5c J9eCGStCSeZWx0t9fl2FMHGrMs+9vGuW0LXEfoHMawuoHh5TBfZHgonKlpg0zs9c Op0gidDHkpUctpil11/iq/Y8JAZo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; s=default; bh=IG1xhvL4Gzn6I9GGPNbF5 Sekk00=; b=wjHnBpB4qAL8juQppS9giE2yXyzLe9GbPJYkP5ayoau3mNYmIwnLL QS830nkMMVqfB8IAfzJ6G8IE7cFmYnFW7CV+F4s6+eDGBwwQ425o82v6xTeJZCxV tioAx+64uIDeF3otGmeEXgEBbZxPFtUlYAGp119fHjp5u9RwAUT5Yk= Received: (qmail 27307 invoked by alias); 6 Nov 2014 00:26:27 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 27293 invoked by uid 89); 6 Nov 2014 00:26:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-wg0-f44.google.com Received: from mail-wg0-f44.google.com (HELO mail-wg0-f44.google.com) (74.125.82.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 06 Nov 2014 00:26:26 +0000 Received: by mail-wg0-f44.google.com with SMTP id x12so2210192wgg.3 for ; Wed, 05 Nov 2014 16:26:22 -0800 (PST) X-Received: by 10.180.73.7 with SMTP id h7mr36426752wiv.83.1415233582812; Wed, 05 Nov 2014 16:26:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.217.80.73 with HTTP; Wed, 5 Nov 2014 16:26:02 -0800 (PST) In-Reply-To: <2546530.ShneSiCpN4@polaris> References: <2546530.ShneSiCpN4@polaris> From: =?ISO-8859-1?Q?Manuel_L=F3pez=2DIb=E1=F1ez?= Date: Thu, 6 Nov 2014 01:26:02 +0100 Message-ID: Subject: Re: [PATCH] PR36312 To: Eric Botcazou Cc: Anthony Brandon , Gcc Patch List , "manu@gcc.gnu.org" , DJ Delorie , janisjo@codesourcery.com, mikestump@codesourcery.com, ro@cebitec.uni-bielefeld.de, Ian Lance Taylor On 5 November 2014 21:57, Eric Botcazou wrote: >> 2014-10-25 Anthony Brandon >> >> 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: Testing now. Cheers, Manuel. 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. */