public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Xi Ruoyao <xry111@xry111.site>
To: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>,
	Carlos O'Donell <carlos@redhat.com>,
	libc-alpha <libc-alpha@sourceware.org>
Cc: liuzhensong <liuzhensong@loongson.cn>, Wang Xuerui <i@xen0n.name>,
	 binutils@sourceware.org, Fangrui Song <maskray@google.com>,
	caiyinyu <caiyinyu@loongson.cn>
Subject: Re: glibc 2.36 - Slushy freeze (3 weeks to release)
Date: Tue, 12 Jul 2022 08:48:18 +0800	[thread overview]
Message-ID: <d08a21a6a3b6f58bc9b99a0526b2ef53400e55be.camel@xry111.site> (raw)
In-Reply-To: <7aba5486-ac02-2088-221e-513a6892817a@linaro.org>

On Mon, 2022-07-11 at 16:10 -0300, Adhemerval Zanella Netto wrote:
> 
> 
> On 11/07/22 13:06, Xi Ruoyao via Binutils wrote:
> > +binutils because we'll have to discuss binutils-related issues.
> > 
> > On Mon, 2022-07-11 at 11:20 -0400, Carlos O'Donell via Libc-alpha
> > wrote:
> > 
> > > Desirable:
> > > 
> > > * GLIBC LoongArch PATCHES
> > > 
> > > The LoongArch patches are currently under review, but there looks
> > > to be
> > > some unresolved binutils issues. Just for clarity we expect a
> > > glibc port
> > > to have committed patches for the linux kernel, gcc, and binutils
> > > before
> > > inclusion in glibc.
> > 
> > GCC is mostly fine.  There are some "outstanding" bugs in 12.1 but
> > AFAIK
> > they don't cause issues building glibc.  You can use releases/gcc-12
> > branch if you have any doubt.
> > 
> > Kernel userspace API is fine in 5.19-rc.  There are issues about
> > boot
> > protocol and some drivers but these issues are completely unrelated
> > to
> > glibc.
> > 
> > For binutils, ld is generating strange R_LARCH_NONE relocations
> > (caused
> > by an over-allocate of .rel.* sections and the usage of 0 as
> > padding),
> > and ld is generating R_LARCH_IRELATIVE for .rel.plt section (Fangrui
> > says .rel.plt should not contain R_LARCH_IRELATIVE).
> > 
> > Loongson engineers seems preparing a large patch series containing
> > *both* the bug fix removing buggy R_LARCH_NONE and R_LARCH_IRELATIVE
> > relocations, *and* the implementation of many new relocation types
> > (superseding the current stack-based relocs which are disliked by
> > many
> > people, including me).
> > 
> > Unfortunately, binutils 2.39 release branch is already created and I
> > don't think such a large change set can be reviewed and landed into
> > binutils soon.  So I'll repeat my suggestion again: it's better to
> > separate the bug fix and the new feature into two patch series, and
> > get
> > the bug fix landed and backported for binutils-2.39 branch ASAP. 
> > The
> > new relocs (and/or other new features) can be reviewed later for
> > binutils 2.40, after 2.39 release.
> > 
> > I don't like the stack-based relocs, maybe even more than you guys -
> > I
> > remember I'd shout loudly with "colorful metaphors" when I had to
> > use
> > these relocs in LLVM.  However another binutils release "supporting"
> > LoongArch but completely unusable in practice will be worse. 
> > (Remind:
> > 2.38 is already such a release.)
> 
> So do we need a binutils 2.39 to have a workable glibc build or is the
> 2.38 suffice?

We need a 2.39, or backport one change [1] to 2.38.

[1]: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=3b14682a

> The R_LARCH_NONE issue should only affect performance,
> since it should be ignored by loader although I am not sure without
> understanding better the issue.

Fangrui suggested [2] we should assume R_LARCH_NONE does not exist to
simplify the code and catch ld bugs earlier.  So the code ignoring
R_LARCH_NONE is moved into #ifndef RTLD_BOOTSTRAP in the latest patch
[3].  My experiment shows it causes a segfault starting ld.so.  ld.so
bootstrapping really hits R_LARCH_NONE, and the execution path falls
into _dl_reloc_bad_type.  But using _dl_reloc_bad_type before bootstrap
complete just leads to a segfault (as the error reporting functions like
_dl_signal_error are not relocated correctly yet).

[2]: https://sourceware.org/pipermail/libc-alpha/2022-June/139424.html
[3]: https://sourceware.org/pipermail/libc-alpha/2022-July/140451.html

I agree to just ignore R_LARCH_NONE at all, because "we are not binutils
test suite".

> For R_LARCH_IRELATIVE I think we can just disable ifunc support for
> now and re-enable on 2.37 once it is properly fixed on binutils (maybe
> also bumping minimum required binutils).

I agree with this approach.

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

  reply	other threads:[~2022-07-12  0:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fef8c3c7-fd30-d8b5-e539-f0f21d562c51@redhat.com>
2022-07-11 16:06 ` Xi Ruoyao
2022-07-11 19:10   ` Adhemerval Zanella Netto
2022-07-12  0:48     ` Xi Ruoyao [this message]
2022-07-12  1:02       ` Xi Ruoyao
2022-07-12  2:32       ` Alan Modra
2022-07-12  4:24         ` Fangrui Song
2022-07-12  6:19           ` Jan Beulich
2022-07-12  6:42           ` WANG Xuerui
2022-07-12  7:33             ` Florian Weimer
2022-07-12  8:49               ` Xi Ruoyao
2022-07-12  8:58                 ` Florian Weimer
2022-07-12  9:24             ` Xi Ruoyao
2022-07-12 10:21               ` Adhemerval Zanella Netto
2022-07-12 11:01                 ` Adhemerval Zanella Netto
2022-07-12 12:15                   ` Michael Matz
2022-07-12 13:17                     ` Florian Weimer
2022-07-12 13:28                       ` Michael Matz
2022-07-15 22:34                         ` Hans-Peter Nilsson
2022-07-12 12:48                   ` caiyinyu
2022-07-12 13:00                     ` Xi Ruoyao
2022-07-12  7:33           ` Andrew Waterman

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=d08a21a6a3b6f58bc9b99a0526b2ef53400e55be.camel@xry111.site \
    --to=xry111@xry111.site \
    --cc=adhemerval.zanella@linaro.org \
    --cc=binutils@sourceware.org \
    --cc=caiyinyu@loongson.cn \
    --cc=carlos@redhat.com \
    --cc=i@xen0n.name \
    --cc=libc-alpha@sourceware.org \
    --cc=liuzhensong@loongson.cn \
    --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).