From owner-freebsd-current@FreeBSD.ORG Sat Aug 4 18:22:59 2007 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 587B916A417 for ; Sat, 4 Aug 2007 18:22:59 +0000 (UTC) (envelope-from nik@cs.chalmers.se) Received: from anubis.medic.chalmers.se (anubis.medic.chalmers.se [129.16.30.218]) by mx1.freebsd.org (Postfix) with ESMTP id 2AB7F13C4B5 for ; Sat, 4 Aug 2007 18:22:59 +0000 (UTC) (envelope-from nik@cs.chalmers.se) Received: from [83.226.118.238] (c-ee76e253.1530-1-64736c11.cust.bredbandsbolaget.se [83.226.118.238]) (Authenticated sender: nik) by anubis.medic.chalmers.se (Postfix) with ESMTP id 2858EE2C3 for ; Sat, 4 Aug 2007 19:52:23 +0200 (CEST) Message-ID: <46B4BC80.1080902@cs.chalmers.se> Date: Sat, 04 Aug 2007 19:50:56 +0200 From: Niklas Sorensson User-Agent: Thunderbird 2.0.0.6 (X11/20070803) MIME-Version: 1.0 To: freebsd-current@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Sat, 04 Aug 2007 18:56:47 +0000 Cc: Subject: gcc 4.2 profiling breaks argv X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Aug 2007 18:22:59 -0000 Hi, following up on the thread started by Nick Frampton yesterday: I can repeat the problem, although it looks slightly different. Instead of crashing when argv is accessed, both argc and argv are zero. This behavior is triggered by both gcc 4.2.0 and 4.2.1: nik> cat test.c #include int main (int argc, char **argv) { fprintf (stderr, "argc=%d, argv=%p\n", argc, argv); return 0; } nik> cc -c -o test.o -pg test.c && cc -o test -pg test.o nik> ./test argc=0, argv=0x0 nik> gcc42 -c -o test.o -pg test.c && gcc42 -o test -pg test.o nik> ./test argc=0, argv=0x0 nik> cc -v Using built-in specs. Target: i386-undermydesk-freebsd Configured with: FreeBSD/i386 system compiler Thread model: posix gcc version 4.2.0 20070514 [FreeBSD] nik> gcc42 -v Using built-in specs. Target: i386-portbld-freebsd7.0 Configured with: ./..//gcc-4.2.1-RC-20070712/configure --disable-nls --with-system-zlib --with-libiconv-prefix=/usr/local --with-gmp=/usr/local --program-suffix=42 --libdir=/usr/local/lib/gcc-4.2.1 --with-gxx-include-dir=/usr/local/lib/gcc-4.2.1/include/c++/ --disable-libgcj --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc42 i386-portbld-freebsd7.0 Thread model: posix gcc version 4.2.1 20070712 (prerelease) nik> uname -a FreeBSD apa 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Fri Aug 3 18:08:53 CEST 2007 root@apa:/usr/obj/usr/src/sys/APA i386 Incidentally, I noticed that lang/gcc42 fails to build unless GNU awk is installed. There is at least one awk-script used during the build that produces the wrong result with the default awk. I think other gcc-based ports may be affected, since I observed the same problem with lang/llvm-gcc4. Cheers, /Niklas