From owner-freebsd-perl@FreeBSD.ORG Wed Sep 29 18:03:00 2010 Return-Path: Delivered-To: perl@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66618106566C; Wed, 29 Sep 2010 18:03:00 +0000 (UTC) (envelope-from rbgarga@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9C9F68FC19; Wed, 29 Sep 2010 18:02:59 +0000 (UTC) Received: by wyb32 with SMTP id 32so17638wyb.13 for ; Wed, 29 Sep 2010 11:02:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=n96f/xduvhU4MkR1CYWmxXRFvv9kInK4KG5M3diZlHA=; b=g8ZVhcKihxrQtt3K5SLRXEM222oDg/ReUytrAJlD5IJyGbYwy0mBSmFW/2Awa1Xz27 myoxr2QtvXtxICaRBgeDeVjZ8OvV6k4F1Pd/dapqF7rkoo+spF9OMuCs/7b+AbXiW555 Z0n+tPvX2bp6d1DNcJAzROyuBCoXC0HfGuCy4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=oFHcx6+fo98Dt144ObjOtL+/uAJlM2phcsGXG6PzXGNZVqrjcoRRvlwFRswAoLYMU+ jMTeePkivCNcwx3mBdtAuuBVML+hO1llX9QvPORFd1Eurwu3rh6bpt9iQ202d9QhBOhe FwqSiNPlucu/TPFAbzlBhYUvtxRVtQ56KgMVE= Received: by 10.216.162.78 with SMTP id x56mr1753904wek.80.1285783378525; Wed, 29 Sep 2010 11:02:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.181.142 with HTTP; Wed, 29 Sep 2010 11:02:38 -0700 (PDT) In-Reply-To: <20100929174434.GA75072@freebsd.org> References: <4C99A53E.7060707@FreeBSD.org> <20100929002843.GA5001@oriental.arm.org> <4CA2E00D.3080102@FreeBSD.org> <4CA3244D.7030907@FreeBSD.org> <20100929155659.GA82433@oriental.arm.org> <20100929173158.GA73653@freebsd.org> <20100929174434.GA75072@freebsd.org> From: Renato Botelho Date: Wed, 29 Sep 2010 15:02:38 -0300 Message-ID: To: perl@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: FreeBSD Current Subject: Fwd: Clang now builds world and kernel, on i386 and amd64 X-BeenThere: freebsd-perl@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: maintainer of a number of perl-related ports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2010 18:03:00 -0000 Could you guys give us some help on this? ---------- Forwarded message ---------- From: Roman Divacky Date: Wed, Sep 29, 2010 at 2:44 PM Subject: Re: Clang now builds world and kernel, on i386 and amd64 To: Renato Botelho Cc: Derek Tattersall , Dimitry Andric , current@freebsd.org On Wed, Sep 29, 2010 at 02:41:17PM -0300, Renato Botelho wrote: > On Wed, Sep 29, 2010 at 2:31 PM, Roman Divacky wrote: > > On Wed, Sep 29, 2010 at 11:56:59AM -0400, Derek Tattersall wrote: > >> * 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. > > > > what does this show with clang libc? > > > > perl -e 'print int(rand(60)) . " \n" foreach (1 .. 10)' > > > > I guess it returns all 0, as the $CHAR[0] is 'A', can you test that? > > > > root@botelhor:/usr/src/lib/libc# perl -e 'print int(rand(60)) . " \n" > foreach (1 .. 10)' > nan > nan > nan > nan > nan > nan > nan > nan > nan > nan heh, now I noticed that Derek already wrote that ;) is anyone able to find where in perl sources the rand function is defined? I failed that :( -- Renato Botelho