Address PR feedback
authorAdeel <adeelbm@outlook.com>
Mon, 20 Apr 2020 17:55:16 +0000 (17:55 +0000)
committerAdeel <adeelbm@outlook.com>
Mon, 20 Apr 2020 17:55:16 +0000 (17:55 +0000)
14 files changed:
src/coreclr/src/debug/daccess/CMakeLists.txt
src/coreclr/src/dlls/dbgshim/CMakeLists.txt
src/coreclr/src/dlls/mscordac/CMakeLists.txt
src/coreclr/src/dlls/mscordbi/CMakeLists.txt
src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt
src/coreclr/src/ilasm/CMakeLists.txt
src/coreclr/src/ildasm/exe/CMakeLists.txt
src/coreclr/src/jit/CMakeLists.txt
src/coreclr/src/pal/src/CMakeLists.txt
src/coreclr/src/pal/src/exception/seh.cpp
src/coreclr/src/pal/src/include/pal/context.h
src/coreclr/src/pal/src/thread/context.cpp
src/coreclr/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/CMakeLists.txt
src/coreclr/src/tools/crossgen/CMakeLists.txt

index 88742fb4eddaac942abb91dea9f5c54fd358feaf..6d18ad64fded8b83664e2a238dd2ff2adf35a38e 100644 (file)
@@ -63,4 +63,4 @@ if(CLR_CMAKE_HOST_OSX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_
   )
 
   add_dependencies(daccess dactablerva_header)
-endif()
+endif(CLR_CMAKE_HOST_OSX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)
index 22bc457720668da07302b50844f562abb1f19134..8f3ef4a3330c16a1abc6e692c9b420cefb0d0b0f 100644 (file)
@@ -43,7 +43,7 @@ endif(CLR_CMAKE_HOST_OSX)
 if(CLR_CMAKE_HOST_SUNOS)
     # Add linker exports file option
     set(EXPORTS_LINKER_OPTION -Wl,-M,${EXPORTS_FILE})
-endif()
+endif(CLR_CMAKE_HOST_SUNOS)
 
 add_library_clr(dbgshim SHARED ${DBGSHIM_SOURCES})
 
index 60c2ee41530815f4134f9e65c04be95d87d5691f..40ddab333011c6edad3f531dacd53b9a9fdb4c0b 100644 (file)
@@ -33,7 +33,7 @@ else(CLR_CMAKE_HOST_WIN32)
 
     if(CLR_CMAKE_HOST_OSX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)
         generate_exports_file(${DEF_SOURCES} ${EXPORTS_FILE})
-    endif()
+    endif(CLR_CMAKE_HOST_OSX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)
 
     if(CLR_CMAKE_HOST_LINUX)
 
@@ -89,17 +89,17 @@ if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD)
 
     # Add linker exports file option
     set(EXPORTS_LINKER_OPTION -Wl,--version-script=${EXPORTS_FILE})
-endif()
+endif(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD)
 
 if(CLR_CMAKE_HOST_OSX)
     # Add linker exports file option
     set(EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${EXPORTS_FILE})
-endif()
+endif(CLR_CMAKE_HOST_OSX)
 
 if(CLR_CMAKE_HOST_SUNOS)
     # Add linker exports file option
     set(EXPORTS_LINKER_OPTION -Wl,-M,${EXPORTS_FILE})
-endif()
+endif(CLR_CMAKE_HOST_SUNOS)
 
 # Create object library to enable creation of proper dependency of mscordaccore.exp on mscordac.obj and
 # mscordaccore on both the mscordaccore.exp and mscordac.obj.
index ccd7102788805417171fb82cda0fa88d36161f98..9d0a4e7596c64d317892893d67cde6200b4cf12e 100644 (file)
@@ -58,7 +58,7 @@ endif(CLR_CMAKE_HOST_OSX)
 if(CLR_CMAKE_HOST_SUNOS)
     # Add linker exports file option
     set(EXPORTS_LINKER_OPTION -Wl,-M,${EXPORTS_FILE})
-endif()
+endif(CLR_CMAKE_HOST_SUNOS)
 
 add_library_clr(mscordbi SHARED ${MSCORDBI_SOURCES})
 target_precompile_header(TARGET mscordbi HEADER stdafx.h)
index 44e61280fee4cbae43b152cb06863c55221867f0..b25aa7eb7a0c824949acea4db028943fe2b056c6 100644 (file)
@@ -59,12 +59,12 @@ else(CLR_CMAKE_HOST_WIN32)
 
     if(CLR_CMAKE_TARGET_ANDROID AND CLR_CMAKE_HOST_ARCH_ARM)
         set(EXPORTS_LINKER_OPTION "${EXPORTS_LINKER_OPTION} -Wl,--no-warn-shared-textrel")
