From patchwork Fri Aug 15 04:27:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yaakov Selkowitz X-Patchwork-Id: 35422 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D36DF202E4 for ; Fri, 15 Aug 2014 04:28:14 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id le20sf5527984vcb.1 for ; Thu, 14 Aug 2014 21:28:14 -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=2k3VqPDW106RVaM7XK4yBNZfyWvS5SO/EhBuvTDJ6qU=; b=Q6JwLGVWZUcEdLI+MwwWy68rj1j/pffN82sd9Qo8KP7ZWR4+ggVWDL8ZScO2H1VXtD jdIPe1r5GKNo7W2oBh9R+Xveog0T7/IqFfeSLGlpNH9oEXrMrT91mbMLOvFS0hS4381P 07s4FT1BR73JP5szklzS0u1Y/Pr5x5DhG0SgNXPJle891toK+gK7foMUIjn2tS2MbRCd 9GKO83hH+GZVphrUtxvt++UFtZqxaENtXeLR1oxY1Sav3v6jjH2rM2BR/0gFkfBlnN16 YdQ/xIlAO/Vi/L/iI3kQdqEUeGkh96TmxYhlwXj4g2kpo/ngQURCQAGaPR4+nJQ8Lo65 btpg== X-Gm-Message-State: ALoCoQmcjQ6EIAm9sZROmpu9EueOuh+b/CaOrLBmc+0UIGc3wNRPcWlypROjRlZEs3EFFqQaiLKD X-Received: by 10.236.15.167 with SMTP id f27mr4842666yhf.37.1408076894533; Thu, 14 Aug 2014 21:28:14 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.202 with SMTP id w68ls1292194qge.4.gmail; Thu, 14 Aug 2014 21:28:14 -0700 (PDT) X-Received: by 10.224.127.133 with SMTP id g5mr19031246qas.67.1408076894449; Thu, 14 Aug 2014 21:28:14 -0700 (PDT) Received: from mail-vc0-x22a.google.com (mail-vc0-x22a.google.com [2607:f8b0:400c:c03::22a]) by mx.google.com with ESMTPS id j107si10449832qge.8.2014.08.14.21.28.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Aug 2014 21:28:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::22a as permitted sender) client-ip=2607:f8b0:400c:c03::22a; Received: by mail-vc0-f170.google.com with SMTP id lf12so2492579vcb.29 for ; Thu, 14 Aug 2014 21:28:14 -0700 (PDT) X-Received: by 10.52.27.16 with SMTP id p16mr216160vdg.14.1408076894205; Thu, 14 Aug 2014 21:28:14 -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 tc5csp84969vcb; Thu, 14 Aug 2014 21:28:13 -0700 (PDT) X-Received: by 10.68.239.201 with SMTP id vu9mr9077396pbc.35.1408076892931; Thu, 14 Aug 2014 21:28:12 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id eb5si6495484pbc.89.2014.08.14.21.28.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Aug 2014 21:28:12 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-375333-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 16941 invoked by alias); 15 Aug 2014 04:27:59 -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 16929 invoked by uid 89); 15 Aug 2014 04:27:58 -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; Fri, 15 Aug 2014 04:27:56 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7F4RsR9012049 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 15 Aug 2014 00:27:55 -0400 Received: from [10.10.116.31] ([10.10.116.31]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7F4Rr1J021003 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Fri, 15 Aug 2014 00:27:54 -0400 Message-ID: <53ED8C48.8000805@redhat.com> Date: Thu, 14 Aug 2014 23:27:52 -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: accept -pthread 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::22a 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 The attached patch enables the -pthread flag for cygwin targets. While not strictly necessary for compiling or linking with pthread or _r functions on Cygwin, accepting it allows for better compatibility with other platforms. Index: gcc/config.gcc =================================================================== --- gcc/config.gcc (revision 213759) +++ gcc/config.gcc (working copy) @@ -1568,7 +1568,7 @@ xm_file=i386/xm-cygwin.h tmake_file="${tmake_file} i386/t-cygming t-slibgcc" target_gtfiles="\$(srcdir)/config/i386/winnt.c" - extra_options="${extra_options} i386/cygming.opt" + extra_options="${extra_options} i386/cygming.opt i386/cygwin.opt" extra_objs="winnt.o winnt-stubs.o" c_target_objs="${c_target_objs} msformat-c.o" cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o" @@ -1584,7 +1584,7 @@ xm_file=i386/xm-cygwin.h tmake_file="${tmake_file} i386/t-cygming t-slibgcc i386/t-cygwin-w64" target_gtfiles="\$(srcdir)/config/i386/winnt.c" - extra_options="${extra_options} i386/cygming.opt" + extra_options="${extra_options} i386/cygming.opt i386/cygwin.opt" extra_objs="winnt.o winnt-stubs.o" c_target_objs="${c_target_objs} msformat-c.o" cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o" Index: gcc/config/i386/cygwin.h =================================================================== --- gcc/config/i386/cygwin.h (revision 213759) +++ gcc/config/i386/cygwin.h (working copy) @@ -32,6 +32,7 @@ #undef CPP_SPEC #define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} \ %{!ansi:-Dunix} \ + %{pthread:-D_REENTRANT} \ %{mwin32:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ %{!ansi:-DWINNT}} \ %{!nostdinc:%{!mno-win32:-idirafter ../include/w32api%s -idirafter ../../include/w32api%s}}\ " @@ -77,6 +77,7 @@ #undef LIB_SPEC #define LIB_SPEC "\ %{pg:-lgmon} \ + %{pthread: } \ -lcygwin \ %{mwindows:-lgdi32 -lcomdlg32} \ -ladvapi32 -lshell32 -luser32 -lkernel32" @@ -129,7 +131,7 @@ /* Every program on cygwin links against cygwin1.dll which contains the pthread routines. There is no need to explicitly link them - and the -pthread flag is not recognized. */ + and the -pthread flag is accepted only for compatibility. */ #undef GOMP_SELF_SPECS #define GOMP_SELF_SPECS "" #undef GTM_SELF_SPECS Index: gcc/config/i386/cygwin.opt =================================================================== --- gcc/config/i386/cygwin.opt (revision 0) +++ gcc/config/i386/cygwin.opt (working copy) @@ -0,0 +1,24 @@ +; Cygwin-specific options. + +; Copyright (C) 2013-2014 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 3, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +; for more details. +; +; You should have received a copy of the GNU General Public License +; along with GCC; see the file COPYING3. If not see +; . + +pthread +Driver + +; Retain blank line above