From: Erwan Velu Date: Wed, 2 Jun 2021 14:15:59 +0000 (+0200) Subject: Makefile: Avoid using built-in stpcpy during clang build X-Git-Tag: fio-3.28~62^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=4b0e335a05f3a082a4f051304ba9bb6f36af4432;p=fio.git Makefile: Avoid using built-in stpcpy during clang build Since clang 12, during the clang build, noticed by the CI, the linking fails as clang optimize some string functions to stpcpy. LINK fio lld-link: error: undefined symbol: stpcpy >>> referenced by C:\projects\fio\options.c:5305 >>> options.o:(fio_options_parse) Two possible implementations : - Adding stpcpy in fio as the kernel did : https://lore.kernel.org/lkml/20200815002417.1512973-1-ndesaulniers@google.com/T/ - Disable the implicit stpcpy To avoid adding code into fio, the latter option was used. Signed-off-by: Erwan Velu --- diff --git a/Makefile b/Makefile index ef317373..f57569d5 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,11 @@ ifdef CONFIG_PDB LDFLAGS += -fuse-ld=lld $(LINK_PDBFILE) endif +# If clang, do not use builtin stpcpy as it breaks the build +ifeq ($(CC),clang) + FIO_CFLAGS += -fno-builtin-stpcpy +endif + ifdef CONFIG_GFIO PROGS += gfio endif