summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeoff Norton <grompf@gmail.com>2015-02-08 10:04:55 -0800
committerGeoff Norton <grompf@gmail.com>2015-02-08 10:04:55 -0800
commita01aa10e956f990486ed969696012a3d1a24888b (patch)
tree22a9cf2d41080c87dbafb1b58f5b1d23a1fa9ace /src
parente22b008db494b1fa4b0450b31d1f711e1595186b (diff)
parentc9279bd6ef21f5b4aaeb2cfbb5e2dd79f4cabbb2 (diff)
downloadcoreclr-a01aa10e956f990486ed969696012a3d1a24888b.tar.gz
coreclr-a01aa10e956f990486ed969696012a3d1a24888b.tar.bz2
coreclr-a01aa10e956f990486ed969696012a3d1a24888b.zip
Merge remote-tracking branch 'origin/master' into va_list_safety
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/ToolBox/SOS/Strike/CMakeLists.txt4
-rw-r--r--src/coreclr/hosts/coreconsole/CMakeLists.txt2
-rw-r--r--src/coreclr/hosts/corerun/CMakeLists.txt2
-rw-r--r--src/debug/daccess/CMakeLists.txt8
-rw-r--r--src/debug/ee/CMakeLists.txt11
-rw-r--r--src/debug/ee/wks/CMakeLists.txt4
-rw-r--r--src/dlls/dbgshim/CmakeLists.txt2
-rw-r--r--src/dlls/mscordac/CMakeLists.txt7
-rw-r--r--src/dlls/mscordbi/CMakeLists.txt10
-rw-r--r--src/dlls/mscoree/CMakeLists.txt6
-rw-r--r--src/dlls/mscoree/coreclr/CMakeLists.txt16
-rw-r--r--src/inc/CMakeLists.txt10
-rw-r--r--src/inc/corhlprpriv.h5
-rw-r--r--src/jit/CMakeLists.txt2
-rw-r--r--src/jit/instr.cpp1
-rw-r--r--src/md/md_dbi.cmake4
-rw-r--r--src/pal/src/include/pal/cs.hpp2
-rw-r--r--src/pal/src/init/pal.cpp26
-rw-r--r--src/pal/src/sync/cs.cpp21
-rw-r--r--src/utilcode/CMakeLists.txt3
-rw-r--r--src/utilcode/dac/CMakeLists.txt2
-rw-r--r--src/utilcode/dyncrt/CMakeLists.txt2
-rw-r--r--src/utilcode/staticnohost/CMakeLists.txt4
-rw-r--r--src/vm/CMakeLists.txt17
-rw-r--r--src/vm/exceptionhandling.cpp2
-rw-r--r--src/vm/wks/CMakeLists.txt6
27 files changed, 85 insertions, 96 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 642e66a9ce..6401672e54 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -12,7 +12,7 @@ include_directories("classlibnative/inc")
if(WIN32)
enable_language(ASM_MASM)
-else(WIN32)
+else()
enable_language(ASM)
# This prevents inclusion of standard C compiler headers
add_compile_options(-nostdinc)
diff --git a/src/ToolBox/SOS/Strike/CMakeLists.txt b/src/ToolBox/SOS/Strike/CMakeLists.txt
index bf8cc2be4c..b6e52b718d 100644
--- a/src/ToolBox/SOS/Strike/CMakeLists.txt
+++ b/src/ToolBox/SOS/Strike/CMakeLists.txt
@@ -43,13 +43,13 @@ set(SOS_SOURCES_AMD64
disasmX86.cpp
)
-set(SOS_SOURCES ${SOS_SOURCES} ${SOS_SOURCES_AMD64})
+list(APPEND SOS_SOURCES ${SOS_SOURCES_AMD64})
add_definitions(-DFX_VER_INTERNALNAME_STR=SOS.dll)
#Preprocess exports definition file
preprocess_def_file(${CMAKE_CURRENT_SOURCE_DIR}/sos.def ${CMAKE_CURRENT_BINARY_DIR}/sos.def)
-set(SOS_SOURCES ${SOS_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/sos.def)
+list(APPEND SOS_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/sos.def)
set(SOS_LIBRARY
corguids
diff --git a/src/coreclr/hosts/coreconsole/CMakeLists.txt b/src/coreclr/hosts/coreconsole/CMakeLists.txt
index 00b6391f30..8848ff7d1a 100644
--- a/src/coreclr/hosts/coreconsole/CMakeLists.txt
+++ b/src/coreclr/hosts/coreconsole/CMakeLists.txt
@@ -16,7 +16,7 @@ if(CLR_CMAKE_PLATFORM_UNIX)
)
endif(CAN_BE_COMPILED_ON_LINUX)
-else(CLR_CMAKE_PLATFORM_UNIX)
+else()
add_executable(CoreConsole
${CoreConsole_SOURCES}
${CoreConsole_RESOURCES}
diff --git a/src/coreclr/hosts/corerun/CMakeLists.txt b/src/coreclr/hosts/corerun/CMakeLists.txt
index 44426106ac..841a7141d6 100644
--- a/src/coreclr/hosts/corerun/CMakeLists.txt
+++ b/src/coreclr/hosts/corerun/CMakeLists.txt
@@ -16,7 +16,7 @@ if(CLR_CMAKE_PLATFORM_UNIX)
)
endif(CAN_BE_COMPILED_ON_LINUX)
-else(CLR_CMAKE_PLATFORM_UNIX)
+else()
add_executable(CoreRun
${CoreRun_SOURCES}
${CoreRun_RESOURCES}
diff --git a/src/debug/daccess/CMakeLists.txt b/src/debug/daccess/CMakeLists.txt
index 5c012ce13f..cdea53390c 100644
--- a/src/debug/daccess/CMakeLists.txt
+++ b/src/debug/daccess/CMakeLists.txt
@@ -36,13 +36,11 @@ set(DACCESS_SOURCES
if(IS_64BIT_BUILD EQUAL 1)
include_directories(amd64)
- set(DACCESS_SOURCES
- ${DACCESS_SOURCES}
+ list(APPEND DACCESS_SOURCES
amd64/primitives.cpp
)
-else(IS_64BIT_BUILD EQUAL 1)
- set(DACCESS_SOURCES
- ${DACCESS_SOURCES}
+else()
+ list(APPEND DACCESS_SOURCES
i386/primitives.cpp
)
endif(IS_64BIT_BUILD EQUAL 1)
diff --git a/src/debug/ee/CMakeLists.txt b/src/debug/ee/CMakeLists.txt
index fff144a5b1..f0f8735220 100644
--- a/src/debug/ee/CMakeLists.txt
+++ b/src/debug/ee/CMakeLists.txt
@@ -33,8 +33,7 @@ set(CORDBEE_SOURCES_DAC
)
if(WIN32)
- set(CORDBEE_SOURCES_WKS
- ${CORDBEE_SOURCES_WKS}
+ list(APPEND CORDBEE_SOURCES_WKS
# The following files need to be ported to Linux
inprocdac.cpp
dbgtransportproxy.cpp
@@ -43,9 +42,9 @@ if(WIN32)
endif(WIN32)
if (IS_64BIT_BUILD EQUAL 1)
- set(CORDBEE_SOURCES_WKS ${CORDBEE_SOURCES_WKS} amd64/amd64walker.cpp)
-else (IS_64BIT_BUILD EQUAL 1)
- set(CORDBEE_SOURCES_WKS ${CORDBEE_SOURCES_WKS} i386/x86walker.cpp)
+ list(APPEND CORDBEE_SOURCES_WKS amd64/amd64walker.cpp)
+else ()
+ list(APPEND CORDBEE_SOURCES_WKS i386/x86walker.cpp)
endif (IS_64BIT_BUILD EQUAL 1)
convert_to_absolute_path(CORDBEE_SOURCES_DAC ${CORDBEE_SOURCES_DAC})
@@ -54,4 +53,4 @@ convert_to_absolute_path(CORDBEE_SOURCES_WKS ${CORDBEE_SOURCES_WKS})
set(CORDBEE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(dac)
-add_subdirectory(wks) \ No newline at end of file
+add_subdirectory(wks)
diff --git a/src/debug/ee/wks/CMakeLists.txt b/src/debug/ee/wks/CMakeLists.txt
index 82b4d7404f..13c575d559 100644
--- a/src/debug/ee/wks/CMakeLists.txt
+++ b/src/debug/ee/wks/CMakeLists.txt
@@ -3,7 +3,7 @@ if (WIN32)
if (IS_64BIT_BUILD EQUAL 1)
FIND_PROGRAM(ASM_COMPILER ml64.exe)
-else (IS_64BIT_BUILD EQUAL 1)
+else ()
FIND_PROGRAM(ASM_COMPILER ml.exe)
endif (IS_64BIT_BUILD EQUAL 1)
@@ -21,7 +21,7 @@ set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/dbghelpers.obj PROPERTIE
add_library(cordbee_wks ${CORDBEE_SOURCES_WKS} ${CMAKE_CURRENT_BINARY_DIR}/dbghelpers.obj)
-else (WIN32)
+else ()
add_compile_options(-fPIC)
add_library(cordbee_wks ${CORDBEE_SOURCES_WKS} ../amd64/dbghelpers.S)
diff --git a/src/dlls/dbgshim/CmakeLists.txt b/src/dlls/dbgshim/CmakeLists.txt
index fde787de31..14bf9831aa 100644
--- a/src/dlls/dbgshim/CmakeLists.txt
+++ b/src/dlls/dbgshim/CmakeLists.txt
@@ -12,7 +12,7 @@ add_definitions(-DFX_VER_INTERNALNAME_STR=dbgshim.dll)
preprocess_def_file(${CMAKE_CURRENT_SOURCE_DIR}/dbgshim.ntdef ${CMAKE_CURRENT_BINARY_DIR}/dbgshim.def)
-set(DBGSHIM_SOURCES ${DBGSHIM_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/dbgshim.def)
+list(APPEND DBGSHIM_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/dbgshim.def)
add_library(dbgshim SHARED ${DBGSHIM_SOURCES})
diff --git a/src/dlls/mscordac/CMakeLists.txt b/src/dlls/mscordac/CMakeLists.txt
index 4e012058fb..ee39e99e4a 100644
--- a/src/dlls/mscordac/CMakeLists.txt
+++ b/src/dlls/mscordac/CMakeLists.txt
@@ -9,7 +9,7 @@ set(CLR_DAC_SOURCES
add_definitions(-DFX_VER_INTERNALNAME_STR=mscordaccore.dll)
if(WIN32)
- set(CLR_DAC_SOURCES ${CLR_DAC_SOURCES}
+ list(APPEND CLR_DAC_SOURCES
Native.rc
)
set(DEF_SOURCES
@@ -64,9 +64,8 @@ if(WIN32)
user32.lib
${STATIC_MT_CRT_LIB}
)
-else(WIN32)
- set(COREDAC_LIBRARIES
- ${COREDAC_LIBRARIES}
+else()
+ list(APPEND COREDAC_LIBRARIES
palrt
)
endif(WIN32)
diff --git a/src/dlls/mscordbi/CMakeLists.txt b/src/dlls/mscordbi/CMakeLists.txt
index 23c6b4b281..627da37524 100644
--- a/src/dlls/mscordbi/CMakeLists.txt
+++ b/src/dlls/mscordbi/CMakeLists.txt
@@ -5,7 +5,7 @@ set(MSCORDBI_SOURCES
if(WIN32)
add_definitions(-DFX_VER_INTERNALNAME_STR=mscordbi.dll)
- set(MSCORDBI_SOURCES ${MSCORDBI_SOURCES}
+ list(APPEND MSCORDBI_SOURCES
Native.rc
)
@@ -16,7 +16,7 @@ if(WIN32)
preprocess_def_file(${DEF_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/mscordbi.def)
- set(MSCORDBI_SOURCES ${MSCORDBI_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/mscordbi.def)
+ list(APPEND MSCORDBI_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/mscordbi.def)
endif(WIN32)
add_library(mscordbi SHARED
@@ -35,8 +35,7 @@ set(COREDBI_LIBRARIES
)
if(WIN32)
- set(COREDBI_LIBRARIES
- ${COREDBI_LIBRARIES}
+ list(APPEND COREDBI_LIBRARIES
ipcmanager-staticcrt
mdhotdata-staticcrt
mdwinmd_dbi
@@ -53,8 +52,7 @@ if(WIN32)
target_link_libraries(mscordbi ${COREDBI_LIBRARIES})
elseif(CLR_CMAKE_PLATFORM_UNIX)
- set(COREDBI_LIBRARIES
- ${COREDBI_LIBRARIES}
+ list(APPEND COREDBI_LIBRARIES
mdhotdata_full
palrt
CoreClrPal
diff --git a/src/dlls/mscoree/CMakeLists.txt b/src/dlls/mscoree/CMakeLists.txt
index b5262d1939..346ec0de88 100644
--- a/src/dlls/mscoree/CMakeLists.txt
+++ b/src/dlls/mscoree/CMakeLists.txt
@@ -5,7 +5,7 @@ set(CLR_SOURCES
)
if(WIN32)
-set(CLR_SOURCES ${CLR_SOURCES}
+list(APPEND CLR_SOURCES
comcallunmarshal.cpp
delayload.cpp
Native.rc
@@ -15,8 +15,8 @@ set (DEF_SOURCES
mscorwks_ntdef.src
)
convert_to_absolute_path(DEF_SOURCES ${DEF_SOURCES})
-else(WIN32)
-set(CLR_SOURCES ${CLR_SOURCES}
+else()
+list(APPEND CLR_SOURCES
unixinterface.cpp
)
endif(WIN32)
diff --git a/src/dlls/mscoree/coreclr/CMakeLists.txt b/src/dlls/mscoree/coreclr/CMakeLists.txt
index 8393cbc0dd..46b2936dae 100644
--- a/src/dlls/mscoree/coreclr/CMakeLists.txt
+++ b/src/dlls/mscoree/coreclr/CMakeLists.txt
@@ -1,7 +1,7 @@
if (WIN32)
preprocess_def_file(${DEF_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/coreclr.def)
-set(CLR_SOURCES ${CLR_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/coreclr.def)
+list(APPEND CLR_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/coreclr.def)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /ENTRY:CoreDllMain")
@@ -9,7 +9,7 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /ENTRY:CoreDllMain")
set(START_LIBRARY_GROUP)
set(END_LIBRARY_GROUP)
-else(WIN32)
+else()
add_definitions(-DNO_CRT_INIT)
@@ -59,8 +59,7 @@ set(CORECLR_LIBRARIES
)
if(WIN32)
- set(CORECLR_LIBRARIES
- ${CORECLR_LIBRARIES}
+ list(APPEND CORECLR_LIBRARIES
mdwinmd_wks
comnls_wks
comcrypt_wks
@@ -77,9 +76,8 @@ if(WIN32)
crypt32.lib
RuntimeObject.lib
)
-else(WIN32)
- set(CORECLR_LIBRARIES
- ${CORECLR_LIBRARIES}
+else()
+ list(APPEND CORECLR_LIBRARIES
CoreClrPal
palrt
)
@@ -94,8 +92,8 @@ if(WIN32)
# Add dac table & debug resource to coreclr
get_include_directories(INC_DIR)
get_compile_definitions(PREPROCESS_DEFINITIONS)
- set(INC_DIR ${INC_DIR} -I${CLR_DIR}/src/vm -I${CLR_DIR}/src/vm/amd64 -I${CLR_DIR}/src/debug/ee -I${CLR_DIR}/src/gc)
- set(PREPROCESS_DEFINITIONS ${PREPROCESS_DEFINITIONS} -DDACCESS_COMPILE -DDBG_TARGET_64BIT=1 -DDBG_TARGET_WIN64=1 -DDBG_TARGET_AMD64=1)
+ list(APPEND INC_DIR -I${CLR_DIR}/src/vm -I${CLR_DIR}/src/vm/amd64 -I${CLR_DIR}/src/debug/ee -I${CLR_DIR}/src/gc)
+ list(APPEND PREPROCESS_DEFINITIONS -DDACCESS_COMPILE -DDBG_TARGET_64BIT=1 -DDBG_TARGET_WIN64=1 -DDBG_TARGET_AMD64=1)
add_custom_command(TARGET coreclr
POST_BUILD
COMMAND ${CMAKE_CXX_COMPILER} /P /EP /TP ${PREPROCESS_DEFINITIONS} ${INC_DIR} /Fi${CMAKE_CURRENT_BINARY_DIR}/daccess.i ${CLR_DIR}/src/debug/daccess/daccess.cpp
diff --git a/src/inc/CMakeLists.txt b/src/inc/CMakeLists.txt
index cdfa7a2dea..66037d2da5 100644
--- a/src/inc/CMakeLists.txt
+++ b/src/inc/CMakeLists.txt
@@ -31,10 +31,10 @@ get_include_directories(MIDL_INCLUDE_DIRECTORIES)
# Run custom midl command over each idl file
FIND_PROGRAM( MIDL midl.exe )
-foreach(GENERATE_IDL ${CORGUIDS_IDL_SOURCES})
+foreach(GENERATE_IDL IN LISTS CORGUIDS_IDL_SOURCES)
get_filename_component(IDLNAME ${GENERATE_IDL} NAME_WE)
set(OUT_NAME ${CMAKE_CURRENT_BINARY_DIR}/idls_out/${IDLNAME}_i.c)
- set(CORGUIDS_SOURCES ${CORGUIDS_SOURCES} ${OUT_NAME})
+ list(APPEND CORGUIDS_SOURCES ${OUT_NAME})
add_custom_command(OUTPUT ${OUT_NAME}
COMMAND ${MIDL} ${MIDL_INCLUDE_DIRECTORIES} /h ${CMAKE_CURRENT_BINARY_DIR}/idls_out/${IDLNAME}.h ${MIDL_DEFINITIONS} /out ${CMAKE_CURRENT_BINARY_DIR}/idls_out ${CMAKE_CURRENT_SOURCE_DIR}/${GENERATE_IDL}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${GENERATE_IDL}
@@ -47,13 +47,13 @@ set_source_files_properties(${CORGUIDS_SOURCES}
# Compile *_i.c as C files
add_compile_options(/TC)
-else(WIN32)
+else()
#The MIDL tool exists for Windows only, so for other systems, we have the prebuilt xxx_i.c files checked in
-foreach(IDL_SOURCE ${CORGUIDS_IDL_SOURCES})
+foreach(IDL_SOURCE IN LISTS CORGUIDS_IDL_SOURCES)
get_filename_component(IDLNAME ${IDL_SOURCE} NAME_WE)
set(C_SOURCE ../pal/prebuilt/idl/${IDLNAME}_i.c)
- set(CORGUIDS_SOURCES ${CORGUIDS_SOURCES} ${C_SOURCE})
+ list(APPEND CORGUIDS_SOURCES ${C_SOURCE})
endforeach(IDL_SOURCE)
endif(WIN32)
diff --git a/src/inc/corhlprpriv.h b/src/inc/corhlprpriv.h
index bacdfb2f13..901507125b 100644
--- a/src/inc/corhlprpriv.h
+++ b/src/inc/corhlprpriv.h
@@ -184,6 +184,11 @@ public:
_Alloc<TRUE /*bGrow*/, TRUE /*bThrow*/>(iItems);
}
+#ifdef __llvm__
+ // This makes sure that we will not get an undefined symbol
+ // when building a release version of libcoreclr using LLVM.
+ __attribute__((used))
+#endif // __llvm__
HRESULT ReSizeNoThrow(SIZE_T iItems);
void Shrink(SIZE_T iItems)
diff --git a/src/jit/CMakeLists.txt b/src/jit/CMakeLists.txt
index dce4f59c3a..59d66bd216 100644
--- a/src/jit/CMakeLists.txt
+++ b/src/jit/CMakeLists.txt
@@ -97,7 +97,7 @@ if(CLR_CMAKE_PLATFORM_UNIX)
${SHARED_LIB_SOURCES}
)
add_dependencies(ClrJit CoreClrPal gcinfo)
-else(CLR_CMAKE_PLATFORM_UNIX)
+else()
add_library(ClrJit
${SOURCES}
)
diff --git a/src/jit/instr.cpp b/src/jit/instr.cpp
index c618fedecc..84f7d20da3 100644
--- a/src/jit/instr.cpp
+++ b/src/jit/instr.cpp
@@ -455,7 +455,6 @@ void CodeGenInterface::inst_FN(instruction ins, unsigned stk)
* Display a stack frame reference.
*/
-inline
void CodeGen::inst_set_SV_var(GenTreePtr tree)
{
#ifdef DEBUG
diff --git a/src/md/md_dbi.cmake b/src/md/md_dbi.cmake
index 6e7166b2fc..7622cf04c9 100644
--- a/src/md/md_dbi.cmake
+++ b/src/md/md_dbi.cmake
@@ -11,7 +11,7 @@ if(WIN32)
# using static crt for dbi
if (CMAKE_BUILD_TYPE STREQUAL DEBUG)
add_definitions(-MTd)
- else(CMAKE_BUILD_TYPE STREQUAL DEBUG)
+ else()
add_definitions(-MT)
endif(CMAKE_BUILD_TYPE STREQUAL DEBUG)
-endif(WIN32) \ No newline at end of file
+endif(WIN32)
diff --git a/src/pal/src/include/pal/cs.hpp b/src/pal/src/include/pal/cs.hpp
index 4bc2e40264..ce120ff419 100644
--- a/src/pal/src/include/pal/cs.hpp
+++ b/src/pal/src/include/pal/cs.hpp
@@ -25,7 +25,7 @@
namespace CorUnix
{
- bool CriticalSectionSubSysInitialize(void);
+ void CriticalSectionSubSysInitialize(void);
void InternalInitializeCriticalSectionAndSpinCount(
PCRITICAL_SECTION pCriticalSection,
diff --git a/src/pal/src/init/pal.cpp b/src/pal/src/init/pal.cpp
index ae1fa50b60..7433cf81ec 100644
--- a/src/pal/src/init/pal.cpp
+++ b/src/pal/src/init/pal.cpp
@@ -137,7 +137,7 @@ PAL_Initialize(
int argc,
const char *argv[])
{
- PAL_ERROR palError = NO_ERROR;
+ PAL_ERROR palError = ERROR_GEN_FAILURE;
CPalThread *pThread = NULL;
CSharedMemoryObjectManager *pshmom = NULL;
LPWSTR command_line = NULL;
@@ -150,7 +150,7 @@ PAL_Initialize(
ENTRY will be called after the DBG channels initialization */
ENTRY_EXTERNAL("PAL_Initialize(argc = %d argv = %p)\n", argc, argv);
/*Firstly initiate a temporary lastError storage */
- StartupLastError = 0;
+ StartupLastError = ERROR_GEN_FAILURE;
#ifdef __APPLE__
if (!RunningNatively())
@@ -160,11 +160,7 @@ PAL_Initialize(
}
#endif // __APPLE__
- if (!CriticalSectionSubSysInitialize())
- {
- // Too early to log a message
- goto exit;
- }
+ CriticalSectionSubSysInitialize();
if(NULL == init_critsec)
{
@@ -293,6 +289,7 @@ PAL_Initialize(
if (!SEHInitializeMachExceptions())
{
ERROR("SEHInitializeMachExceptions failed!\n");
+ palError = ERROR_GEN_FAILURE;
goto CLEANUP1;
}
#endif // HAVE_MACH_EXCEPTIONS
@@ -367,6 +364,8 @@ PAL_Initialize(
g_pSynchronizationManager =
CPalSynchMgrController::CreatePalSynchronizationManager(pThread);
+ palError = ERROR_GEN_FAILURE;
+
if (NULL == g_pSynchronizationManager)
{
ERROR("Failure creating synchronization manager\n");
@@ -440,6 +439,8 @@ PAL_Initialize(
goto CLEANUP5;
}
+ palError = ERROR_GEN_FAILURE;
+
/* initialize structured exception handling stuff (signals, etc) */
if (FALSE == SEHInitialize(pThread))
{
@@ -511,6 +512,8 @@ PAL_Initialize(
(void)PAL_Enter(PAL_BoundaryTop);
TRACE("Initialization count increases to %d\n", init_count.Load());
+
+ SetLastError(NO_ERROR);
retval = 0;
}
goto done;
@@ -575,7 +578,14 @@ done:
_ASSERTE(pThread->suspensionInfo.IsSuspensionStateSafe());
}
-exit:
+ if (retval != 0 && GetLastError() == ERROR_SUCCESS)
+ {
+ ASSERT("returning failure, but last error not set\n");
+ }
+
+#ifdef __APPLE__
+exit :
+#endif // __APPLE__
LOGEXIT("PAL_Initialize returns int %d\n", retval);
return retval;
}
diff --git a/src/pal/src/sync/cs.cpp b/src/pal/src/sync/cs.cpp
index a63d09cf0e..7ad1ae4262 100644
--- a/src/pal/src/sync/cs.cpp
+++ b/src/pal/src/sync/cs.cpp
@@ -529,8 +529,12 @@ namespace CorUnix
Initializes CS subsystem
--*/
- bool CriticalSectionSubSysInitialize()
+ void CriticalSectionSubSysInitialize()
{
+ static_assert(sizeof(CRITICAL_SECTION) >= sizeof(PAL_CRITICAL_SECTION),
+ "PAL fatal internal error: sizeof(CRITICAL_SECTION) is "
+ "smaller than sizeof(PAL_CRITICAL_SECTION)");
+
#ifdef _DEBUG
LONG lRet = InterlockedCompareExchange((LONG *)&csssInitState,
(LONG)CSSubSysInitializing,
@@ -553,21 +557,6 @@ namespace CorUnix
}
}
#endif // _DEBUG
-
- // In non-error conditions the optimizer should remove the following
- // 'if' block, since the tested expression is verifiable at compile time
- if (sizeof(CRITICAL_SECTION) < sizeof(PAL_CRITICAL_SECTION))
- {
- // Too early to log, writing directly to stderr
- fprintf(stderr,
- "PAL fatal internal error: sizeof(CRITICAL_SECTION)=%lu is "
- "smaller than sizeof(PAL_CRITICAL_SECTION)=%lu\n",
- sizeof(CRITICAL_SECTION),
- sizeof(PAL_CRITICAL_SECTION));
-
- return false;
- }
- return true;
}
/*++
diff --git a/src/utilcode/CMakeLists.txt b/src/utilcode/CMakeLists.txt
index ea760e4f97..3d2140bd79 100644
--- a/src/utilcode/CMakeLists.txt
+++ b/src/utilcode/CMakeLists.txt
@@ -72,8 +72,7 @@ set(UTILCODE_SOURCES
# They should be moved out from here into the declaration
# of UTILCODE_SOURCES above after fixing compiler errors.
if(WIN32)
- set(UTILCODE_SOURCES
- ${UTILCODE_SOURCES}
+ list(APPEND UTILCODE_SOURCES
appxutil.cpp
dlwrap.cpp
downlevel.cpp
diff --git a/src/utilcode/dac/CMakeLists.txt b/src/utilcode/dac/CMakeLists.txt
index d792c4ca57..ff6c48581a 100644
--- a/src/utilcode/dac/CMakeLists.txt
+++ b/src/utilcode/dac/CMakeLists.txt
@@ -4,7 +4,7 @@ include(${CLR_DIR}/dac.cmake)
if(CLR_CMAKE_PLATFORM_UNIX)
add_library(utilcode_dac STATIC ${UTILCODE_SOURCES})
add_dependencies(utilcode_dac CoreClrPal)
-else(CLR_CMAKE_PLATFORM_UNIX)
+else()
add_definitions(-DSELF_NO_HOST)
add_library(utilcode_dac STATIC ${UTILCODE_SOURCES} ../hostimpl.cpp)
endif(CLR_CMAKE_PLATFORM_UNIX) \ No newline at end of file
diff --git a/src/utilcode/dyncrt/CMakeLists.txt b/src/utilcode/dyncrt/CMakeLists.txt
index ceb0cff1f4..36f2ef4872 100644
--- a/src/utilcode/dyncrt/CMakeLists.txt
+++ b/src/utilcode/dyncrt/CMakeLists.txt
@@ -2,6 +2,6 @@
if(CLR_CMAKE_PLATFORM_UNIX)
add_library(utilcode STATIC ${UTILCODE_SOURCES})
add_dependencies(utilcode CoreClrPal)
-else(CLR_CMAKE_PLATFORM_UNIX)
+else()
add_library(utilcode STATIC ${UTILCODE_SOURCES})
endif(CLR_CMAKE_PLATFORM_UNIX) \ No newline at end of file
diff --git a/src/utilcode/staticnohost/CMakeLists.txt b/src/utilcode/staticnohost/CMakeLists.txt
index f28aa9774f..254ada1ff9 100644
--- a/src/utilcode/staticnohost/CMakeLists.txt
+++ b/src/utilcode/staticnohost/CMakeLists.txt
@@ -3,9 +3,9 @@ add_definitions(-DSELF_NO_HOST)
if(WIN32)
add_definitions(-D_CRTIMP=) # use static version of crt
- set(UTILCODE_SOURCES ${UTILCODE_SOURCES} ../hostimpl.cpp)
+ list(APPEND UTILCODE_SOURCES ../hostimpl.cpp)
add_library(utilcodestaticnohost STATIC ${UTILCODE_SOURCES})
elseif(CLR_CMAKE_PLATFORM_UNIX)
add_library(utilcodestaticnohost STATIC ${UTILCODE_SOURCES})
-endif(WIN32) \ No newline at end of file
+endif(WIN32)
diff --git a/src/vm/CMakeLists.txt b/src/vm/CMakeLists.txt
index 489b5c7f0b..f777e41443 100644
--- a/src/vm/CMakeLists.txt
+++ b/src/vm/CMakeLists.txt
@@ -257,8 +257,7 @@ set(VM_SOURCES_DAC_AND_WKS_WIN32
winrttypenameconverter.cpp
)
-set(VM_SOURCES_WKS
- ${VM_SOURCES_WKS}
+list(APPEND VM_SOURCES_WKS
${VM_SOURCES_DAC_AND_WKS_WIN32}
marvin32.cpp # move out of win32 when FEATURE_RANDOMIZED_STRING_HASHING is enabled for linux
# These should not be included for Linux
@@ -294,8 +293,7 @@ set(VM_SOURCES_WKS
winrthelpers.cpp
)
-set(VM_SOURCES_DAC
- ${VM_SOURCES_DAC}
+list(APPEND VM_SOURCES_DAC
${VM_SOURCES_DAC_AND_WKS_WIN32}
# These should not be included for Linux
clrprivbinderwinrt.cpp
@@ -326,7 +324,7 @@ set(VM_SOURCES_WKS_AMD64_ASM
${AMD64_SOURCES_DIR}/VirtualCallStubAMD64.asm
)
-else(WIN32)
+else()
set(VM_SOURCES_WKS_AMD64_ASM
${AMD64_SOURCES_DIR}/jithelpers_fastwritebarriers.S
${AMD64_SOURCES_DIR}/jithelpers_slow.S
@@ -358,8 +356,7 @@ set(VM_SOURCES_WKS_AMD64
if(CLR_CMAKE_PLATFORM_UNIX)
-set(VM_SOURCES_WKS_AMD64
- ${VM_SOURCES_WKS_AMD64}
+list(APPEND VM_SOURCES_WKS_AMD64
${AMD64_SOURCES_DIR}/unixstubs.cpp
)
@@ -371,14 +368,12 @@ set(VM_SOURCES_DAC_AMD64
exceptionhandling.cpp
)
-set(VM_SOURCES_WKS
- ${VM_SOURCES_WKS}
+list(APPEND VM_SOURCES_WKS
${VM_SOURCES_WKS_AMD64}
${VM_SOURCES_DAC_AND_WKS_AMD64}
)
-set(VM_SOURCES_DAC
- ${VM_SOURCES_DAC}
+list(APPEND VM_SOURCES_DAC
${VM_SOURCES_DAC_AMD64}
${VM_SOURCES_DAC_AND_WKS_AMD64}
)
diff --git a/src/vm/exceptionhandling.cpp b/src/vm/exceptionhandling.cpp
index 4827bf7689..e8bc63d20c 100644
--- a/src/vm/exceptionhandling.cpp
+++ b/src/vm/exceptionhandling.cpp
@@ -4516,7 +4516,7 @@ void FixupDispatcherContext(DISPATCHER_CONTEXT* pDispatcherContext, CONTEXT* pCo
// See the comment above for the overloaded version of this function.
-FORCEINLINE void FixupDispatcherContext(DISPATCHER_CONTEXT* pDispatcherContext, CONTEXT* pContext, CONTEXT* pOriginalContext, PEXCEPTION_ROUTINE pUnwindPersonalityRoutine = NULL)
+void FixupDispatcherContext(DISPATCHER_CONTEXT* pDispatcherContext, CONTEXT* pContext, CONTEXT* pOriginalContext, PEXCEPTION_ROUTINE pUnwindPersonalityRoutine = NULL)
{
_ASSERTE(pOriginalContext != NULL);
FixupDispatcherContext(pDispatcherContext, pContext, (LPVOID)::GetIP(pOriginalContext), pUnwindPersonalityRoutine);
diff --git a/src/vm/wks/CMakeLists.txt b/src/vm/wks/CMakeLists.txt
index 2f7c16d69f..49d45ccc2f 100644
--- a/src/vm/wks/CMakeLists.txt
+++ b/src/vm/wks/CMakeLists.txt
@@ -9,21 +9,21 @@ get_directory_property(COMPILE_DEFINITIONS_LIST COMPILE_DEFINITIONS)
# Extract the definitions for the ASM code. Since there is a bug in the cmake that prevents us from
# using the generator expressions, we split the definitions into lists based on the configuration.
-foreach(DEFINITION ${COMPILE_DEFINITIONS_LIST})
+foreach(DEFINITION IN LISTS COMPILE_DEFINITIONS_LIST)
if (${DEFINITION} MATCHES "^\\$<\\$<CONFIG:([^>]+)>:([^>]+)>$")
# The entry contains generator expression, so insert the definition into a definitions list
# corresponding to the config
string(TOUPPER ${CMAKE_MATCH_1} CONFIG)
set(ASM_DEFINITIONS_${CONFIG} ${ASM_DEFINITIONS_${CONFIG}} ${CMAKE_MATCH_2})
else()
- set(ASM_DEFINITIONS ${ASM_DEFINITIONS} ${DEFINITION})
+ list(APPEND ASM_DEFINITIONS ${DEFINITION})
endif()
endforeach()
# Add defines for the ASM. Unfortunately setting it on the target is ignored for asm by the cmake, so we have
# to set it on the sources.
set_property(SOURCE ${VM_SOURCES_WKS_AMD64_ASM} PROPERTY COMPILE_DEFINITIONS ${ASM_DEFINITIONS})
-foreach(CONFIG ${CMAKE_CONFIGURATION_TYPES})
+foreach(CONFIG IN LISTS CMAKE_CONFIGURATION_TYPES)
string(TOUPPER ${CONFIG} CONFIG)
set_property(SOURCE ${VM_SOURCES_WKS_AMD64_ASM} PROPERTY COMPILE_DEFINITIONS_${CONFIG} ${ASM_DEFINITIONS_${CONFIG}})
endforeach()