From patchwork Mon Jul 15 01:15:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Yong <10walls@gmail.com> X-Patchwork-Id: 258921 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id D1F3A2C00DB for ; Mon, 15 Jul 2013 11:16:31 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=uTtjx8b89M9EPRPpi puFMfnxgqi6qTg3i3Jr0lFzHihUh1rZwPf0FQCa97Q6P7OY9X6YHxlU8yo8AP+kn qmbZZvylWnGDnNcuDYoFzK2fwMG64dHm2XQGhIxvdGf5XLQVu/8SW5/LdYvICB28 3pVL7BOxEq1Ueev0ITZaWjA7Uo= 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=b6eLST53EdItwFKl627HKzX Fz+o=; b=lVtNyPsYsb/h5yAevzKVOlcemlqZmUMBxRhJ1xYTR6C7xzUqD2h/M1E TiiPfybBKpQRmNFwdWBoQoLSmsOsSmSmaz8UDQkneYvmAhdHIiZCuQEKqo1HjQ5y ekznGGjp2XK7erd0RRfZfAoq5ORXCmO+GGQO5A1ngQ0ZD9q6xeqI= Received: (qmail 5831 invoked by alias); 15 Jul 2013 01:16:15 -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 5787 invoked by uid 89); 15 Jul 2013 01:16:14 -0000 X-Spam-SWARE-Status: No, score=-4.5 required=5.0 tests=AWL, BAYES_50, FREEMAIL_FROM, KHOP_PGP_SIGNED, KHOP_THREADED, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_YE, RDNS_NONE, SPF_PASS, TW_LG autolearn=no version=3.3.1 Received: from Unknown (HELO mail-pd0-f171.google.com) (209.85.192.171) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 15 Jul 2013 01:16:13 +0000 Received: by mail-pd0-f171.google.com with SMTP id y14so10166317pdi.30 for ; Sun, 14 Jul 2013 18:16:06 -0700 (PDT) X-Received: by 10.68.234.8 with SMTP id ua8mr51697378pbc.36.1373850966524; Sun, 14 Jul 2013 18:16:06 -0700 (PDT) Received: from [219.92.172.116] (swz-172-116.tm.net.my. [219.92.172.116]) by mx.google.com with ESMTPSA id kc8sm57745093pbc.18.2013.07.14.18.16.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 14 Jul 2013 18:16:05 -0700 (PDT) Message-ID: <51E34D4F.20105@gmail.com> Date: Mon, 15 Jul 2013 09:15:59 +0800 From: JonY <10walls@gmail.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: Kai Tietz CC: Gcc Patch List , "Yaakov (Cygwin/X)" , Dave Korn Subject: Re: Minor Cygwin patches References: <51DD56E7.6040203@gmail.com> <51E21030.1070200@gmail.com> In-Reply-To: X-Virus-Found: No On 7/15/2013 06:02, Kai Tietz wrote: > 2013/7/13 JonY <10walls@gmail.com>: >> On 7/10/2013 20:43, JonY wrote: >>> Hi, >>> >>> Attached are some minor patches, comments? >>> >> >> Kai, ping? > > > Please sent each patch as separate mail, and please add ChangeLogs for > them too. Additionally it would be fine to read some lines about > cause for those patches. > > Kai > This patch makes gcc accept -pthread and -rdynamic for compatibility with Linux. Add --large-address-aware, and use --tsaware, only with EXEs. Changelog 2013-03-08 Dave Korn * (gcc/config.gcc): Include Cygwin specific file. * (gcc/config/i386/cygwin.h): Link shared libgcc by default. * (gcc/config/i386/cygwin.h): Add --large-address-aware, and use --tsaware for exes * (gcc/config/i386/cygwin.h): Add -pthreads, -rdynamic stubs. * (gcc/config/i386/cygwin.opt): New file. Accept -pthread and -rdynamic for compatibility with Linux. Add --large-address-aware, and use --tsaware, only with EXEs. --- origsrc/gcc-4.7.2/gcc/config.gcc 2012-09-12 04:03:54.000000000 -0500 +++ src/gcc-4.7.2/gcc/config.gcc 2013-03-11 03:41:03.674656700 -0500 @@ -1417,7 +1417,7 @@ i[34567]86-*-cygwin*) 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" --- origsrc/gcc-4.7.2/gcc/config/i386/cygwin.h 2012-02-13 15:46:38.000000000 -0600 +++ src/gcc-4.7.2/gcc/config/i386/cygwin.h 2013-03-06 00:13:25.986558800 -0600 @@ -22,7 +22,7 @@ along with GCC; see the file COPYING3. #define EXTRA_OS_CPP_BUILTINS() /* Nothing. */ #undef CPP_SPEC -#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} \ +#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{pthread: } \ -D__CYGWIN32__ -D__CYGWIN__ %{!ansi:-Dunix} -D__unix__ -D__unix \ %{mwin32:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ %{!ansi:-DWINNT}} \ %{!nostdinc:%{!mno-win32:-idirafter ../include/w32api%s -idirafter ../../include/w32api%s}}\ @@ -49,11 +49,7 @@ along with GCC; see the file COPYING3. %{static|static-libgcc:-lgcc -lgcc_eh} \ %{!static: \ %{!static-libgcc: \ - %{!shared: \ - %{!shared-libgcc:-lgcc -lgcc_eh} \ - %{shared-libgcc:-lgcc_s -lgcc} \ - } \ - %{shared:-lgcc_s -lgcc} \ + -lgcc_s -lgcc \ } \ } " #else @@ -72,6 +72,7 @@ along with GCC; see the file COPYING3. #undef LIB_SPEC #define LIB_SPEC "\ %{pg:-lgmon} \ + %{pthread: } \ -lcygwin \ %{mwindows:-lgdi32 -lcomdlg32} \ -ladvapi32 -lshell32 -luser32 -lkernel32" @@ -115,7 +116,9 @@ along with GCC; see the file COPYING3. %{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 \ + %{rdynamic: --export-all-symbols} \ + %{!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. */ --- origsrc/gcc-4.7.2/gcc/config/i386/cygwin.opt 1969-12-31 18:00:00.000000000 -0600 +++ src/gcc-4.7.2/gcc/config/i386/cygwin.opt 2013-03-11 03:36:36.556378400 -0500 @@ -0,0 +1,27 @@ +; Cygwin-specific options. + +; Copyright (C) 2005, 2007, 2009, 2010, 2011 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 + +rdynamic +Driver + +; Retain blank line above