Re: BIND 9.21.21: Problem with dynamic libraries on NetBSD
RVP <[email protected]>
| Newsgroups | gmane.os.netbsd.general |
|---|---|
| Message-ID | <[email protected]> |
On Sun, 19 Apr 2026, Lars-Johan Liman wrote:
> Is anyone else experimenting with BIND 9.21.21 on amd64?
> [...]
> BIND version: 9.21.21
> NetBSD version: 10.1
>
> After having straightened out the dependencies, BIND builds nice enough,
> except for two warnings from ninja:
>
> [334/371] Linking target dig
> lto-wrapper: warning: using serial compilation of 2 LTRANS jobs
> [352/371] Linking target nslookup
> lto-wrapper: warning: using serial compilation of 2 LTRANS jobs
>
Harmless diagnostic. You can turn off LTO if it annoys you.
> The problem seems to be that ld.elf_so is unhappy with
> libdns-9.21.21.so. It finds the file, does mmap() of it, but then
> immediately does an munmap() and goes looking for better fish.
>
> 6002 6002 tsig-keygen open("/usr/local/src/bind/bind-9.21.21/build/.//libdns-9.21.21.so", 0, 0x3) = 3
> 6002 6002 tsig-keygen __fstat50(0x3, 0x7f7fffb27d38) = 0
> 6002 6002 tsig-keygen mmap(0, 0x1000, 0x1, 0x1, 0x3, 0, 0) = 0x7902210f1000
> 6002 6002 tsig-keygen munmap(0x7902210f1000, 0x1000) = 0
> 6002 6002 tsig-keygen close(0x3) = 0
> 6002 6002 tsig-keygen open("/usr/pkg/lib/libdns-9.21.21.so", 0, 0x6) Err#2 ENOENT
> 6002 6002 tsig-keygen open("/usr/lib/libdns-9.21.21.so", 0, 0x2) Err#2 ENOENT
> 6002 6002 tsig-keygen write(0x2, 0x7f7fffb283d8, 0x3a) = 58
> "./tsig-keygen: Shared object "libdns-9.21.21.so" not found"
>
Turn on debugging (commented out) in src/libexec/ld.elf_so/Makefile, then
run the command like: env LD_DEBUG=1 ./tsig-keygen
to see why ld.so is unhappy with that library.
> This is interesting too:
>
> % ldd named tsig-keygen
> ldd: /usr/local/src/bind/bind-9.21.21/build/named: invalid ELF class 2; expected 1
> ldd: /usr/local/src/bind/bind-9.21.21/build/tsig-keygen: invalid ELF class 2; expected 1
>
What does a `file $(which ldd) /libexec/ld.elf*' output? Have you somehow ended
up with a 32-bit ldd(1)?
-RVP