From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 943DB1FA12 for ; Wed, 21 Jul 2021 19:04:54 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9B569384604F for ; Wed, 21 Jul 2021 19:04:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B569384604F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1626894293; bh=v+zJF8NWWWKm6/cXAgsK4qRhAEW8boK9sWK6at9x0sw=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=UAUom8KwGjpl9+vebr6tCBlXPCZ5RWFT9lL1B2exNtRPgXdN7J6mLAFCNyn3+8ziJ KvmaQ3cAvjxA5VwDrwuEDUBHmWBAwyKVcBUTpzLlzjKCwL4Ak7M+wmZSenC+IVVXYp 9sxm05gszvq37/WOpKYWlyfA6CqeREks/UCR5Ppw= Received: from hera.aquilenet.fr (hera.aquilenet.fr [IPv6:2a0c:e300::1]) by sourceware.org (Postfix) with ESMTPS id C80A33857424; Wed, 21 Jul 2021 19:04:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C80A33857424 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id B7A21229; Wed, 21 Jul 2021 21:04:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4h3I1I4O8bXB; Wed, 21 Jul 2021 21:04:30 +0200 (CEST) Received: from begin (unknown [IPv6:2a01:cb19:956:1b00:de41:a9ff:fe47:ec49]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 0A0BD164; Wed, 21 Jul 2021 21:04:28 +0200 (CEST) Received: from samy by begin with local (Exim 4.94.2) (envelope-from ) id 1m6HW8-00EZx5-4c; Wed, 21 Jul 2021 21:04:28 +0200 Date: Wed, 21 Jul 2021 21:04:28 +0200 To: libc-alpha@sourceware.org, Siddhesh Poyarekar , DJ Delorie Subject: tst-interpose-static-thread-{m,malloc-}check linking statically? Message-ID: <20210721190428.dfnqd4lpqdpohy2a@begin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spamd-Bar: - X-Rspamd-Server: hera X-Rspamd-Queue-Id: B7A21229 X-Spamd-Result: default: False [-1.50 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; SUBJECT_ENDS_QUESTION(1.00)[]; BAYES_HAM(-3.00)[100.00%] X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Samuel Thibault via Libc-alpha Reply-To: Samuel Thibault Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" 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/m= alloc/tst-interpose-static-thread-mcheck -Wl,-z,combreloc -Wl,-z,relro -= Wl,--hash-style=3Dboth /usr/src/glibc-upstream/build/csu/Scrt1.o /usr/src/g= libc-upstream/build/csu/crti.o `gcc --print-file-name=3DcrtbeginS.o` /usr/= src/glibc-upstream/build/malloc/tst-interpose-static-thread.o /usr/src/glib= c-upstream/build/support/libsupport_nonshared.a /usr/src/glibc-upstream/bui= ld/malloc/libmcheck.a /usr/src/glibc-upstream/build/malloc/tst-interpose-au= x-thread.o ../htl/libpthread_syms.a /usr/src/glibc-upstream/build/htl/libpt= hread.a /usr/src/glibc-upstream/build/mach/libmachuser.a /usr/src/glibc-ups= tream/build/hurd/libhurduser.a -Wl,-dynamic-linker=3D/lib/i386-gnu/ld.so.1= -Wl,-rpath-link=3D/usr/src/glibc-upstream/build:/usr/src/glibc-upstream/bu= ild/math:/usr/src/glibc-upstream/build/elf:/usr/src/glibc-upstream/build/dl= fcn:/usr/src/glibc-upstream/build/nss:/usr/src/glibc-upstream/build/nis:/us= r/src/glibc-upstream/build/rt:/usr/src/glibc-upstream/build/resolv:/usr/src= /glibc-upstream/build/mathvec:/usr/src/glibc-upstream/build/support:/usr/sr= c/glibc-upstream/build/crypt:/usr/src/glibc-upstream/build/htl:/usr/src/gli= bc-upstream/build/mach:/usr/src/glibc-upstream/build/hurd -lgcc -Wl,--as-ne= eded -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/gli= bc-upstream/build/elf/ld.so -Wl,--no-as-needed -lgcc -Wl,--as-needed -lgcc_= s -Wl,--no-as-needed `gcc --print-file-name=3DcrtendS.o` /usr/src/glibc-u= pstream/build/csu/crtn.o /usr/bin/ld: /usr/src/glibc-upstream/build/htl/libpthread.a(pt-sysdep.o): i= n function `_init_routine': /usr/src/glibc-upstream/htl/../sysdeps/mach/hurd/htl/pt-sysdep.c:88: undefi= ned 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 :=3D mallocbug tst-malloc tst-valloc tst-calloc ts= t-obstack \ =20 tests-static :=3D \ 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 \ =20 # Test for the malloc_set_state symbol removed in glibc 2.25.