why Glibc does not build with clang?

Rich Felker dalias@libc.org
Sat May 24 15:26:00 GMT 2014


On Sat, May 24, 2014 at 04:46:03PM +0200, Andreas Schwab wrote:
> Rich Felker <dalias@libc.org> writes:
> 
> > Nested functions are a feature that fundamentally requires producing
> > an insecure executable/library (executable-stack flag)
> 
> Only if you pass the address of it out of the containing function.

That's my "_except_ in cases where the compiler optimizes out that
need." I'm quite aware that in the current usage cases in glibc, with
current compiler optimizations, the need is optimized out. What I
object to is relying on this optimization to satisfy a security
contract.

BTW one could imagine "reasonable" uses where the address gets "passed
out" of the containing function to another small static function; in
such cases, whether the resulting code requires executable stack, even
with current compilers, likely depends on the level of inlining and
inter-procedural optimization.

Rich



More information about the Libc-alpha mailing list