From: "Ludovic Courtès via Libc-alpha" <libc-alpha@sourceware.org>
To: Vineet Gupta <vineetg@rivosinc.com>
Cc: libc-alpha@sourceware.org, Carlos O'Donell <carlos@redhat.com>,
Fangrui Song <maskray@google.com>,
nelson Chu <nelson@rivosinc.com>,
palmer@rivosinc.com, gnu-toolchain@rivosinc.com
Subject: Re: [PATCH] Revert "Correctly determine libc.so 'OUTPUT_FORMAT' when cross-compiling."
Date: Sat, 26 Nov 2022 15:57:42 +0100 [thread overview]
Message-ID: <87lenx9315.fsf@gnu.org> (raw)
In-Reply-To: <20221123025932.473655-1-vineetg@rivosinc.com> (Vineet Gupta's message of "Tue, 22 Nov 2022 18:59:32 -0800")
Hi,
Vineet Gupta <vineetg@rivosinc.com> skribis:
> This reverts commit 361d6454c034a920f2c96517c277990d390b9652.
>
> This trips up riscv gnu toolchain builds [1]
>
> riscv ld segfaults when linking libgcc because libc.so linker script
> contains `OUTPUT_FORMAT(elf32-little)` vs. `OUTPUT_FORMAT(elf32-littleriscv)`.
>
> This patch causes builds to lookup riscv32* prefixed objdump and failing
> to find it falls back to host objdump which is the root of the issue.
> The host objdump in turn generates `OUTPUT_FORMAT(elf32-little)`
>
> riscv glibc multilib builds lack riscv32 prefix binaries. They have a
> single set of "riscv64" prefixed binaries supporting both 32 and 64-bit
> abis: ilp32/ilp32d/lp64/lp64d using -march/-mabi.
>
> FWIW I'm not sure how this patch fixed a real problem to begin with.
The rationale was described in the context of cross-compilation to
aarch64-linux-gnu:
https://sourceware.org/pipermail/libc-alpha/2021-July/128333.html
We observed a similar issue with objcopy when cross-compiling to
powerpc64le-linux-gnu:
https://issues.guix.gnu.org/49417
Maybe we should see, in your case, why “riscv32-linux-gnu-objdump -f”
reports “elf32-little” instead of “elf32-littleriscv”?
HTH,
Ludo’.
next prev parent reply other threads:[~2022-11-26 14:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-23 2:59 [PATCH] Revert "Correctly determine libc.so 'OUTPUT_FORMAT' when cross-compiling." Vineet Gupta
2022-11-26 14:57 ` Ludovic Courtès via Libc-alpha [this message]
2022-11-28 2:24 ` Vineet Gupta
2022-11-28 15:37 ` Ludovic Courtès via Libc-alpha
2022-11-28 19:04 ` Vineet Gupta
2022-11-28 23:25 ` Palmer Dabbelt
2022-11-30 12:39 ` Adhemerval Zanella Netto via Libc-alpha
2022-12-01 0:45 ` Vineet Gupta
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=87lenx9315.fsf@gnu.org \
--to=libc-alpha@sourceware.org \
--cc=carlos@redhat.com \
--cc=gnu-toolchain@rivosinc.com \
--cc=ludo@gnu.org \
--cc=maskray@google.com \
--cc=nelson@rivosinc.com \
--cc=palmer@rivosinc.com \
--cc=vineetg@rivosinc.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).