-    endif()
+    endif(CLR_CMAKE_TARGET_ANDROID AND CLR_CMAKE_HOST_ARCH_ARM)
 
     if(CLR_CMAKE_HOST_SUNOS)
         # Add linker exports file option
         set(EXPORTS_LINKER_OPTION -Wl,-M,${EXPORTS_FILE})
-    endif()
+    endif(CLR_CMAKE_HOST_SUNOS)
 
 endif (CLR_CMAKE_HOST_WIN32)
 
index 2f44dbd861b864a185d4bdd146a3b4044ca31bf2..94fe6b83d3a41492a99ad8d9bbc8f87326604050 100644 (file)
@@ -61,7 +61,7 @@ if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CL
     # ensure proper resolving of circular references between a subset of the libraries.
     set(START_LIBRARY_GROUP -Wl,--start-group)
     set(END_LIBRARY_GROUP -Wl,--end-group)
-endif()
+endif(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)
 
 _add_executable(ilasm
   ${ILASM_SOURCES}
index 57499c4d86f60bda247c29b70196fcbc282da51f..87a0fa01f820fb2dc14aa47340f262e11a2bb3e0 100644 (file)
@@ -56,7 +56,7 @@ if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CL
     # ensure proper resolving of circular references between a subset of the libraries.
     set(START_LIBRARY_GROUP -Wl,--start-group)
     set(END_LIBRARY_GROUP -Wl,--end-group)
-endif()
+endif(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)
 
 _add_executable(ildasm
     ${ILDASM_SOURCES}
index 5093ce9a0161f8a09e11f243d849b1482c3633c3..582d11d6d40569cd1020b3fd84709d94bed75368 100644 (file)
@@ -322,7 +322,7 @@ else()
   elseif(CLR_CMAKE_HOST_SUNOS)
     # Add linker exports file option
     set(JIT_EXPORTS_LINKER_OPTION -Wl,-M,${JIT_EXPORTS_FILE})
-  endif()
+  endif(CLR_CMAKE_HOST_SUNOS)
 
   set(SHARED_LIB_SOURCES ${SOURCES})
 endif()
index 253f36e2641c54a07f02e1f35934c2b7960c9032..1a39363832285676c4ad7f53b1a9c84ba5602293 100644 (file)
@@ -1,7 +1,7 @@
 if(CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_FREEBSD)
   # On OSX and *BSD, we use the libunwind that's part of the OS
   set(CLR_CMAKE_USE_SYSTEM_LIBUNWIND 1)
-endif()
+endif(CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_FREEBSD)
 
 if(NOT DEFINED ENV{ROOTFS_DIR})
   include_directories(SYSTEM /usr/local/include)
@@ -113,7 +113,7 @@ set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -Wl,--no
 
 if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
   add_compile_options(-Wno-unused-result)
-endif()
+endif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
 
 set(ARCH_SOURCES
   arch/${PAL_ARCH_SOURCES_DIR}/context2.S
index 259b963a03321c4681b267e46f933c15f63c2cc1..f194156509d49fb3b96cc206bc4c95b29b3b73ac 100644 (file)
@@ -323,8 +323,6 @@ PAL_ERROR SEHEnable(CPalThread *pthrCurrent)
 #if HAVE_MACH_EXCEPTIONS
     return pthrCurrent->EnableMachExceptions();
 #elif defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__sun)
-    // TODO: This needs to be implemented. Cannot put an ASSERT here
-    // because it will make other parts of PAL fail.
     return NO_ERROR;
 #else// HAVE_MACH_EXCEPTIONS
 #error not yet implemented
@@ -349,8 +347,6 @@ PAL_ERROR SEHDisable(CPalThread *pthrCurrent)
 {
 #if HAVE_MACH_EXCEPTIONS
     return pthrCurrent->DisableMachExceptions();
-    // TODO: This needs to be implemented. Cannot put an ASSERT here
-    // because it will make other parts of PAL fail.
 #elif defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__sun)
     return NO_ERROR;
 #else // HAVE_MACH_EXCEPTIONS
index 74822ad20d1a873a0d3ec4aeb7e5ddd9145fc317..9313fc51653f7e5961fc7825817f8a2edcae9e92 100644 (file)
@@ -144,8 +144,8 @@ using asm_sigcontext::_xstate;
 #define FPREG_StatusWord(uc) (FPREG_Fpstate(uc)->sw)
 #define FPREG_MxCsr_Mask(uc) (FPREG_Fpstate(uc)->mxcsr_mask)
 
-// on Solaris, fctw and __fx_rsvd are uint8_t, whereas on linux ftw is uint16_t,
-// so we use split and join these two uint8_t members at callsites.
+// on SunOS, fctw and __fx_rsvd are uint8_t, whereas on linux ftw is uint16_t,
+// so we use split and join technique for these two uint8_t members at call sites.
 #define FPREG_TagWord1(uc) (FPREG_Fpstate(uc)->fctw)
 #define FPREG_TagWord2(uc) (FPREG_Fpstate(uc)->__fx_rsvd)
 #else
index 746bf2d1bad7918ca779204d263ab9c829c70f7a..435b04715eda4c57e80aa70304cdeebde461ad29 100644 (file)
@@ -430,19 +430,21 @@ void CONTEXTToNativeContext(CONST CONTEXT *lpContext, native_context_t *native)
     }
 #undef ASSIGN_REG
 
-#if (HAVE_GREGSET_T || HAVE_GREGSET_T) && !HAVE_FPREGS_WITH_CW
+#if !HAVE_FPREGS_WITH_CW
+#if HAVE_GREGSET_T || HAVE_GREGSET_T
 #if HAVE_GREGSET_T
     if (native->uc_mcontext.fpregs == nullptr)
 #elif HAVE___GREGSET_T
     if (native->uc_mcontext.__fpregs == nullptr)
-#endif
+#endif // HAVE_GREGSET_T
     {
         // If the pointer to the floating point state in the native context
         // is not valid, we can't copy floating point registers regardless of
         // whether CONTEXT_FLOATING_POINT is set in the CONTEXT's flags.
         return;
     }
-#endif
+#endif // HAVE_GREGSET_T || HAVE_GREGSET_T
+#endif // !HAVE_FPREGS_WITH_CW
 
     if ((lpContext->ContextFlags & CONTEXT_FLOATING_POINT) == CONTEXT_FLOATING_POINT)
     {
@@ -544,12 +546,13 @@ void CONTEXTFromNativeContext(const native_context_t *native, LPCONTEXT lpContex
     }
 #undef ASSIGN_REG
 
-#if (HAVE_GREGSET_T || HAVE___GREGSET_T) && !HAVE_FPREGS_WITH_CW
+#if !HAVE_FPREGS_WITH_CW
+#if HAVE_GREGSET_T || HAVE___GREGSET_T
 #if HAVE_GREGSET_T
     if (native->uc_mcontext.fpregs == nullptr)
 #elif HAVE___GREGSET_T
     if (native->uc_mcontext.__fpregs == nullptr)
-#endif
+#endif // HAVE_GREGSET_T
     {
         // Reset the CONTEXT_FLOATING_POINT bit(s) and the CONTEXT_XSTATE bit(s) so it's
         // clear that the floating point and extended state data in the CONTEXT is not
@@ -566,7 +569,8 @@ void CONTEXTFromNativeContext(const native_context_t *native, LPCONTEXT lpContex
         // Bail out regardless of whether the caller wanted CONTEXT_FLOATING_POINT or CONTEXT_XSTATE
         return;
     }
-#endif
+#endif // HAVE_GREGSET_T || HAVE___GREGSET_T
+#endif // !HAVE_FPREGS_WITH_CW
 
     if ((contextFlags & CONTEXT_FLOATING_POINT) == CONTEXT_FLOATING_POINT)
     {
index 293d3c43eb16ec21d098ff2d0e164a1c36a0743a..ff2588ce21a1a0f92cb5bf71fec997aca7b921ef 100644 (file)
@@ -20,16 +20,16 @@ generate_exports_file(${DEF_SOURCES1} ${EXPORTS_FILE1})
 
 if(CLR_CMAKE_TARGET_LINUX OR CLR_CMAKE_TARGET_FREEBSD OR CLR_CMAKE_TARGET_NETBSD)
     set(EXPORTS_LINKER_OPTION1 -Wl,--version-script=${EXPORTS_FILE1})
-endif()
+endif(CLR_CMAKE_TARGET_LINUX OR CLR_CMAKE_TARGET_FREEBSD OR CLR_CMAKE_TARGET_NETBSD)
 
 if(CLR_CMAKE_TARGET_OSX)
     set(EXPORTS_LINKER_OPTION1 -Wl,-exported_symbols_list,${EXPORTS_FILE1})
-endif()
+endif(CLR_CMAKE_HOST_OSX)
 
 if(CLR_CMAKE_HOST_SUNOS)
     # Add linker exports file option
     set(EXPORTS_LINKER_OPTION -Wl,-M,${EXPORTS_FILE})
-endif()
+endif(CLR_CMAKE_HOST_SUNOS)
 
 set(DLL1SOURCES dlltest1.cpp)
 add_library(paltest_pal_sxs_test1_dll1 SHARED ${DLL1SOURCES})
index 2d6b94b5184690624cf023c07b5f78cc23ba8a77..685ba73c11fe5ba6c6c217397db35e647f2a452b 100644 (file)
@@ -35,7 +35,7 @@ if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CL
     # ensure proper resolving of circular references between a subset of the libraries.
     set(START_LIBRARY_GROUP -Wl,--start-group)
     set(END_LIBRARY_GROUP -Wl,--end-group)
-endif()
+endif(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)
 
 target_link_libraries(crossgen
     ${START_LIBRARY_GROUP} # Start group of libraries that have circular references