Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111014010317.GY132@brightrain.aerifal.cx>
Date: Thu, 13 Oct 2011 21:03:17 -0400
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] properly terminate linked link of dsos

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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.