Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Aug 2008 04:21:19 -0700
From:      Jeremy Chadwick <koitsu@FreeBSD.org>
To:        Ashish Shukla <wahjava.ml@gmail.com>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: Is _environ present in 7.0-RELEASE ?
Message-ID:  <20080811112119.GA20914@eos.sc1.parodius.com>
In-Reply-To: <200808111538.09660.wahjava.ml@gmail.com>
References:  <200808111538.09660.wahjava.ml@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 |




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080811112119.GA20914>