Blame SOURCES/corefx-optflags-support.patch

105ad9
diff --git a/src/Native/Unix/configure.cmake b/src/Native/Unix/configure.cmake
105ad9
index f4a30ad6cb..f2db68402a 100644
105ad9
--- a/src/Native/Unix/configure.cmake
105ad9
+++ b/src/Native/Unix/configure.cmake
105ad9
@@ -27,6 +27,12 @@ else ()
105ad9
     message(FATAL_ERROR "Unknown platform.  Cannot define PAL_UNIX_NAME, used by RuntimeInformation.")
105ad9
 endif ()
105ad9
 
105ad9
+
105ad9
+set (PREVIOUS_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
e9eb67
+set (CMAKE_CXX_FLAGS "-D_GNU_SOURCE")
105ad9
+set (PREVIOUS_CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
e9eb67
+set (CMAKE_C_FLAGS "-D_GNU_SOURCE")
105ad9
+
105ad9
 # We compile with -Werror, so we need to make sure these code fragments compile without warnings.
105ad9
 # Older CMake versions (3.8) do not assign the result of their tests, causing unused-value errors
105ad9
 # which are not distinguished from the test failing. So no error for that one.
105ad9
@@ -698,6 +704,9 @@ endif()
105ad9
 
105ad9
 set (CMAKE_REQUIRED_LIBRARIES)
105ad9
 
105ad9
+set (CMAKE_CXX_FLAGS "${PREVIOUS_CMAKE_CXX_FLAGS}")
105ad9
+set (CMAKE_C_FLAGS "${PREVIOUS_CMAKE_C_FLAGS}")
105ad9
+
105ad9
 check_c_source_compiles(
105ad9
     "
105ad9
     #include <sys/inotify.h>