From: Samuel Thibault <samuel.thibault@gnu.org>
To: libc-alpha@sourceware.org,
Siddhesh Poyarekar <siddhesh@sourceware.org>,
DJ Delorie <dj@redhat.com>
Subject: tst-interpose-static-thread-{m,malloc-}check linking statically?
Date: Wed, 21 Jul 2021 21:04:28 +0200 [thread overview]
Message-ID: <20210721190428.dfnqd4lpqdpohy2a@begin> (raw)
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.
next reply other threads:[~2021-07-21 19:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-21 19:04 Samuel Thibault [this message]
2021-07-22 14:01 ` [PATCH] Exclude static tests for mcheck and malloc-check Siddhesh Poyarekar
2021-07-24 14:52 ` Samuel Thibault
[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
2021-07-23 1:28 ` Siddhesh Poyarekar
2021-07-23 7:45 ` Samuel Thibault
2021-07-23 11:18 ` Siddhesh Poyarekar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210721190428.dfnqd4lpqdpohy2a@begin \
--to=samuel.thibault@gnu.org \
--cc=dj@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=siddhesh@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).