$ pkg install fd-find $ ldd /usr/local/bin/fd /usr/local/bin/fd: ldd: /usr/local/bin/fd: /usr/local/bin/fd: No space available for static Thread Local Storage /usr/local/bin/fd: exit status 1 This happens on 11.3, 12.1, and 13.0.
Provide a tarball with the binary and all needed libraries.
(In reply to Konstantin Belousov from comment #1) You cannot run pkg install? It does not have any dependencies outside of libc, libthr, libgcc_s. https://pkg.freebsd.org/FreeBSD:12:amd64/latest/All/fd-find-8.0.0.txz
(In reply to Tobias Kortkamp from comment #2) I definitely do not want to run pkg install of some random package even on test machine. I unpacked the tarball and looked. The reason why the things fail are somewhat silly. First, the binary seems to be built as PIE, which results in the binary actually be dso. Then, the binary has TLS segment, compiled for initial exec mode. This mode is unsupported for dlopened libs, we reserve 128 bytes of slack for them, but fd requires ~6K of TLS data. ldd for libraries does dlopen(), and we cannot dlopen because the slack is only 128 bytes, while binary asks for 6k. So we abort.
A commit references this bug: Author: kib Date: Wed Apr 22 18:39:46 UTC 2020 New revision: 360201 URL: https://svnweb.freebsd.org/changeset/base/360201 Log: rtld: ignore static TLS segments when tracing. For PIE binaries, ldd(1) performs dlopen(RTLD_TRACE) on the binary. It is legal for binary to use initial exec TLS mode, but when such binary (actually dso) is dlopened, we might not have enough free space in the finalized static TLS segment. Make ldd operational by skipping TLS space allocation, we are not going to execute any code from the dso anyway. Reported by: tobik PR: 245677 Sponsored by: The FreeBSD Foundation MFC after: 1 week Changes: head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h
MFCed to stable/12 in r360456.
^Triage: Track stable merges (MFC)
Any possibility that this will be merged into 11 after code slush takes off?
A commit references this bug: Author: kib Date: Sun Jun 7 09:38:46 UTC 2020 New revision: 361889 URL: https://svnweb.freebsd.org/changeset/base/361889 Log: MFC r360201: Fix ldd for PIE binaries with static TLS segment. PR: 245677 Changes: _U stable/11/ stable/11/libexec/rtld-elf/rtld.c stable/11/libexec/rtld-elf/rtld.h
(In reply to commit-hook from comment #8) Thanks.
^Triage: Track merge to stable/11