From owner-freebsd-current@FreeBSD.ORG Wed Sep 29 15:57:04 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 361961065806; Wed, 29 Sep 2010 15:57:03 +0000 (UTC) (envelope-from dlt@mebtel.net) Received: from mail940c35.nsolutionszone.com (mail940c35.nsolutionszone.com [209.235.152.130]) by mx1.freebsd.org (Postfix) with ESMTP id 86E5E8FC1B; Wed, 29 Sep 2010 15:57:02 +0000 (UTC) X-POP-User: dlt.mebtel.net Received: from localhost (99-194-23-158.dyn.centurytel.net [99.194.23.158]) by mail940c35.nsolutionszone.com (8.13.6/8.13.1) with ESMTP id o8TFuxNc027525; Wed, 29 Sep 2010 15:57:00 GMT Date: Wed, 29 Sep 2010 11:56:59 -0400 From: Derek Tattersall To: Dimitry Andric Message-ID: <20100929155659.GA82433@oriental.arm.org> References: <4C99A53E.7060707@FreeBSD.org> <20100929002843.GA5001@oriental.arm.org> <4CA2E00D.3080102@FreeBSD.org> <4CA3244D.7030907@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CA3244D.7030907@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-CSC: 0 X-CHA: v=1.1 cv=nRMQXXDkJm4awCcx+M7+jmO1Ng3APGd8nKmIJUVj4hw= c=1 sm=1 a=BUHArxkelXkA:10 a=GPr01A5e9VcA:10 a=kj9zAlcOel0A:10 a=5FSmvsqyZ8dLHOg+TByL6Q==:17 a=6I5d2MoRAAAA:8 a=_IEhM8lNAAAA:8 a=xwPayol1AAAA:8 a=CjxXgO3LAAAA:8 a=pGLkceISAAAA:8 a=napnQit-wInXbOPhmfYA:9 a=rp46ZIqd_4T7ICMuPsgA:7 a=WAwbG0H6a0Rgpqs1CWJKjPqdQNwA:4 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=0Ob1RWNGeVAA:10 a=rC2wZJ5BpNYA:10 a=MSl-tDqOz04A:10 a=5FSmvsqyZ8dLHOg+TByL6Q==:117 Cc: Renato Botelho , current@freebsd.org Subject: Re: Clang now builds world and kernel, on i386 and amd64 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dlt@mebtel.net List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2010 15:57:04 -0000 * Dimitry Andric [100929 08:55]: > On 2010-09-29 13:23, Renato Botelho wrote: > > #!/usr/bin/perl > > > > use File::Temp; > > > > my ( $fh, $filename ) = File::Temp::tempfile(); > > print "$filename\n"; > > For me it works perfectly, though I am using perl 5.10: > > $ cat foo.pl > #!/usr/bin/perl > > use File::Temp; > > my ( $fh, $filename ) = File::Temp::tempfile(); > print "$filename\n"; > $ perl -v > > This is perl, v5.10.1 (*) built for i386-freebsd-64int > > Copyright 1987-2009, Larry Wall > > Perl may be copied only under the terms of either the Artistic License or the > GNU General Public License, which may be found in the Perl 5 source kit. > > Complete documentation for Perl, including FAQ lists, should be found on > this system using "man perl" or "perldoc perl". If you have access to the > Internet, point your browser at http://www.perl.org/, the Perl Home Page. > > $ perl foo.pl > /tmp/tv25CPnWhF > $ perl foo.pl > /tmp/L2UJQ5_JJs > $ perl foo.pl > /tmp/6ynQYvWIc1 > $ perl foo.pl > /tmp/Tdpf7PKBMg > $ perl foo.pl > /tmp/76ir2i1ici > $ perl foo.pl > /tmp/LhfD0eZgd8 > > I'll try building perl 5.12 and try it again. > > Btw, I assume you did *not* rebuild perl with clang, so your perl is > still compiled with gcc? > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" I built a test case using perl 5.12 and demonstrated that calling int(rand()) in perl returns NAN, as does calling rand() by itself. A "C" program that calls libc's rand() does return differing integers. The perl documentation claims that perl's rand() calls "C"s rand() and srand() if necessary. I think this effectively demonstrates that the problem lies with the perl function rand() and it's interface to libc's rand() as provided by clang. On a recent stable system, perl's mktemp works fine. The only real difference is that libc on stable is built with gcc and libc on current is built with clang. The perl source for mktemp() is in /usr/local/lib/perl5/5.12.2/File/Temp.pm. The line that builds the filename from the template is line 632. -- Best regards, Derek Tattersall dlt@mebtel.net dlt666@yahoo.com dtatters@gmail.com