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@xxxxxxxxxxxxxxxx> 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? Thanks.