<sys/cdefs.h>: Rework __weak_reference() macro.
authorzrj <rimvydas.jasinskas@gmail.com>
Thu, 6 Oct 2016 09:13:25 +0000 (12:13 +0300)
committerzrj <zrj@dragonflybsd.org>
Mon, 24 Oct 2016 11:55:21 +0000 (14:55 +0300)
commitf8406b33bbed7faf9fbde74cd27d301a5cae7cbc
tree87c64edf54da389d8a3e23056b42baf5d307966b
parentceeadccd358e346511796c7b057af4af0ae50f2d
<sys/cdefs.h>: Rework __weak_reference() macro.

My LTO build blew away weak symbols from slim LTO objects.
Use __strong_reference() + weak attribute to allow the compiler to catch
extern declarations and not to fold weak symbols as local ones.

Keep previous version as __weak_reference_asm() in _pthread_stubs.c for
now due to several issues (there is a need to do it in a cleaner way).

lib/libc/gen/ucontext.c:
  add missing __DECONST for ucp, shouldn't sigreturn take const ucontext_t?

lib/libc/inet/inet_ntoa.c:
  add missing #undef inet_ntoa_r

No symbol changes in libc and librt on normal compilation.

While there, add __weak_symbol attribute for future additions.
13 files changed:
lib/libc/gen/_pthread_stubs.c
lib/libc/gen/_thread_init.c
lib/libc/gen/fmtcheck.c
lib/libc/gen/sigwait.c
lib/libc/gen/tls.c
lib/libc/gen/ucontext.c
lib/libc/inet/inet_ntoa.c
lib/libc/stdio/_flock_stub.c
lib/libc/string/strchrnul.c
lib/libc/x86_64/gen/makecontext.c
lib/libc/x86_64/gen/quickcontext.c
lib/librt/mq.c
sys/sys/cdefs.h