unbound binaries execution issue

Hi All,

I get the below error while trying to launch unbound-host or unbound-anchor or any unbound executable in my build env. Can someone help to solve this issue?

sbaby@ubuntu:~/workspace/wqar/tmp/work/mips-mv-linux/libunbound-1.6.8-r0/libunbound/unbound-1.6.8$ ./unbound-host
./unbound-host: line 117: /home/sbaby/workspace/wqar/tmp/work/mips-mv-linux/libunbound-1.6.8-r0/libunbound/unbound-1.6.8/.libs/lt-unbound-host: cannot execute binary file
./unbound-host: line 117: /home/sbaby/workspace/wqar/tmp/work/mips-mv-linux/libunbound-1.6.8-r0/libunbound/unbound-1.6.8/.libs/lt-unbound-host: Success

sbaby@ubuntu:~/workspace/wqar/tmp/work/mips-mv-linux/libunbound-1.6.8-r0/libunbound/unbound-1.6.8$ ls -ll unbound-anchor
-rwxr-xr-x 1 sbaby sbaby 9402 2018-03-05 15:25 unbound-anchor
sbaby@ubuntu:~/workspace/wqar/tmp/work/mips-mv-linux/libunbound-1.6.8-r0/libunbound/unbound-1.6.8$ ./unbound-anchor
./unbound-anchor: line 117: /home/sbaby/workspace/wqar/tmp/work/mips-mv-linux/libunbound-1.6.8-r0/libunbound/unbound-1.6.8/.libs/lt-unbound-anchor: cannot execute binary file
./unbound-anchor: line 117: /home/sbaby/workspace/wqar/tmp/work/mips-mv-linux/libunbound-1.6.8-r0/libunbound/unbound-1.6.8/.libs/lt-unbound-anchor: Success
sbaby@ubuntu:~/workspace/wqar/tmp/work/mips-mv-linux/libunbound-1.6.8-r0/libunbound/unbound-1.6.8$

sbaby@ubuntu:~/workspace/wqar/tmp/work/mips-mv-linux/libunbound-1.6.8-r0/libunbound/unbound-1.6.8$ ls
acl_list.lo autotrust.lo config.status dnstree.lo iter_donotq.lo libunbound.lo Makefile.in netevent.lo rbtree.o services timehist.o unbound-host val_nsec.lo
acl_list.o autotrust.o config.sub dnstree.o iter_donotq.o libunbound.o malloc.lo netevent.o README shm_main.lo tube.lo unbound-host.lo val_nsec.o
aclocal.m4 ax_pthread.m4 configure doc iter_fwd.lo libworker.lo malloc.o net_help.lo reallocarray.lo shm_main.o tube.o unbound-host.o val_secalgo.lo
ac_pkg_swig.m4 cachedb configure.ac edns-subnet iter_fwd.o libworker.o memcmp.lo net_help.o reallocarray.o slabhash.lo ub_event.lo unbound.lo val_secalgo.o
acx_nlnetlabs.m4 cachedb.lo context.lo explicit_bzero.lo iter_hints.lo LICENSE memcmp.o outbound_list.lo regional.lo slabhash.o ub_event.o unbound.o val_sigcrypt.lo
acx_python.m4 cachedb.o context.o explicit_bzero.o iter_hints.o listen_dnsport.lo mesh.lo outbound_list.o regional.o sldns ub_event_pluggable.lo util val_sigcrypt.o
alloc.lo cachedump.lo contrib fptr_wlist.lo iter_priv.lo listen_dnsport.o mesh.o outside_network.lo remote.lo smallapp ub_event_pluggable.o val_anchor.lo val_utils.lo
alloc.o cachedump.o daemon fptr_wlist.o iter_priv.o localzone.lo mini_event.lo outside_network.o remote.o stats.lo unbound val_anchor.o val_utils.o
arc4_lock.lo compat daemon.lo getentropy_linux.lo iter_resptype.lo localzone.o mini_event.o packed_rrset.lo respip stats.o unbound-anchor validator view.lo
arc4_lock.o config_file.lo daemon.o getentropy_linux.o iter_resptype.o locks.lo modstack.lo packed_rrset.o respip.lo str2wire.lo unbound-anchor.lo validator.lo view.o
arc4random.lo config_file.o dname.lo infra.lo iter_scrub.lo locks.o modstack.o parse.lo respip.o str2wire.o unbound-anchor.o validator.o winrc
arc4random.o config.guess dname.o infra.o iter_scrub.o log.lo module.lo parse.o rrdef.lo strlcat.lo unbound-checkconf val_kcache.lo winsock_event.lo
arc4random_uniform.lo config.h dns64 install-sh iter_utils.lo log.o module.o parseutil.lo rrdef.o strlcat.o unbound-checkconf.lo val_kcache.o winsock_event.o
arc4random_uniform.o config.h.in dns64.lo ipsecmod iter_utils.o lookup3.lo msgencode.lo parseutil.o rrset.lo strlcpy.lo unbound-checkconf.o val_kentry.lo wire2str.lo
as112.lo configlexer.lo dns64.o iterator keyraw.lo lookup3.o msgencode.o patches rrset.o strlcpy.o unbound-control val_kentry.o wire2str.o
as112.o configlexer.o dnscrypt iterator.lo keyraw.o lruhash.lo msgparse.lo pythonmod rtt.lo systemd.m4 unbound-control.lo val_neg.lo worker_cb.lo
authzone.lo config.log dns.lo iterator.o libtool lruhash.o msgparse.o random.lo rtt.o testcode unbound-control.o val_neg.o worker_cb.o
authzone.o configparser.lo dns.o iter_delegpt.lo libunbound ltmain.sh msgreply.lo random.o sbuffer.lo testdata unbound-control-setup val_nsec3.lo worker.lo
autom4te.cache configparser.o dnstap iter_delegpt.o libunbound.la Makefile msgreply.o rbtree.lo sbuffer.o timehist.lo unbound.h val_nsec3.o worker.o

