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 <e.velu@criteo.com>
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