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

Solaris 11.3 and missing symbols be64toh, htobe64 #29

Closed
noloader opened this issue May 4, 2019 · 2 comments
Closed

Solaris 11.3 and missing symbols be64toh, htobe64 #29

noloader opened this issue May 4, 2019 · 2 comments

Comments

@noloader
Copy link
Contributor

noloader commented May 4, 2019

Results from building Unbound 1.9.1 tarball on Solaris 11.3 i86pc. Unbound compiles fine on Solaris. It looks like a couple of symbols are missing on the non-GNU systems.

libtool: link: gcc -I. -I/usr/local/include -DNDEBUG -I/usr/local/include -I/usr/local/include -I/usr/local/include -DSRCDIR=. -g2 -O2 -march=native -fPIC -pthread -std=c99 -D_REENTRANT -pthreads -Wl,-R -Wl,/usr/local/lib -o unbound-host .libs/unbound-host.o .libs/keyraw.o .libs/sbuffer.o .libs/wire2str.o .libs/parse.o .libs/parseutil.o .libs/rrdef.o .libs/str2wire.o .libs/explicit_bzero.o  -L/usr/local/lib -L. -L.libs /export/home/build/unbound-1.9.1/.libs/libunbound.a -lssl -lsocket -lnsl -ldl -lpthread -lcrypto -lhiredis -pthreads -pthread  -R/usr/local/lib
Undefined                       first referenced
 symbol                             in file
be64toh                             /export/home/build/unbound-1.9.1/.libs/libunbound.a(cachedb.o)
htobe64                             /export/home/build/unbound-1.9.1/.libs/libunbound.a(cachedb.o)
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
gmake: *** [unbound-host] Error 1
gmake: *** Waiting for unfinished jobs....
libtool: link: gcc -I. -I/usr/local/include -DNDEBUG -I/usr/local/include -I/usr/local/include -I/usr/local/include -DSRCDIR=. -g2 -O2 -march=native -fPIC -pthread -std=c99 -D_REENTRANT -pthreads -Wl,-R -Wl,/usr/local/lib -o unbound-checkconf .libs/unbound-checkconf.o .libs/worker_cb.o .libs/dns.o .libs/infra.o .libs/rrset.o .libs/dname.o .libs/msgencode.o .libs/as112.o .libs/msgparse.o .libs/msgreply.o .libs/packed_rrset.o .libs/iterator.o .libs/iter_delegpt.o .libs/iter_donotq.o .libs/iter_fwd.o .libs/iter_hints.o .libs/iter_priv.o .libs/iter_resptype.o .libs/iter_scrub.o .libs/iter_utils.o .libs/localzone.o .libs/mesh.o .libs/modstack.o .libs/view.o .libs/outbound_list.o .libs/alloc.o .libs/config_file.o .libs/configlexer.o .libs/configparser.o .libs/fptr_wlist.o .libs/edns.o .libs/locks.o .libs/log.o .libs/mini_event.o .libs/module.o .libs/net_help.o .libs/random.o .libs/rbtree.o .libs/regional.o .libs/rtt.o .libs/dnstree.o .libs/lookup3.o .libs/lruhash.o .libs/slabhash.o .libs/tcp_conn_limit.o .libs/timehist.o .libs/tube.o .libs/winsock_event.o .libs/autotrust.o .libs/val_anchor.o .libs/validator.o .libs/val_kcache.o .libs/val_kentry.o .libs/val_neg.o .libs/val_nsec3.o .libs/val_nsec.o .libs/val_secalgo.o .libs/val_sigcrypt.o .libs/val_utils.o .libs/dns64.o .libs/cachedb.o .libs/redis.o .libs/authzone.o .libs/respip.o .libs/netevent.o .libs/listen_dnsport.o .libs/outside_network.o .libs/ub_event.o .libs/keyraw.o .libs/sbuffer.o .libs/wire2str.o .libs/parse.o .libs/parseutil.o .libs/rrdef.o .libs/str2wire.o .libs/explicit_bzero.o .libs/reallocarray.o .libs/arc4random.o .libs/arc4random_uniform.o .libs/arc4_lock.o  -L/usr/local/lib -lssl -lsocket -lnsl -ldl -lpthread -lcrypto -lhiredis -pthreads -pthread  -R/usr/local/lib
libtool: link: gcc -I. -I/usr/local/include -DNDEBUG -I/usr/local/include -I/usr/local/include -I/usr/local/include -DSRCDIR=. -g2 -O2 -march=native -fPIC -pthread -std=c99 -D_REENTRANT -pthreads -Wl,-R -Wl,/usr/local/lib -o unbound-control .libs/unbound-control.o .libs/worker_cb.o .libs/dns.o .libs/infra.o .libs/rrset.o .libs/dname.o .libs/msgencode.o .libs/as112.o .libs/msgparse.o .libs/msgreply.o .libs/packed_rrset.o .libs/iterator.o .libs/iter_delegpt.o .libs/iter_donotq.o .libs/iter_fwd.o .libs/iter_hints.o .libs/iter_priv.o .libs/iter_resptype.o .libs/iter_scrub.o .libs/iter_utils.o .libs/localzone.o .libs/mesh.o .libs/modstack.o .libs/view.o .libs/outbound_list.o .libs/alloc.o .libs/config_file.o .libs/configlexer.o .libs/configparser.o .libs/fptr_wlist.o .libs/edns.o .libs/locks.o .libs/log.o .libs/mini_event.o .libs/module.o .libs/net_help.o .libs/random.o .libs/rbtree.o .libs/regional.o .libs/rtt.o .libs/dnstree.o .libs/lookup3.o .libs/lruhash.o .libs/slabhash.o .libs/tcp_conn_limit.o .libs/timehist.o .libs/tube.o .libs/winsock_event.o .libs/autotrust.o .libs/val_anchor.o .libs/validator.o .libs/val_kcache.o .libs/val_kentry.o .libs/val_neg.o .libs/val_nsec3.o .libs/val_nsec.o .libs/val_secalgo.o .libs/val_sigcrypt.o .libs/val_utils.o .libs/dns64.o .libs/cachedb.o .libs/redis.o .libs/authzone.o .libs/respip.o .libs/netevent.o .libs/listen_dnsport.o .libs/outside_network.o .libs/ub_event.o .libs/keyraw.o .libs/sbuffer.o .libs/wire2str.o .libs/parse.o .libs/parseutil.o .libs/rrdef.o .libs/str2wire.o .libs/explicit_bzero.o .libs/reallocarray.o .libs/arc4random.o .libs/arc4random_uniform.o .libs/arc4_lock.o  -L/usr/local/lib -lssl -lsocket -lnsl -ldl -lpthread -lcrypto -lhiredis -pthreads -pthread  -R/usr/local/lib
libtool: link: gcc -I. -I/usr/local/include -DNDEBUG -I/usr/local/include -I/usr/local/include -I/usr/local/include -DSRCDIR=. -g2 -O2 -march=native -fPIC -pthread -std=c99 -D_REENTRANT -pthreads -Wl,-R -Wl,/usr/local/lib -o unbound .libs/acl_list.o .libs/cachedump.o .libs/daemon.o .libs/shm_main.o .libs/remote.o .libs/stats.o .libs/unbound.o .libs/worker.o .libs/dns.o .libs/infra.o .libs/rrset.o .libs/dname.o .libs/msgencode.o .libs/as112.o .libs/msgparse.o .libs/msgreply.o .libs/packed_rrset.o .libs/iterator.o .libs/iter_delegpt.o .libs/iter_donotq.o .libs/iter_fwd.o .libs/iter_hints.o .libs/iter_priv.o .libs/iter_resptype.o .libs/iter_scrub.o .libs/iter_utils.o .libs/localzone.o .libs/mesh.o .libs/modstack.o .libs/view.o .libs/outbound_list.o .libs/alloc.o .libs/config_file.o .libs/configlexer.o .libs/configparser.o .libs/fptr_wlist.o .libs/edns.o .libs/locks.o .libs/log.o .libs/mini_event.o .libs/module.o .libs/net_help.o .libs/random.o .libs/rbtree.o .libs/regional.o .libs/rtt.o .libs/dnstree.o .libs/lookup3.o .libs/lruhash.o .libs/slabhash.o .libs/tcp_conn_limit.o .libs/timehist.o .libs/tube.o .libs/winsock_event.o .libs/autotrust.o .libs/val_anchor.o .libs/validator.o .libs/val_kcache.o .libs/val_kentry.o .libs/val_neg.o .libs/val_nsec3.o .libs/val_nsec.o .libs/val_secalgo.o .libs/val_sigcrypt.o .libs/val_utils.o .libs/dns64.o .libs/cachedb.o .libs/redis.o .libs/authzone.o .libs/respip.o .libs/netevent.o .libs/listen_dnsport.o .libs/outside_network.o .libs/ub_event.o .libs/keyraw.o .libs/sbuffer.o .libs/wire2str.o .libs/parse.o .libs/parseutil.o .libs/rrdef.o .libs/str2wire.o .libs/explicit_bzero.o .libs/reallocarray.o .libs/arc4random.o .libs/arc4random_uniform.o .libs/arc4_lock.o  -L/usr/local/lib -lssl -lsocket -lnsl -ldl -lpthread -lcrypto -lhiredis -pthreads -pthread  -R/usr/local/lib
Undefined                       first referenced
 symbol                             in file
