Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

@mikedn
Copy link

@mikedn mikedn commented Dec 5, 2015

Fixes #2245

I haven't actually removed /SAFESEH:NO yet as that may conflict with #2170. If it turns out that ARM64 doesn't need /SAFESEH:NO then it can be entirely removed in that PR without breaking the x86 build.

@jkotas
Copy link
Member

jkotas commented Dec 5, 2015

Thank you for jumping on it!

ARM64 doesn't need /SAFESEH:NO

I am pretty sure it should not be need it. You can remove it now.

Could you please also add src\dlls\mscoree\i386\handlers.asm to the build? It may be nice to move this file to vm\i386 as part of doing this - it would be more logical place for it, and it would save us from replicating asm building boiler plate code in yet another CMake file.

handlers.asm is necessary to tell the OS about the fs:0 handlers used by the VM. The exception handling would be broken without it. The OS would treat these fs:0 handlers as malicious (ie introduced by a hack - stack buffer overrun) and kill the process immediately whenever it would see one of them.

@mikedn
Copy link
Author

mikedn commented Dec 5, 2015

I am pretty sure it should not be need it. You can remove it now.

Done.

Could you please also add src\dlls\mscoree\i386\handlers.asm to the build? It may be nice to move this file to vm\i386 as part of doing this - it would be more logical place for it, and it would save us from replicating asm building boiler plate code in yet another CMake file.

I tried to move handlers.asm (and included it in makefiles) but it doesn't work. It builds fine but those functions don't show up in the SEH table of coreclr.dll. They show up if I copy the .safeseh directives to an existing file - asmhelpers.asm for example. I suspect that this happens because handlers.obj doesn't define any symbols and the linker simply ignores it (there's probably a LNK4221 somewhere but I didn't look for it, too many of them).

IMO moving those .safeseh directives to asmhelpers.asm is preferable to keeping the file in the wrong place and duplicating the CMake ASM goo in mscoree. Opinions?

@jkotas
Copy link
Member

jkotas commented Dec 5, 2015

moving those .safeseh directives to asmhelpers.asm

Sounds good to me.

@mikedn
Copy link
Author

mikedn commented Dec 6, 2015

Done. Here's an excerpt from dumpbin /loadconfig coreclr.dll output:

    Safe Exception Handler Table

          Address
          --------
          10205360  _COMPlusFrameHandler
          102056E0  _COMPlusFrameHandlerRevCom
          10205730  _COMPlusNestedExceptionHandler
          102059A0  _FastNExportExceptHandler
          10205A00  _UMThunkPrestubHandler
          10CA0BDD  __except_handler4

@benpye
Copy link

benpye commented Dec 6, 2015

607978a has a commit message that indicates the inverse of the changes made.

@mikedn
Copy link
Author

mikedn commented Dec 6, 2015

607978a has a commit message that indicates the inverse of the changes made.

Thanks, the message is indeed wrong. This will likely get squashed so it will disappear, waiting to see if @jkotas is ok with the deletion in the last commit.

@mikedn
Copy link
Author

mikedn commented Dec 6, 2015

Deleted. I take it that mirroring is smart enough to deal with this :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is part of the file that has just macros and forward declarations that do not generate any code. It would look better to have it later in the file - e.g. before CallRtlUnwind may be a good place.

@jkotas
Copy link
Member

jkotas commented Dec 6, 2015

LGTM otherwise. Could you please squash it into fewer commits so it is ready to merge?

