Ondřej Surý <ond...@sury.org> writes:

> /«PKGBUILDDIR»/5.2-cqueues/.libs/liblua5.2-cqueues.so: undefined
> reference to `getpeereid'
> /«PKGBUILDDIR»/5.2-cqueues/.libs/liblua5.2-cqueues.so: undefined
> reference to `arc4random'

I was afraid it wouldn't be quite that simple.  It looks like these come
from libbsd (naturally enough), so I see three possible fixes offhand:

* Use libbsd only on kFreeBSD.

* Use libbsd everywhere, and take the opportunity to use arc4random on
  Linux (by building with -DDNS_RANDOM=arc4random).

* Avoid libbsd altogether by building with -DDNS_RANDOM=random or
  -DDNS_RANDOM=RAND_bytes and replacing the call to getpeereid with
  direct use of the LOCAL_PEERCRED ioctl, which works with struct
  xucred.

Please note that when using libbsd, you should pull in its headers,
either via explicit #include directives (<bsd/unistd.h> for getpeereid,
<bsd/stdlib.h> for arc4random) or by building with
-I/usr/include/bsd -DLIBBSD_OVERLAY

Thanks!

-- 
Aaron M. Ucko, KB1CJC (amu at alum.mit.edu, ucko at debian.org)
http://www.mit.edu/~amu/ | http://stuff.mit.edu/cgi/finger/?a...@monk.mit.edu

Reply via email to