Limit exports on debugger modules. (#5442)
authorMike McLaughlin <mikem@microsoft.com>
Fri, 3 Jun 2016 21:15:43 +0000 (14:15 -0700)
committerMike McLaughlin <mikem@microsoft.com>
Fri, 3 Jun 2016 21:15:43 +0000 (14:15 -0700)
Remove obsolete ExecuteAssembly hosting API from coreclr.

Needed to add palrt to dbi instead of trying to export from palrt.

Didn't end up adding the --no-allow-shlib-undefined linker option because Centos
and FreeBSD link with lots of undefined symbols from the C++ runtime libraries.

13 files changed:
src/ToolBox/SOS/Strike/CMakeLists.txt
src/ToolBox/SOS/Strike/sildasm.cpp
src/ToolBox/SOS/Strike/sos_unixexports.src [new file with mode: 0644]
src/dlls/dbgshim/CMakeLists.txt
src/dlls/dbgshim/dbgshim_unixexports.src [new file with mode: 0644]
src/dlls/mscordac/CMakeLists.txt
src/dlls/mscordac/mscordac_unixexports.src [new file with mode: 0644]
src/dlls/mscordbi/CMakeLists.txt
src/dlls/mscordbi/mscordbi_unixexports.src [new file with mode: 0644]
src/dlls/mscoree/coreclr/CMakeLists.txt
src/dlls/mscoree/mscorwks_unixexports.src
src/dlls/mscoree/unixinterface.cpp
src/pal/src/cruntime/misc.cpp

index f832e764fc16c5abffdb57a77b670c8367a03090..5d12a0c3294cf7b418b98d338aab3b7ca49b0f8f 100644 (file)
@@ -131,6 +131,10 @@ else(WIN32)
     # share the PAL in the dac module
     mscordaccore
   )
+
+  set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/sos_unixexports.src)
+  set(EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/sos.exports)
+  generate_exports_file(${DEF_SOURCES} ${EXPORTS_FILE})
 endif(WIN32)
 
 if(CLR_CMAKE_PLATFORM_ARCH_AMD64)
@@ -160,8 +164,28 @@ endif()
 
 list(APPEND SOS_SOURCES ${SOS_SOURCES_ARCH})
 
+if(CLR_CMAKE_PLATFORM_LINUX OR CLR_CMAKE_PLATFORM_FREEBSD OR CLR_CMAKE_PLATFORM_NETBSD)
+    # Add linker exports file option
+    set(EXPORTS_LINKER_OPTION -Wl,--version-script=${EXPORTS_FILE})
+endif(CLR_CMAKE_PLATFORM_LINUX OR CLR_CMAKE_PLATFORM_FREEBSD OR CLR_CMAKE_PLATFORM_NETBSD)
+
+if(CLR_CMAKE_PLATFORM_DARWIN)
+    # Add linker exports file option
+    set(EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${EXPORTS_FILE})
+endif(CLR_CMAKE_PLATFORM_DARWIN)
+
 add_library_clr(sos SHARED ${SOS_SOURCES})
-add_dependencies(sos mscordaccore)
+
+if(CLR_CMAKE_PLATFORM_UNIX)
+    add_custom_target(sos_exports DEPENDS ${EXPORTS_FILE})
+    add_dependencies(sos sos_exports)
+
+    set_property(TARGET sos APPEND_STRING PROPERTY LINK_FLAGS ${EXPORTS_LINKER_OPTION})
+    set_property(TARGET sos APPEND_STRING PROPERTY LINK_DEPENDS ${EXPORTS_FILE})
+
+    add_dependencies(sos mscordaccore)
+endif(CLR_CMAKE_PLATFORM_UNIX)
+
 target_link_libraries(sos ${SOS_LIBRARY})
 
 # add the install targets
index 71d364de44df79cfcf89e6c34cf22878bd1295cb..2dbea22974b76ed185ecd93124ec3c2b7425a0c4 100644 (file)
@@ -623,13 +623,6 @@ void DecodeDynamicIL(BYTE *data, ULONG Size, DacpObjectData& tokenArray)
 
 /******************************************************************************/
 // CQuickBytes utilities
