Is _environ present in 7.0-RELEASE ?
Jeremy Chadwick
koitsu at FreeBSD.org
Mon Aug 11 11:21:19 UTC 2008
On Mon, Aug 11, 2008 at 03:38:04PM +0530, Ashish Shukla wrote:
> Following is the test program I wrote to reproduce the error.
>
> ----8<----8<----
> abbe [~] monte-cristo% cat test.c
> extern char ** _environ;
>
> #ifndef NULL
> #define NULL (char**)0
> #endif
>
> int main()
> {
> _environ = NULL;
> }
> abbe [~] monte-cristo% cc -o test test.c
> /var/tmp//ccz3twdu.o(.text+0x7): In function `main':
> : undefined reference to `_environ'
> abbe [~] monte-cristo% sed -e s/_environ/environ/g -i '' test.c
> abbe [~] monte-cristo% cat test.c
> extern char ** environ;
>
> #ifndef NULL
> #define NULL (char**)0
> #endif
>
> int main()
> {
> environ = NULL;
> }
> abbe [~] monte-cristo% cc -o test test.c
> abbe [xine-lib-1.1.14] monte-cristo% cat /etc/make.conf
> CPUTYPE?=nocona
> CFLAGS= -O2 -fno-strict-aliasing -pipe -msse -msse2 -msse3 -mmmx -march=nocona
> MAKEOPTS=-j3
> ---->8---->8----
>
> The '__environ' symbol is also not defined. Can anyone hint me, what is misconfigured on my box ?
Something tells me this might interest you. See the most recent commit:
http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/stdlib/getenv.c
--
| Jeremy Chadwick jdc at parodius.com |
| Parodius Networking http://www.parodius.com/ |
| UNIX Systems Administrator Mountain View, CA, USA |
| Making life hard for others since 1977. PGP: 4BD6C0CB |
More information about the freebsd-ports
mailing list