Bug 207712 - FreeBSD buildworld fails if option WITHOUT_SYMVER is set
Summary: FreeBSD buildworld fails if option WITHOUT_SYMVER is set
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Ed Maste
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-04 19:25 UTC by Ed Maste
Modified: 2022-07-18 13:54 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2016-03-04 19:25:12 UTC
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)
Comment 1 Ed Maste freebsd_committer freebsd_triage 2016-03-07 15:39:03 UTC
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).
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-03-08 00:10:21 UTC
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
Comment 3 Ed Maste freebsd_committer freebsd_triage 2016-04-19 20:20:25 UTC
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.
Comment 4 Enji Cooper freebsd_committer freebsd_triage 2016-05-06 23:13:26 UTC
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
Comment 5 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:43:26 UTC
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.
Comment 6 Ed Maste freebsd_committer freebsd_triage 2022-07-18 13:53:11 UTC
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