From patchwork Wed Aug 13 05:14:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yaakov Selkowitz X-Patchwork-Id: 35326 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C4997203C5 for ; Wed, 13 Aug 2014 05:15:09 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id fp1sf71373268pdb.1 for ; Tue, 12 Aug 2014 22:15:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:message-id:date:from:user-agent:mime-version:to :subject:x-original-sender:x-original-authentication-results :content-type; bh=gQxnlPMCySz5pRyEc+N1VVZ7xt7DsiHnfPD3fZH7g3o=; b=fyIw9qO3Q7NJJ65XWTUPNByaL1efnaq6WdvRdRwyK0qK/PujYMtS4CsBDpSdDvMnMJ xw9tGjxH/onc7dOxQfnrDH9cWO2ZaHXScvyloyDQro9NzakiAdXPiXpqKo03V/tOxVEA X1uz9yVebi/6nncYWIk1GXsTvzd6AoxBDbT/lHtxfpyT0oS3Cx5LtsPt24kaKDMP7eM/ G2wTkQjXdp3x/aZC/enBElfTriyGrlBO8STSJOs/QTzpe5s7U6hqr6r9OORlVL7ecqMf DxGs4um9cDcyeY6K2iQhg111K+3UjlKsYpmziABaOy0BNkkuwl3yAs6EGvz/0jfgpykz 47Yg== X-Gm-Message-State: ALoCoQkLgysOWsh8c8nDjsqo6Rjx+m0v3ZCxcjK3X+HXZHnPWe7WFdt5DFCkuH+kInUTegpj01lw X-Received: by 10.66.193.227 with SMTP id hr3mr1451438pac.0.1407906909082; Tue, 12 Aug 2014 22:15:09 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.101.210 with SMTP id u76ls392653qge.62.gmail; Tue, 12 Aug 2014 22:15:09 -0700 (PDT) X-Received: by 10.52.35.81 with SMTP id f17mr1423101vdj.13.1407906908949; Tue, 12 Aug 2014 22:15:08 -0700 (PDT) Received: from mail-vc0-x22d.google.com (mail-vc0-x22d.google.com [2607:f8b0:400c:c03::22d]) by mx.google.com with ESMTPS id p1si474327vcr.40.2014.08.12.22.15.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Aug 2014 22:15:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::22d as permitted sender) client-ip=2607:f8b0:400c:c03::22d; Received: by mail-vc0-f173.google.com with SMTP id hy10so14434801vcb.18 for ; Tue, 12 Aug 2014 22:15:08 -0700 (PDT) X-Received: by 10.52.136.196 with SMTP id qc4mr1481487vdb.22.1407906908850; Tue, 12 Aug 2014 22:15:08 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp302258vcb; Tue, 12 Aug 2014 22:15:07 -0700 (PDT) X-Received: by 10.66.124.226 with SMTP id ml2mr484672pab.142.1407906907083; Tue, 12 Aug 2014 22:15:07 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id mk5si634180pab.93.2014.08.12.22.15.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Aug 2014 22:15:07 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-375039-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 2925 invoked by alias); 13 Aug 2014 05:14:54 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 2910 invoked by uid 89); 13 Aug 2014 05:14:53 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 13 Aug 2014 05:14:52 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7D5EoC7008706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 13 Aug 2014 01:14:51 -0400 Received: from [10.3.113.59] (ovpn-113-59.phx2.redhat.com [10.3.113.59]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7D5Engg002518 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Wed, 13 Aug 2014 01:14:50 -0400 Message-ID: <53EAF450.3070600@redhat.com> Date: Wed, 13 Aug 2014 00:14:56 -0500 From: Yaakov Selkowitz User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Gcc Patch List Subject: [PATCH] cygwin: fix --tsaware, add --large-address-aware X-Original-Sender: yselkowi@redhat.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::22d as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 This patch fixes two issues with LINK_SPEC on Cygwin targets: 1) --tsaware makes sense only for EXEs, not DLLs. 2) Under WoW64 (32-bit Cygwin on 64-bit Windows), Cygwin applications can access up to 4 GiB of address space (for DLLs, Cygwin heap, mmap()s, etc.) if they are linked with --large-address-aware. Because of how Cygwin implements fork(), the ability to use this extra space is a huge benefit. This flag too is only for EXEs, not DLLs. Patch attached. Index: gcc/config/i386/cygwin-w64.h =================================================================== --- gcc/config/i386/cygwin-w64.h (revision 213759) +++ gcc/config/i386/cygwin-w64.h (working copy) @@ -66,7 +66,8 @@ %{static:-Bstatic} %{!static:-Bdynamic} \ %{shared|mdll: " SUB_LINK_ENTRY " --enable-auto-image-base} \ %(shared_libgcc_undefs) \ - --dll-search-prefix=cyg -tsaware" + --dll-search-prefix=cyg \ + %{!shared: %{!mdll: %{" SPEC_32 ":--large-address-aware} --tsaware}}" /* Cygwin64 will have a 64-bit long type. */ #undef LONG_TYPE_SIZE Index: gcc/config/i386/cygwin.h =================================================================== --- gcc/config/i386/cygwin.h (revision 213759) +++ gcc/config/i386/cygwin.h (working copy) @@ -120,7 +120,8 @@ %{shared: --shared} %{mdll:--dll} \ %{static:-Bstatic} %{!static:-Bdynamic} \ %{shared|mdll: --enable-auto-image-base -e __cygwin_dll_entry@12} \ - --dll-search-prefix=cyg -tsaware" + --dll-search-prefix=cyg \ + %{!shared: %{!mdll: --large-address-aware --tsaware}}" /* Binutils does not handle weak symbols from dlls correctly. For now, do not use them unnecessarily in gthr-posix.h. */