Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LoongArch: Replace -ffreestanding with finer-grained -fno-builtin's
As explained by Nick in the original issue: the kernel usually does a good job of providing library helpers that have similar semantics as their ordinary userspace libc equivalents, but -ffreestanding disables such libcall optimization and other related features in the compiler, which can lead to unexpected things such as CONFIG_FORTIFY_SOURCE not working (!). As it turns out to be the case, only the memory operations really need to be prevented from expansion by the compiler, and this is doable with finer-grained -fno-builtin-* toggles. So only disable memcpy, memmove and memset, while leaving other builtins enabled, to fix source fortification among others. Closes: ClangBuiltLinux#1897 Reported-by: Nathan Chancellor <[email protected]> Suggested-by: Nick Desaulniers <[email protected]> Signed-off-by: WANG Xuerui <[email protected]>
- Loading branch information