public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: John Baldwin <jhb@FreeBSD.org>,
	Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Cc: binutils@sourceware.org
Subject: Re: [PATCH] ld: Add lib32 directories for 32-bit emulation on FreeBSD/amd64
Date: Thu, 21 Dec 2023 08:25:17 +0100	[thread overview]
Message-ID: <f213d2ff-33c6-4e27-8ef4-6255b86218ef@suse.com> (raw)
In-Reply-To: <6499aee9-3935-41c1-8897-a177f6173e8a@FreeBSD.org>

On 20.12.2023 18:47, John Baldwin wrote:
> On 12/20/23 1:12 AM, Rainer Orth wrote:
>> Jan Beulich <jbeulich@suse.com> writes:
>>
>>> On 19.12.2023 23:23, Rainer Orth wrote:
>>>> Ping?  It's been a week:
>>>>
>>>> 	https://sourceware.org/pipermail/binutils/2023-December/131178.html
>>>>
>>>> 	Rainer
>>>
>>> Not knowing FreeBSD it's hard to approve a change like this. Specifically, ...
>>
>> Unfortunately, there's no listed FreeBSD binutils maintainer.  I'm
>> Cc'ing John Baldwin who actively maintains gdb on FreeBSD.  Maybe he can
>> shed some insight or knows someone else who could.
>>
>>>>> GNU ld currently fails to link 32-bit executables on FreeBSD/amd64 when
>>>>> the linked libraries have dependencies on shared objects themselves:
>>>>>
>>>>> $ gcc -m32 -o ei ei.c -lexecinfo
>>>>> /var/gcc/binutils/amd64/lib/gcc/amd64-pc-freebsd14.0/13.2.0/../../../../amd64-pc-freebsd14.0/bin/ld:
>>>>> warning: libelf.so.2, needed by /usr/lib/../lib32/libexecinfo.so, not found
>>>>> (try using -rpath or -rpath-link)
>>>>> /var/gcc/binutils/amd64/lib/gcc/amd64-pc-freebsd14.0/13.2.0/../../../../amd64-pc-freebsd14.0/bin/ld:
>>>>> /usr/lib/../lib32/libexecinfo.so: undefined reference to `elf_begin@R1.0'
>>>>> [...]
>>>>>
>>>>> Fixed by handling FreeBSD/amd64 like Linux/x86.
>>>>>
>>>>> Tested on amd64-pc-freebsd14.0.
>>>
>>> ... it doesn't look implausible that things may have worked on earlier
>>> versions (or else perhaps someone would have noticed long ago), and that
>>> hence your change might break things there.
>>
>> I'm certain they didn't: I originally developed this patch 4 years ago,
>> but either forgot to submit it back then or hoped an active member of
>> the FreeBSD community would.  This must have been in the FreeBSD 11 or
>> 12 timeframe, and obviously nothing has happened/been improved since.
> 
> FreeBSD has always used /usr/lib and for the "native" ABI and /usr/lib32 for
> 32-bit ABIs on 64-bit platforms.  This includes both i386 on x86-64 as well
> as 32-bit powerpc on powerpc64 and more recently 32-bit arm (armv7) on
> aarch64.  Given that, I believe the patch to be correct (and it likely applies
> for powerpc64* using "powerpc" emulation and aarch64* using "armv7" emulation).

John - thanks for the feedback.

Rainer - based on the above, your change is approved.

Jan

  reply	other threads:[~2023-12-21  7:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13  9:33 Rainer Orth
2023-12-19 22:23 ` Rainer Orth
2023-12-20  7:35   ` Jan Beulich
2023-12-20  9:12     ` Rainer Orth
2023-12-20 17:47       ` John Baldwin
2023-12-21  7:25         ` Jan Beulich [this message]
2023-12-21 12:03         ` Rainer Orth

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=f213d2ff-33c6-4e27-8ef4-6255b86218ef@suse.com \
    --to=jbeulich@suse.com \
    --cc=binutils@sourceware.org \
    --cc=jhb@FreeBSD.org \
    --cc=ro@CeBiTec.Uni-Bielefeld.DE \
    /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).