set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,6.00") #windows subsystem
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LARGEADDRESSAWARE") # can handle addresses larger than 2 gigabytes
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /RELEASE") #sets the checksum in the header
-if (IS_64BIT_BUILD EQUAL 0)
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO") #Image does not have Safe Exception Handlers..valid only for x86
-endif (IS_64BIT_BUILD EQUAL 0)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NXCOMPAT") #Compatible with Data Execution Prevention
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DYNAMICBASE") #Use address space layout randomization
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEBUGTYPE:cv,fixup") #debugging format
get_include_directories(ASM_INCLUDE_DIRECTORIES)
get_compile_definitions(ASM_DEFINITIONS)
+set(ASM_OPTIONS /c /Zi /W3 /errorReport:prompt)
+
+if (CLR_CMAKE_PLATFORM_ARCH_I386)
+ list (APPEND ASM_OPTIONS /safeseh)
+endif (CLR_CMAKE_PLATFORM_ARCH_I386)
# Need to compile asm file using custom command as include directories are not provided to asm compiler
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dbghelpers.obj
- COMMAND ${CMAKE_ASM_MASM_COMPILER} ${ASM_INCLUDE_DIRECTORIES} ${ASM_DEFINITIONS} /c /Zi /Fo${CMAKE_CURRENT_BINARY_DIR}/dbghelpers.obj /W3 /errorReport:prompt /Ta${CORDBEE_DIR}/${ARCH_SOURCES_DIR}/dbghelpers.asm
+ COMMAND ${CMAKE_ASM_MASM_COMPILER} ${ASM_INCLUDE_DIRECTORIES} ${ASM_DEFINITIONS} ${ASM_OPTIONS} /Fo${CMAKE_CURRENT_BINARY_DIR}/dbghelpers.obj /Ta${CORDBEE_DIR}/${ARCH_SOURCES_DIR}/dbghelpers.asm
DEPENDS ${CORDBEE_DIR}/${ARCH_SOURCES_DIR}/dbghelpers.asm
COMMENT "Compiling dbghelpers.asm")
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-;
-; Copyright (c) Microsoft. All rights reserved.
-; Licensed under the MIT license. See LICENSE file in the project root for full license information.
-;
-
-; ==++==
-;
-
-;
-; ==--==
-;
-; This file contains definitions for each CLR exception handler.
-; The assembler marks all functions in this file as safe-exception
-; handler.
-;
-
-.686
-.model flat
-
-COMPlusFrameHandler proto c
-.safeseh COMPlusFrameHandler
-
-COMPlusNestedExceptionHandler proto c
-.safeseh COMPlusNestedExceptionHandler
-
-FastNExportExceptHandler proto c
-.safeseh FastNExportExceptHandler
-
-UMThunkPrestubHandler proto c
-.safeseh UMThunkPrestubHandler
-
-ifdef FEATURE_COMINTEROP
-COMPlusFrameHandlerRevCom proto c
-.safeseh COMPlusFrameHandlerRevCom
-endif
-
-end
-
<ItemGroup Condition="'$(FeatureCoreclr)'=='true'">
<CppCompile Include="..\unixinterface.cpp" />
</ItemGroup>
-
- <ItemGroup>
- <Assemble386 Condition="'$(BuildArchitecture)' == 'i386'" Include="..\i386\handlers.asm" />
- </ItemGroup>
-
</Project>
endif ; _DEBUG
endif ; FEATURE_CORECLR
+; Register CLR exception handlers defined on the C++ side with SAFESEH.
+; Note that these directives must be in a file that defines symbols that will be used during linking,
+; otherwise it's possible that the resulting .obj will completly be ignored by the linker and these
+; directives will have no effect.
+COMPlusFrameHandler proto c
+.safeseh COMPlusFrameHandler
+
+COMPlusNestedExceptionHandler proto c
+.safeseh COMPlusNestedExceptionHandler
+
+FastNExportExceptHandler proto c
+.safeseh FastNExportExceptHandler
+
+UMThunkPrestubHandler proto c
+.safeseh UMThunkPrestubHandler
+
+ifdef FEATURE_COMINTEROP
+COMPlusFrameHandlerRevCom proto c
+.safeseh COMPlusFrameHandlerRevCom
+endif
+
; Note that RtlUnwind trashes EBX, ESI and EDI, so this wrapper preserves them
CallRtlUnwind PROC stdcall public USES ebx esi edi, pEstablisherFrame :DWORD, callback :DWORD, pExceptionRecord :DWORD, retVal :DWORD
endforeach()
if (CLR_CMAKE_PLATFORM_ARCH_I386)
- set_source_files_properties(${VM_SOURCES_WKS_ARCH_ASM} PROPERTIES COMPILE_FLAGS "/Zm")
+ set_source_files_properties(${VM_SOURCES_WKS_ARCH_ASM} PROPERTIES COMPILE_FLAGS "/Zm /safeseh")
endif (CLR_CMAKE_PLATFORM_ARCH_I386)
# Convert AsmConstants.h into AsmConstants.inc