[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250407192537.GA518371@ax162>
Date: Mon, 7 Apr 2025 12:25:37 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Kees Cook <kees@...nel.org>, linux-kernel@...r.kernel.org,
Andrey Konovalov <andreyknvl@...il.com>,
Andy Shevchenko <andy@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Peter Collingbourne <pcc@...gle.com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Will Deacon <will@...nel.org>, llvm@...ts.linux.dev
Subject: Re: [GIT PULL] string fixes for v6.15-rc1
On Mon, Apr 07, 2025 at 12:02:04PM -0700, Linus Torvalds wrote:
> On Mon, 7 Apr 2025 at 10:37, Nathan Chancellor <nathan@...nel.org> wrote:
> > +# Ensure clang does not transform certain loops into calls to wcslen() after
> > +# https://github.com/llvm/llvm-project/commit/9694844d7e36fd5e01011ab56b64f27b867aa72d
> > +KBUILD_CFLAGS-$(call clang-min-version, 210000) += -fno-builtin-wcslen
>
> I think you could just use
>
> KBUILD_CFLAGS += $(call cc-option, -fno-builtin-wcslen)
>
> instead, and not use some version check?
Sure, I just figured this has not been a problem up until this point so
applying it for older versions of clang should not be necessary (since
the optimization that introduces it does not exist) but also not be
harmful. However, I would rather not call out to the compiler since we
know it is supported with all versions of clang (and GCC but it
obviously does not need it) so maybe just
KBUILD_CFLAGS-$(CONFIG_CC_IS_CLANG) += -fno-builtin-wcslen
or
ifdef CONFIG_CC_IS_CLANG
KBUILD_CFLAGS += -fno-builtin-wcslen
endif
or if you do want this for GCC too, unconditionally adding it should be
fine too.
KBUILD_CFLAGS += -fno-builtin-wcslen
No strong opinion, let me know your preference and I will make it so.
Cheers,
Nathan
Powered by blists - more mailing lists