From patchwork Thu Oct 27 20:47:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caroline Tice X-Patchwork-Id: 79799 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp839430qge; Thu, 27 Oct 2016 13:47:58 -0700 (PDT) X-Received: by 10.98.149.149 with SMTP id c21mr18285957pfk.100.1477601278887; Thu, 27 Oct 2016 13:47:58 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 23si9664233pgb.38.2016.10.27.13.47.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Oct 2016 13:47:58 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-439787-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-439787-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-439787-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=REJECT dis=NONE) header.from=google.com 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:cc:content-type; q=dns; s=default; b=WunAiHaJHGXm0sODh7nGT6Z/dKCDkxj//MtwK9w5fCL in7dDVm2JQ5gdRObShHAvunwzC1f5Y27tny0b06muPTe/NLyhZxHJCVvxdnZCGCb SXtX2fnpUX7l02cfwcloRm2t50nEtGCD8t3CggeS8E2mlC9yGW4KGeH6+REs1y18 = 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:cc:content-type; s=default; bh=6USHf6z7OhI/2p5hv8JdgsNDL4Q=; b=xImXnRyX6JmX0Z9Xk yx1tKWf0fd5iF5l1jl/MAL40t/7qQJoq/MhlN3nkYF38gQWm/pPSfw6lTZTMW5h3 ht6Sdg9HDu3FFrp6N3W18mQpxWBF7ocBe021ddZ+TeusZJiAw1NYOaSI4agY2dUb 6SsuC6JXxACnC0uiCwC2UUSl/M= Received: (qmail 101010 invoked by alias); 27 Oct 2016 20:47:42 -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 100989 invoked by uid 89); 27 Oct 2016 20:47:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=decoration, caroline, Caroline, decorated X-HELO: mail-yw0-f170.google.com Received: from mail-yw0-f170.google.com (HELO mail-yw0-f170.google.com) (209.85.161.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Oct 2016 20:47:31 +0000 Received: by mail-yw0-f170.google.com with SMTP id w3so59121371ywg.1 for ; Thu, 27 Oct 2016 13:47:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=dR4lulB7Gup9ig9kva6ME4hZUwpPWB4PxARuxXiR9qc=; b=mWypyCeBNdoVYID/sYCUtNv8ONjYVbkyc2V58ZATHjJVPry8XYhQJUY9oDLdM44mKg nJu7k1DZBYZiU3th0fIVaH+RwF0aa8LkwRCMu0wxeOMP2aaknDXYxsoRnQIToWxUYZj4 doHatw3cwx0a7f4xPeNpTgu/MDHTdlDbGiDcoaTte9kUlXvBEPVGyVw+I0O2pGAcNn7W OG4uv9NqeQg3vfdk6ohv1ME2D69HywCAPyktYHvYaTBso7FJnSkPcOikV3EOWO1+04/e ti3CnwZmPf14E9rxlIqFHp8yW5F6lCWShE+RiO9+HEP9Jda9dqU8YkTlpXRC8kdPWSro HKeg== X-Gm-Message-State: ABUngvf2qajE0cnNvHrRvBUT2w5M8DnrHf9MLdrD7f8ngW6mk5OZZQ8esnpUFMDIR7CTcdhJ36kXOGwbJzUqfxL1 X-Received: by 10.13.235.198 with SMTP id u189mr4910937ywe.322.1477601247908; Thu, 27 Oct 2016 13:47:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.94.135 with HTTP; Thu, 27 Oct 2016 13:47:07 -0700 (PDT) From: Caroline Tice Date: Thu, 27 Oct 2016 13:47:07 -0700 Message-ID: Subject: [PATCH, GCC] Fix conflicting posix_memalign declaration error To: GCC Patches Cc: Caroline Tice , Luis Lozano X-IsSubscribed: yes The posix_memalign declaration in gcc/i386/config/pmm_malloc.h is decorated with 'throw ()', which occasionally causes declaration conflict errors (some header files, not part of GCC, that declare posix_memalign, do not have the throw decoration). An example of this can be seen at https://github.com/android-ndk/ndk/issues/91. It appears that the 'throw()' decoration comes from glibc header files. Adding ifdefs to check for __GLIBC__ before adding the 'throw()' fixed the github problem mentioned above. I have tested this patch by bootstrapping and by running test testsuite with no regressions. Is this ok to commit? -- Caroline Tice ctice42@gmail.com gcc/ChangeLog: 2016-10-27 Caroline Tice * config/i386/pmm_malloc.h (posix_memalign): Add ifdefs to only decorate the declaration with 'throw()' if __GLIBC__ is defined. Index: gcc/config/i386/pmm_malloc.h =================================================================== --- gcc/config/i386/pmm_malloc.h (revision 241483) +++ gcc/config/i386/pmm_malloc.h (working copy) @@ -31,8 +31,12 @@ #ifndef __cplusplus extern int posix_memalign (void **, size_t, size_t); #else +#ifdef __GLIBC__ extern "C" int posix_memalign (void **, size_t, size_t) throw (); +#else +extern "C" int posix_memalign (void **, size_t, size_t); #endif +#endif static __inline void * _mm_malloc (size_t __size, size_t __alignment)