public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Sergey Bugaev <bugaevc@gmail.com>
Cc: libc-alpha@sourceware.org,
	 Samuel Thibault <samuel.thibault@gnu.org>,
	bug-hurd <bug-hurd@gnu.org>
Subject: Re: x86_64-gnu port -- help needed
Date: Thu, 09 Mar 2023 18:26:18 +0100	[thread overview]
Message-ID: <87pm9hzvid.fsf@igel.home> (raw)
In-Reply-To: <CAN9u=HdY0KBr4Bb7njnw_XANM8PBOQOM6SJhLJ8+Ws+d5OuUQw@mail.gmail.com> (Sergey Bugaev's message of "Thu, 9 Mar 2023 19:18:07 +0300")

On Mär 09 2023, Sergey Bugaev wrote:

> x86_64-gnu-gcc -nostdlib -nostartfiles -r -o elf/librtld.map.o
> elf/librtld.mapT.o '-Wl,-(' elf/dl-allobjs.os libc_pic.a
> mach/libmachuser_pic.a hurd/libhurduser_pic.a -lgcc '-Wl,-)'
> -Wl,-Map,elf/librtld.mapT
> x86_64-gnu/bin/ld: libc_pic.a(_exit.os): in function `__GI__exit':
> posix/../sysdeps/mach/hurd/_exit.c:50: multiple definition of `__GI__exit';
> elf/dl-allobjs.os:elf/../sysdeps/mach/hurd/dl-sysdep.c:728: first defined
> here

The only symbol provided by _exit.os that is not defined by
../sysdeps/mach/hurd/dl-sysdep.c is _Exit.  Does anything call this
function?

> x86_64-gnu/bin/ld: libc_pic.a(strtoul.os): in function
> `__GI___strtoul_internal':
> stdlib/../sysdeps/wordsize-64/strtoul.c:108: multiple definition of
> `__GI___strtoul_internal';
> elf/dl-allobjs.os:elf/../sysdeps/mach/hurd/dl-sysdep.c:713: first defined
> here

Similarily, something is pulling in strtoul.os because it references a
symbol from there not defined by ../sysdeps/mach/hurd/dl-sysdep.c.

elf/librtld.mapT should tell you where the references come from.

> 1. What is this about, what's it even trying to do? If this is linking the
> dynamic linker (ld.so / rtld — these are the same thing, right?), then why
> does it need the dl-sysdep version if the real version is available?

The comments in ../sysdeps/mach/hurd/dl-sysdep.c indicate that the
dynamic linker wants to use some stripped down implementation of these
functions.

> 3. How come this works on i686-gnu, the duplicated symbols are clearly
> present there too!

Pure luck, perhaps.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

  reply	other threads:[~2023-03-09 17:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09 16:18 Sergey Bugaev
2023-03-09 17:26 ` Andreas Schwab [this message]
2023-03-09 19:44   ` Sergey Bugaev
2023-03-09 19:47     ` Jessica Clarke

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=87pm9hzvid.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=bug-hurd@gnu.org \
    --cc=bugaevc@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=samuel.thibault@gnu.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).