mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: [PATCH] properly terminate linked link of dsos
Date: Thu, 13 Oct 2011 21:03:17 -0400	[thread overview]
Message-ID: <20111014010317.GY132@brightrain.aerifal.cx> (raw)
In-Reply-To: <05e2d053cdb7c8726eb0f9bcebbbf048@exys.org>

On Wed, Oct 12, 2011 at 04:46:30PM +0200, aep wrote:
> clang optimized away the check in calloc.c to false.
> I can work around it with a cast to something volatile:

You could instead just change the (size_t *) cast to
(volatile size_t *)...

But I think the problem is much deeper. This "optimization" is
necessarily based on the compiler making an assumption about what the
function named "malloc" does. Compiling the implementation (libc)
itself requires disabling such assumptions; with gcc, this is achieved
with -ffreestanding (-fno-builtin will also work). Can you use the
same or similar option with clang?

I made similar comments on IRC..

Rich


  reply	other threads:[~2011-10-14  1:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-12 13:42 Arvid Ephraim Picciani
2011-10-12 14:01 ` Rich Felker
2011-10-12 14:25   ` aep
2011-10-12 14:46     ` aep
2011-10-14  1:03       ` Rich Felker [this message]
2011-10-14 21:11         ` Isaac Dunham
2011-10-14 22:53           ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111014010317.GY132@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).