From owner-freebsd-current@FreeBSD.ORG Tue Mar 23 22:36:26 2010 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 ACEA51065670 for ; Tue, 23 Mar 2010 22:36:26 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-relay2.uni-muenster.de (ZIVM-RELAY2.UNI-MUENSTER.DE [128.176.192.13]) by mx1.freebsd.org (Postfix) with ESMTP id 37A288FC1F for ; Tue, 23 Mar 2010 22:36:25 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.51,297,1267398000"; d="scan'208";a="239888148" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER01.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay2.uni-muenster.de with ESMTP; 23 Mar 2010 23:36:24 +0100 Received: by ZIVMAILUSER01.UNI-MUENSTER.DE (Postfix, from userid 149459) id 4A7561B0768; Tue, 23 Mar 2010 23:36:24 +0100 (CET) Date: Tue, 23 Mar 2010 23:36:22 +0100 (CET) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Message-ID: In-Reply-To: <790a9fff1003231119h5a91d9c6kdc5d50de7ec43eff@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: Re: build failures after stdlib update 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: Tue, 23 Mar 2010 22:36:26 -0000 Scot Hetzel schrieb am 2010-03-23: > On Tue, Mar 23, 2010 at 4:34 AM, Alexander Best > wrote: > > i don't think conf/112997 and the issue where gcc segfaults are > > directly > > related to each other: > > 1. if CPUTYPE is set to 'native' your patch uses `gcc -v -x c -E > > -mtune=native > > /dev/null -o /dev/null 2>&1 | grep mtune | sed -e 's/.*mtune=//'` > > to determine > > gcc's idea of the appropriate -mtune value. that command however > > segfaults. so > > this doesn't really help. > The command runs correctly with a properly built gcc: > # gcc -v -x c -E -mtune=native /dev/null -o /dev/null 2>&1 | grep > mtune | sed -e 's/.*mtune=//' > generic i was finally able to solve this issue. it turns out the issue was caused by an option in my CLFAGS called "-fno-builtin". sys/conf/NOTES recommends using this switch for kernel builds, but it seems in a world environment the flag is harmful to gcc. a gcc built with "-fno-builtin" trips over strlen() for some reason. you should be able to reproduce this problem simply by adding "-O2 -fno-strict-aliasing -pipe -fno-builtin" to your CFLAGS. maybe "-O2 -fno-builtin" triggers it too, but "-fno-builtin" (without -O2) doesn't. thanks to everyone for all the help. :) cheers. alex > > 2. i wasn't able to reproduce your `make -V MACHINE_CPU > > -DCPUTYPE=native` > > examples. for me `make` prints the same no matter what CPUTYPE is > > set to: > > otaku% make -V MACHINE_CPU -DCPUTYPE=native > > amd64 sse2 sse > > otaku% make -V MACHINE_CPU -DCPUTYPE=nocona > > amd64 sse2 sse > > otaku% make -V MACHINE_CPU -DCPUTYPE=i386 > > amd64 sse2 sse > > otaku% make -V MACHINE_CPU -DCPUTYPE=lalalala > > amd64 sse2 sse > > ..oh and of course i ran these commands with no CPUTYPE set in > > make.conf. ;) > If I run the same commands as above, I get similar results: > # make -V MACHINE_CPU -DCPUTYPE=native > amd64 sse2 sse > # make -V MACHINE_CPU -DCPUTYPE=k8 > amd64 sse2 sse > # make -V MACHINE_CPU -DCPUTYPE=nocona > amd64 sse2 sse > # make -V MACHINE_CPU -DCPUTYPE=i386 > amd64 sse2 sse > # make -V MACHINE_CPU -DCPUTYPE=lala > amd64 sse2 sse > But if I run the commands without the "-D", it shows the problem > correctly: > # make -V MACHINE_CPU CPUTYPE=native > unknown amd64 sse2 sse mmx > # make -V MACHINE_CPU CPUTYPE=k8 > k8 3dnow amd64 sse2 sse mmx > # make -V MACHINE_CPU CPUTYPE=nocona > sse3 amd64 sse2 sse mmx > # make -V MACHINE_CPU CPUTYPE=i386 > unknown amd64 sse2 sse mmx > # make -V MACHINE_CPU CPUTYPE=lalala > unknown amd64 sse2 sse mmx > # grep CPUTYPE /etc/make.conf /etc/src.conf > grep: /etc/src.conf: No such file or directory > This was run under a Feb 28th -CURRENT. > Now here is something strange. Defining CPUTYPE in /etc/src.conf has > no effect on the output of MACHING_CPU. > /etc/src.conf: 1 lines, 11 characters. > # make -V MACHINE_CPU ; grep CPUTYPE /etc/make.conf /etc/src.conf > amd64 sse2 sse > /etc/src.conf:CPUTYPE=k8 > # make -V MACHINE_CPU ; grep CPUTYPE /etc/make.conf /etc/src.conf > k8 3dnow amd64 sse2 sse mmx > /etc/make.conf:CPUTYPE=k8 > Scot -- Alexander Best