public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@redhat.com>
To: "Fangrui Song" <maskray@google.com>, "Ludovic Courtès" <ludo@gnu.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] Correctly determine libc.so 'OUTPUT_FORMAT' when cross-compiling.
Date: Fri, 28 Oct 2022 21:45:21 -0400	[thread overview]
Message-ID: <644019f7-9616-f7de-7126-ff1a9d32a0d6@redhat.com> (raw)
In-Reply-To: <20221013205621.upcf2c2oo5diyxfx@google.com>

On 10/13/22 16:56, Fangrui Song wrote:
> On 2022-10-07, Ludovic Courtès via Libc-alpha wrote:
>> Hi Carlos,
>>
>> Carlos O'Donell <carlos@redhat.com> skribis:
>>
>>> On Thu, Jul 01, 2021 at 11:00:19PM +0200, Ludovic Courtès via Libc-alpha wrote:
>>>> Commit 87d583c6e8cd0e49f64da76636ebeec033298b4d replaces the sed script
>>>> with an "objdump -f" invocation to determine the 'OUTPUT_FORMAT' bit of
>>>> the libc.so linker script.
>>>>
>>>> However, when cross-compiling, for example from x86_64-linux-gnu to
>>>> aarch64-linux-gnu, "objdump -f" would report the wrong
>>>> format ("elf64-little").  Conversely, "aarch64-linux-gnu-objdump -f"
>>>> reports "elf64-littleaarch64" as expected.
>>>>
>>>> This patch changes 'configure.ac' to use AC_CHECK_TOOL rather than
>>>> '$CC -print-prog-name=objdump' to determine the value of the OBJDUMP
>>>> variable.  That way, OBJDUMP is set to TRIPLET-objdump when
>>>> cross-compiling for TRIPLET.
>>>
>>> I've been tackling a backlog of old glibc patches, and this one is up
>>> next. Yes it's been over a year, but this patch still applies and the
>>> idea is sound. I've tested this with build-many-glibcs (bmg) on x86_64
>>> and it has no impact because bmg always sets OBJDUMP. My opinion is that
>>> bmg is the "base standard" for how we build native and cross tooling and
>>> so it your changes work here, they should work in other instances.
>>>
>>> The change looks good to me.
>>>
>>> No regresions on x86_64.
>>>
>>> Would you like me to commit this? :-)
>>
>> I don’t have commit access AFAIK so I’ll happily defer to you.  :-)
>>
>> Thanks for taking the time to look at the backlog!
>>
>> Ludo’.
> 
> Thanks. This looks good.
 
Tested again with bmg to cross x86_64 to aarch64. No regressions.

Pushed. Thank you!

-- 
Cheers,
Carlos.


      reply	other threads:[~2022-10-29  1:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01 21:00 Ludovic Courtès
2022-10-06 14:55 ` Carlos O'Donell
2022-10-07  9:41   ` Ludovic Courtès
2022-10-13 20:56     ` Fangrui Song
2022-10-29  1:45       ` Carlos O'Donell [this message]

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=644019f7-9616-f7de-7126-ff1a9d32a0d6@redhat.com \
    --to=carlos@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=ludo@gnu.org \
    --cc=maskray@google.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).