Skip to content

Commit

Permalink
Move out globalization code from runtime (#98495)
Browse files Browse the repository at this point in the history
* Move out globalization code from runtime
---------
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
  • Loading branch information
mkhamoyan authored Mar 15, 2024
1 parent b6585cc commit c7ada75
Show file tree
Hide file tree
Showing 14 changed files with 88 additions and 265 deletions.
3 changes: 3 additions & 0 deletions eng/liveBuilds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@
IsNative="" />
<ExcludeNativeLibrariesRuntimeFiles Condition="'$(IncludeOOBLibraries)' != 'true'"
Include="$(LibrariesNativeArtifactsPath)libSystem.IO.Ports.Native.*" />

<ExcludeNativeLibrariesRuntimeFiles Condition="'$(RuntimeFlavor)' != 'Mono'"
Include="$(LibrariesNativeArtifactsPath)System.Globalization.Native.dll;$(LibrariesNativeArtifactsPath)System.Globalization.Native.so;$(LibrariesNativeArtifactsPath)System.Globalization.Native.dylib" />
<LibrariesRuntimeFiles Include="
$(LibrariesNativeArtifactsPath)*.dat;
$(LibrariesNativeArtifactsPath)*.dll;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
<PlatformManifestFileEntry Include="msquic.dll" IsNative="true" FallbackFileVersion="$(MsQuicFileVersion)" />
<PlatformManifestFileEntry Include="libmsquic.dylib" IsNative="true" FallbackFileVersion="$(MsQuicFileVersion)" Condition="'$(Configuration)' == 'Debug' or '$(LibrariesConfiguration)' == 'Debug'"/>
<PlatformManifestFileEntry Include="System.IO.Compression.Native.dll" IsNative="true" />
<PlatformManifestFileEntry Include="System.Globalization.Native.dll" IsNative="true" />
<PlatformManifestFileEntry Include="createdump.exe" IsNative="true" />
<PlatformManifestFileEntry Include="createdump" IsNative="true" />
<PlatformManifestFileEntry Include="libcoreclrtraceptprovider.so" IsNative="true" />
Expand Down
8 changes: 5 additions & 3 deletions src/libraries/native-binplace.proj
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
<!-- Ordering matters! Overriding GetBinPlaceItems and Build targets after the Sdk import. -->
<Target Name="GetBinPlaceItems">
<ItemGroup>
<BinPlaceItem Include="$(NativeBinDir)*.dll" />
<ExcludeNativeLibrariesRuntimeFiles Condition="'$(RuntimeFlavor)' != 'Mono'"
Include="$(NativeBinDir)System.Globalization.Native.dll;$(NativeBinDir)System.Globalization.Native.so;$(NativeBinDir)System.Globalization.Native.dylib" />
<BinPlaceItem Include="$(NativeBinDir)*.dll" Exclude="@(ExcludeNativeLibrariesRuntimeFiles)" />
<BinPlaceItem Include="$(NativeBinDir)*.pdb" />
<BinPlaceItem Include="$(NativeBinDir)*.lib" />
<BinPlaceItem Include="$(NativeBinDir)*.a" />
<BinPlaceItem Include="$(NativeBinDir)*.bc" />
<BinPlaceItem Include="$(NativeBinDir)*.so" />
<BinPlaceItem Include="$(NativeBinDir)*.so" Exclude="@(ExcludeNativeLibrariesRuntimeFiles)" />
<BinPlaceItem Include="$(NativeBinDir)*.dbg" />
<BinPlaceItem Include="$(NativeBinDir)*.dylib" />
<BinPlaceItem Include="$(NativeBinDir)*.dylib" Exclude="@(ExcludeNativeLibrariesRuntimeFiles)" />
<BinPlaceItem Include="$(NativeBinDir)*.dwarf" />
<BinPlaceItem Include="$(NativeBinDir)*.dex" />
<BinPlaceItem Include="$(NativeBinDir)*.jar" />
Expand Down
76 changes: 0 additions & 76 deletions src/mono/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ endif()

if(NOT AOT_TARGET_TRIPLE STREQUAL "")
set(MONO_CROSS_COMPILE 1)
add_definitions(-DNO_GLOBALIZATION_SHIM)
if(NOT AOT_OFFSETS_FILE STREQUAL "")
set(MONO_OFFSETS_FILE "${AOT_OFFSETS_FILE}")
endif()
Expand Down Expand Up @@ -241,7 +240,6 @@ elseif(CLR_CMAKE_HOST_OS STREQUAL "android")
# FIXME: Rest of the flags from configure.ac
elseif(CLR_CMAKE_HOST_OS STREQUAL "emscripten")
set(HOST_BROWSER 1)
add_definitions(-DNO_GLOBALIZATION_SHIM)
add_definitions(-D_THREAD_SAFE)
add_compile_options(-Wno-strict-prototypes)
add_compile_options(-Wno-unused-but-set-variable)
Expand All @@ -255,7 +253,6 @@ elseif(CLR_CMAKE_HOST_OS STREQUAL "emscripten")
elseif(CLR_CMAKE_HOST_OS STREQUAL "wasi")
set(HOST_WASI 1)
add_definitions(-D_WASI_EMULATED_PROCESS_CLOCKS -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_MMAN -DHOST_WASI)
add_definitions(-DNO_GLOBALIZATION_SHIM)
add_definitions(-D_THREAD_SAFE)
add_definitions(-DDISABLE_SOCKET_TRANSPORT)
add_definitions(-DDISABLE_EGD_SOCKET)
Expand Down Expand Up @@ -711,79 +708,6 @@ if(LLVM_PREFIX)
add_definitions(-DLLVM_API_VERSION=${llvm_api_version})
endif()

######################################
# ICU CHECKS
######################################
if(HOST_OSX OR HOST_MACCAT OR HOST_IOS OR HOST_TVOS)
# FIXME: Handle errors
execute_process(COMMAND brew --prefix OUTPUT_VARIABLE brew_prefix OUTPUT_STRIP_TRAILING_WHITESPACE)

if((HOST_MACCAT OR HOST_IOS OR HOST_TVOS) AND "${CMAKE_SHARED_LINKER_FLAGS}" MATCHES "${brew_prefix}/opt/icu4c/lib")
message(FATAL_ERROR "Linker flags contain the Homebrew version of ICU which conflicts with the iOS/tvOS/MacCatalyst version: ${CMAKE_SHARED_LINKER_FLAGS}")
endif()
endif()

set(ICU_SHIM_PATH "${CLR_SRC_NATIVE_DIR}/libs/System.Globalization.Native")
if(MONO_CROSS_COMPILE)
elseif(HOST_OSX AND NOT HOST_MACCAT)
include(FindPkgConfig)
set(ENV{PKG_CONFIG_PATH} "{$PKG_CONFIG_PATH}:${brew_prefix}/lib/pkgconfig:${brew_prefix}/opt/icu4c/lib/pkgconfig")
# Defines ICU_INCLUDEDIR/ICU_LIBDIR
pkg_check_modules(ICU icu-uc)
set(OSX_ICU_LIBRARY_PATH /usr/lib/libicucore.dylib)
set(ICU_FLAGS "-DTARGET_UNIX -DU_DISABLE_RENAMING -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option -Wno-deprecated-declarations")
set(HAVE_SYS_ICU 1)
elseif(HOST_WASI)
set(ICU_FLAGS "-DPALEXPORT=\"\" -DU_DISABLE_RENAMING -DHAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS -DHAVE_SET_MAX_VARIABLE -DTARGET_UNIX -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option")
set(HAVE_SYS_ICU 1)
set(STATIC_ICU 1)
set(ICU_LIBS "icucore")
elseif(HOST_BROWSER)
set(ICU_FLAGS "-DPALEXPORT=\"\" -DU_DISABLE_RENAMING -DHAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS -DHAVE_SET_MAX_VARIABLE -DTARGET_UNIX -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option")
set(HAVE_SYS_ICU 1)
set(STATIC_ICU 1)
set(ICU_LIBS "icucore")
elseif(HOST_IOS OR HOST_TVOS OR HOST_MACCAT)
set(ICU_FLAGS "-DTARGET_UNIX -DU_DISABLE_RENAMING -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option -Wno-deprecated-declarations")
if(HOST_IOS)
string(APPEND ICU_FLAGS " -DTARGET_IOS")
elseif(HOST_TVOS)
string(APPEND ICU_FLAGS " -DTARGET_TVOS")
elseif(HOST_MACCAT)
string(APPEND ICU_FLAGS " -DTARGET_MACCATALYST")
endif()
string(APPEND ICU_FLAGS " -DAPPLE_HYBRID_GLOBALIZATION")
set(HAVE_SYS_ICU 1)
set(STATIC_ICU 1)
elseif(HOST_ANDROID)
set(ICU_FLAGS "-DPALEXPORT=\"\" -DHAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS -DHAVE_SET_MAX_VARIABLE -DTARGET_UNIX -DTARGET_ANDROID -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option")
set(HAVE_SYS_ICU 1)
elseif(HOST_LINUX)
include(FindPkgConfig)
if(CROSS_ROOTFS)
set(ENV{PKG_CONFIG_SYSROOT_DIR} "${CROSS_ROOTFS}")
endif(CROSS_ROOTFS)
pkg_check_modules(ICU icu-uc)
set(ICU_FLAGS "-DTARGET_UNIX -DU_DISABLE_RENAMING -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option -Wno-deprecated-declarations")
set(HAVE_SYS_ICU 1)
elseif(HOST_WIN32)
set(ICU_FLAGS "-DTARGET_WINDOWS -DPALEXPORT=EXTERN_C")
set(HAVE_SYS_ICU 1)
elseif(HOST_SOLARIS)
set(ICU_FLAGS "-DPALEXPORT=\"\" -DTARGET_UNIX -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option")
set(HAVE_SYS_ICU 1)
elseif(TARGET_FREEBSD)
set(ICU_FLAGS "-DTARGET_UNIX -Wno-deprecated-declarations")
set(HAVE_SYS_ICU 1)
set(ICU_INCLUDEDIR "${CROSS_ROOTFS}/usr/local/include")
set(ICU_LIBDIR "${CROSS_ROOTFS}/usr/local/lib")
elseif(HOST_HAIKU)
set(ICU_FLAGS "-DTARGET_UNIX -DU_DISABLE_RENAMING -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option -Wno-deprecated-declarations")
set(HAVE_SYS_ICU 1)
else()
message(FATAL_ERROR "Unknown host")
endif()

######################################
# GC CHECKS
######################################
Expand Down
3 changes: 0 additions & 3 deletions src/mono/cmake/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,6 @@
/* Define to 1 if you have the <unwind.h> header file. */
#cmakedefine HAVE_UNWIND_H 1

/* Use static ICU */
#cmakedefine STATIC_ICU 1

/* Use in-tree zlib */
#cmakedefine INTERNAL_ZLIB 1

Expand Down
31 changes: 0 additions & 31 deletions src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
</PropertyGroup>

<ItemGroup Condition="'$(TargetsBrowser)' == 'true' or '$(TargetsWasi)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true'">
<PackageReference Include="Microsoft.NETCore.Runtime.ICU.Transport" PrivateAssets="all" Version="$(MicrosoftNETCoreRuntimeICUTransportVersion)" GeneratePathProperty="true" />
<PackageReference Condition="'$(HostOS)' == 'windows'"
Include="Microsoft.NET.Runtime.Emscripten.3.1.34.Python.win-x64"
PrivateAssets="all"
Expand Down Expand Up @@ -297,9 +296,6 @@
<_MonoBuildEnv Condition="'$(Platform)' == 'arm64'" Include="TARGET_BUILD_ARCH=arm64" />
<_MonoBuildEnv Condition="'$(Platform)' == 'arm'" Include="TARGET_BUILD_ARCH=arm" />
<_MonoBuildEnv Condition="'$(Platform)' == 'armv6'" Include="TARGET_BUILD_ARCH=armv6" />
<_MonoBuildEnv Condition="'$(Platform)' == 'arm64'" Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/aarch64-linux-gnu/pkgconfig" />
<_MonoBuildEnv Condition="'$(Platform)' == 'arm'" Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/arm-linux-gnueabihf/pkgconfig" />
<_MonoBuildEnv Condition="'$(Platform)' == 'armv6'" Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/arm-linux-gnueabihf/pkgconfig" />
<_MonoCFLAGS Condition="'$(TargetArchitecture)' == 'armv6'" Include="-march=armv6zk" />
<_MonoCFLAGS Condition="'$(TargetArchitecture)' == 'armv6'" Include="-mcpu=arm1176jzf-s" />
<_MonoCFLAGS Condition="'$(TargetArchitecture)' == 'armv6'" Include="-mfpu=vfp" />
Expand All @@ -314,49 +310,42 @@
<ItemGroup Condition="'$(Targetsillumos)' == 'true' and '$(MonoCrossDir)' != ''">
<_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" />
<_MonoBuildEnv Include="TARGET_BUILD_ARCH=x64" />
<_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/lib/pkgconfig" />
</ItemGroup>

<!-- x64 Haiku cross build options -->
<ItemGroup Condition="'$(TargetsHaiku)' == 'true' and '$(MonoCrossDir)' != ''">
<_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" />
<_MonoBuildEnv Include="TARGET_BUILD_ARCH=x64" />
<_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/boot/system/lib/pkgconfig" />
</ItemGroup>

<!-- x64 linux cross build options -->
<ItemGroup Condition="'$(TargetsLinux)' == 'true' and '$(MonoCrossDir)' != '' and '$(TargetArchitecture)' == 'x64'">
<_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" />
<_MonoBuildEnv Include="TARGET_BUILD_ARCH=x64" />
<_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/pkgconfig" />
</ItemGroup>

<!-- x86 linux cross build options -->
<ItemGroup Condition="'$(TargetsLinux)' == 'true' and '$(MonoCrossDir)' != '' and '$(TargetArchitecture)' == 'x86'">
<_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" />
<_MonoBuildEnv Include="TARGET_BUILD_ARCH=x86" />
<_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/pkgconfig" />
</ItemGroup>

<!-- riscv64 Linux cross build options -->
<ItemGroup Condition="'$(MonoCrossDir)' != '' and '$(TargetArchitecture)' == 'riscv64'">
<_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" />
<_MonoBuildEnv Include="TARGET_BUILD_ARCH=riscv64" />
<_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/riscv64-linux-gnu/pkgconfig" />
</ItemGroup>

<!-- s390x Linux cross build options -->
<ItemGroup Condition="'$(MonoCrossDir)' != '' and '$(TargetArchitecture)' == 's390x'">
<_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" />
<_MonoBuildEnv Include="TARGET_BUILD_ARCH=s390x" />
<_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/s390x-linux-gnu/pkgconfig" />
</ItemGroup>

<!-- ppc64le Linux cross build options -->
<ItemGroup Condition="'$(MonoCrossDir)' != '' and '$(TargetArchitecture)' == 'ppc64le'">
<_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" />
<_MonoBuildEnv Include="TARGET_BUILD_ARCH=ppc64le" />
<_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/powerpc64le-linux-gnu/pkgconfig" />
</ItemGroup>

<!-- x64 FreeBSD cross build options -->
Expand Down Expand Up @@ -443,9 +432,6 @@
<ItemGroup Condition="'$(TargetsBrowser)' == 'true'">
<_MonoCMakeArgs Include="-DENABLE_LLVM_RUNTIME=1"/>
<_MonoCMakeArgs Include="-DEMSCRIPTEN_SYSTEM_PROCESSOR=wasm"/>
<_MonoCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="$(EscapedQuoteW)-I$([MSBuild]::NormalizePath('$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)', 'runtimes', 'browser-wasm-threads', 'native', 'include'))$(EscapedQuoteW)"/>

<_MonoCFLAGS Condition="'$(WasmEnableThreads)' != 'true'" Include="$(EscapedQuoteW)-I$([MSBuild]::NormalizePath('$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)', 'runtimes', 'browser-wasm', 'native', 'include'))$(EscapedQuoteW)"/>
</ItemGroup>
<!-- WASI specific options -->
<ItemGroup Condition="'$(TargetsWasi)' == 'true'">
Expand All @@ -460,8 +446,6 @@
<_MonoCFLAGS Include="-D_WASI_EMULATED_PROCESS_CLOCKS"/>
<_MonoCFLAGS Include="-D_WASI_EMULATED_SIGNAL"/>
<_MonoCFLAGS Include="-D_WASI_EMULATED_MMAN"/>
<_MonoCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="$(EscapedQuoteW)-I$([MSBuild]::NormalizePath('$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)', 'runtimes', 'wasi-wasm-threads', 'native', 'include').Replace('\','/'))$(EscapedQuoteW)"/>
<_MonoCFLAGS Condition="'$(WasmEnableThreads)' != 'true'" Include="$(EscapedQuoteW)-I$([MSBuild]::NormalizePath('$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)', 'runtimes', 'wasi-wasm', 'native', 'include').Replace('\','/'))$(EscapedQuoteW)"/>
</ItemGroup>

<!-- iOS/tvOS specific options -->
Expand Down Expand Up @@ -832,21 +816,6 @@
<_MonoAotBuildEnv Include="TARGET_BUILD_ARCH=$(AotHostArchitecture)" />
</ItemGroup>

<!-- x64 Linux cross build options -->
<ItemGroup Condition="'$(AotHostArchitecture)' == 'x64' and '$(AotHostOS)' == 'linux'">
<_MonoAotBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/x86_64-linux-gnu/pkgconfig" />
</ItemGroup>

<!-- ARM Linux cross build options on CI -->
<ItemGroup Condition="'$(AotHostArchitecture)' == 'arm64' and '$(AotHostOS)' == 'linux'">
<_MonoAotBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/aarch64-linux-gnu/pkgconfig" />
</ItemGroup>

<!-- ARM Linux cross build options on CI -->
<ItemGroup Condition="'$(AotHostOS)' == 'linux-musl'">
<_MonoAotBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/pkgconfig" />
</ItemGroup>

<PropertyGroup>
<_MonoAOTCFLAGSOption>-DCMAKE_C_FLAGS=&quot;@(_MonoAOTCPPFLAGS, ' ') @(_MonoAOTCFLAGS, ' ')&quot;</_MonoAOTCFLAGSOption>
<_MonoAOTCXXFLAGSOption>-DCMAKE_CXX_FLAGS=&quot;@(_MonoAOTCPPFLAGS, ' ') @(_MonoAOTCXXFLAGS, ' ')&quot;</_MonoAOTCXXFLAGSOption>
Expand Down
8 changes: 1 addition & 7 deletions src/mono/mono/eventpipe/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,7 @@ if(ENABLE_PERFTRACING)
set(CMAKE_SKIP_RPATH 1)
add_executable(ep-test ${EVENTPIPE_TEST_SOURCES} ${EVENTPIPE_TEST_HEADERS})
target_sources(ep-test PRIVATE "${mono-components-objects}")
target_link_libraries(ep-test PRIVATE eglib_api monosgen-static ${OS_LIBS} ${LLVM_LIBS} ${ICU_LIBS} ${Z_LIBS} monoapi)
if(HAVE_SYS_ICU)
target_link_libraries(ep-test PRIVATE icu_shim_objects)
endif()
if(ICU_LDFLAGS)
set_target_properties(ep-test PROPERTIES LINK_FLAGS ${ICU_LDFLAGS})
endif()
target_link_libraries(ep-test PRIVATE eglib_api monosgen-static ${OS_LIBS} ${LLVM_LIBS} ${Z_LIBS} monoapi)
install_with_stripped_symbols(ep-test TARGETS bin)
else(ENABLE_EVENTPIPE_TEST AND STATIC_COMPONENTS AND (NOT DISABLE_COMPONENTS) AND (NOT DISABLE_LIBS) AND (NOT DISABLE_EXECUTABLES))
message(VERBOSE "Skip building native EventPipe library test runner.")
Expand Down
30 changes: 0 additions & 30 deletions src/mono/mono/metadata/native-library.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ static GHashTable *native_library_module_map;
*/
static GHashTable *native_library_module_blocklist;

#ifndef NO_GLOBALIZATION_SHIM
extern const void *GlobalizationResolveDllImport (const char *name);
#endif

static GHashTable *global_module_map; // should only be accessed with the global loader data lock

static MonoDl *internal_module; // used when pinvoking `__Internal`
Expand Down Expand Up @@ -786,26 +782,6 @@ get_dllimportsearchpath_flags (MonoCustomAttrInfo *cinfo)
return flags;
}

