Linking libc fails with: --- libc.so.7.full --- /tank/emaste/obj/tank/emaste/src/freebsd/tmp/usr/bin/ld: libc.so.7.full: version node not found for symbol iconv_close@FBSD_1.3 /tank/emaste/obj/tank/emaste/src/freebsd/tmp/usr/bin/ld: failed to set dynamic section sizes: Bad value cc: error: linker command failed with exit code 1 (use -v to see invocation)
There are similar failures w/o symver due to symver compat use in: contrib/jemalloc/src/jemalloc.c contrib/jemalloc/src/util.c lib/libc/db/mpool/Makefile.inc lib/libc/gen/Makefile.inc lib/libc/gen/sem.c lib/libc/gen/semctl.c lib/libc/gen/ttyslot.c lib/libc/iconv/Makefile.inc lib/libc/include/compat.h lib/libc/posix1e/Makefile.inc lib/libc/secure/Makefile.inc lib/libc/sys/openat.c lib/libc/sys/setcontext.c lib/libc/sys/swapcontext.c lib/libthr/thread/thr_sem.c lib/libthread_db/thread_db.c In addition: Not a build failure, but libc ends up with .text relocations on .cerror without symver, as described in LLVM PR 26813 (http://llvm.org/pr26813).
A commit references this bug: Author: emaste Date: Tue Mar 8 00:09:34 UTC 2016 New revision: 296474 URL: https://svnweb.freebsd.org/changeset/base/296474 Log: libc/{i386,amd64}: Do not export .cerror when building WITHOUT_SYMVER Further to r240152 (i386) and r240178 (amd64), hide the .cerror symbol so that it is not exported if symbol versioning is not in use. Without this change WITHOUT_SYMVER libc contains .text relocations for .cerror, as described in LLVM PR 26813 (http://llvm.org/pr26813). This is a no-op for the regular build as the symbol version script already controls .cerror visibility. PR: 207712 Submitted by: Rafael Esp?ndola Reviewed by: jilles, kib Differential Revision: https://reviews.freebsd.org/D5571 Changes: head/lib/libc/amd64/sys/cerror.S head/lib/libc/i386/sys/cerror.S
Another issue arises from lib/libthr/thread/thr_exit.c which has a local stub implementation of _Unwind_ForcedUnwind, but does a dlsym(handle, "_Unwind_ForcedUnwind")). With symver the symbol is not exported by libthr.so and the dlsym correctly finds the one in libgcc_s.so. Without symver it returns the stub and results in an endless loop.
I ran into this issue with setcontext(2): /usr/bin/ld: libc.so.7.full: version node not found for symbol setcontext@FBSD_1.0
batch change: For bugs that match the following - Status Is In progress AND - Untouched since 2018-01-01. AND - Affects Base System OR Documentation DO: Reset to open status. Note: I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
commit 371f3da616598f7bcd14e26b54c7b2c96ec9bbd7 Author: John Baldwin <jhb@FreeBSD.org> Date: Thu Apr 30 22:08:40 2020 +0000 Remove the SYMVER build option. This option was added as a transition aide when symbol versioning was first added. It was enabled by default in 2007 and is supported even by the old GPLv2 binutils. Trying to disable it currently fails to build in libc and at this point it isn't worth fixing the build. Reported by: Michael Dexter Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D24637 Notes: svn path=/head/; revision=360511