This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix C11 conformance issues
On 07/25/2018 07:47 PM, Joseph Myers wrote:
What seems to be a problem is that libpthread.a must now be C11-clean for its
C11 symbols (which is currently not the case on Hurd). But fixing that is
probably not a bad idea anyway.
Yes, if libpthread is used to provide some C11 symbols, it needs to be
C11-clean for all the C11 symbols it provides (including those also
present in libc).
So I think we need something like this. It resolves the new
linknamespace failures for me.
Thanks,
Florian
Subject: [PATCH] htl: Use weak aliases for public symbols
To: libc-alpha@sourceware.org
Strong definitions of flockfile, funlockfile, ftrylockfile can conflict
with application symbols when linking statically.
2018-07-25 Florian Weimer <fweimer@redhat.com>
* htl/lockfile.c (flockfile, funlockfile, ftrylockfile): Use weak
aliases for symbols not in the implementation namespace.
diff --git a/htl/lockfile.c b/htl/lockfile.c
index 7828d47dae..1d0ab88b13 100644
--- a/htl/lockfile.c
+++ b/htl/lockfile.c
@@ -53,8 +53,8 @@ int _IO_ftrylockfile (FILE *)
__attribute__ ((alias ("_cthreads_ftrylockfile")));
void flockfile (FILE *)
- __attribute__ ((alias ("_cthreads_flockfile")));
+ __attribute__ ((weak, alias ("_cthreads_flockfile")));
void funlockfile (FILE *)
- __attribute__ ((alias ("_cthreads_funlockfile")));
+ __attribute__ ((weak, alias ("_cthreads_funlockfile")));
int ftrylockfile (FILE *)
- __attribute__ ((alias ("_cthreads_ftrylockfile")));
+ __attribute__ ((weak, alias ("_cthreads_ftrylockfile")));