#ifndef NO_GLOBALIZATION_SHIM
#ifdef HOST_WIN32
#define GLOBALIZATION_DLL_NAME "System.Globalization.Native"
#else
#define GLOBALIZATION_DLL_NAME "libSystem.Globalization.Native"
#endif

static gpointer
default_resolve_dllimport (const char *dll, const char *func)
{
if (strcmp (dll, GLOBALIZATION_DLL_NAME) == 0) {
const void *method_impl = GlobalizationResolveDllImport (func);
if (method_impl)
return (gpointer)method_impl;
}

return NULL;
}
#endif // NO_GLOBALIZATION_SHIM

gpointer
lookup_pinvoke_call_impl (MonoMethod *method, MonoLookupPInvokeStatus *status_out)
{
Expand Down Expand Up @@ -881,12 +857,6 @@ lookup_pinvoke_call_impl (MonoMethod *method, MonoLookupPInvokeStatus *status_ou
}
#endif

#ifndef NO_GLOBALIZATION_SHIM
addr = default_resolve_dllimport (new_scope, new_import);
if (addr)
goto exit;
#endif

if (pinvoke_override) {
addr = pinvoke_override (new_scope, new_import);
if (addr)
Expand Down
Loading

0 comments on commit c7ada75

Please sign in to comment.