Blame SOURCES/corefx-optflags-support.patch

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