Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspberry Pi - nearly builds, builds a lot, then fails with /usr/bin/ld: ./.libs/libevent.so: undefined reference to arc4random_addrandom'` 🙄 #209

Open
enjoysmath opened this issue Apr 1, 2024 · 1 comment

Comments

@enjoysmath
Copy link

checking for pid_t... yes
checking for size_t... yes
checking for ssize_t... yes
checking for uint64_t... yes
checking for uint32_t... yes
checking for uint16_t... yes
checking for uint8_t... yes
checking for uintptr_t... yes
checking for fd_mask... yes
checking size of long long... 8
checking size of long... 8
checking size of int... 4
checking size of short... 2
checking size of size_t... 8
checking size of void *... 8
checking size of off_t... 8
checking for struct in6_addr... yes
checking for struct sockaddr_in6... yes
checking for sa_family_t... yes
checking for struct addrinfo... yes
checking for struct sockaddr_storage... yes
checking for struct in6_addr.s6_addr32... yes
checking for struct in6_addr.s6_addr16... yes
checking for struct sockaddr_in.sin_len... no
checking for struct sockaddr_in6.sin6_len... no
checking for struct sockaddr_storage.ss_family... yes
checking for struct sockaddr_storage.__ss_family... no
checking for struct so_linger... no
checking for socklen_t... yes
checking whether our compiler supports __func__... yes
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking size of pthread_t... 8
checking for library containing ERR_remove_thread_state... -lcrypto
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating libevent.pc
config.status: creating libevent_openssl.pc
config.status: creating libevent_pthreads.pc
config.status: creating libevent_core.pc
config.status: creating libevent_extra.pc
config.status: creating Makefile
config.status: creating config.h
config.status: creating evconfig-private.h
config.status: executing depfiles commands
config.status: executing libtool commands
[  9%] Performing build step for 'libevent'
  GEN      test/rpcgen-attempted
  File "/home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/test/../event_rpcgen.py", line 39
    print s
    ^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
event_rpcgen.py failed, /home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/test/regress.gen.\[ch\] will be reused.
  GEN      include/event2/event-config.h
  CC       buffer.lo
  CC       bufferevent.lo
  CC       bufferevent_filter.lo
/home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/bufferevent_filter.c: In function ‘be_filter_ctrl’:
/home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/bufferevent_filter.c:610:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
  610 |                 if (bevf->underlying &&
      |                    ^
/home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/bufferevent_filter.c:616:9: note: here
  616 |         case BEV_CTRL_GET_FD:
      |         ^~~~
  CC       bufferevent_pair.lo
  CC       bufferevent_ratelim.lo
  CC       bufferevent_sock.lo
  CC       event.lo
/home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/event.c: In function ‘event_signal_closure’:
/home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/event.c:1319:32: warning: storing the address of local variable ‘ncalls’ in ‘*ev.ev_.ev_signal.ev_pncalls’ [-Wdangling-pointer=]
 1319 |                 ev->ev_pncalls = &ncalls;
      |                 ~~~~~~~~~~~~~~~^~~~~~~~~
/home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/event.c:1313:15: note: ‘ncalls’ declared here
 1313 |         short ncalls;
      |               ^~~~~~
/home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/event.c:1313:15: note: ‘ev’ declared here
  CC       evmap.lo
  CC       evthread.lo
  CC       evutil.lo
/home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/evutil.c:208:21: warning: argument 4 of type ‘int[2]’ with mismatched bound [-Warray-parameter=]
  208 |     evutil_socket_t fd[2])
In file included from /home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/evutil.c:80:
/home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/include/event2/util.h:312:25: note: previously declared as ‘int[]’
  312 | #define evutil_socket_t int
/home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/util-internal.h:268:47: note: in expansion of macro ‘evutil_socket_t’
  268 | int evutil_ersatz_socketpair_(int, int , int, evutil_socket_t[]);
      |                                               ^~~~~~~~~~~~~~~
  CC       evutil_rand.lo
/home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/evutil_rand.c: In function ‘evutil_secure_rng_add_bytes’:
/home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/evutil_rand.c:198:9: warning: implicit declaration of function ‘arc4random_addrandom’ [-Wimplicit-function-declaration]
  198 |         arc4random_addrandom((unsigned char*)buf,
      |         ^~~~~~~~~~~~~~~~~~~~
/home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/evutil_rand.c:198:9: warning: nested extern declaration of ‘arc4random_addrandom’ [-Wnested-externs]
  CC       evutil_time.lo
  CC       listener.lo
  CC       log.lo
  CC       strlcpy.lo
  CC       select.lo
  CC       poll.lo
  CC       epoll.lo
  CC       signal.lo
  CC       evdns.lo
/home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/evdns.c: In function ‘evdns_request_transmit’:
/home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/evdns.c:2269:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
 2269 |                 retcode = 1;
      |                 ~~~~~~~~^~~
/home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/evdns.c:2272:9: note: here
 2272 |         default:
      |         ^~~~~~~
  CC       event_tagging.lo
  CC       evrpc.lo
  CC       http.lo
  CCLD     libevent.la
ar: `u' modifier ignored since `D' is the default (see `U')
  CCLD     libevent_core.la
ar: `u' modifier ignored since `D' is the default (see `U')
  CCLD     libevent_extra.la
ar: `u' modifier ignored since `D' is the default (see `U')
  CC       evthread_pthread.lo
  CCLD     libevent_pthreads.la
ar: `u' modifier ignored since `D' is the default (see `U')
  CC       libevent_openssl_la-bufferevent_openssl.lo
  CCLD     libevent_openssl.la
ar: `u' modifier ignored since `D' is the default (see `U')
  CC       sample/dns-example.o
/home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/sample/dns-example.c: In function ‘main’:
/home/dshuser/uscxml/build/raspberry/deps/libevent/src/libevent/sample/dns-example.c:169:48: warning: comparison is always true due to limited range of data type [-Wtype-limits]
  169 |         while ((opt = getopt(c, v, "xvc:Ts:")) != -1) {
      |                                                ^~
  CCLD     sample/dns-example
/usr/bin/ld: ./.libs/libevent.so: undefined reference to `arc4random_addrandom'
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:1400: sample/dns-example] Error 1
make[3]: *** [Makefile:1248: all] Error 2
make[2]: *** [CMakeFiles/libevent.dir/build.make:86: deps/libevent/src/libevent-stamp/libevent-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:283: CMakeFiles/libevent.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
dshuser@raspberrypi:~/uscxml/build/raspberry$

I need this tool urgently for a paid Raspberry Pi 4 controlled house solar heating system. The system is simply too complicated to code / manage without such a tool. How can I fix this error? Thank you! 😎

@enjoysmath
Copy link
Author

Looks like someone is using Python 2 print statements EVERYWHERE!!!! 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant