cmake_modules/compilerchecks.cmake
changeset 9154 a43406054648
parent 9153 354a9803fe91
child 9155 480f483de544
--- a/cmake_modules/compilerchecks.cmake	Sat Jun 08 01:56:23 2013 +0200
+++ b/cmake_modules/compilerchecks.cmake	Sat Jun 08 02:03:02 2013 +0200
@@ -9,6 +9,7 @@
 check_c_compiler_flag("" HAVE_NOEXECSTACK)
 if(HAVE_NOEXECSTACK)
     list(APPEND pascal_flags "-k-z" "-knoexecstack")
+    list(APPEND haskell_flags "-optl" "-z" "-optl" "noexecstack")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_REQUIRED_FLAGS}")
 endif()
 
@@ -17,6 +18,7 @@
 check_c_compiler_flag("" HAVE_RELROFULL)
 if(HAVE_RELROFULL)
     list(APPEND pascal_flags "-k-z" "-krelro" "-k-z" "-know")
+    list(APPEND haskell_flags "-optl" "-z" "-optl" "relro" "-optl" "-z" "-optl" "now")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_REQUIRED_FLAGS}")
 else()
     #if full relro is not available, try partial relro
@@ -24,6 +26,7 @@
     check_c_compiler_flag("" HAVE_RELROPARTIAL)
     if(HAVE_RELROPARTIAL)
         list(APPEND pascal_flags "-k-z" "-krelro")
+        list(APPEND haskell_flags "-optl" "-z" "-optl" "relro")
         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_REQUIRED_FLAGS}")
     endif()
 endif()
@@ -33,6 +36,7 @@
 check_c_compiler_flag("" HAVE_WINASLR)
 if(HAVE_WINASLR)
     list(APPEND pascal_flags "-k--nxcompat")
+    list(APPEND haskell_flags "-optl" "--nxcompat")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_REQUIRED_FLAGS}")
 endif()
 
@@ -41,6 +45,7 @@
 check_c_compiler_flag("" HAVE_WINDEP)
 if(HAVE_WINDEP)
     list(APPEND pascal_flags "-k--dynamicbase")
+    list(APPEND haskell_flags "-optl" "--dynamicbase")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_REQUIRED_FLAGS}")
 endif()