From owner-freebsd-ports@FreeBSD.ORG Mon Aug 11 11:21:19 2008 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC7241065686 for ; Mon, 11 Aug 2008 11:21:19 +0000 (UTC) (envelope-from jdc@parodius.com) Received: from mx01.sc1.parodius.com (mx01.sc1.parodius.com [72.20.106.3]) by mx1.freebsd.org (Postfix) with ESMTP id AAEA18FC2F for ; Mon, 11 Aug 2008 11:21:19 +0000 (UTC) (envelope-from jdc@parodius.com) Received: by mx01.sc1.parodius.com (Postfix, from userid 1000) id 11B031CC0BE; Mon, 11 Aug 2008 04:21:19 -0700 (PDT) Date: Mon, 11 Aug 2008 04:21:19 -0700 From: Jeremy Chadwick To: Ashish Shukla Message-ID: <20080811112119.GA20914@eos.sc1.parodius.com> References: <200808111538.09660.wahjava.ml@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200808111538.09660.wahjava.ml@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-ports@freebsd.org Subject: Re: Is _environ present in 7.0-RELEASE ? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2008 11:21:19 -0000 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 |