be64toh                             .libs/cachedb.o
htobe64                             .libs/cachedb.o
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
gmake: *** [unbound-checkconf] Error 1
Undefined                       first referenced
 symbol                             in file
be64toh                             .libs/cachedb.o
htobe64                             .libs/cachedb.o
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
gmake: *** [unbound-control] Error 1
Undefined                       first referenced
 symbol                             in file
be64toh                             .libs/cachedb.o
htobe64                             .libs/cachedb.o
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
gmake: *** [unbound] Error 1
Failed to build Unbound
@noloader
Copy link
Contributor Author

noloader commented May 4, 2019

Here is what I used in my build scripts: Commit 7840fb169e96. You might find it useful as a starting point. You might also find Is there any “standard” htonl-like function for 64 bits integers useful.

Unbound tested OK on Solaris 11.3 i86pc after the change.


One word of warning... Do not do this:

#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__

__BYTE_ORDER__ seems to be a Linux thing. Some compilers do not define __BYTE_ORDER__, like Microsoft and IBM XLC on AIX. Just use:

#if __BIG_ENDIAN__

or

#if __LITTLE_ENDIAN__

@wcawijngaards
Copy link
Member

I changed your patch to include #ifndef be64toh before it, so that it does not trigger if used on Solaris with corrected header files (if those machines exist). But otherwise your patch was very helpful. Thank you!

jedisct1 added a commit to jedisct1/unbound that referenced this issue May 8, 2019
* nlnet/master:
  - Attempt to fix build failure in oss-fuzz
  - Fix doxygen output error on readme markdown vignettes.
  - Fix edns-subnet locks, in error cases the lock was not unlocked.
  Fix spelling in code annotation of changes
  - Fix NLnetLabs#30: AddressSanitizer finding in lookup3.c.
  - Fix NLnetLabs#29: Solaris 11.3 and missing symbols be64toh, htobe64.
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

2 participants