From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hera.aquilenet.fr (hera.aquilenet.fr [IPv6:2a0c:e300::1]) by sourceware.org (Postfix) with ESMTPS id 203F93854834 for ; Tue, 19 Jan 2021 00:04:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 203F93854834 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id E6E10703; Tue, 19 Jan 2021 01:04:05 +0100 (CET) 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 Za3AoDQdAVSC; Tue, 19 Jan 2021 01:04:05 +0100 (CET) Received: from begin (unknown [IPv6:2a01:cb19:956:1b00:de41:a9ff:fe47:ec49]) by hera.aquilenet.fr (Postfix) with ESMTPSA id D31459D; Tue, 19 Jan 2021 01:04:04 +0100 (CET) Received: from samy by begin with local (Exim 4.94) (envelope-from ) id 1l1eV8-00CjYb-KB; Tue, 19 Jan 2021 01:04:02 +0100 Date: Tue, 19 Jan 2021 01:04:02 +0100 From: Samuel Thibault To: Joseph Myers Cc: Thomas Schwinge , bug-hurd@gnu.org, libc-alpha@sourceware.org Subject: Re: [PATCH] Hurd: Enable ifunc by default Message-ID: <20210119000402.koywpx2l2hhhhem4@begin> Mail-Followup-To: Joseph Myers , Thomas Schwinge , bug-hurd@gnu.org, libc-alpha@sourceware.org References: <20201108225251.3195591-1-samuel.thibault@ens-lyon.org> <87h7nl1425.fsf@dem-tschwing-1.ger.mentorg.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="rifg2e3o6fvfl6gu" Content-Disposition: inline In-Reply-To: Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spamd-Bar: - X-Rspamd-Server: hera X-Rspamd-Queue-Id: E6E10703 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)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; HAS_ATTACHMENT(0.00)[]; MIME_GOOD(-0.10)[multipart/mixed,text/plain]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; CTYPE_MIXED_BOGUS(1.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Tue, 19 Jan 2021 00:04:09 -0000 --rifg2e3o6fvfl6gu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline (leaving gcc out, it's really out of the story, it just happens to expose support for ifunc) Joseph Myers, le lun. 18 janv. 2021 20:05:44 +0000, a ecrit: > /scratch/jmyers/glibc-bot/install/compilers/i686-gnu/lib/gcc/i686-glibc-gnu/11.0.0/../../../../i686-glibc-gnu/bin/ld: /scratch/jmyers/glibc-bot/build/compilers/i686-gnu/glibc/i686-gnu/elf/librtld.os: in function `hurd_file_name_lookup_retry': > (.text+0x1e08e): undefined reference to `strncpy' The story seems complex and related to the glibc rtld build rules. - We need hurd/lookup-retry.c in the rtld - It happens to use strncpy since ee11682d4f5 ("hurd: Fix strcpy calls") - strncpy happens to have a hidden def in libc - hurd/lookup-retry.os thus refers to __GI_strncpy rather than strncpy - dl-allobjs.os thus includes strncpy-c.os (that provides __GI_strncpy), and not strncpy.os (that provides strncpy) - librtld.map thus contains strncpy-c.os only, and not strncpy.os - thus no rtld-strncpy.os is getting built - thus strncpy is not available in rtld - but strncpy doesn't have a hidden def in rtld - and thus hurd/rtld-lookup-retry.os refers to strncpy, not __GI_strncpy - thus the link failure. The base issue I see here is that dl-allobjs is based on libc-built objects that might be using hidden defs while rtld-built objects might not. But we could also say that it's strncpy that should also have a hidden def in rtld. The attached patch does this, is this ok? Samuel --rifg2e3o6fvfl6gu Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch diff --git a/include/libc-symbols.h b/include/libc-symbols.h index ea126ae70c..051d6b9492 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -856,6 +856,8 @@ for linking") # define HIDDEN_BUILTIN_JUMPTARGET(name) HIDDEN_JUMPTARGET(name) #endif +#define rtld_hidden_builtin_proto(name, attrs...) rtld_hidden_proto (name, ##attrs) + #if IS_IN (libutil) # define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) # define libutil_hidden_tls_proto(name, attrs...) \ diff --git a/include/string.h b/include/string.h index 81dab39891..27cbde47ef 100644 --- a/include/string.h +++ b/include/string.h @@ -144,6 +144,7 @@ libc_hidden_builtin_proto (strcspn) libc_hidden_builtin_proto (strlen) libc_hidden_builtin_proto (strncmp) libc_hidden_builtin_proto (strncpy) +rtld_hidden_builtin_proto (strncpy) libc_hidden_builtin_proto (strpbrk) libc_hidden_builtin_proto (stpcpy) libc_hidden_builtin_proto (strrchr) --rifg2e3o6fvfl6gu--