From patchwork Wed Feb 9 23:22:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 82546 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 A2EF2B7109 for ; Thu, 10 Feb 2011 10:22:50 +1100 (EST) Received: (qmail 11630 invoked by alias); 9 Feb 2011 23:22:48 -0000 Received: (qmail 11608 invoked by uid 22791); 9 Feb 2011 23:22:46 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, TW_CX X-Spam-Check-By: sourceware.org Received: from mail-iw0-f175.google.com (HELO mail-iw0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Feb 2011 23:22:41 +0000 Received: by iwn8 with SMTP id 8so705751iwn.20 for ; Wed, 09 Feb 2011 15:22:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.230.2 with SMTP id jk2mr22728958icb.392.1297293758272; Wed, 09 Feb 2011 15:22:38 -0800 (PST) Received: by 10.42.230.68 with HTTP; Wed, 9 Feb 2011 15:22:38 -0800 (PST) Date: Wed, 9 Feb 2011 23:22:38 +0000 Message-ID: Subject: [v3] fix libstdc++/43863 From: Jonathan Wakely To: "libstdc++" , gcc-patches 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 moves the definition of the recursive_init_error destructor to a separate file so that users who build the library with -fno-exceptions and link to the static libstdc++.a are not forced to pull in the exception class. 2011-02-09 Jonathan Wakely PR libstdc++/43863 * libsupc++/guard.cc (recursive_init_error::~recursive_init_error): Move to ... * libsupc++/guard_error.cc: ... new file. * libsupc++/Makefile.am: Update. * libsupc++/Makefile.in: Regenerate. Tested x86_64-linux, and bootstrapped with --enable-cxxflags=-fno-exceptions, committed to trunk. Index: libsupc++/guard.cc =================================================================== --- libsupc++/guard.cc (revision 169984) +++ libsupc++/guard.cc (working copy) @@ -1,4 +1,5 @@ -// Copyright (C) 2002, 2004, 2006, 2008, 2009 Free Software Foundation, Inc. +// Copyright (C) 2002, 2004, 2006, 2008, 2009, 2010, 2011 +// Free Software Foundation, Inc. // // This file is part of GCC. // @@ -134,11 +135,6 @@ __set_and_release (__cxxabiv1::__guard * #endif /* __GTHREADS */ -namespace __gnu_cxx -{ - recursive_init_error::~recursive_init_error() throw() { } -} - // // Here are C++ run-time routines for guarded initiailization of static // variables. There are 4 scenarios under which these routines are called: Index: libsupc++/guard_error.cc =================================================================== --- libsupc++/guard_error.cc (revision 0) +++ libsupc++/guard_error.cc (revision 0) @@ -0,0 +1,31 @@ +// Copyright (C) 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +#include +#include + +namespace __gnu_cxx +{ + recursive_init_error::~recursive_init_error() throw() { } +} + Index: libsupc++/Makefile.am =================================================================== --- libsupc++/Makefile.am (revision 169984) +++ libsupc++/Makefile.am (working copy) @@ -75,6 +75,7 @@ sources = \ function_type_info.cc \ fundamental_type_info.cc \ guard.cc \ + guard_error.cc \ hash_bytes.cc \ new_handler.cc \ new_op.cc \