-#ifdef FEATURE_PAL
-// Don't need the implementations since sos references the dac module containing them.
-char* asString(CQuickBytes *out);
-void appendStr(CQuickBytes *out, const char* str, unsigned len = -1);
-void appendChar(CQuickBytes *out, char chr);
-void insertStr(CQuickBytes *out, const char* str);
-#else
 static char* asString(CQuickBytes *out) {
     SIZE_T oldSize = out->Size();
     out->ReSize(oldSize + 1);
@@ -664,7 +657,6 @@ static void insertStr(CQuickBytes *out, const char* str) {
     memcpy(out->Ptr(), str, len);  
         // Note no trailing null!   
 }
-#endif
 
 static void appendStrNum(CQuickBytes *out, int num) {
     char buff[16];  
diff --git a/src/ToolBox/SOS/Strike/sos_unixexports.src b/src/ToolBox/SOS/Strike/sos_unixexports.src
new file mode 100644 (file)
index 0000000..4ce1a4b
--- /dev/null
@@ -0,0 +1,53 @@
+; Licensed to the .NET Foundation under one or more agreements.
+; The .NET Foundation licenses this file to you under the MIT license.
+; See the LICENSE file in the project root for more information.
+
+bpmd
+ClrStack
+DumpArray
+DumpAssembly
+DumpClass
+DumpDomain
+DumpGCData
+DumpHeap
+DumpIL
+DumpLog
+DumpMD
+DumpModule
+DumpMT
+DumpObj
+DumpRuntimeTypes
+DumpSig
+DumpSigElem
+DumpStack
+DumpStackObjects
+DumpVC
+EEHeap
+EEStack
+EHInfo
+FindAppDomain
+GCInfo
+GCRoot
+Help
+HistClear
+HistInit
+HistObj
+HistObjFind
+HistRoot
+HistStats
+IP2MD
+Name2EE
+PrintException
+StopOnCatch
+Threads
+ThreadState
+Token2EE
+u
+VerifyHeap
+VerifyStackTrace
+    
+_EFN_GetManagedExcepStack
+_EFN_GetManagedExcepStackW
+_EFN_GetManagedObjectFieldInfo    
+_EFN_GetManagedObjectName
+_EFN_StackTrace
index 5024642ca56062f10f4ea1138b88120d54787599..4e72ee219a5dfab0fce8d5839302f5f6f0e6a4a0 100644 (file)
@@ -18,20 +18,38 @@ if(WIN32)
 
     preprocess_def_file(${CMAKE_CURRENT_SOURCE_DIR}/dbgshim.ntdef ${CMAKE_CURRENT_BINARY_DIR}/dbgshim.def)
     list(APPEND DBGSHIM_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/dbgshim.def)
+else(WIN32)
+    set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/dbgshim_unixexports.src)
+    set(EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/dbgshim.exports)
+    generate_exports_file(${DEF_SOURCES} ${EXPORTS_FILE})
 endif(WIN32)
 
-if(CLR_CMAKE_PLATFORM_UNIX)
-    add_compile_options(-fPIC)
-endif(CLR_CMAKE_PLATFORM_UNIX)
-
-if(CLR_CMAKE_PLATFORM_LINUX OR CLR_CMAKE_PLATFORM_NETBSD)
+if(CLR_CMAKE_PLATFORM_LINUX OR CLR_CMAKE_PLATFORM_FREEBSD OR CLR_CMAKE_PLATFORM_NETBSD)
     # This option is necessary to ensure that the overloaded delete operator defined inside
     # of the utilcode will be used instead of the standard library delete operator.
-    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic -Bsymbolic-functions")
-endif(CLR_CMAKE_PLATFORM_LINUX OR CLR_CMAKE_PLATFORM_NETBSD)
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic -Xlinker -Bsymbolic-functions")    
+
+    # Add linker exports file option
+    set(EXPORTS_LINKER_OPTION -Wl,--version-script=${EXPORTS_FILE})
+endif(CLR_CMAKE_PLATFORM_LINUX OR CLR_CMAKE_PLATFORM_FREEBSD OR CLR_CMAKE_PLATFORM_NETBSD)
+
+if(CLR_CMAKE_PLATFORM_DARWIN)
+    # Add linker exports file option
+    set(EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${EXPORTS_FILE})
+endif(CLR_CMAKE_PLATFORM_DARWIN)
 
 add_library_clr(dbgshim SHARED ${DBGSHIM_SOURCES})
 
+if(CLR_CMAKE_PLATFORM_UNIX)
+    add_compile_options(-fPIC)
+
+    add_custom_target(dbgshim_exports DEPENDS ${EXPORTS_FILE})
+    add_dependencies(dbgshim dbgshim_exports)
+
+    set_property(TARGET dbgshim APPEND_STRING PROPERTY LINK_FLAGS ${EXPORTS_LINKER_OPTION})
+    set_property(TARGET dbgshim APPEND_STRING PROPERTY LINK_DEPENDS ${EXPORTS_FILE})
+endif(CLR_CMAKE_PLATFORM_UNIX)
+
 set(DBGSHIM_LIBRARIES
     debug-pal
     debugshim
diff --git a/src/dlls/dbgshim/dbgshim_unixexports.src b/src/dlls/dbgshim/dbgshim_unixexports.src
new file mode 100644 (file)
index 0000000..b1cc36b
--- /dev/null
@@ -0,0 +1,16 @@
+; Licensed to the .NET Foundation under one or more agreements.
+; The .NET Foundation licenses this file to you under the MIT license.
+; See the LICENSE file in the project root for more information.
+
+CreateProcessForLaunch
+ResumeProcess
+CloseResumeHandle
+RegisterForRuntimeStartup
+UnregisterForRuntimeStartup
+GetStartupNotificationEvent
+EnumerateCLRs
+CloseCLREnumeration
+CreateVersionStringFromModule
+CreateDebuggingInterfaceFromVersion
+CreateDebuggingInterfaceFromVersionEx
+CLRCreateInstance
index 8c2cec1b8127530b870aceb1019444f47450d6cf..8ef0a54432c64906d77f8d21f896c0621f5858b3 100644 (file)
@@ -30,20 +30,40 @@ if(WIN32)
     set(START_LIBRARY_GROUP)
     set(END_LIBRARY_GROUP)
 else(WIN32)
-    if(CLR_CMAKE_PLATFORM_LINUX OR CLR_CMAKE_PLATFORM_NETBSD)
-        # This option is necessary to ensure that the overloaded delete operator defined inside
-        # of the utilcode will be used instead of the standard library delete operator.
-        set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic -Bsymbolic-functions")
-
-        # The following linked options can be inserted into the linker libraries list to 
-        # 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(CLR_CMAKE_PLATFORM_LINUX OR CLR_CMAKE_PLATFORM_NETBSD)
+    set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/mscordac_unixexports.src)
+    set(EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/mscordac.exports)
+    generate_exports_file(${DEF_SOURCES} ${EXPORTS_FILE})
 endif(WIN32)
 
+if(CLR_CMAKE_PLATFORM_LINUX OR CLR_CMAKE_PLATFORM_FREEBSD OR CLR_CMAKE_PLATFORM_NETBSD)
+    # This option is necessary to ensure that the overloaded delete operator defined inside
+    # of the utilcode will be used instead of the standard library delete operator.
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic -Xlinker -Bsymbolic-functions")    
+
+    # The following linked options can be inserted into the linker libraries list to 
+    # 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)
+
+    # Add linker exports file option
+    set(EXPORTS_LINKER_OPTION -Wl,--version-script=${EXPORTS_FILE})
+endif(CLR_CMAKE_PLATFORM_LINUX OR CLR_CMAKE_PLATFORM_FREEBSD OR CLR_CMAKE_PLATFORM_NETBSD)
+
+if(CLR_CMAKE_PLATFORM_DARWIN)
+    # Add linker exports file option
+    set(EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${EXPORTS_FILE})
+endif(CLR_CMAKE_PLATFORM_DARWIN)
+
 add_library_clr(mscordaccore SHARED ${CLR_DAC_SOURCES})
 
+if(CLR_CMAKE_PLATFORM_UNIX)
+    add_custom_target(mscordaccore_exports DEPENDS ${EXPORTS_FILE})
+    add_dependencies(mscordaccore mscordaccore_exports)
+
+    set_property(TARGET mscordaccore APPEND_STRING PROPERTY LINK_FLAGS ${EXPORTS_LINKER_OPTION})
+    set_property(TARGET mscordaccore APPEND_STRING PROPERTY LINK_DEPENDS ${EXPORTS_FILE})
+endif(CLR_CMAKE_PLATFORM_UNIX)
+
 # IMPORTANT! Please do not rearrange the order of the libraries. The linker on Linux is
 # order dependent and changing the order can result in undefined symbols in the shared 
 # library.
@@ -96,7 +116,7 @@ else(WIN32)
     )
 endif(WIN32)
 