Rgds
simon

is "sbaby" a mips machines too? It looks like you are perhaps
cross-compiling, so in that case the binary cannot be tested
on the build host.

Or maybe your "mips-mv-linux" is a cross compile using a different
set of libraries (like a different c library) ?

Paul

Hello Paul,

Thank for looking into my issue. Yes, Am cross compiling for the target. Below is my configuration logs. I am implementing the client resolver application with the library. So if I cannot run the binary in my host machine, how can I generate the trust-anchor key and pass to the application. May be I can execute unbound-anchor on the target and generate the key, and then put back to the application on the host machine?

  • /home/sbaby/workspace/wqar/tmp/work/mips-mv-linux/libunbound-1.6.8-r0/libunbound/unbound-1.6.8/configure --build=i686-linux --host=mips64-mv-linux --target=mips64-mv-linux --prefix=/usr --exec_prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec --datadir=/usr/share --sysconfdir=/etc --sharedstatedir=/com --localstatedir=/var --libdir=/usr/lib32 --includedir=/usr/include --oldincludedir=/usr/include --infodir=/usr/share/info --mandir=/usr/share/man --build=i686-linux --host=mips64-mv-linux --target=mips64-mv-linux
    checking for mips64-mv-linux-gcc… mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32
    checking whether the C compiler works… yes
    checking for C compiler default output file name… a.out
    checking for suffix of executables…
    checking whether we are cross compiling… yes
    checking for suffix of object files… o
    checking whether we are using the GNU C compiler… yes
    checking whether mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32 accepts -g… yes
    checking for mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32 option to accept ISO C89… none needed
    checking how to run the C preprocessor… mips-montavista-linux-gnu-gcc -E
    checking for grep that handles long lines and -e… /home/sbaby/workspace/wqar/tmp/staging/i686-linux/usr/bin/grep
    checking for egrep… /home/sbaby/workspace/wqar/tmp/staging/i686-linux/usr/bin/grep -E
    checking for ANSI C header files… yes
    checking for sys/types.h… yes
    checking for sys/stat.h… yes
    checking for stdlib.h… yes
    checking for string.h… yes
    checking for memory.h… yes
    checking for strings.h… yes
    checking for inttypes.h… yes
    checking for stdint.h… yes
    checking for unistd.h… yes
    checking minix/config.h usability… no
    checking minix/config.h presence… no
    checking for minix/config.h… no
    checking whether it is safe to define EXTENSIONS… yes
    checking for an ANSI C-conforming const… yes
    checking for mips64-mv-linux-gcc… (cached) mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32
    checking whether we are using the GNU C compiler… (cached) yes
    checking whether mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32 accepts -g… (cached) yes
    checking for mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32 option to accept ISO C89… (cached) none needed
    checking mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32 dependency flag… -MM
    checking whether mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32 supports -Werror… yes
    checking whether mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32 supports -Wall… yes
    checking whether mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32 supports -std=c99… yes
    checking whether mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32 supports -xc99… no
    checking for getopt.h… yes
    checking for time.h… yes
    checking whether we need -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE as a flag for mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32… no
    checking whether we need -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE as a flag for mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32… no
    checking whether we need -std=c99 as a flag for mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32… no
    checking whether we need -D_BSD_SOURCE -D_DEFAULT_SOURCE as a flag for mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32… no
    checking whether we need -D_GNU_SOURCE as a flag for mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32… yes
    checking whether we need -D_GNU_SOURCE -D_FRSRESGID as a flag for mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32… no
    checking whether we need -D_POSIX_C_SOURCE=200112 as a flag for mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32… no
    checking whether we need -D__EXTENSIONS__ as a flag for mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32… no
    checking if mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32 supports -flto… no
    checking for inline… inline
    checking whether the C compiler (mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32) accepts the “format” attribute… yes
    checking whether the C compiler (mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32) accepts the “unused” attribute… yes
    checking whether the C compiler (mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32) accepts the “weak” attribute… yes
    checking for flex… flex
    checking lex output file root… lex.yy
    checking lex library… -lfl
    checking whether yytext is a pointer… yes
    checking for yylex_destroy… yes
    checking for bison… bison -y
    checking for doxygen… no
    checking for mips64-mv-linux-strip… mips-montavista-linux-gnu-strip
    checking build system type… i686-pc-linux-gnu
    checking host system type… mips64-mv-linux-gnu
    checking for mips64-mv-linux-ar… no
    checking for ar… /usr/bin/ar
    configure: WARNING: using cross tools not prefixed with host triplet
    checking how to print strings… printf
    checking for a sed that does not truncate output… /bin/sed
    checking for fgrep… /home/sbaby/workspace/wqar/tmp/staging/i686-linux/usr/bin/grep -F
    checking for ld used by mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32… mips-montavista-linux-gnu-ld
    checking if the linker (mips-montavista-linux-gnu-ld) is GNU ld… yes
    checking for BSD- or MS-compatible name lister (nm)… mips-montavista-linux-gnu-nm
    checking the name lister (mips-montavista-linux-gnu-nm) interface… BSD nm
    checking whether ln -s works… yes
    checking the maximum length of command line arguments… 1572864
    checking how to convert i686-pc-linux-gnu file names to mips64-mv-linux-gnu format… func_convert_file_noop
    checking how to convert i686-pc-linux-gnu file names to toolchain format… func_convert_file_noop
    checking for mips-montavista-linux-gnu-ld option to reload object files… -r
    checking for mips64-mv-linux-objdump… mips-montavista-linux-gnu-objdump
    checking how to recognize dependent libraries… pass_all
    checking for mips64-mv-linux-dlltool… no
    checking for dlltool… no
    checking how to associate runtime and link libraries… printf %s\n
    checking for mips64-mv-linux-ar… /usr/bin/ar
    checking for archiver @FILE support… @
    checking for mips64-mv-linux-strip… (cached) mips-montavista-linux-gnu-strip
    checking for mips64-mv-linux-ranlib… mips-montavista-linux-gnu-ranlib
    checking for gawk… gawk
    checking command to parse mips-montavista-linux-gnu-nm output from mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32 object… ok
    checking for sysroot… no
    checking for a working dd… /home/sbaby/workspace/wqar/tmp/staging/i686-linux/usr/bin/dd
    checking how to truncate binary pipes… /home/sbaby/workspace/wqar/tmp/staging/i686-linux/usr/bin/dd bs=4096 count=1
    checking for mips64-mv-linux-mt… no
    checking for mt… mt
    checking if mt is a manifest tool… no
    checking for dlfcn.h… yes
    checking for objdir… .libs
    checking if mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32 supports -fno-rtti -fno-exceptions… no
    checking for mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32 option to produce PIC… -fPIC -DPIC
    checking if mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32 PIC flag -fPIC -DPIC works… yes
    checking if mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32 static flag -static works… yes
    checking if mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32 supports -c -o file.o… yes
    checking if mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32 supports -c -o file.o… (cached) yes
    checking whether the mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32 linker (mips-montavista-linux-gnu-ld -m elf32btsmipn32) supports shared libraries… yes
    checking whether -lc should be explicitly linked in… no
    checking dynamic linker characteristics… GNU/Linux ld.so
    checking how to hardcode library paths into programs… immediate
    checking whether stripping libraries is possible… yes
    checking if libtool supports shared libraries… yes
    checking if libtool supports shared libraries… yes
    checking whether to build shared libraries… yes
    checking whether to build static libraries… yes
    checking for stdarg.h… yes
    checking for stdbool.h… yes
    checking for netinet/in.h… yes
    checking for netinet/tcp.h… yes
    checking for sys/param.h… yes
    checking for sys/socket.h… yes
    checking for sys/un.h… yes
    checking for sys/uio.h… yes
    checking for sys/resource.h… yes
    checking for arpa/inet.h… yes
    checking for syslog.h… yes
    checking for netdb.h… yes
    checking for sys/wait.h… yes
    checking for pwd.h… yes
    checking for glob.h… yes
    checking for grp.h… yes
    checking for login_cap.h… no
    checking for winsock2.h… no
    checking for ws2tcpip.h… no
    checking for endian.h… yes
    checking for sys/ipc.h… yes
    checking for sys/shm.h… yes
    checking for int8_t… yes
    checking for int16_t… yes
    checking for int32_t… yes
    checking for int64_t… yes
    checking for uint8_t… yes
    checking for uint16_t… yes
    checking for uint32_t… yes
    checking for uint64_t… yes
    checking for size_t… yes
    checking for ssize_t… yes
    checking for uid_t in sys/types.h… yes
    checking for pid_t… yes
    checking for off_t… yes
    checking for u_char… yes
    checking for rlim_t… yes
    checking for socklen_t… yes
    checking for in_addr_t… yes
    checking for in_port_t… yes
    checking if memcmp compares unsigned… cross-compile no
    checking size of time_t… 4
    checking for library containing inet_pton… none required
    checking for library containing socket… none required
    checking for unistd.h… (cached) yes
    checking for working chown… no
    checking vfork.h usability… no
    checking vfork.h presence… no
    checking for vfork.h… no
    checking for fork… yes
    checking for vfork… yes
    checking for working fork… cross
    configure: WARNING: result yes guessed because of cross compilation
    checking for working vfork… (cached) yes
    checking return type of signal handlers… void
    checking for _LARGEFILE_SOURCE value needed for large files… no
    checking for special C compiler options needed for large files… no
    checking for _FILE_OFFSET_BITS value needed for large files… 64
    checking whether we need -D_LARGEFILE_SOURCE=1 as a flag for mips-montavista-linux-gnu-gcc -march=octeon -msoft-float -mabi=n32… no
    checking if nonblocking sockets work… crosscompile(yes)
    checking whether mkdir has one arg… no
    checking for strptime… yes
    checking whether strptime works… maybe
    checking for GNU libc compatible malloc… no (crosscompile)
    checking if compiler needs -Werror to reject unknown flags… no
    checking for the pthreads library -lpthreads… no
    checking whether pthreads work without any flags… no
    checking whether pthreads work with -Kthread… no
    checking whether pthreads work with -kthread… no
    checking for the pthreads library -llthread… no
    checking whether pthreads work with -pthread… yes
    checking for joinable pthread attribute… PTHREAD_CREATE_JOINABLE
    checking if more special flags are required for pthreads… no
    checking for PTHREAD_PRIO_INHERIT… yes
    checking for pthread_spinlock_t… yes
    checking for pthread_rwlock_t… yes
    checking if -pthread unused during linking… no
    checking for SSL… found in /usr/local/ssl
    checking for HMAC_Update in -lcrypto… yes
    checking for openssl/ssl.h… yes
    checking for openssl/err.h… yes
    checking for openssl/rand.h… yes
    checking if libssl needs libdl… no
    119,1 25%

Rgds
Simon

Hi,

Yes the key files are platform independent.

Best regards, Wouter

Hello Paul,

Can i know if I can specify the particular interface as a default gw for sending query in the code
without explicitly configuring that interface as a gw. I checked in my system and it fails. In my system I do not have any default gw configured. So the packets generated within my system are not going outside until
I configure a default gw.

Rgds
simon

Hello Paul,

Do we have any other public DNS validating servers other that 8.8.8.8 which support DNSSEC? I tried with 8.8.8.8 and the results are always bogus. it looks like 8.8.8.8 is stripping off all the
DNSSEC related flags when it send back the reply to my client.

Rgds
Simon

I believe the "Quad9" (9.9.9.9) public resolver supports DNSSEC properlly:
https://www.quad9.net/

hope this helps,
-pete

Thank you so much Paul. I will try with QUAD9.

Rgds
Simon

Hi Pete,

Quad9 worked. Thank you for the help.

Rgds
Simon