From patchwork Mon Jan 16 19:18:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Kosnik X-Patchwork-Id: 136352 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 0DCFBB6EEA for ; Tue, 17 Jan 2012 06:18:36 +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=1327346317; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Date:From:To:Subject:Message-ID:Mime-Version:Content-Type: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=TOjfHYULK73oiVfVOw0N xbMbDsU=; b=ax/JV/z9hukdgInUnyZqkvFIxE1wILT/vhLf234TwCssp6gEqXvl 7JXZS3qnEmfzu+z/S9HWwyRKX8dQHEkMVxTIRViM8kgzaGN/QzvX2O4zzAhy8l0a AEr/DCutojPMVgUzmtv1RYo1OThZPr4o3V1H3JYYNP2yehZ6WpDFoU8= 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:Received:Date:From:To:Subject:Message-ID:Mime-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=KqwfXhrkVvgaBmtNPc3WePGxGM4ZcNU8p2djUyW1Xwo62y/db+ElfMP5l7mX9Z k5j/wBL4u6AV+Uyrx+civTUwyVsoZ+v0H2wgL4UNlT7ip3NNvPjY7GjqhvajuxbY wxyveS8KtoLFmLGjW7xOW11Yervku4dWF8tVb+XcCDvss=; Received: (qmail 11023 invoked by alias); 16 Jan 2012 19:18:27 -0000 Received: (qmail 11007 invoked by uid 22791); 16 Jan 2012 19:18:26 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 Jan 2012 19:18:11 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0GJIBHU015227 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 16 Jan 2012 14:18:11 -0500 Received: from shotwell (ovpn-113-128.phx2.redhat.com [10.3.113.128]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q0GJIAsj012658 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 16 Jan 2012 14:18:11 -0500 Date: Mon, 16 Jan 2012 11:18:10 -0800 From: Benjamin Kosnik To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [v3] RFC libstdc++11convenience.la Message-ID: <20120116111810.088ba064@shotwell> Mime-Version: 1.0 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 This breaks separates the libstdc++ source files for C++11 from the C++03 sources, and puts C++11 files in a new source directory, src-c++11, which is compiled into libstdc++11convenience.a, and linked in to libstdc++ in the same manner that libsupc++ uses. Thus, no change to user-level or tool-level linking. To use C++11, you'd still just link in libstdc++. To use C++03, you'd still just link in libstdc++. The build rules for C++11 were established early on. This seems like a useful abstraction now that so many of the sources have to be built with C++11 flags. At some point, the continued ad hoc nature of src/Makefile.am's current approach will break down. At some other point, we might want to start building a libstdc++11 library with different flags from src/c++03. This is how to get there. tested x86/linux -benjamin 2012-01-16 Benjamin Kosnik Add libstdc++11convenience.la. * src-c++11: New directory. * acinclude.m4: (GLIBCXX_CONFIGURE): Add src-c++11. * configure: Regenerated. * Makefile.am (hosted_source): Add src-c++11 to SUBDIRS. * Makefile.in: Regenerate. * libsupc++/Makefile.am (AM_CXXFLAGS): USe XTEMPLATE_FLAGS for -fno-implicit-templates. * libsupc++/Makefile.in: Regenerate. * src/Makefile.am (inst_sources): Move... C++11 files into separate directory for libstdc++11convenience.la. Files are: fstream-inst.cc, string-inst.cc, wlocale-inst.cc, wstring-inst.cc). (sources): Move C++11 files. Files are: compatibility-c++0x.cc, compatibility-atomic-c++0x.cc, debug.cc, functexcept.cc, functional.cc, hash_c++0x.cc, hashtable_c++0x.cc, limits.cc, system_error.cc, placeholders.cc, regex.cc, shared_ptr.cc, mutex.cc, condition_variable.cc, chrono.cc, thread.cc, future.cc. * src/Makefile.in: Regenerate. * src-c++11/Makefile.am: New. * src-c++11/Makefile.in: Generate. diff --git a/libstdc++-v3/Makefile.am b/libstdc++-v3/Makefile.am index f1b5b07..02d60e1 100644 --- a/libstdc++-v3/Makefile.am +++ b/libstdc++-v3/Makefile.am @@ -24,7 +24,7 @@ include $(top_srcdir)/fragment.am if GLIBCXX_HOSTED - hosted_source = doc src po testsuite + hosted_source = src-c++11 src doc po testsuite endif ## Keep this list sync'd with acinclude.m4:GLIBCXX_CONFIGURE. diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 9d08178..0bb4d63 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -49,7 +49,7 @@ AC_DEFUN([GLIBCXX_CONFIGURE], [ # Keep these sync'd with the list in Makefile.am. The first provides an # expandable list at autoconf time; the second provides an expandable list # (i.e., shell variable) at configure time. - m4_define([glibcxx_SUBDIRS],[include libsupc++ python src doc po testsuite]) + m4_define([glibcxx_SUBDIRS],[include libsupc++ python src-c++11 src doc po testsuite]) SUBDIRS='glibcxx_SUBDIRS' # These need to be absolute paths, yet at the same time need to diff --git a/libstdc++-v3/libsupc++/Makefile.am b/libstdc++-v3/libsupc++/Makefile.am index fb5c26f..b27725d 100644 --- a/libstdc++-v3/libsupc++/Makefile.am +++ b/libstdc++-v3/libsupc++/Makefile.am @@ -104,8 +104,8 @@ libsupc__convenience_la_SOURCES = $(sources) $(c_sources) # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden # as the occasion call for it. AM_CXXFLAGS = \ - -fno-implicit-templates \ $(LIBSUPCXX_PICFLAGS) \ + $(XTEMPLATE_FLAGS) \ $(WARN_CXXFLAGS) \ $(OPTIMIZE_CXXFLAGS) \ $(CONFIG_CXXFLAGS) diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am index eefa6e2..681f365 100644 --- a/libstdc++-v3/src/Makefile.am +++ b/libstdc++-v3/src/Makefile.am @@ -1,7 +1,7 @@ -## Makefile for the src subdirectory of the GNU C++ Standard library. +## Makefile for the C++11 sources of the GNU C++ Standard library. ## ## Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -## 2006, 2007, 2008, 2009, 2010, 2011 +## 2006, 2007, 2008, 2009, 2010, 2011, 2012 ## Free Software Foundation, Inc. ## ## This file is part of the libstdc++ version 3 distribution. @@ -171,7 +171,6 @@ inst_sources = \ allocator-inst.cc \ concept-inst.cc \ ext-inst.cc \ - fstream-inst.cc \ ios-inst.cc \ iostream-inst.cc \ istream-inst.cc \ @@ -180,9 +179,7 @@ inst_sources = \ ostream-inst.cc \ sstream-inst.cc \ streambuf-inst.cc \ - string-inst.cc \ - wlocale-inst.cc \ - wstring-inst.cc + wlocale-inst.cc else XTEMPLATE_FLAGS = inst_sources = @@ -195,27 +192,19 @@ sources = \ mt_allocator.cc \ codecvt.cc \ compatibility.cc \ - compatibility-c++0x.cc \ - compatibility-atomic-c++0x.cc \ compatibility-debug_list.cc \ compatibility-debug_list-2.cc \ compatibility-list.cc \ compatibility-list-2.cc \ complex_io.cc \ ctype.cc \ - debug.cc \ - functexcept.cc \ - functional.cc \ globals_io.cc \ - hash_c++0x.cc \ hash_tr1.cc \ - hashtable_c++0x.cc \ hashtable_tr1.cc \ ios.cc \ ios_failure.cc \ ios_init.cc \ ios_locale.cc \ - limits.cc \ list.cc \ locale.cc \ locale_init.cc \ @@ -225,18 +214,9 @@ sources = \ math_stubs_long_double.cc \ stdexcept.cc \ strstream.cc \ - system_error.cc \ tree.cc \ istream.cc \ - placeholders.cc \ - regex.cc \ - shared_ptr.cc \ streambuf.cc \ - mutex.cc \ - condition_variable.cc \ - chrono.cc \ - thread.cc \ - future.cc \ valarray.cc \ ${host_sources} \ ${host_sources_extra} @@ -248,11 +228,13 @@ libstdc___la_SOURCES = $(sources) libstdc___la_LIBADD = \ $(GLIBCXX_LIBS) \ - $(top_builddir)/libsupc++/libsupc++convenience.la + $(top_builddir)/libsupc++/libsupc++convenience.la \ + $(top_builddir)/src-c++11/libstdc++11convenience.la libstdc___la_DEPENDENCIES = \ ${version_dep} \ - $(top_builddir)/libsupc++/libsupc++convenience.la + $(top_builddir)/libsupc++/libsupc++convenience.la \ + $(top_builddir)/src-c++11/libstdc++11convenience.la libstdc___la_LDFLAGS = \ -version-info $(libtool_VERSION) ${version_arg} -lm @@ -292,107 +274,6 @@ compatibility-parallel_list-2.lo: compatibility-parallel_list-2.cc compatibility-parallel_list-2.o: compatibility-parallel_list-2.cc $(CXXCOMPILE) -c $< -# Use special rules for the C++0x sources so that the proper flags are passed. -functexcept.lo: functexcept.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -functexcept.o: functexcept.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - -shared_ptr.lo: shared_ptr.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -shared_ptr.o: shared_ptr.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - -system_error.lo: system_error.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -system_error.o: system_error.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - -mutex.lo: mutex.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -mutex.o: mutex.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - -condition_variable.lo: condition_variable.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -condition_variable.o: condition_variable.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - -compatibility-c++0x.lo: compatibility-c++0x.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -compatibility-c++0x.o: compatibility-c++0x.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - -compatibility-atomic-c++0x.lo: compatibility-atomic-c++0x.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -compatibility-atomic-c++0x.o: compatibility-atomic-c++0x.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - -functional.lo: functional.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -functional.o: functional.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - -hash_c++0x.lo: hash_c++0x.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -hash_c++0x.o: hash_c++0x.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - -hashtable_c++0x.lo: hashtable_c++0x.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -hashtable_c++0x.o: hashtable_c++0x.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - -limits.lo: limits.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -limits.o: limits.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - -fstream-inst.lo: fstream-inst.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -fstream-inst.o: fstream-inst.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - -string-inst.lo: string-inst.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -string-inst.o: string-inst.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - -wstring-inst.lo: wstring-inst.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -wstring-inst.o: wstring-inst.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - -chrono.lo: chrono.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -chrono.o: chrono.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - -thread.lo: thread.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -thread.o: thread.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - -future.lo: future.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -future.o: future.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - -regex.lo: regex.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -regex.o: regex.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - -debug.lo: debug.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -debug.o: debug.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - -placeholders.lo: placeholders.cc - $(LTCXXCOMPILE) -std=gnu++0x -c $< -placeholders.o: placeholders.cc - $(CXXCOMPILE) -std=gnu++0x -c $< - if GLIBCXX_LDBL_COMPAT # Use special rules for compatibility-ldbl.cc compilation, as we need to # pass -mlong-double-64.