From 60ef6b027ec05b5e248901f1d95f1a03434e8ce2 Mon Sep 17 00:00:00 2001 From: Vincent Fu Date: Thu, 12 Dec 2019 15:22:06 -0700 Subject: [PATCH] Makefile: add libssp for Windows Recent Cygwin mingw releases require linking against libssp to avoid undefined symbols. See https://github.com/msys2/MINGW-packages/issues/5868 for discussion. https://github.com/msys2/MINGW-packages/issues/5803 also contains discussion of possibly disabling the FORTIFY_SOURCE linker flag. Fixes: https://github.com/axboe/fio/issues/881 Signed-off-by: Vincent Fu --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7aab6abd..4a07fab3 100644 --- a/Makefile +++ b/Makefile @@ -209,7 +209,7 @@ ifeq ($(CONFIG_TARGET_OS), Darwin) endif ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS))) SOURCE += os/windows/posix.c - LIBS += -lpthread -lpsapi -lws2_32 + LIBS += -lpthread -lpsapi -lws2_32 -lssp CFLAGS += -DPSAPI_VERSION=1 -Ios/windows/posix/include -Wno-format endif @@ -506,7 +506,7 @@ t/time-test: $(T_TT_OBJS) ifdef CONFIG_HAVE_CUNIT unittests/unittest: $(UT_OBJS) $(UT_TARGET_OBJS) - $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(UT_OBJS) $(UT_TARGET_OBJS) -lcunit + $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(UT_OBJS) $(UT_TARGET_OBJS) -lcunit $(LIBS) endif clean: FORCE -- 2.25.1