All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sami Tolvanen <samitolvanen@google.com>
To: Arvind Sankar <nivedita@alum.mit.edu>
Cc: "Sedat Dilek" <sedat.dilek@gmail.com>,
	"Fangrui Song" <maskray@google.com>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Joe Perches" <joe@perches.com>,
	"Kees Cook" <keescook@chromium.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Dávid Bolvanský" <david.bolvansky@gmail.com>,
	"Eli Friedman" <efriedma@quicinc.com>,
	"# 3.4.x" <stable@vger.kernel.org>,
	"Vishal Verma" <vishal.l.verma@intel.com>,
	"Dan Williams" <dan.j.williams@intel.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Joel Fernandes (Google)" <joel@joelfernandes.org>,
	"Daniel Axtens" <dja@axtens.net>,
	"Ingo Molnar" <mingo@kernel.org>,
	"Yury Norov" <yury.norov@gmail.com>,
	"Alexandru Ardelean" <alexandru.ardelean@analog.com>,
	LKML <linux-kernel@vger.kernel.org>,
	clang-built-linux <clang-built-linux@googlegroups.com>,
	"Rasmus Villemoes" <linux@rasmusvillemoes.dk>
Subject: Re: [PATCH v2] lib/string.c: implement stpcpy
Date: Mon, 17 Aug 2020 10:14:43 -0700	[thread overview]
Message-ID: <CABCJKucsXufD6rmv7qQZ=9kLC7XrngCJkKA_WzGOAn-KfcObeA@mail.gmail.com> (raw)
In-Reply-To: <20200816150217.GA1306483@rani.riverdale.lan>

On Sun, Aug 16, 2020 at 8:02 AM Arvind Sankar <nivedita@alum.mit.edu> wrote:
>
> On Sun, Aug 16, 2020 at 07:22:35AM +0200, Sedat Dilek wrote:
> > On Sun, Aug 16, 2020 at 2:19 AM 'Fangrui Song' via Clang Built Linux
> > <clang-built-linux@googlegroups.com> wrote:
> > >
> > > Adding a definition without a declaration for stpcpy looks good.
> > > Clang LTO will work.
> > >
> > > (If the kernel does not want to provide these routines,
> > > is http://git.kernel.org/linus/6edfba1b33c701108717f4e036320fc39abe1912
> > > probably wrong? (why remove -ffreestanding from the main Makefile) )
> > >
> >
> > We had some many issues in arch/x86 where *FLAGS were removed or used
> > differently and had to re-add them :-(.
> >
> > So if -ffreestanding is used in arch/x86 and was! used in top-level
> > Makefile - it makes sense to re-add it back?
> > ( I cannot speak for archs other than x86. )
> >
> > - Sedat -
>
> -ffreestanding disables _all_ builtins and libcall optimizations, which
> is probably not desirable. If we added it back, we'd need to also go
> back to #define various string functions to the __builtin versions.
>
> Though I don't understand the original issue, with -ffreestanding,
> sprintf shouldn't have been turned into strcpy in the first place.
>
> 32-bit still has -ffreestanding -- I wonder if that's actually necessary
> any more?
>
> Why does -fno-builtin-stpcpy not work with clang LTO? Isn't that a
> compiler bug?

I just confirmed that adding -fno-builtin-stpcpy to KBUILD_CFLAGS does
work with LTO as well.

Sami

  reply	other threads:[~2020-08-17 17:25 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-15  0:24 [PATCH] lib/string.c: implement stpcpy Nick Desaulniers
2020-08-15  0:52 ` Joe Perches
2020-08-15  2:00   ` Nick Desaulniers
2020-08-15  0:53 ` Sami Tolvanen
2020-08-15  1:33 ` Arvind Sankar
2020-08-15  1:40   ` Arvind Sankar
2020-08-15  2:09     ` [PATCH v2] " Nick Desaulniers
2020-08-15  2:58       ` Arvind Sankar
2020-08-15  3:42       ` Joe Perches
2020-08-15 16:34       ` Kees Cook
2020-08-15 17:38         ` Dávid Bolvanský
2020-08-15 20:47         ` Nick Desaulniers
2020-08-15 21:23           ` Joe Perches
2020-08-15 21:27             ` Dávid Bolvanský
2020-08-15 21:28             ` Nick Desaulniers
2020-08-15 21:31               ` Joe Perches
2020-08-15 22:17                 ` Nick Desaulniers
2020-08-16  0:19                   ` Fangrui Song
2020-08-16  5:22                     ` Sedat Dilek
2020-08-16 15:02                       ` Arvind Sankar
2020-08-17 17:14                         ` Sami Tolvanen [this message]
2020-08-17 18:36                           ` Nick Desaulniers
2020-08-17 19:15                             ` Kees Cook
2020-08-17 20:13                             ` Arvind Sankar
2020-08-17 21:45                               ` Nick Desaulniers
     [not found]                             ` <77557c29286140dea726cc334b4f59fc@AcuMS.aculab.com>
2020-08-18  8:32                               ` Joe Perches
2020-08-17 19:16                           ` Kees Cook
2020-08-16  7:44       ` kernel test robot
2020-08-16  7:44         ` kernel test robot
2020-08-15  2:00   ` [PATCH] " Nick Desaulniers
2020-08-15 22:17 ` David Laight

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='CABCJKucsXufD6rmv7qQZ=9kLC7XrngCJkKA_WzGOAn-KfcObeA@mail.gmail.com' \
    --to=samitolvanen@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexandru.ardelean@analog.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=dan.j.williams@intel.com \
    --cc=david.bolvansky@gmail.com \
    --cc=dja@axtens.net \
    --cc=efriedma@quicinc.com \
    --cc=joe@perches.com \
    --cc=joel@joelfernandes.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=maskray@google.com \
    --cc=mingo@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nivedita@alum.mit.edu \
    --cc=sedat.dilek@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=vishal.l.verma@intel.com \
    --cc=yury.norov@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.