jkotas added a commit that referenced this pull request Dec 6, 2015
Use /safeseh to compile x86 MASM files
@jkotas jkotas merged commit 18deaf9 into dotnet:master Dec 6, 2015
@mikedn mikedn deleted the safeseh branch December 14, 2015 17:26
sdmaclea added a commit to sdmaclea/coreclr that referenced this pull request Apr 14, 2020
 + Auto renames for (dotnet/coreclr/dotnet#26080)
 + Rename _WIN64 define to BIT64 (dotnet#26080)
 + Remove stray sos reference (dotnet/runtime/dotnet#1875)
 + Fix MSVC warn as errors... (dotnet/runtime/dotnet#1876)
 + Remove unused/unnecessary defines (dotnet/runtime/dotnet#1878)
 + Rename CLR_CMAKE_PLATFORM* CLR_CMAKE_HOST* (dotnet/runtime/#1974)
 + Rename PAL_CMAKE_* CLR_CMAKE_* (dotnet/runtime/dotnet#1984)
 + Add alpinedac & linuxdac build options (dotnet/runtime/dotnet#2056)
 + Refactor CMake system to allow cross OS DAC compile (dotnet/runtime/#2054)
 + Add FEATURE_REMOTE_PROC_MEM (dotnet/runtime/dotnet#2244)
 + Fix compilation of dbgtransportsession (dotnet/runtime/dotnet#2247)
 + Auto renames from (dotnet/runtime/#2256)
 + Rename cross compilation related defines (dotnet/runtime/#2256)
 + Fix logic to disable mscordbi build (dotnet/runtime/#31745)
 + Fix unused variable warning (dotnet/runtime/#31747)
 + Remove GetRecycleMemoryInfo from DAC builds (dotnet/runtime/#31748)
 + Fix check.* cross compilation linker errors (dotnet/runtime/#31751)
 + Reduce PAL DAC exports (dotnet/runtime/#31749)
 + Add EMPTY_BASES_DECL (dotnet/runtime/dotnet#26980)
 + Disable linux unwinder on Windows (dotnet/runtime/#31777)
 + Add cross OS support for MAKEDLLNAME (dotnet/runtime/#31746)
 + Fix host compiler when cross OS DAC compiling (dotnet/runtime/#31775)
 + Fix arm64singlestepper #ifdef (dotnet/runtime/#31776)
 + Configure host features based on host OS (dotnet/runtime/#31778)
 + Configure Host OS APIs based on HOST macros (dotnet/runtime/#31774)
 + Use common CLR_CMAKE_* variables in more places (dotnet/runtime/#31659)
 + Add T_CRITICAL_SECTION for cross OS DAC compile (dotnet/runtime/#31908)
 + Fix arm cross OS DAC compilation (dotnet/runtime/#31903)
 + Add CrossOS DAC build back (dotnet/runtime/#33064)
 + Fix typo (dotnet/runtime/#33192)
 + Fix type layout whan Cross OS compiling (dotnet/runtime/#33487)
 + Partial revert auto renames from (dotnet/runtime/dotnet#2056)
 + Partial revert (dotnet/runtime/dotnet#26080)
sdmaclea added a commit to sdmaclea/coreclr that referenced this pull request Jun 25, 2020
 + Auto renames for (dotnet/coreclr/dotnet#26080)
 + Rename _WIN64 define to BIT64 (dotnet#26080)
 + Remove stray sos reference (dotnet/runtime/dotnet#1875)
 + Fix MSVC warn as errors... (dotnet/runtime/dotnet#1876)
 + Remove unused/unnecessary defines (dotnet/runtime/dotnet#1878)
 + Rename CLR_CMAKE_PLATFORM* CLR_CMAKE_HOST* (dotnet/runtime/#1974)
 + Rename PAL_CMAKE_* CLR_CMAKE_* (dotnet/runtime/dotnet#1984)
 + Add alpinedac & linuxdac build options (dotnet/runtime/dotnet#2056)
 + Refactor CMake system to allow cross OS DAC compile (dotnet/runtime/#2054)
 + Add FEATURE_REMOTE_PROC_MEM (dotnet/runtime/dotnet#2244)
 + Fix compilation of dbgtransportsession (dotnet/runtime/dotnet#2247)
 + Auto renames from (dotnet/runtime/#2256)
 + Rename cross compilation related defines (dotnet/runtime/#2256)
 + Fix logic to disable mscordbi build (dotnet/runtime/#31745)
 + Fix unused variable warning (dotnet/runtime/#31747)
 + Remove GetRecycleMemoryInfo from DAC builds (dotnet/runtime/#31748)
 + Fix check.* cross compilation linker errors (dotnet/runtime/#31751)
 + Reduce PAL DAC exports (dotnet/runtime/#31749)
 + Add EMPTY_BASES_DECL (dotnet/runtime/dotnet#26980)
 + Disable linux unwinder on Windows (dotnet/runtime/#31777)
 + Add cross OS support for MAKEDLLNAME (dotnet/runtime/#31746)
 + Fix host compiler when cross OS DAC compiling (dotnet/runtime/#31775)
 + Fix arm64singlestepper #ifdef (dotnet/runtime/#31776)
 + Configure host features based on host OS (dotnet/runtime/#31778)
 + Configure Host OS APIs based on HOST macros (dotnet/runtime/#31774)
 + Use common CLR_CMAKE_* variables in more places (dotnet/runtime/#31659)
 + Add T_CRITICAL_SECTION for cross OS DAC compile (dotnet/runtime/#31908)
 + Fix arm cross OS DAC compilation (dotnet/runtime/#31903)
 + Add CrossOS DAC build back (dotnet/runtime/#33064)
 + Fix typo (dotnet/runtime/#33192)
 + Fix type layout whan Cross OS compiling (dotnet/runtime/#33487)
 + Partial revert auto renames from (dotnet/runtime/dotnet#2056)
 + Partial revert (dotnet/runtime/dotnet#26080)
sdmaclea added a commit to sdmaclea/coreclr that referenced this pull request Jun 25, 2020
 + Auto renames for (dotnet/coreclr/dotnet#26080)
 + Rename _WIN64 define to BIT64 (dotnet#26080)
 + Remove stray sos reference (dotnet/runtime/dotnet#1875)
 + Fix MSVC warn as errors... (dotnet/runtime/dotnet#1876)
 + Remove unused/unnecessary defines (dotnet/runtime/dotnet#1878)
 + Rename CLR_CMAKE_PLATFORM* CLR_CMAKE_HOST* (dotnet/runtime/#1974)
 + Rename PAL_CMAKE_* CLR_CMAKE_* (dotnet/runtime/dotnet#1984)
 + Add alpinedac & linuxdac build options (dotnet/runtime/dotnet#2056)
 + Refactor CMake system to allow cross OS DAC compile (dotnet/runtime/#2054)
 + Add FEATURE_REMOTE_PROC_MEM (dotnet/runtime/dotnet#2244)
 + Fix compilation of dbgtransportsession (dotnet/runtime/dotnet#2247)
 + Auto renames from (dotnet/runtime/#2256)
 + Rename cross compilation related defines (dotnet/runtime/#2256)
 + Fix logic to disable mscordbi build (dotnet/runtime/#31745)
 + Fix unused variable warning (dotnet/runtime/#31747)
 + Remove GetRecycleMemoryInfo from DAC builds (dotnet/runtime/#31748)
 + Fix check.* cross compilation linker errors (dotnet/runtime/#31751)
 + Reduce PAL DAC exports (dotnet/runtime/#31749)
 + Add EMPTY_BASES_DECL (dotnet/runtime/dotnet#26980)
 + Disable linux unwinder on Windows (dotnet/runtime/#31777)
 + Add cross OS support for MAKEDLLNAME (dotnet/runtime/#31746)
 + Fix host compiler when cross OS DAC compiling (dotnet/runtime/#31775)
 + Fix arm64singlestepper #ifdef (dotnet/runtime/#31776)
 + Configure host features based on host OS (dotnet/runtime/#31778)
 + Configure Host OS APIs based on HOST macros (dotnet/runtime/#31774)
 + Use common CLR_CMAKE_* variables in more places (dotnet/runtime/#31659)
 + Add T_CRITICAL_SECTION for cross OS DAC compile (dotnet/runtime/#31908)
 + Fix arm cross OS DAC compilation (dotnet/runtime/#31903)
 + Add CrossOS DAC build back (dotnet/runtime/#33064)
 + Fix typo (dotnet/runtime/#33192)
 + Fix type layout whan Cross OS compiling (dotnet/runtime/#33487)
 + Partial revert auto renames from (dotnet/runtime/dotnet#2056)
 + Partial revert (dotnet/runtime/dotnet#26080)
 + Enable cross OS DBI build(dotnet/runtime/#35021)
sdmaclea added a commit to sdmaclea/coreclr that referenced this pull request Jul 1, 2020
 + Auto renames for (dotnet/coreclr/dotnet#26080)
 + Rename _WIN64 define to BIT64 (dotnet#26080)
 + Remove stray sos reference (dotnet/runtime/dotnet#1875)
 + Fix MSVC warn as errors... (dotnet/runtime/dotnet#1876)
 + Remove unused/unnecessary defines (dotnet/runtime/dotnet#1878)
 + Rename CLR_CMAKE_PLATFORM* CLR_CMAKE_HOST* (dotnet/runtime/#1974)
 + Rename PAL_CMAKE_* CLR_CMAKE_* (dotnet/runtime/dotnet#1984)
 + Add alpinedac & linuxdac build options (dotnet/runtime/dotnet#2056)
 + Refactor CMake system to allow cross OS DAC compile (dotnet/runtime/#2054)
 + Add FEATURE_REMOTE_PROC_MEM (dotnet/runtime/dotnet#2244)
 + Fix compilation of dbgtransportsession (dotnet/runtime/dotnet#2247)
 + Auto renames from (dotnet/runtime/#2256)
 + Rename cross compilation related defines (dotnet/runtime/#2256)
 + Fix logic to disable mscordbi build (dotnet/runtime/#31745)
 + Fix unused variable warning (dotnet/runtime/#31747)
 + Remove GetRecycleMemoryInfo from DAC builds (dotnet/runtime/#31748)
 + Fix check.* cross compilation linker errors (dotnet/runtime/#31751)
 + Reduce PAL DAC exports (dotnet/runtime/#31749)
 + Add EMPTY_BASES_DECL (dotnet/runtime/dotnet#26980)
 + Disable linux unwinder on Windows (dotnet/runtime/#31777)
 + Add cross OS support for MAKEDLLNAME (dotnet/runtime/#31746)
 + Fix host compiler when cross OS DAC compiling (dotnet/runtime/#31775)
 + Fix arm64singlestepper #ifdef (dotnet/runtime/#31776)
 + Configure host features based on host OS (dotnet/runtime/#31778)
 + Configure Host OS APIs based on HOST macros (dotnet/runtime/#31774)
 + Use common CLR_CMAKE_* variables in more places (dotnet/runtime/#31659)
 + Add T_CRITICAL_SECTION for cross OS DAC compile (dotnet/runtime/#31908)
 + Fix arm cross OS DAC compilation (dotnet/runtime/#31903)
 + Add CrossOS DAC build back (dotnet/runtime/#33064)
 + Fix typo (dotnet/runtime/#33192)
 + Fix type layout whan Cross OS compiling (dotnet/runtime/#33487)
 + Partial revert auto renames from (dotnet/runtime/dotnet#2056)
 + Partial revert (dotnet/runtime/dotnet#26080)
 + Enable cross OS DBI build(dotnet/runtime/#35021)
 + Disable EMPTY_BASE_DECL except for cross OS DAC
 + Fix DBI type layout issues
   + Add utilcode_dbi
   + Consistently define DBI features
   + Define T_CRITICAL_SECTION during non-DAC builds
 + Port cross DAC unwind support to 3.1
   + Libunwind 1.5rc2 again (dotnet/runtime#36988)
 + Add libunwind to cross DAC (dotnet/runtime#37521)
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Use /safeseh to compile x86 MASM files

Commit migrated from dotnet/coreclr@18deaf9
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants