From patchwork Thu Feb 22 16:09:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Edelsohn X-Patchwork-Id: 876763 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-473717-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="k2z7YDCb"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3znK7c4xk5z9sDQ for ; Fri, 23 Feb 2018 03:10:03 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=ugigR3iQrCvVJ07nLhoSCNkH6MuCvzabfW8TwQXK0E+lJ3 AU5Ie52FsZRXeLBePoWk3oMHVjzBVKfp6L7CbKjJ7kOkGNtDTXuguRE5VTBa7nBs 6fhvCmj6P9ygZOKMPNTzkjGEmIMidZwfjET8Ey3/5qli8pfsBzkpuMQjpL1m8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=NyFqMLzDZ/csvkETgFrS7W2vfGQ=; b=k2z7YDCbLqoHqcXqV46I wEJ7hf8ULrSQRUc50GpAsEjraUA7Dm6y9Y+TMSQqjzWvQkLGyaGUXevRbqx7J973 miS6iRBkiM9dLcXeR5aKjs2giS6r+65nWevkdINRWREl8yh0x+GL9km6hEuiDfwg lKOgAl6poXpFf0Uxyts+ODA= Received: (qmail 46095 invoked by alias); 22 Feb 2018 16:09:56 -0000 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 Received: (qmail 45187 invoked by uid 89); 22 Feb 2018 16:09:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-lf0-f45.google.com Received: from mail-lf0-f45.google.com (HELO mail-lf0-f45.google.com) (209.85.215.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Feb 2018 16:09:54 +0000 Received: by mail-lf0-f45.google.com with SMTP id t79so8160803lfe.3 for ; Thu, 22 Feb 2018 08:09:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ZDI3x4y1kf8SYqrsnK5LW9Xf+JdZztZQzAQyUyaRowA=; b=g4KJ9aN3zWTh0+F8vqbBRlEr1y3/eFlcoCvCTV4NkxQYNxt4xXA9vTJOzEoYljIv2h 03MZGfZHCtDsIE1wwGXoy89jrxTZdWOzKnFkmHi/2R0YGBUjgjcelIDAacwdxt6AE3QS r0JRCHlUUzcgP59x/S1lU4C4CVWLzFEslAInwN5O6K4eOBfdgqMjtdobsFqh8ys1Dt5V RlYzpskpSaEWd7MB5NP0pCt/lGjV72Te10HeuJ4wgtA10KlccDan/tkySZucsA6VyOhb pF1gVWC+mkOiXc+BzkMW2q5BHGdpO/8IsT65BACvpbjgQDrwiAZzsh+RHrLq6ezF8bEa Yc0g== X-Gm-Message-State: APf1xPCkz6zeN2G3Ol6wVdvP7OkWOz4L2oeew13OCQzypGLz3yNgV7g+ hkZvJWWfHLp0ZRObw+YNZRRMjJgfNlf89H8+H8YQ5g== X-Google-Smtp-Source: AH8x224uCrln3qDfG1vmouMtS0Xyi3UMCEMuozpSK8/FxfgvYs4fPxMUrdI16AkwAVMurWPU1lHNJuqMyt+ZGlomeQo= X-Received: by 10.25.76.9 with SMTP id z9mr5359919lfa.141.1519315791779; Thu, 22 Feb 2018 08:09:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.64.133 with HTTP; Thu, 22 Feb 2018 08:09:51 -0800 (PST) From: David Edelsohn Date: Thu, 22 Feb 2018 11:09:51 -0500 Message-ID: Subject: [PATCH,AIX] Fixincludes for vec_malloc, vec_calloc To: GCC Patches AIX stdlib.h header decides to redefine malloc and calloc when __VEC__ is defined. Hilarity ensues, such as when GCC uses __attribute__(("malloc")). Fixed with the appended fixincludes patch. Thanks, David * inclhack.def (aix_stdlib_vec_malloc): New. (aix_stdlib_vec_calloc): New. * fixincl.x: Regenerate. * tests/base/stdlib.h [AIX_STDLIB_VEC_MALLOC]: New test. [AIX_STDLIB_VEC_CALLOC]: New test. Index: inclhack.def =================================================================== --- inclhack.def (revision 257901) +++ inclhack.def (working copy) @@ -838,6 +838,26 @@ test_text = "#define valloc __linux_valloc"; }; +fix = { + hackname = aix_stdlib_vec_malloc; + mach = "*-*-aix*"; + files = stdlib.h; + select = "#define[ \t]+malloc[ \t]+vec_malloc"; + c_fix = format; + c_fix_arg = "extern void *malloc(size_t) __asm__(\"vec_malloc\");"; + test_text = "#define malloc vec_malloc"; +}; + +fix = { + hackname = aix_stdlib_vec_calloc; + mach = "*-*-aix*"; + files = stdlib.h; + select = "#define[ \t]+calloc[ \t]+vec_calloc"; + c_fix = format; + c_fix_arg = "extern void *calloc(size_t, size_t) __asm__(\"vec_calloc\");"; + test_text = "#define calloc vec_calloc"; +}; + /* * stdlib.h on AIX 4.3 declares strtof() with a non-const first argument. */ Index: tests/base/stdlib.h =================================================================== --- tests/base/stdlib.h (revision 257901) +++ tests/base/stdlib.h (working copy) @@ -29,6 +29,16 @@ #endif /* AIX_STDLIB_VALLOC_CHECK */ +#if defined( AIX_STDLIB_VEC_MALLOC_CHECK ) +extern void *malloc(size_t) __asm__("vec_malloc"); +#endif /* AIX_STDLIB_VEC_MALLOC_CHECK */ + + +#if defined( AIX_STDLIB_VEC_CALLOC_CHECK ) +extern void *calloc(size_t, size_t) __asm__("vec_calloc"); +#endif /* AIX_STDLIB_VEC_CALLOC_CHECK */ + + #if defined( AIX_STRTOF_CONST_CHECK ) extern float strtof(const char *, char **); #endif /* AIX_STRTOF_CONST_CHECK */