[CMAKE/MSVC]

* Use the runtime checks globally in ReactOS now, not just for user mode modules.
* We no longer need the MS support lib, as Timo kindly implemented one for ReactOS.
* Rename the lib to runtmchk.
[PSEH][CRT]
* Remove some constrictions to seh.s source files, we no longer need them.
[KERNEL32]
* We no longer need to explicitly link to the runtime checks lib.
[FREELDR][KEYBOARD][NTOS][SETUPLDR]
* Link to the runtime checks lib when this mode is enabled.
CORE-8626

svn path=/trunk/; revision=64807
This commit is contained in:
Amine Khaldi 2014-10-18 14:22:09 +00:00
parent ee8be36736
commit df43f0f0a0
9 changed files with 23 additions and 41 deletions

View file

@ -213,6 +213,9 @@ target_link_libraries(freeldr_pe_dbg freeldr_common cportlib cmlib rtl libcntpr)
if(STACK_PROTECTOR)
target_link_libraries(freeldr_pe gcc_ssp)
target_link_libraries(freeldr_pe_dbg gcc_ssp)
elseif(RUNTIME_CHECKS)
target_link_libraries(freeldr_pe runtmchk)
target_link_libraries(freeldr_pe_dbg runtmchk)
endif()
add_dependencies(freeldr_pe asm)
@ -273,6 +276,9 @@ target_link_libraries(setupldr_pe_dbg freeldr_common cportlib cmlib rtl libcntpr
if(STACK_PROTECTOR)
target_link_libraries(setupldr_pe gcc_ssp)
target_link_libraries(setupldr_pe_dbg gcc_ssp)
elseif(RUNTIME_CHECKS)
target_link_libraries(setupldr_pe runtmchk)
target_link_libraries(setupldr_pe_dbg runtmchk)
endif()
add_dependencies(setupldr_pe asm)

View file

@ -502,14 +502,6 @@ function(add_importlibs _module)
if("${LIB}" MATCHES "msvcrt")
add_target_compile_definitions(${_module} _DLL __USE_CRTIMP)
target_link_libraries(${_module} msvcrtex)
if(MSVC)
if(RUNTIME_CHECKS)
if(NOT ${_module} STREQUAL "kernel32")
add_target_compile_flags(${_module} "/RTC1")
target_link_libraries(${_module} RunTmChk.lib)
endif()
endif()
endif()
endif()
target_link_libraries(${_module} lib${LIB})
add_dependencies(${_module} lib${LIB})

View file

@ -88,6 +88,7 @@ endif()
if(RUNTIME_CHECKS)
add_definitions(-D__RUNTIME_CHECKS__)
add_compile_flags("/RTC1")
endif()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE")
@ -232,6 +233,11 @@ function(set_module_type_toolchain MODULE TYPE)
elseif(${TYPE} STREQUAL "wdmdriver")
add_target_link_flags(${MODULE} "/DRIVER:WDM")
endif()
if(RUNTIME_CHECKS)
target_link_libraries(${MODULE} runtmchk)
endif()
endfunction()
# Define those for having real libraries

View file

@ -102,6 +102,10 @@ foreach(_keyboard_layout ${_keyboard_layouts})
add_target_link_flags(${_keyboard_layout} "-Wl,-T,${CMAKE_SOURCE_DIR}/kbdlayout.lds")
endif()
if(RUNTIME_CHECKS)
target_link_libraries(${_keyboard_layout} runtmchk)
endif()
add_dependencies(${_keyboard_layout} psdk)
add_cd_file(TARGET ${_keyboard_layout} DESTINATION reactos/system32 FOR all)
endforeach()

View file

@ -106,11 +106,6 @@ set_subsystem(kernel32 console)
################# END HACK #################
target_link_libraries(kernel32 wine chkstk ${PSEH_LIB})
if(RUNTIME_CHECKS)
target_link_libraries(kernel32 RunTmChk.lib)
endif()
add_importlibs(kernel32 ntdll)
add_pch(kernel32 k32.h SOURCE)
add_dependencies(kernel32 psdk errcodes asm)

View file

@ -22,12 +22,9 @@ EXTERN _RtlUnwind@16:PROC
/* GLOBALS *******************************************************************/
#ifndef __RUNTIME_CHECKS__
PUBLIC __global_unwind2
PUBLIC __local_unwind2
PUBLIC __abnormal_termination
#endif
PUBLIC __except_handler2
PUBLIC __except_handler3

View file

@ -25,11 +25,8 @@ EXTERN _RtlUnwind@16:PROC
PUBLIC __global_unwind2
PUBLIC __local_unwind2
PUBLIC __abnormal_termination
#if !defined(__RUNTIME_CHECKS__) || (defined(__RUNTIME_CHECKS__) && !defined(_LIBCNT_))
PUBLIC __except_handler2
PUBLIC __except_handler3
#endif
/* FUNCTIONS *****************************************************************/

View file

@ -10,7 +10,6 @@ set(NTKRNLMP_SOURCE ${SOURCE})
set(NTKRNLMP_ASM_SOURCE ${ASM_SOURCE})
spec2def(ntoskrnl.exe ntoskrnl.spec ADD_IMPORTLIB)
add_asm_files(ntoskrnl_asm ${NTOSKRNL_ASM_SOURCE})
add_executable(ntoskrnl
@ -37,19 +36,12 @@ else()
endif()
endif()
target_link_libraries(ntoskrnl
cportlib
csq
${PSEH_LIB}
cmlib
rtl
${ROSSYM_LIB}
libcntpr
wdmguid
ioevent)
target_link_libraries(ntoskrnl cportlib csq ${PSEH_LIB} cmlib rtl ${ROSSYM_LIB} libcntpr wdmguid ioevent)
if(STACK_PROTECTOR)
target_link_libraries(ntoskrnl gcc_ssp)
elseif(RUNTIME_CHECKS)
target_link_libraries(ntoskrnl runtmchk)
endif()
add_importlibs(ntoskrnl hal kdcom bootvid)

View file

@ -1,3 +1,4 @@
include(../ntos.cmake)
spec2def(ntkrnlmp.exe ../ntoskrnl.spec)
@ -32,19 +33,11 @@ endif()
if(STACK_PROTECTOR)
target_link_libraries(ntkrnlmp gcc_ssp)
elseif(RUNTIME_CHECKS)
target_link_libraries(ntkrnlmp runtmchk)
endif()
target_link_libraries(ntkrnlmp
cportlib
csq
${PSEH_LIB}
cmlib
rtl
${ROSSYM_LIB}
libcntpr
wdmguid
ioevent)
target_link_libraries(ntkrnlmp cportlib csq ${PSEH_LIB} cmlib rtl ${ROSSYM_LIB} libcntpr wdmguid ioevent)
add_importlibs(ntkrnlmp hal kdcom bootvid)
add_pch(ntkrnlmp ${REACTOS_SOURCE_DIR}/ntoskrnl/include/ntoskrnl.h NTKRNLMP_SOURCE)
add_dependencies(ntkrnlmp psdk bugcodes asm)