unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* tst-interpose-static-thread-{m,malloc-}check linking statically?
@ 2021-07-21 19:04 Samuel Thibault via Libc-alpha
  2021-07-22 14:01 ` [PATCH] Exclude static tests for mcheck and malloc-check Siddhesh Poyarekar via Libc-alpha
       [not found] ` <41e663cf-208d-4d9d-a8eb-351163d6e168@email.android.com>
  0 siblings, 2 replies; 8+ messages in thread
From: Samuel Thibault via Libc-alpha @ 2021-07-21 19:04 UTC (permalink / raw)
  To: libc-alpha, Siddhesh Poyarekar, DJ Delorie

Hello,

tl;dr: I believe we want the patch below? AIUI the
tst-interpose-static-{no,}thread-{m,malloc-}check tests are supposed to
be linked completely statically?


On the GNU/Hurd port we have an issue linking the
tst-interpose-static-thread-{m,malloc-}check
tests:

gcc -pie -Wl,-O1 -nostdlib -nostartfiles -o /usr/src/glibc-upstream/build/malloc/tst-interpose-static-thread-mcheck    -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both /usr/src/glibc-upstream/build/csu/Scrt1.o /usr/src/glibc-upstream/build/csu/crti.o `gcc  --print-file-name=crtbeginS.o` /usr/src/glibc-upstream/build/malloc/tst-interpose-static-thread.o /usr/src/glibc-upstream/build/support/libsupport_nonshared.a /usr/src/glibc-upstream/build/malloc/libmcheck.a /usr/src/glibc-upstream/build/malloc/tst-interpose-aux-thread.o ../htl/libpthread_syms.a /usr/src/glibc-upstream/build/htl/libpthread.a /usr/src/glibc-upstream/build/mach/libmachuser.a /usr/src/glibc-upstream/build/hurd/libhurduser.a  -Wl,-dynamic-linker=/lib/i386-gnu/ld.so.1 -Wl,-rpath-link=/usr/src/glibc-upstream/build:/usr/src/glibc-upstream/build/math:/usr/src/glibc-upstream/build/elf:/usr/src/glibc-upstream/build/dlfcn:/usr/src/glibc-upstream/build/nss:/usr/src/glibc-upstream/build/nis:/usr/src/glibc-upstream/build/rt:/usr/src/glibc-upstream/build/resolv:/usr/src/glibc-upstream/build/mathvec:/usr/src/glibc-upstream/build/support:/usr/src/glibc-upstream/build/crypt:/usr/src/glibc-upstream/build/htl:/usr/src/glibc-upstream/build/mach:/usr/src/glibc-upstream/build/hurd -lgcc -Wl,--as-needed -lgcc_s  -Wl,--no-as-needed /usr/src/glibc-upstream/build/libc.so.0.3 /usr/src/glibc-upstream/build/libc_nonshared.a -Wl,--as-needed /usr/src/glibc-upstream/build/elf/ld.so -Wl,--no-as-needed -lgcc -Wl,--as-needed -lgcc_s  -Wl,--no-as-needed `gcc  --print-file-name=crtendS.o` /usr/src/glibc-upstream/build/csu/crtn.o
/usr/bin/ld: /usr/src/glibc-upstream/build/htl/libpthread.a(pt-sysdep.o): in function `_init_routine':
/usr/src/glibc-upstream/htl/../sysdeps/mach/hurd/htl/pt-sysdep.c:88: undefined reference to `_dl_init_static_tls'
collect2: error: ld returned 1 exit status

The problem is that libpthread.a is getting linked in, but not libc.a,
and thus _dl_init_static_tls (from libc.a) is not available to
libpthread. But I'm wondering: are we supposed to support linking
libpthread statically in while not linking libc statically in? The
source code suggests me that we aren't.

Samuel

diff --git a/malloc/Makefile b/malloc/Makefile
index 47369b6084..fc66abe94b 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -46,7 +46,11 @@ tests := mallocbug tst-malloc tst-valloc tst-calloc tst-obstack \
 
 tests-static := \
 	 tst-interpose-static-nothread \
+	 tst-interpose-static-nothread-mcheck \
+	 tst-interpose-static-nothread-malloc-check \
 	 tst-interpose-static-thread \
+	 tst-interpose-static-thread-mcheck \
+	 tst-interpose-static-thread-malloc-check \
 	 tst-malloc-usable-static \
 
 # Test for the malloc_set_state symbol removed in glibc 2.25.

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-07-24 14:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21 19:04 tst-interpose-static-thread-{m,malloc-}check linking statically? Samuel Thibault via Libc-alpha
2021-07-22 14:01 ` [PATCH] Exclude static tests for mcheck and malloc-check Siddhesh Poyarekar via Libc-alpha
2021-07-24 14:52   ` Samuel Thibault via Libc-alpha
     [not found] ` <41e663cf-208d-4d9d-a8eb-351163d6e168@email.android.com>
2021-07-22  2:09   ` tst-interpose-static-thread-{m,malloc-}check linking statically? Siddhesh Poyarekar
2021-07-22 18:36   ` Samuel Thibault via Libc-alpha
2021-07-23  1:28     ` Siddhesh Poyarekar
2021-07-23  7:45       ` Samuel Thibault via Libc-alpha
2021-07-23 11:18         ` Siddhesh Poyarekar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).