Subject: compiling -std=c99 on cobalt fails with alloca
To: None <port-cobalt@NetBSD.ORG>
From: Kristaps Johnson <kristaps@gradient-enterprises.com>
List: port-cobalt
Date: 08/28/2006 14:22:30
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hello everybody, a strange problem with the cobalt port's libc 
(speculation, see below).  Consider the following programme:

#include <stdlib.h>
int main() { (void)alloca(14); return(0); }

This compiles and runs fine as:

$ uname -rm
3.0.1 cobalt
$ gcc foo.c
$ ./a.out

But when compiled as such:

$ gcc -std=c99 foo.c
/var/tmp//cc9lV8g8.o(.text+0x28): In function `main':
: undefined reference to `alloca'

This behaviour occurs on NetBSD 3.0.1 cobalt (I'm technically emulating 
with gxemul but this behaviour has been reported natively, specifically at 
http://archive.lists.bsd.lv/sysjail/msg00007.html).

This compiles without flaw under i386 3.0 - I don't have a 3.0.1 i386 
handy to see if this is an error between versions (versus between ports).

$ uname -rm
3.0 i386
$ gcc -std=c99 foo.c
$ ./a.out

Thoughts?  Thank you!

   Kristaps

PS, I don't appear to be subscribed to this list (or majordomo is VERY 
slow today), so please CC me in any responses.  Thanks again.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFE8zRqK0ldVyV4920RAhlSAJ46yrwvLq1hWraMKt7H8M2JLzQlLACgpdHy
Ml/IXqQ2z54DDYQ4r7jI+7Y=
=kC74
-----END PGP SIGNATURE-----