From patchwork Thu Nov 29 10:12:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 202694 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]) by ozlabs.org (Postfix) with SMTP id 892972C008F for ; Thu, 29 Nov 2012 21:13:03 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1354788783; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=opDH6XM 8jEn3kr+UsYTSPV7N4xI=; b=FOvLTndxDTqapFxmC/ORH8xRY+2HK6DTdOwdyBU Flt++FYSJl1QE53+DLqe9+w+OUOIiPsQObhSpAm4xS9syKMneTNnAdmWydk6w4kZ FX7YbGhuJN5oEGAqq9qWsO+RwNalNvgfLwlhZ/8HCoo4QLPlYqaeDVtSdlLJIlem o4u8= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=V0bBul8vAZwY7bPXhK/q5wHPm6m8h5qKfzdSj1zKRW4lG1n6UdVhfaNG00GZhl yS1OUkR/krLL1zM76SuCoYu5ke1fXemmZhSOY6eJuHSakkI2Yc6na0oMtUQ+IMhO s1J1rFdgly1djrJ3zagUWu1AkgmHfo/D9G/AYtnMqs2qc=; Received: (qmail 13003 invoked by alias); 29 Nov 2012 10:12:56 -0000 Received: (qmail 12990 invoked by uid 22791); 29 Nov 2012 10:12:55 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL, BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, KHOP_RCVD_TRUST, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_LG X-Spam-Check-By: sourceware.org Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Nov 2012 10:12:49 +0000 Received: by mail-wg0-f51.google.com with SMTP id ei8so5308905wgb.8 for ; Thu, 29 Nov 2012 02:12:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.180.14.162 with SMTP id q2mr37542662wic.21.1354183968406; Thu, 29 Nov 2012 02:12:48 -0800 (PST) Received: by 10.216.153.132 with HTTP; Thu, 29 Nov 2012 02:12:48 -0800 (PST) Date: Thu, 29 Nov 2012 11:12:48 +0100 Message-ID: Subject: [patch mingw]: Cleanup about static/shared libgcc From: Kai Tietz To: GCC Patches X-IsSubscribed: yes 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 Hi, this patch synchronize handling - and fixes latent bug - of static/shared flags with cygwin-host. in static case prior code added to linker-script reference to shared libgcc, which is obviously wrong. Due link-order the shared version doesn't get actual linked, but nevertheless there is a latent issue. ChangeLog 2012-11-29 Kai Tietz * config/i386/mingw32.h (SHARED_LIBGCC_SPEC): Synchronize with cygwin-host. Tested for i686-w64-mingw32, and x86_64-w64-mingw32. I will apply tomorrow if there aren't any objections. Regards, Kai #undef STARTFILE_SPEC Index: mingw32.h =================================================================== --- mingw32.h (Revision 193925) +++ mingw32.h (Arbeitskopie) @@ -121,15 +121,24 @@ /* Include in the mingw32 libraries with libgcc */ #ifdef ENABLE_SHARED_LIBGCC -#define SHARED_LIBGCC_SPEC "%{shared-libgcc:-lgcc_s} %{!shared-libgcc:-lgcc_eh}" +#define SHARED_LIBGCC_SPEC " \ + %{static|static-libgcc:-lgcc -lgcc_eh} \ + %{!static: \ + %{!static-libgcc: \ + %{!shared: \ + %{!shared-libgcc:-lgcc -lgcc_eh} \ + %{shared-libgcc:-lgcc_s -lgcc} \ + } \ + %{shared:-lgcc_s -lgcc} \ + } \ + } " #else -#define SHARED_LIBGCC_SPEC /*empty*/ +#define SHARED_LIBGCC_SPEC " -lgcc " #endif #undef REAL_LIBGCC_SPEC #define REAL_LIBGCC_SPEC \ "%{mthreads:-lmingwthrd} -lmingw32 \ "SHARED_LIBGCC_SPEC" \ - -lgcc \ -lmoldname -lmingwex -lmsvcrt"