Re: [GIT PULL] string fixes for v6.15-rc1
From: Nathan Chancellor
Date: Mon Apr 07 2025 - 17:02:07 EST
On Mon, Apr 07, 2025 at 01:25:04PM -0700, Linus Torvalds wrote:
> I think if unconditionally works, that's probably the best option
> simply because it's the simplest option.
>
> But I don't see 'wcslen' in the gcc docs, which was why I was assuming
> it wanted that "check if it works" thing with "$(call cc-option,...)"
It appears that neither gcc nor clang warn for "invalid" libcall values
to '-fno-builtin-*':
$ echo 'int main(void) { return 0; }' | clang -fno-builtin-ireallydonotexist -o /dev/null -S -x c -
$ echo 'int main(void) { return 0; }' | gcc -fno-builtin-ireallydonotexist -o /dev/null -S -x c -
> I don't think we need to call out the particular compiler, since the
> argument against using it is not compiler-specific per se.
Sounds good, I will ultimately make this:
# Ensure compilers do not transform certain loops into calls to wcslen()
KBUILD_CFLAGS += -fno-builtin-wcslen
Cheers,
Nathan