/home/xxx/libevent.a(evutil_rand.o): In function `arc4_seed_getrandom':
/home/xxx/open_src/libevent-2.1.12-stable/./arc4random.c:188: undefined reference to `getrandom'
collect2: error: ld returned 1 exit status
主要原因是libevent.a 是在一台具有getrandom系统调用的机器上编译的,可看下图
?ape???? nm libevent.a | grep random
0000000000000100 t bev_group_random_element_
0000000000000000 b arc4random_urandom_filename
0000000000000000 t arc4_seed_urandom_helper_
0000000000000520 T evutil_secure_rng_set_urandom_device_file
U getrandom
0000000000004600 T evdns_set_random_bytes_fn
当该库在一台不具有getrandom的机器上使用的时候,就会出现问题。
getrandom() was introduced in version 3.17 of the Linux kernel.
Support was added to glibc in version 2.25.
|