From: "H.J. Lu" <hjl.tools@gmail.com>
To: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Cc: "Carlos O'Donell" <carlos@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH 6/6] x86: Fix -Os build (BZ #29576)
Date: Wed, 5 Oct 2022 14:27:39 -0700 [thread overview]
Message-ID: <CAMe9rOrZbiTk9itdwrYCpo=3JWVsF-QSuOC7ED09dV4HX8Vcaw@mail.gmail.com> (raw)
In-Reply-To: <ad1df0cb-1bb8-b71c-c387-9ab8f09e11bf@linaro.org>
On Wed, Oct 5, 2022 at 1:43 PM Adhemerval Zanella Netto
<adhemerval.zanella@linaro.org> wrote:
>
>
>
> On 05/10/22 15:06, H.J. Lu wrote:
> > On Wed, Oct 5, 2022 at 10:38 AM Adhemerval Zanella Netto
> > <adhemerval.zanella@linaro.org> wrote:
> >>
> >>
> >>
> >> On 05/10/22 14:21, H.J. Lu wrote:
> >>> On Wed, Oct 5, 2022 at 7:10 AM Carlos O'Donell <carlos@redhat.com> wrote:
> >>>>
> >>>> On Wed, Sep 21, 2022 at 10:51:08AM -0300, Adhemerval Zanella via Libc-alpha wrote:
> >>>>> The compiler might transform __stpcpy calls (which are routed to
> >>>>> __builtin_stpcpy as an optimization) to strcpy and x86_64 strcpy
> >>>>> multiarch implementation does not build any working symbol due
> >>>>> ISA_SHOULD_BUILD not being evaluated for IS_IN(rtld).
> >>>>
> >>>> Ohhhhhh... that is interesting. This changes the strcpy used in rtld for
> >>>> all x86_64 build options, and I'm going to ACK this, but we may need to
> >>>> revisit this if it shows up in a profile.
> >>>
> >>> Will this lead to both strcpy and stpcpy in ld.so? Currently there is only
> >>> stpcpy in ld.so.
> >>
> >> I think that is expected behavior if compiler creates a reference for a
> >> supported string function in the loader (rtld build pulls the
> >> implementation).
> >
> > strcpy is only generated in dl-profile.os:
> >
> > text data bss dec hex filename
> > 2716 0 72 2788 ae4 dl-profile.os (-O2)
> > 2265 0 72 2337 921 dl-profile.os (-Os)
> > 1840 0 0 1840 730 strcpy.os
> >
> > Should we compile dl-profile.c with -O2 with
> >
> > CFLAGS-dl-profile.c += $(if $(findstring -Os,$(+cflags)), -O2)
> >
> > It will create a smaller ld.so.
>
> It might be an option to a subsequent patch, but I would avoid trying to outsmart
> the compiler here since it might generate a smaller in other version and it would
> most likely be arch-specific (adding even more building complexity).
>
Fair enough.
LGTM.
Thanks.
--
H.J.
next prev parent reply other threads:[~2022-10-05 21:28 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-21 13:51 [PATCH 0/6] Fix -Os build Adhemerval Zanella
2022-09-21 13:51 ` [PATCH 1/6] locale: prevent maybe-uninitialized errors with -Os [BZ #19444] Adhemerval Zanella
2022-10-05 13:39 ` Carlos O'Donell
2022-09-21 13:51 ` [PATCH 2/6] posix: Suppress -Os warnings on fnmatch Adhemerval Zanella
2022-10-05 13:47 ` Carlos O'Donell
2022-10-05 20:01 ` Paul Eggert
2022-09-21 13:51 ` [PATCH 3/6] posix: Suppress -Os may be used uninitialized warnings on regexec Adhemerval Zanella
2022-10-05 13:49 ` Carlos O'Donell
2022-09-21 13:51 ` [PATCH 4/6] rt: Initialize mq_send input on tst-mqueue{5,6} Adhemerval Zanella
2022-10-05 13:51 ` Carlos O'Donell
2022-09-21 13:51 ` [PATCH 5/6] sunrpc: Suppress GCC -Os warning on user2netname Adhemerval Zanella
2022-10-05 13:52 ` Carlos O'Donell
2022-09-21 13:51 ` [PATCH 6/6] x86: Fix -Os build (BZ #29576) Adhemerval Zanella
2022-10-05 14:10 ` Carlos O'Donell
2022-10-05 17:21 ` H.J. Lu
2022-10-05 17:38 ` Adhemerval Zanella Netto
2022-10-05 18:06 ` H.J. Lu
2022-10-05 20:43 ` Adhemerval Zanella Netto
2022-10-05 21:27 ` H.J. Lu [this message]
2022-10-05 13:40 ` [PATCH 0/6] Fix -Os build Carlos O'Donell
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='CAMe9rOrZbiTk9itdwrYCpo=3JWVsF-QSuOC7ED09dV4HX8Vcaw@mail.gmail.com' \
--to=hjl.tools@gmail.com \
--cc=adhemerval.zanella@linaro.org \
--cc=carlos@redhat.com \
--cc=libc-alpha@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).