cvs commit: src/share/mk bsd.sys.mk
tjr at FreeBSD.ORG
Fri Jun 13 18:59:08 PDT 2003
On Sat, Jun 14, 2003 at 12:39:33AM +0200, Dag-Erling Smorgrav wrote:
> Peter Wemm <peter at FreeBSD.org> writes:
> > Log:
> > We cannot use c99 on amd64 either due to lack of alloca(). libc:strptime()
> > uses alloca() and alloca is impossible to implement as a callable function
> > on amd64. It has to be a compiler builtin. Note that the bigger problem
> > is that libc is not c99 clean internally.
> #define alloca(sz) __builtin_alloca(sz)
That would be fine in the __GNUC__ >= 2 && __BSD_VISIBLE case.
For the other cases, I think we should also take the alloca() implementation
from contrib/amd/libamu/alloca.c and throw out lib/libc/i386/gen/alloca.S.
That way we get GCC's fast and conventional alloca() implementation for
!CSTD=c?9 programs, and a slower alloca() that uses the heap and sometimes
leaks memory for CSTD=c?9 programs (and programs that are compiled with
non-GCC compilers without their own alloca() implementation).
> and please remove CSTD?=c99 from bsd.sys.mk, it was never intended to
> be used that way.
More information about the cvs-all