-target_link_libraries(mscordaccore ${COREDAC_LIBRARIES})
+target_link_libraries(mscordaccore PRIVATE ${COREDAC_LIBRARIES})
 
 # add the install targets
 install_clr(mscordaccore)
\ No newline at end of file
diff --git a/src/dlls/mscordac/mscordac_unixexports.src b/src/dlls/mscordac/mscordac_unixexports.src
new file mode 100644 (file)
index 0000000..466a1bf
--- /dev/null
@@ -0,0 +1,174 @@
+; Licensed to the .NET Foundation under one or more agreements.
+; The .NET Foundation licenses this file to you under the MIT license.
+; See the LICENSE file in the project root for more information.
+
+DacDbiInterfaceInstance
+CLRDataCreateInstance
+
+; PAL module registration
+DllMain
+PAL_RegisterModule
+PAL_UnregisterModule
+
+PAL_BindResources
+PAL_bsearch
+PAL_errno
+PAL_fflush
+PAL__flushall
+PAL_free
+PAL_fwprintf
+PAL_swprintf
+PAL_GetPALDirectoryW
+PAL_GetResourceString
+PAL_get_stdout
+PAL_get_stderr
+PAL_GetSymbolModuleBase
+PAL_GetTransportPipeName
+PAL_InitializeDLL
+PAL_IsDebuggerPresent
+PAL_iswspace
+PAL_memcpy
+PAL_malloc
+PAL_realloc
+PAL_printf
+PAL_qsort
+PAL_Reenter
+PAL_fprintf
+PAL__vsnprintf
+PAL__wcstoui64
+PAL_wcstoul
+PAL_iswprint
+PAL_wcslen
+PAL_wcsncmp
+PAL_wcsrchr
+PAL_wcscmp
+PAL_wcschr
+PAL_wcscspn
+PAL_wcscat
+PAL_wcsstr
+
+_wcsicmp
+_stricmp
+_snprintf
+_snwprintf
+_vsnwprintf
+_itow
+_i64tow
+memcpy_s
+
+CoCreateGuid
+CopyFileW
+CreateDirectoryW
+CreateFileMappingA
+CreateFileMappingW
+CreateFileA
+CreateFileW
+CreateMutexW
+CreateEventW
+CreateProcessW
+CreateSemaphoreExW
+CreateStreamOnHGlobal
+CreateThread
+CloseHandle
+DebugBreak
+DeleteCriticalSection
+DeleteFileW
+DuplicateHandle
+EnterCriticalSection
+FindClose
+FindFirstFileW
+FindNextFileW
+FlushFileBuffers
+FlushInstructionCache
+FormatMessageW
+FreeLibrary
+FileTimeToSystemTime
+GetACP
+GetCPInfo
+GetCurrentDirectoryW
+GetCurrentProcess
+GetCurrentProcessId
+GetCurrentThreadId
+GetEnvironmentVariableA
+GetEnvironmentVariableW
+GetFileAttributesExW
+GetFileAttributesW
+GetFileSize
+GetFullPathNameW
+GetLastError
+GetLongPathNameW
+GetModuleFileNameW
+GetProcAddress
+GetProcessHeap
+GetShortPathNameW
+GetStdHandle
+GetSystemInfo
+GetSystemTime
+GetSystemTimeAsFileTime
+GetTempFileNameW
+GetTempPathW
+HeapAlloc
+HeapFree
+HeapSetInformation
+IIDFromString
+IID_IClassFactory
+IID_ISequentialStream
+IID_IStream
+IID_IUnknown
+InitializeCriticalSection
+IsDBCSLeadByte
+LeaveCriticalSection
+LoadLibraryA
+LoadLibraryW
+LoadLibraryExW
+LocalAlloc
+LocalReAlloc
+LocalFree
+MapViewOfFile
+MoveFileExW
+MultiByteToWideChar
+OpenProcess
+OutputDebugStringW
+OpenEventW
+OutputDebugStringA
+QueryPerformanceCounter
+QueryPerformanceFrequency
+RaiseException
+ReadFile
+ReleaseMutex
+ReleaseSemaphore
+RemoveDirectoryW
+ResetEvent
+ResumeThread
+SearchPathW
+SetEvent
+SetFileAttributesW
+SetFilePointer
+SetLastError
+SetErrorMode
+Sleep
+SleepEx
+SwitchToThread
+TerminateProcess
+TlsAlloc
+TlsFree
+TlsGetValue
+TlsSetValue
+VirtualAlloc
+VirtualFree
+VirtualProtect
+VirtualQuery
+UnmapViewOfFile
+WaitForMultipleObjectsEx
+WaitForSingleObject
+WaitForSingleObjectEx
+WideCharToMultiByte
+WriteFile
+YieldProcessor
+
+nativeStringResourceTable_mscorrc_debug
+_ZN25NativeExceptionHolderBase4PushEv
+_ZN25NativeExceptionHolderBaseC2Ev
+_ZN25NativeExceptionHolderBaseD2Ev
+_ZN28CatchHardwareExceptionHolderC1Ev
+_ZN28CatchHardwareExceptionHolderD1Ev
\ No newline at end of file
index 28b006b58c32cc85d306d6a33dc7665443b7df8f..5f5ad5139e0d04db7b0ac3df52354097ebacf028 100644 (file)
@@ -26,16 +26,41 @@ if(WIN32)
     set(DEF_SOURCES
       mscordbi.src
     )
