From: Samuel Thibault via Libc-alpha <libc-alpha@sourceware.org>
To: Joseph Myers <joseph@codesourcery.com>
Cc: libc-alpha@sourceware.org, bug-hurd@gnu.org,
Thomas Schwinge <thomas@codesourcery.com>
Subject: Re: [PATCH] Hurd: Enable ifunc by default
Date: Tue, 19 Jan 2021 01:04:02 +0100 [thread overview]
Message-ID: <20210119000402.koywpx2l2hhhhem4@begin> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2101182003160.272665@digraph.polyomino.org.uk>
[-- Attachment #1: Type: text/plain, Size: 1445 bytes --]
(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
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 946 bytes --]
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)
next prev parent reply other threads:[~2021-01-19 0:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20201108225251.3195591-1-samuel.thibault@ens-lyon.org>
[not found] ` <87h7nl1425.fsf@dem-tschwing-1.ger.mentorg.com>
2021-01-18 20:05 ` [PATCH] Hurd: Enable ifunc by default Joseph Myers
2021-01-18 20:25 ` Samuel Thibault via Libc-alpha
2021-01-19 0:04 ` Samuel Thibault via Libc-alpha [this message]
2021-01-19 0:17 ` H.J. Lu via Libc-alpha
2021-01-19 0:21 ` Samuel Thibault via Libc-alpha
2021-01-19 0:24 ` Samuel Thibault via Libc-alpha
2021-01-19 0:40 ` H.J. Lu via Libc-alpha
2021-01-19 2:24 ` [PATCH] Hurd: Add rtld-strncpy-c.c H.J. Lu via Libc-alpha
2021-01-19 9:02 ` Samuel Thibault via Libc-alpha
2021-01-19 12:21 ` H.J. Lu via Libc-alpha
2021-01-19 12:25 ` Adhemerval Zanella via Libc-alpha
2021-01-19 12:35 ` H.J. Lu via Libc-alpha
2021-01-19 12:44 ` Samuel Thibault via Libc-alpha
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
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210119000402.koywpx2l2hhhhem4@begin \
--to=libc-alpha@sourceware.org \
--cc=bug-hurd@gnu.org \
--cc=joseph@codesourcery.com \
--cc=samuel.thibault@gnu.org \
--cc=thomas@codesourcery.com \
/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).