Clang now builds world and kernel, on i386 and amd64

Renato Botelho rbgarga at gmail.com
Wed Sep 29 18:22:32 UTC 2010


On Wed, Sep 29, 2010 at 2:44 PM, Roman Divacky <rdivacky at 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 at 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 at botelhor:~/testes> ./test
random value 0.396465

clang libc:
garga at 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


More information about the freebsd-current mailing list