+
     convert_to_absolute_path(DEF_SOURCES ${DEF_SOURCES})
 
     preprocess_def_file(${DEF_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/mscordbi.def)
 
     list(APPEND MSCORDBI_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/mscordbi.def)
+else(WIN32)
+    set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/mscordbi_unixexports.src)
+    set(EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/mscordbi.exports)
+    generate_exports_file(${DEF_SOURCES} ${EXPORTS_FILE})
 endif(WIN32)
 
-add_library_clr(mscordbi SHARED
-  ${MSCORDBI_SOURCES}
-)
+if(CLR_CMAKE_PLATFORM_LINUX OR CLR_CMAKE_PLATFORM_FREEBSD OR CLR_CMAKE_PLATFORM_NETBSD)
+    # This option is necessary to ensure that the overloaded new/delete operators defined inside
+    # of the utilcode will be used instead of the standard library delete operator.
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic -Xlinker -Bsymbolic-functions")    
+
+    # Add linker exports file option
+    set(EXPORTS_LINKER_OPTION -Wl,--version-script=${EXPORTS_FILE})
+endif(CLR_CMAKE_PLATFORM_LINUX OR CLR_CMAKE_PLATFORM_FREEBSD OR CLR_CMAKE_PLATFORM_NETBSD)
+
+if(CLR_CMAKE_PLATFORM_DARWIN)
+    # Add linker exports file option
+    set(EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${EXPORTS_FILE})
+endif(CLR_CMAKE_PLATFORM_DARWIN)
+
+add_library_clr(mscordbi SHARED ${MSCORDBI_SOURCES})
+
+if(CLR_CMAKE_PLATFORM_UNIX)
+    add_custom_target(mscordbi_exports DEPENDS ${EXPORTS_FILE})
+    add_dependencies(mscordbi mscordbi_exports)
+
+    set_property(TARGET mscordbi APPEND_STRING PROPERTY LINK_FLAGS ${EXPORTS_LINKER_OPTION})
+    set_property(TARGET mscordbi APPEND_STRING PROPERTY LINK_DEPENDS ${EXPORTS_FILE})
+endif(CLR_CMAKE_PLATFORM_UNIX)
 
 set(COREDBI_LIBRARIES
   debug-pal
@@ -69,24 +94,20 @@ if(WIN32)
 
 elseif(CLR_CMAKE_PLATFORM_UNIX)
 
-    if(CLR_CMAKE_PLATFORM_LINUX OR CLR_CMAKE_PLATFORM_NETBSD)
-        # This option is necessary to ensure that the overloaded new/delete operators defined inside
-        # of the utilcode will be used instead of the standard library delete operator.
-        set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic -Bsymbolic-functions")    
-    endif(CLR_CMAKE_PLATFORM_LINUX OR CLR_CMAKE_PLATFORM_NETBSD)
-
     list(APPEND COREDBI_LIBRARIES
         mdhotdata_full
+        palrt
         # share the PAL in the dac module
         mscordaccore
     )
 
+    add_dependencies(mscordbi mscordaccore)
+
     # COREDBI_LIBRARIES is mentioned twice because ld is one pass linker and will not find symbols
     # if they are defined after they are used. Having all libs twice makes sure that ld will actually
     # find all symbols.
     target_link_libraries(mscordbi ${COREDBI_LIBRARIES} ${COREDBI_LIBRARIES})
 
-    add_dependencies(mscordbi mscordaccore)
 endif(WIN32)
 
 # add the install targets
diff --git a/src/dlls/mscordbi/mscordbi_unixexports.src b/src/dlls/mscordbi/mscordbi_unixexports.src
new file mode 100644 (file)
index 0000000..b4704ae
--- /dev/null
@@ -0,0 +1,18 @@
+; Licensed to the .NET Foundation under one or more agreements.
+; The .NET Foundation licenses this file to you under the MIT license.
+; See the LICENSE file in the project root for more information.
+
+; COM-instantiation
+DllGetClassObjectInternal
+DllGetClassObject
+
+; CoreClr API
+CoreCLRCreateCordbObject
+
+; Out-of-proc creation path from the shim - ICLRDebugging
+OpenVirtualProcessImpl
+
+; PAL module registration
+DllMain
+PAL_RegisterModule
+PAL_UnregisterModule
\ No newline at end of file
index 42a3bc6550dcd30f407719f7310b24346d003ddb..a51e841c78684434b22fa5d9f4a8a615bdb88645 100644 (file)
@@ -24,7 +24,7 @@ else()
     if(CMAKE_SYSTEM_NAME STREQUAL Linux OR CMAKE_SYSTEM_NAME STREQUAL FreeBSD OR CMAKE_SYSTEM_NAME STREQUAL NetBSD)
         # This option is necessary to ensure that the overloaded delete operator defined inside
         # of the utilcode will be used instead of the standard library delete operator.
-        set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic -Bsymbolic-functions")
+        set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic -Xlinker -Bsymbolic-functions")
 
         # The following linked options can be inserted into the linker libraries list to 
         # ensure proper resolving of circular references between a subset of the libraries.
index 71203371776b236416c2247158634bbbbcd42857..9c151a942c4b540d941ceb5b7dfccc9989163999 100644 (file)
@@ -10,9 +10,6 @@ GetMetaDataInternalInterface
 GetMetaDataInternalInterfaceFromPublic
 GetMetaDataPublicInterfaceFromInternal
 
-; Obsolete Unix hosting API, to be removed
-ExecuteAssembly
-
 ; PAL module registration
 PAL_RegisterModule
 PAL_UnregisterModule
index 42f2d8005425fa25b7e941194e4deb848645cb2d..be345b3ca10d1d6a3550fdd1046e63908be6b8e9 100644 (file)
@@ -352,89 +352,3 @@ int coreclr_execute_assembly(
 
     return hr;
 }
-
-#ifdef PLATFORM_UNIX
-//
-// Execute a managed assembly with given arguments
-//
-// Parameters:
-//  exePath                 - Absolute path of the executable that invoked the ExecuteAssembly
-//  coreClrPath             - Absolute path of the libcoreclr.so
-//  appDomainFriendlyName   - Friendly name of the app domain that will be created to execute the assembly
-//  propertyCount           - Number of properties (elements of the following two arguments)
-//  propertyKeys            - Keys of properties of the app domain
-//  propertyValues          - Values of properties of the app domain
-//  argc                    - Number of arguments passed to the executed assembly
-//  argv                    - Array of arguments passed to the executed assembly
-//  managedAssemblyPath     - Path of the managed assembly to execute (or NULL if using a custom entrypoint).
-//  enntyPointAssemblyName  - Name of the assembly which holds the custom entry point (or NULL to use managedAssemblyPath).
-//  entryPointTypeName      - Name of the type which holds the custom entry point (or NULL to use managedAssemblyPath).
-//  entryPointMethodName    - Name of the method which is the custom entry point (or NULL to use managedAssemblyPath).
-//  exitCode                - Exit code returned by the executed assembly
-//
-// Returns:
-//  HRESULT indicating status of the operation. S_OK if the assembly was successfully executed
-//
-extern "C"
-HRESULT ExecuteAssembly(
-            LPCSTR exePath,
-            LPCSTR coreClrPath,
-            LPCSTR appDomainFriendlyName,
-            int propertyCount,
-            LPCSTR* propertyKeys,
-            LPCSTR* propertyValues,
-            int argc,
-            LPCSTR* argv,
-            LPCSTR managedAssemblyPath,
-            LPCSTR entryPointAssemblyName,
-            LPCSTR entryPointTypeName,
-            LPCSTR entryPointMethodName,
-            DWORD* exitCode)
-{
-    if (exitCode == NULL)
-    {
-        return HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER);
-    }
-    *exitCode = -1;
-
-    ReleaseHolder<ICLRRuntimeHost2> host; //(reinterpret_cast<ICLRRuntimeHost2*>(hostHandle));
-    DWORD domainId;
-
-    HRESULT hr = coreclr_initialize(exePath, appDomainFriendlyName, propertyCount, propertyKeys, propertyValues, &host, &domainId);
-    IfFailRet(hr);
-
-    ConstWStringArrayHolder argvW;
-    argvW.Set(StringArrayToUnicode(argc, argv), argc);
-    
-    if (entryPointAssemblyName == NULL || entryPointTypeName == NULL || entryPointMethodName == NULL)
-    {
-        ConstWStringHolder managedAssemblyPathW = StringToUnicode(managedAssemblyPath);
-
-        hr = host->ExecuteAssembly(domainId, managedAssemblyPathW, argc, argvW, exitCode);
-        IfFailRet(hr);
-    }
-    else
-    {
-        ConstWStringHolder entryPointAssemblyNameW = StringToUnicode(entryPointAssemblyName);
-        ConstWStringHolder entryPointTypeNameW = StringToUnicode(entryPointTypeName);
-        ConstWStringHolder entryPointMethodNameW = StringToUnicode(entryPointMethodName);
-
-        HostMain pHostMain;
-
-        hr = host->CreateDelegate(
-            domainId,
-            entryPointAssemblyNameW,
-            entryPointTypeNameW,
-            entryPointMethodNameW,
-            (INT_PTR*)&pHostMain);
-        
-        IfFailRet(hr);
-
-        *exitCode = pHostMain(argc, argvW);
-    }
-
-    hr = coreclr_shutdown(host, domainId);
-
-    return hr;
-}
-#endif
index 12465c7341d98f241e4870efd13f4e7b6baf416c..9e5acf65ff819667ff952325029e800f89a9e9ab 100644 (file)
@@ -293,8 +293,6 @@ void PAL__mm_setcsr(unsigned int i)
 
 #endif // _AMD64_ 
 
-#if defined(_DEBUG)
-
 /*++
 Function:
 PAL_memcpy
@@ -302,14 +300,15 @@ PAL_memcpy
 Overlapping buffer-safe version of memcpy.
 See MSDN doc for memcpy
 --*/
+EXTERN_C
+PALIMPORT
 void *PAL_memcpy (void *dest, const void *src, size_t count)
 {
     UINT_PTR x = (UINT_PTR)dest, y = (UINT_PTR)src;
-    assert((x + count <= y) || (y + count <= x));
+    _ASSERTE((x + count <= y) || (y + count <= x));
     
     void *ret;
     #undef memcpy
     ret = memcpy(dest, src, count);
     return ret;
 }
-#endif //DEBUG