This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][AArch64] update libm-test-ulps
- From: Szabolcs Nagy <nsz at port70 dot net>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: Szabolcs Nagy <szabolcs dot nagy at arm dot com>, GNU C Library <libc-alpha at sourceware dot org>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>
- Date: Fri, 10 Apr 2015 22:51:24 +0200
- Subject: Re: [PATCH][AArch64] update libm-test-ulps
- Authentication-results: sourceware.org; auth=none
- References: <5523BAB1 dot 5020700 at arm dot com> <alpine dot DEB dot 2 dot 10 dot 1504071654120 dot 20250 at digraph dot polyomino dot org dot uk> <55254CF4 dot 8060508 at arm dot com> <alpine dot DEB dot 2 dot 10 dot 1504081549350 dot 25740 at digraph dot polyomino dot org dot uk> <552555ED dot 9090305 at arm dot com> <alpine dot DEB dot 2 dot 10 dot 1504081631430 dot 25740 at digraph dot polyomino dot org dot uk> <5527D4AC dot 6040503 at arm dot com> <alpine dot DEB dot 2 dot 10 dot 1504101723140 dot 21834 at digraph dot polyomino dot org dot uk>
* Joseph Myers <joseph@codesourcery.com> [2015-04-10 17:42:23 +0000]:
> On Fri, 10 Apr 2015, Szabolcs Nagy wrote:
>
> > shm_open does not work with static linking because __shm_directory
> > depends on dynamic linking (fails at link time), sem_open likewise
> > (except it segfaults at runtime)
>
> Why does it depend on dynamic linking? That looks rather like a bug to
> me. Functions should work for static linking unless there are strong
> reasons it can't be supported.
>
ok i was wrong (probably)
shm_open is in librt which references __shm_directory in libpthread
and i got the link error because the test system used -lrt -lpthread
in the wrong order
then __shm_directory segfaults because it uses __libc_once which
uses weakref __pthread_once for whatever reason
so the way to statically link something with shm_open is
cc foo.o -lrt -Wl,--whole-archive -lpthread -Wl,--no-whole-archive
but i find this solution unsatisfying