diff --git a/Makefile b/Makefile index b9072fe3c492..f90d41602a1d 100644 --- a/Makefile +++ b/Makefile @@ -698,6 +698,12 @@ KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0409, \ # Tell gcc to never replace conditional load with a non-conditional one KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0) +# The compiler may "libcall optimize" certain function calls into the below +# functions, for architectures that don't use -ffreestanding. If we don't plan +# to provide implementations of these routines, then prevent the compiler from +# emitting calls to what will be undefined symbols. +KBUILD_CFLAGS += -fno-builtin-stpcpy + # check for 'asm goto' ifeq ($(call shell-cached,$(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y) KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO