From patchwork Wed Oct 26 16:26:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Edlinger X-Patchwork-Id: 79454 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp153618qge; Wed, 26 Oct 2016 09:27:06 -0700 (PDT) X-Received: by 10.98.108.4 with SMTP id h4mr5603883pfc.11.1477499226165; Wed, 26 Oct 2016 09:27:06 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id d130si3585316pga.1.2016.10.26.09.27.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Oct 2016 09:27:06 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-439641-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-439641-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-439641-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:content-type:mime-version; q=dns; s= default; b=G8Y3K7KzfvbwOcFea4kYMqV/GNH5e35+RJ2raPybWtMpPmtlTcjpn SiBFAa4oxwn4uK6mWCg03hm2l/0IBHVg2BFCzBCXewnnT/aaulJzg7FP3NDptxLF n6A/yCmLL+rAULDZyJ9JjgUfrelrvlFdvesnVrOJb5h8fbJf9iQJco= 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:from :to:subject:date:message-id:content-type:mime-version; s= default; bh=PQ5zwTQZKHfMFjnTVl+MJfgsvH0=; b=uRRB3pDxKuBah87X1ios 8gpXqBBOdZK5RT7Ai6+HEVw+tDC/SmddcvkX9VPVKrU+slv/Ab4TVL8BwcMcj/Fy e2gqNb6Md512FjJGSZmQFs+hH1QmUMMrjjqZvjt3zHkxaWxfwNsJW0CRHcpNm7mE Z/685P/lIf38C4vuI3L7YH4= Received: (qmail 119209 invoked by alias); 26 Oct 2016 16:26:51 -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 119186 invoked by uid 89); 26 Oct 2016 16:26:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=HX-MS-Has-Attach:yes, Hx-exchange-antispam-report-cfa-test:102415321, H*c:sk:HHHPRHH, HX-OriginatorOrg:outlook.com X-Spam-User: qpsmtpd, 2 recipients X-HELO: BLU004-OMC4S14.hotmail.com Received: from blu004-omc4s14.hotmail.com (HELO BLU004-OMC4S14.hotmail.com) (65.55.111.153) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Oct 2016 16:26:40 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com ([65.55.111.137]) by BLU004-OMC4S14.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Wed, 26 Oct 2016 09:26:38 -0700 Received: from HE1EUR02FT044.eop-EUR02.prod.protection.outlook.com (10.152.10.57) by HE1EUR02HT085.eop-EUR02.prod.protection.outlook.com (10.152.11.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.7; Wed, 26 Oct 2016 16:26:36 +0000 Received: from HE1PR0701MB2169.eurprd07.prod.outlook.com (10.152.10.58) by HE1EUR02FT044.mail.protection.outlook.com (10.152.11.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.679.5 via Frontend Transport; Wed, 26 Oct 2016 16:26:36 +0000 Received: from HE1PR0701MB2169.eurprd07.prod.outlook.com ([10.168.36.18]) by HE1PR0701MB2169.eurprd07.prod.outlook.com ([10.168.36.18]) with mapi id 15.01.0679.015; Wed, 26 Oct 2016 16:26:36 +0000 From: Bernd Edlinger To: "libstdc++@gcc.gnu.org" , "gcc-patches@gcc.gnu.org" , Jonathan Wakely Subject: [PATCH] Fix build problem with eCos/newlib (PR 78110) Date: Wed, 26 Oct 2016 16:26:36 +0000 Message-ID: authentication-results: gcc.gnu.org; dkim=none (message not signed) header.d=none; gcc.gnu.org; dmarc=none action=none header.from=hotmail.de; x-ms-exchange-messagesentrepresentingtype: 1 x-eopattributedmessage: 0 x-microsoft-exchange-diagnostics: 1; HE1EUR02HT085; 6:TJjCkCljGnjf9i6SzmCwqBqt6G52WrfGb6+ZQTmKzBU1w11aKf0M159qbfa8wyoac4dFlJ8HI1vNFgSZvqWDbXMF7pklnMn/viotKESG/R1iEFQCdiaYlnycPUfFengsIDz/Qi0Wz2xosMb5LwZq75eMSUghtd90t12/amxzOGt9h15Wf7nHwa81uXfWiErayOWq4YbNAPkk7oA2VlLpYL446liV+ElkL5nJoZ5PJPTRDj/vEGUFyrnTu6RquTB6QRq9wqdkirQzt9Wzm2mjRyF1ZShdIQaJDpZrJo0MlkAbCT+yFuBTI8h+zP9PHTDK; 5:Q8ifcXwx2GE7BpJn+DueRzgGr3wpNPfmWZDHGg8izB9KkxmbBPCkYzPcaMfC2d0Q1oIGYeZVCI98iAjsFLPWsmVY0fYJG/tIGXvn97z6KIDKi8/hjz07Xv17ReDoSNJDrqT0T2OjHiIFm6CMjdRVTA==; 24:ka0J2cbvuj+Rs5KarYSzJdeMj4/UHSL68JjEt0XNEq5BpI9HgNahF4lwIzqxRFffJAoMsHr6gdqOAIrxzvAiX9L6LtnPKGPO6BLV9zrWQho=; 7:u/lphYQnWYBF832raLs9Sw0dL0NRrvjhjWaWuXXPG1BQZVHX7W4+a+AIVJstQcE1B4ZtOcHBtasFCEn3E78CwZvEzX74Hq48qyzrTtg0cttCBrx0sAJGIJYUdIU640VBMcvSrtK5lR5TxSr+X3nV43VR+TnXqzCdDV9jpM0S177JyuJiVZxpjD/nbVznTw4Cx0ALzMyJaocvWA0D5zZ8Dv1evi75BG90Kryn2B2wXbOht53gnrzeAySwKBsPRdBmgt+QQ9DfvXoJJkdG4YhyT9aDTwUs9p+kows2om8Ch+E/v2+aDZFs3ESaYZIdQlegow5IdAttAKgmsaw2Rnif6ohfgdg9RaeF0EhYR/ZxeTw= x-forefront-antispam-report: EFV:NLI; SFV:NSPM; SFS:(10019020)(98900003); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1EUR02HT085; H:HE1PR0701MB2169.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; x-ms-office365-filtering-correlation-id: ef9532b6-ba72-4554-07d5-08d3fdbcda2d x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(1601124038)(1603103081)(1601125047); SRVR:HE1EUR02HT085; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(432015012)(102415321)(82015046); SRVR:HE1EUR02HT085; BCL:0; PCL:0; RULEID:; SRVR:HE1EUR02HT085; x-forefront-prvs: 0107098B6C spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Oct 2016 16:26:36.2579 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR02HT085 Hi, this patch avoids including malloc.h in free standing builds with eCos/newlib, and declares the memalign directly. Successfully built a cross compiler for eCos. Is it OK for trunk? Thanks Bernd. 2016-10-26 Bernd Edlinger * libsupc++/new_opa.cc: Don't include in a free standing environmnet. Declare memalign directly in that case. --- libstdc++-v3/libsupc++/new_opa.cc.orig 2016-09-16 20:09:14.000000000 +0200 +++ libstdc++-v3/libsupc++/new_opa.cc 2016-10-26 09:40:41.722542566 +0200 @@ -48,7 +48,11 @@ return nullptr; } #elif _GLIBCXX_HAVE_MEMALIGN +#if _GLIBCXX_HOSTED #include +#else +extern "C" void *memalign(std::size_t boundary, std::size_t size); +#endif #define aligned_alloc memalign #else // The C library doesn't provide any aligned allocation functions, declare