From patchwork Sat Oct 1 14:31:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: JonY X-Patchwork-Id: 117272 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 DCC3EB6F72 for ; Sun, 2 Oct 2011 00:32:29 +1000 (EST) Received: (qmail 14968 invoked by alias); 1 Oct 2011 14:32:27 -0000 Received: (qmail 14958 invoked by uid 22791); 1 Oct 2011 14:32:25 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-gy0-f175.google.com (HELO mail-gy0-f175.google.com) (209.85.160.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 01 Oct 2011 14:32:09 +0000 Received: by gyg8 with SMTP id 8so2708461gyg.20 for ; Sat, 01 Oct 2011 07:32:08 -0700 (PDT) Received: by 10.68.22.195 with SMTP id g3mr46471792pbf.108.1317479527628; Sat, 01 Oct 2011 07:32:07 -0700 (PDT) Received: from [175.142.11.162] ([175.142.11.162]) by mx.google.com with ESMTPS id h5sm30553755pbq.11.2011.10.01.07.32.04 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 01 Oct 2011 07:32:07 -0700 (PDT) Message-ID: <4E872459.802@users.sourceforge.net> Date: Sat, 01 Oct 2011 22:31:53 +0800 From: JonY 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: Paolo Carlini CC: Gcc Patch List , "mingw-w64-developer@lists.sourceforge.net" , Kai Tietz Subject: Re: [patch] --enable-dynamic-string default for mingw-w64 v2 References: <4E86AD37.9020407@users.sourceforge.net> <4E86DA1B.1010603@oracle.com> <4E86E1F9.8020704@users.sourceforge.net> <4E86E6A0.3050401@oracle.com> <4E86F52A.9090201@users.sourceforge.net> In-Reply-To: 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 On 10/1/2011 19:16, Paolo Carlini wrote: > Hi, > >> Thanks, but I am having problems sending a proper diff with the >> regenerated files, they have a lot of unrelated, even if I made sure I >> am using autoconf 2.64 and automake 1.11.1. > > To be clear, regenerated files should **not** be part of the patch submitted for review, but should definitely appear on the ChangeLog and the changes eventually committed. > After some careful adjustments, I see just configure and config.h.in changed. New patch with updated Changelog attached. Be sure to copy config/os/mingw32 over to config/os/mingw32-w64 before continuing. >> I guess its due to libtool versions, any ideas how to fix this? > > Nope, sorry, on Linux, provided the versions are correct - please double check that, I'm traveling - regen works like a charm. You just invoke autoreconf, right? > > Paolo Yeah, just "autoreconf" under Cygwin to regenerate them, calling autoconf and autoheader avoids new libtool getting pulled in. Index: configure.host =================================================================== --- configure.host (revision 179411) +++ configure.host (working copy) @@ -260,8 +260,15 @@ atomic_word_dir=os/irix ;; mingw32*) - os_include_dir="os/mingw32" - error_constants_dir="os/mingw32" + case "$host" in + *-w64-*) + os_include_dir="os/mingw32-w64" + error_constants_dir="os/mingw32-w64" + ;; + *) + os_include_dir="os/mingw32" + error_constants_dir="os/mingw32" + ;; OPT_LDFLAGS="${OPT_LDFLAGS} \$(lt_host_flags)" ;; netbsd*) Index: include/bits/basic_string.h =================================================================== --- include/bits/basic_string.h (revision 179411) +++ include/bits/basic_string.h (working copy) @@ -201,7 +201,7 @@ void _M_set_length_and_sharable(size_type __n) { -#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING +#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 if (__builtin_expect(this != &_S_empty_rep(), false)) #endif { @@ -231,7 +231,7 @@ void _M_dispose(const _Alloc& __a) { -#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING +#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 if (__builtin_expect(this != &_S_empty_rep(), false)) #endif { @@ -252,7 +252,7 @@ _CharT* _M_refcopy() throw() { -#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING +#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 if (__builtin_expect(this != &_S_empty_rep(), false)) #endif __gnu_cxx::__atomic_add_dispatch(&this->_M_refcount, 1); @@ -430,7 +430,7 @@ * @brief Default constructor creates an empty string. */ basic_string() -#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING +#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 : _M_dataplus(_S_empty_rep()._M_refdata(), _Alloc()) { } #else : _M_dataplus(_S_construct(size_type(), _CharT(), _Alloc()), _Alloc()){ } @@ -502,7 +502,7 @@ basic_string(basic_string&& __str) noexcept : _M_dataplus(__str._M_dataplus) { -#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING +#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 __str._M_data(_S_empty_rep()._M_refdata()); #else __str._M_data(_S_construct(size_type(), _CharT(), get_allocator())); Index: include/bits/basic_string.tcc =================================================================== --- include/bits/basic_string.tcc (revision 179411) +++ include/bits/basic_string.tcc (working copy) @@ -80,7 +80,7 @@ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a, input_iterator_tag) { -#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING +#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 if (__beg == __end && __a == _Alloc()) return _S_empty_rep()._M_refdata(); #endif @@ -126,7 +126,7 @@ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a, forward_iterator_tag) { -#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING +#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 if (__beg == __end && __a == _Alloc()) return _S_empty_rep()._M_refdata(); #endif @@ -154,7 +154,7 @@ basic_string<_CharT, _Traits, _Alloc>:: _S_construct(size_type __n, _CharT __c, const _Alloc& __a) { -#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING +#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 if (__n == 0 && __a == _Alloc()) return _S_empty_rep()._M_refdata(); #endif @@ -456,7 +456,7 @@ basic_string<_CharT, _Traits, _Alloc>:: _M_leak_hard() { -#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING +#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 if (_M_rep() == &_S_empty_rep()) return; #endif Index: ChangeLog =================================================================== --- ChangeLog (revision 179411) +++ ChangeLog (working copy) @@ -1,3 +1,18 @@ +2011-10-01 Jonathan Yong + + * configure.host: Use config/os/mingw32-w64 instead of + config/os/mingw32 if vendor key is "w64". + * config/os/mingw32-w64: Duplicate from config/os/mingw32. + * config/os/mingw32-w64/os_defines.h: Enable + _GLIBCXX_FULLY_DYNAMIC_STRING if undefined. + * acinclude.m4: Set fully-dynamic-string to 1 when enabled, + 0 when disabled or undefined if unset by user. + * include/bits/basic_string.h: Check if _GLIBCXX_FULLY_DYNAMIC_STRING + is set to 0 instead of undefined. + include/bits/basic_string.tcc: Likewise. + * configure: Regenerated. + * config.h.in: Likewise. + 2011-09-29 Paolo Carlini * include/bits/hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Index: config/os/mingw32-w64/os_defines.h =================================================================== --- config/os/mingw32-w64/os_defines.h (revision 179411) +++ config/os/mingw32-w64/os_defines.h (working copy) @@ -65,4 +65,9 @@ // ioctlsocket function doesn't work for normal file-descriptors. #define _GLIBCXX_NO_IOCTL 1 +// mingw-w64 should use fully-dynamic-string by default +#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING +#define _GLIBCXX_FULLY_DYNAMIC_STRING 1 #endif + +#endif Index: acinclude.m4 =================================================================== --- acinclude.m4 (revision 179411) +++ acinclude.m4 (working copy) @@ -564,17 +564,21 @@ dnl memory (mostly useful together with shared memory allocators, see PR dnl libstdc++/16612 for details). dnl -dnl --enable-fully-dynamic-string defines _GLIBCXX_FULLY_DYNAMIC_STRING -dnl --disable-fully-dynamic-string leaves _GLIBCXX_FULLY_DYNAMIC_STRING undefined +dnl --enable-fully-dynamic-string defines _GLIBCXX_FULLY_DYNAMIC_STRING to 1 +dnl --disable-fully-dynamic-string defines _GLIBCXX_FULLY_DYNAMIC_STRING to 0 +dnl otherwise undefined dnl + Usage: GLIBCXX_ENABLE_FULLY_DYNAMIC_STRING[(DEFAULT)] dnl Where DEFAULT is either `yes' or `no'. dnl AC_DEFUN([GLIBCXX_ENABLE_FULLY_DYNAMIC_STRING], [ GLIBCXX_ENABLE(fully-dynamic-string,$1,,[do not put empty strings in per-process static memory]) if test $enable_fully_dynamic_string = yes; then - AC_DEFINE(_GLIBCXX_FULLY_DYNAMIC_STRING, 1, - [Define if a fully dynamic basic_string is wanted.]) + enable_fully_dynamic_string_def=1 + else + enable_fully_dynamic_string_def=0 fi + AC_DEFINE_UNQUOTED([_GLIBCXX_FULLY_DYNAMIC_STRING], [${enable_fully_dynamic_string_def}], + [Define to 1 if a fully dynamic basic_string is wanted, 0 to disable, undefined for platform defaults]) ])