From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1752 Path: news.gmane.org!not-for-mail From: agent Newsgroups: gmane.linux.lib.musl.general Subject: Re: build musl with clang Date: Sat, 25 Aug 2012 11:57:16 +0600 Message-ID: <5038693C.2020101@gmail.com> References: <20120823175545.GQ27715@brightrain.aerifal.cx> <5037181B.9050508@gmail.com> <20120824060611.GX27715@brightrain.aerifal.cx> <5037596C.1030409@gmail.com> <20120824110153.GA23569@port70.net> <503771F3.2040204@gmail.com> <20120824145938.GA7705@port70.net> <20120824175150.GE27715@brightrain.aerifal.cx> <5037CE26.3060702@gmail.com> <20120824190421.GA11149@port70.net> <20120825000917.GK27715@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1345874320 20942 80.91.229.3 (25 Aug 2012 05:58:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Aug 2012 05:58:40 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-1753-gllmg-musl=m.gmane.org@lists.openwall.com Sat Aug 25 07:58:41 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1T59OJ-0002zt-FW for gllmg-musl@plane.gmane.org; Sat, 25 Aug 2012 07:58:39 +0200 Original-Received: (qmail 16297 invoked by uid 550); 25 Aug 2012 05:58:36 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 16287 invoked from network); 25 Aug 2012 05:58:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=1p3M7SIGRIQIydJvWrDcTQPTIMb876tbk7bwm8EW4kw=; b=XWboYlt36yAAyM+AXUOcoiugx8n6rF7bibC6KuxUvEb+6jtfg1VOudiq7ob27d2ii3 RRJtT8vhoBLxqC/aYpHP2LVP5lblnPcECbWMdSkSgCGHLu/IPAQqdiAjA2LYxTeI9hOC 14M9MDs1tKavg3/OxXRsxup180/KHQxYzEXmUNYsBd93a6TwJjqWm0kg1JB4typ1/YLZ alHlyBglLjHY071dI8cSfO/G7QBBmXTDNY9Rds2YorrXejMJWPFlW4Fp60/VlvzJKBc+ 500lLZLJiCSr6oHEp1ZgkHYOLBdrgr+BueoKYrn0APyglggtTCqulQW2kXBO0Scllam7 ZxxQ== User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 In-Reply-To: <20120825000917.GK27715@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:1752 Archived-At: 25.08.2012 06:09, Rich Felker пишет: > Here's an idea for a workaround: > > void *not_called_malloc(size_t) __asm__("malloc"); > #define malloc not_called_malloc > > If that fixes it, it would be an amusing way to present it in the bug > report. > > Rich that is stilled optimized for a plain malloc call even if i call not_called_malloc directly and not via a macro. to test the bug i used the following function: void *foo(size_t n) { static char buf[200]; return buf + 10; } and that was the way when 'if' was not optimized out. if i use malloc in foo() it is still wiped out. as far as i know, optimizations are done not only in clang itself but in llvm too, so maybe if clang does not notice malloc, llvm does.