From 63d20c029bd283e03a93d3ab93e1565ac427cdce Mon Sep 17 00:00:00 2001 From: glx22 Date: Sun, 28 Jun 2020 01:18:28 +0200 Subject: Fix 887b912af: MinGW requires an extra link flag with _FORTIFY_SOURCE (#8246) see #7860 --- cmake/CompileFlags.cmake | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cmake') diff --git a/cmake/CompileFlags.cmake b/cmake/CompileFlags.cmake index 9287ca249..e7d470c7d 100644 --- a/cmake/CompileFlags.cmake +++ b/cmake/CompileFlags.cmake @@ -33,6 +33,11 @@ macro(compile_flags) "$<$:-D_DEBUG>" "$<$>:-D_FORTIFY_SOURCE=2>" # FORTIFY_SOURCE should only be used in non-debug builds (requires -O1+) ) + if (MINGW) + add_link_options( + "$<$>:-fstack-protector>" # Prevent undefined references when _FORTIFY_SOURCE > 0 + ) + endif (MINGW) # Prepare a generator that checks if we are not a debug, and don't have asserts # on. We need this later on to set some compile options for stable releases. -- cgit v1.2.3-70-g09d2