[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200817201351.GA2246446@rani.riverdale.lan>
Date: Mon, 17 Aug 2020 16:13:51 -0400
From: Arvind Sankar <nivedita@...m.mit.edu>
To: Nick Desaulniers <ndesaulniers@...gle.com>
Cc: Sami Tolvanen <samitolvanen@...gle.com>,
Arvind Sankar <nivedita@...m.mit.edu>,
Kees Cook <keescook@...omium.org>,
Sedat Dilek <sedat.dilek@...il.com>,
Fangrui Song <maskray@...gle.com>,
Joe Perches <joe@...ches.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Dávid Bolvanský <david.bolvansky@...il.com>,
Eli Friedman <efriedma@...cinc.com>,
"# 3.4.x" <stable@...r.kernel.org>,
Vishal Verma <vishal.l.verma@...el.com>,
Dan Williams <dan.j.williams@...el.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
"Joel Fernandes (Google)" <joel@...lfernandes.org>,
Daniel Axtens <dja@...ens.net>, Ingo Molnar <mingo@...nel.org>,
Yury Norov <yury.norov@...il.com>,
Alexandru Ardelean <alexandru.ardelean@...log.com>,
LKML <linux-kernel@...r.kernel.org>,
clang-built-linux <clang-built-linux@...glegroups.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Nathan Chancellor <natechancellor@...il.com>
Subject: Re: [PATCH v2] lib/string.c: implement stpcpy
On Mon, Aug 17, 2020 at 11:36:49AM -0700, Nick Desaulniers wrote:
> > > Though I don't understand the original issue, with -ffreestanding,
> > > sprintf shouldn't have been turned into strcpy in the first place.
>
> Huh? The original issue for this thread is because `-ffreestanding`
> *isn't* being used for most targets (oh boy, actually mixed usage by
> ARCH. Looks like MIPS, m68k, superH, xtensa, and 32b x86 use it?); and
> I'm not suggesting it be used.
>
Sorry, I meant the issue mentioned in the commit that removed
-ffreestanding, not the stpcpy one you're solving now. It says that
sprintf got converted into strcpy, which caused failures because back
then, strcpy was #define'd to __builtin_strcpy, and the default
implementation was actually of a function called __builtin_strcpy o_O,
not strcpy.
Anyway, that's water under the bridge now.
6edfba1b33c7 ("x86_64: Don't define string functions to builtin")
gcc should handle this anyways, and it causes problems when
sprintf is turned into strcpy by gcc behind our backs and
the C fallback version of strcpy is actually defining __builtin_strcpy
Powered by blists - more mailing lists