public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cmuellner at linux dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/30095] New: Inhibit early libcalls before ifunc support is ready
Date: Tue, 07 Feb 2023 11:55:52 +0000	[thread overview]
Message-ID: <bug-30095-131@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=30095

            Bug ID: 30095
           Summary: Inhibit early libcalls before ifunc support is ready
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: cmuellner at linux dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

When developing a first version of ifunc support for RISC-V, I encountered an
endless loop in the first few instructions of a statically linked RV64 binary.
When analyzing this issue, I observed that GCC has identified the loop in
_dl_aux_init() as memset-zero operation and replaced it with a libcall to
memset.

This turned out to be problematic because the ifunc support is not ready at
that time.

One solution is to set a function attribute to inhibit loop-to-libcall
transformations by the compiler ("-fno-tree-loop-distribute-patterns").
A corresponding patch has been sent as part of the RISC-V ifunc series:
  https://sourceware.org/pipermail/libc-alpha/2023-February/145350.html
 
https://patchwork.sourceware.org/project/glibc/patch/20230207001618.458947-2-christoph.muellner@vrull.eu/

The issue was triggered with GCC upstream/master and glibc upstream/master
cross-compiling glibc with "-O3" for RV64.

I believe this issue is not caused by a wrong implementation in the RISC-V
ifunc support, therefore, I decided the open this ticket (with the hope it can
get addressed independently of the ifunc series).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2023-02-07 11:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07 11:55 cmuellner at linux dot com [this message]
2023-02-07 18:31 ` [Bug libc/30095] " adhemerval.zanella at linaro dot org
2023-02-08  9:52 ` cmuellner at linux dot com

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=bug-30095-131@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.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).