Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Sep 2010 15:22:07 -0300
From:      Renato Botelho <rbgarga@gmail.com>
To:        Roman Divacky <rdivacky@freebsd.org>
Cc:        Derek Tattersall <dlt@mebtel.net>, Dimitry Andric <dim@freebsd.org>, current@freebsd.org
Subject:   Re: Clang now builds world and kernel, on i386 and amd64
Message-ID:  <AANLkTikPFi3gjXHGzq3hFBSBzA0j%2BWsOAHM-d8SYNWuD@mail.gmail.com>
In-Reply-To: <20100929174434.GA75072@freebsd.org>
References:  <4C99A53E.7060707@FreeBSD.org> <AANLkTimYj1VnVQBLROE94rqPYO7pQyHWfpjiYYZ2ORrX@mail.gmail.com> <AANLkTikm0FrJbOTiRPQhcqM30N-GyOYRBk_8jR-Gq9jF@mail.gmail.com> <20100929002843.GA5001@oriental.arm.org> <4CA2E00D.3080102@FreeBSD.org> <AANLkTik4k%2Bg8NGwRUp=7bvF2MiHhbBOHmA=Ree_-xRDT@mail.gmail.com> <4CA3244D.7030907@FreeBSD.org> <20100929155659.GA82433@oriental.arm.org> <20100929173158.GA73653@freebsd.org> <AANLkTi=6n0%2BEYsXT5aG_mjFmTK=fUYhwptvW%2Bn4zQMOK@mail.gmail.com> <20100929174434.GA75072@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 29, 2010 at 2:44 PM, Roman Divacky <rdivacky@freebsd.org> wrote:
> 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 :(

It's using drand48() instead of rand()

root@botelhor:/usr/ports/lang/perl5.12# make configure |& grep -i rand
drand48_r() NOT found.
random_r() NOT found.
srand48_r() NOT found.
srandom_r() NOT found.
Looking for a random number function...
Good, found drand48().
Use which function to generate random numbers? [drand48]
Checking how to generate random libraries on your machine...

Test results here:

GCC libc:
garga@botelhor:~/testes> ./test
random value 0.396465

clang libc:
garga@botelhor:~/testes> ./test
random value -inf

Source of test.c:

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int main() {
        printf("random value %f\n", drand48());
        exit(0);
}

-- 
Renato Botelho



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTikPFi3gjXHGzq3hFBSBzA0j%2BWsOAHM-d8SYNWuD>