From patchwork Fri Dec 30 04:12:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Kargl X-Patchwork-Id: 133616 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 952CFB6FA1 for ; Fri, 30 Dec 2011 15:13:13 +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=1325823194; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Date:From:To:Subject:Message-ID:Mime-Version:Content-Type: Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=oNXtGPt2bVYWxtdkNq8e/J2E3yg=; b=COLcx769xUw5s89 CY/o63G0sy7yPjhKrLdVHj4YDUi4wT22hWzOlwtjhxVzpD1KpzZJW05xxPaEKVWw I/lHpE8dQYVVztkWZ4U5DjdBQ4bw7iVr0o5MEBXJ1izLSVmrBLyVy0wYjs293UVH HVwj43SZcbrWkcmbpEdTy3YBZpnE= 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:Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=r5zozgH6M198yE5QKf6InBwabnYLsPKFp4tgdHPrhFW3f5iJMrx2atmur/CdiT Cd8vb0nBPpddCK5YHrTGd4+voKlDgo5kQmhU5FY6/B18ItrtgNXFNCAoPO1e0pQZ qq3UWMp68x4Ge7anBybOVIVkBTwx5trIzH2lgTYUiqlSU=; Received: (qmail 26305 invoked by alias); 30 Dec 2011 04:13:08 -0000 Received: (qmail 26120 invoked by uid 22791); 30 Dec 2011 04:13:07 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from troutmask.apl.washington.edu (HELO troutmask.apl.washington.edu) (128.95.76.21) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 30 Dec 2011 04:12:53 +0000 Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.5/8.14.5) with ESMTP id pBU4CqDr051376 for ; Thu, 29 Dec 2011 20:12:52 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.5/8.14.5/Submit) id pBU4CpRe051375 for gcc-patches@gcc.gnu.org; Thu, 29 Dec 2011 20:12:51 -0800 (PST) (envelope-from sgk) Date: Thu, 29 Dec 2011 20:12:51 -0800 From: Steve Kargl To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR bootstrap/51705 Message-ID: <20111230041251.GA51358@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.4.2.3i 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 The audit trail in the PR pretty much sums up the problem. OK to commit? 2011-12-29 Steven G. Kargl * inclhack.def: Disgusting hack to workaround brain damage of defining __cplusplus as 201103L with -std=c++11 when g++ does not support c++11. * fixincl.x: regenerated. * genfixes: Fix to version test. Index: inclhack.def =================================================================== --- inclhack.def (revision 182738) +++ inclhack.def (working copy) @@ -20,6 +20,21 @@ autogen definitions fixincl; FIXINC_DEBUG = yes; #endif +/* + * g++ -std=c++11 defines __cplusplus to 201103L, which lies about + * the level of support g++ has for the C++11 standard. + */ +fix = { + hackname = cdef_cplusplus; + mach = "*-*-freebsd10.*"; + files = sys/cdefs.h; + select = "\\\\[\\\\[noreturn\\\\]\\\\]"; + sed = "s/\\\\[\\\\[noreturn\\\\]\\\\]/__dead2/"; + test_text = "#include "; +}; + + + /* On AIX when _LARGE_FILES is defined stdio.h defines fopen to * fopen64 etc. and this causes problems when building with g++ * because cstdio udefs everything from stdio.h, leaving us with Index: fixincl.x =================================================================== --- fixincl.x (revision 182738) +++ fixincl.x (working copy) @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed November 7, 2011 at 01:16:39 PM by AutoGen 5.10 + * It has been AutoGen-ed December 29, 2011 at 06:29:22 PM by AutoGen 5.12 * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT SVN-MERGE THIS FILE, EITHER Mon Nov 7 13:16:39 EST 2011 +/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Dec 29 18:29:22 PST 2011 * * You must regenerate it. Use the ./genfixes script. * @@ -15,7 +15,7 @@ * certain ANSI-incompatible system header files which are fixed to work * correctly with ANSI C and placed in a directory that GNU C will search. * - * This file contains 222 fixup descriptions. + * This file contains 223 fixup descriptions. * * See README for more information. * @@ -43,6 +43,42 @@ static char const sed_cmd_z[] = SED_PROG /* * * * * * * * * * * * * * * * * * * * * * * * * * * + * Description of Cdef_Cplusplus fix + */ +tSCC zCdef_CplusplusName[] = + "cdef_cplusplus"; + +/* + * File name selection pattern + */ +tSCC zCdef_CplusplusList[] = + "sys/cdefs.h\0"; +/* + * Machine/OS name selection pattern + */ +tSCC* apzCdef_CplusplusMachs[] = { + "*-*-freebsd10.*", + (const char*)NULL }; + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zCdef_CplusplusSelect0[] = + "\\\\[\\\\[noreturn\\\\]\\\\]"; + +#define CDEF_CPLUSPLUS_TEST_CT 1 +static tTestDesc aCdef_CplusplusTests[] = { + { TT_EGREP, zCdef_CplusplusSelect0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Cdef_Cplusplus + */ +static const char* apzCdef_CplusplusPatch[] = { sed_cmd_z, + "-e", "s/\\\\[\\\\[noreturn\\\\]\\\\]/__dead2/", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * * Description of Aab_Aix_Stdio fix */ tSCC zAab_Aix_StdioName[] = @@ -9034,14 +9070,15 @@ static const char* apzX11_SprintfPatch[] * * List of all fixes */ -#define REGEX_COUNT 264 +#define REGEX_COUNT 265 #define MACH_LIST_SIZE_LIMIT 181 -#define FIX_COUNT 222 +#define FIX_COUNT 223 /* * Enumerate the fixes */ typedef enum { + CDEF_CPLUSPLUS_FIXIDX, AAB_AIX_STDIO_FIXIDX, AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_FIXIDX, AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_2_FIXIDX, @@ -9267,6 +9304,11 @@ typedef enum { } t_fixinc_idx; tFixDesc fixDescList[ FIX_COUNT ] = { + { zCdef_CplusplusName, zCdef_CplusplusList, + apzCdef_CplusplusMachs, + CDEF_CPLUSPLUS_TEST_CT, FD_MACH_ONLY, + aCdef_CplusplusTests, apzCdef_CplusplusPatch, 0 }, + { zAab_Aix_StdioName, zAab_Aix_StdioList, apzAab_Aix_StdioMachs, AAB_AIX_STDIO_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, Index: genfixes =================================================================== --- genfixes (revision 182738) +++ genfixes (working copy) @@ -62,7 +62,7 @@ fi AG="autogen $AG" set -e -if [ -z "`${AG} -v | fgrep 'Ver. 5.'`" ] +if [ -z "`${AG} -v | fgrep '5.'`" ] then echo "AutoGen appears to be out of date or not correctly installed." echo "Please download and install:"