From patchwork Fri Mar 23 18:47:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Edelsohn X-Patchwork-Id: 148481 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 CE4BEB6EE8 for ; Sat, 24 Mar 2012 05:47:31 +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=1333133253; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=pK8WkdY vi745zjX83cQcPOocyr4=; b=W3CBtscdIRdxGjzd6QpBJSjOR8TAXFxJ6ddXoJ4 BHxg0yC8FCwB3xanh+nJSQvS/Qfa5nASTZDZXCYb7MXRVXvrfj2Xz+oa14tfcgta ZUJGly0Llr55Mr765e7DoWJCFoo3RFiydbmUVwRuFpXEX7WHFSZtKQroXOcHaFX9 MV0c= 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:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Bk4IStfM/TSI+1sxM/yS2bScZ4L5yoEsZ2NmQMe0S+VVJiqhEMpozAqKgEX1CK uvpnRfeHO6hIf7IHmG838GizMNnBulJc7v7jpyas9k2RVUhZibpeQ1RtUBe+wjLt TEukedsjLN4HEGfBo1JbTbU2Cr17NV8mx0Nn7Ik1eRBcQ=; Received: (qmail 28984 invoked by alias); 23 Mar 2012 18:47:28 -0000 Received: (qmail 28956 invoked by uid 22791); 23 Mar 2012 18:47:27 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-yw0-f47.google.com (HELO mail-yw0-f47.google.com) (209.85.213.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Mar 2012 18:47:14 +0000 Received: by yhjj56 with SMTP id j56so3223488yhj.20 for ; Fri, 23 Mar 2012 11:47:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.25.73 with SMTP id a9mr16318433oeg.63.1332528433878; Fri, 23 Mar 2012 11:47:13 -0700 (PDT) Received: by 10.182.98.132 with HTTP; Fri, 23 Mar 2012 11:47:13 -0700 (PDT) Date: Fri, 23 Mar 2012 14:47:13 -0400 Message-ID: Subject: [PATCH] AIX malloc.h fixincludes From: David Edelsohn To: Bruce Korb , 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 Some early releases of AIX 6 include a malloc.h header with an incorrect use of "builtin" keyword: #ifdef __cplusplus extern "C" { extern "builtin" char *__alloca (size_t); # define alloca __alloca } #endif /* def __cplusplus */ GCC is not too happy about this. Now that GCC mainline and 4.7 use C++ for bootstrap, this breaks bootstrap on a narrow range of AIX 6 systems. The following patch applies the same fix to the header file that IBM applied in its own update. Okay for trunk, 4.7 and 4.6? Thanks, David * inclhack.def (aix_malloc): New. * fixincl.x: Regenerate. * tests/base/malloc.h [AIX_MALLOC_CHECK]: New. Index: inclhack.def =================================================================== --- inclhack.def (revision 185739) +++ inclhack.def (working copy) @@ -370,6 +370,19 @@ }; /* + * malloc.h on AIX6 uses XLC++ specific builtin syntax + */ +fix = { + hackname = aix_malloc; + mach = "*-*-aix*"; + files = "malloc.h"; + select = "#ifdef __cplusplus"; + c_fix = format; + c_fix_arg = "#if (defined(__cplusplus) && defined(__IBMCPP__))"; + test_text = "#ifdef __cplusplus"; +}; + +/* * net/if_arp.h defines a variable fc_softc instead of adding a * typedef for the struct on AIX 5.2, 5.3, 6.1 and 7.1 */