From a7b756179a7ea61ed1c0cb2c2438b72ce40d9350 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Thu, 15 Feb 2024 15:33:03 +0100 Subject: [PATCH 01/43] Move out globalization code from runtime --- src/mono/CMakeLists.txt | 73 ------------------------- src/mono/mono.proj | 25 --------- src/mono/mono/metadata/native-library.c | 30 ---------- src/mono/mono/mini/CMakeLists.txt | 72 ------------------------ 4 files changed, 200 deletions(-) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index 00f883aca07e4..e7db5576d3e5c 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -710,79 +710,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 ###################################### diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 3b0ade6bd89cc..5bee7d724ad79 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -297,9 +297,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" /> @@ -314,49 +311,42 @@ <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x64" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/lib/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x64" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/boot/system/lib/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x64" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x86" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=riscv64" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/riscv64-linux-gnu/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=s390x" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/s390x-linux-gnu/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=ppc64le" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/powerpc64le-linux-gnu/pkgconfig" /> @@ -834,21 +824,6 @@ <_MonoAotBuildEnv Include="TARGET_BUILD_ARCH=$(AotHostArchitecture)" /> - - - <_MonoAotBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/x86_64-linux-gnu/pkgconfig" /> - - - - - <_MonoAotBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/aarch64-linux-gnu/pkgconfig" /> - - - - - <_MonoAotBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/pkgconfig" /> - - <_MonoAOTCFLAGSOption>-DCMAKE_C_FLAGS="@(_MonoAOTCPPFLAGS, ' ') @(_MonoAOTCFLAGS, ' ')" <_MonoAOTCXXFLAGSOption>-DCMAKE_CXX_FLAGS="@(_MonoAOTCPPFLAGS, ' ') @(_MonoAOTCXXFLAGS, ' ')" diff --git a/src/mono/mono/metadata/native-library.c b/src/mono/mono/metadata/native-library.c index 6692736251330..f26ab2e9152af 100644 --- a/src/mono/mono/metadata/native-library.c +++ b/src/mono/mono/metadata/native-library.c @@ -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` @@ -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) { @@ -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) diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index 5e6ebe9ce49dc..335867bac8eff 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -45,78 +45,6 @@ if(HOST_WIN32) add_link_options(/OPT:NOICF) endif() -# ICU -if(HAVE_SYS_ICU) - if(STATIC_ICU) - set(pal_icushim_sources_base - pal_icushim_static.c) - add_definitions(-DSTATIC_ICU=1) - else() - set(pal_icushim_sources_base - pal_icushim.c) - endif() - - set(icu_shim_sources_base - pal_idna.c - pal_common.c - entrypoints.c - ${pal_icushim_sources_base}) - -if (NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS) - set(icu_shim_sources_base - ${icu_shim_sources_base} - pal_calendarData.c - pal_casing.c - pal_collation.c - pal_locale.c - pal_localeNumberData.c - pal_localeStringData.c - pal_normalization.c - pal_timeZoneInfo.c - ) -endif() - -if (CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) - set(icu_shim_sources_base - ${icu_shim_sources_base} - pal_placeholders.c - ) -endif() - - addprefix(icu_shim_sources "${ICU_SHIM_PATH}" "${icu_shim_sources_base}") - - if (TARGET_DARWIN) - set(icu_shim_darwin_sources_base - pal_locale.m - pal_collation.m - pal_casing.m - pal_calendarData.m - pal_normalization.m - pal_timeZoneInfo.m) - - addprefix(icu_shim_darwin_sources "${ICU_SHIM_PATH}" "${icu_shim_darwin_sources_base}") - set(icu_shim_sources ${icu_shim_sources} ${icu_shim_darwin_sources}) - endif() - - set_source_files_properties(${icu_shim_sources} PROPERTIES COMPILE_DEFINITIONS OSX_ICU_LIBRARY_PATH="${OSX_ICU_LIBRARY_PATH}") - set_source_files_properties(${icu_shim_sources} PROPERTIES COMPILE_FLAGS "-I\"${ICU_INCLUDEDIR}\" -I\"${CLR_SRC_NATIVE_DIR}/libs/System.Globalization.Native/\" -I\"${CLR_SRC_NATIVE_DIR}/libs/Common/\" ${ICU_FLAGS}") - if(TARGET_DARWIN) - set_property(SOURCE ${icu_shim_darwin_sources} APPEND_STRING PROPERTY COMPILE_FLAGS " -fobjc-arc ${CLR_CMAKE_COMMON_OBJC_FLAGS}") - endif() - if(TARGET_WIN32) - set_source_files_properties(${icu_shim_sources} PROPERTIES LANGUAGE CXX) - endif() - if(ICU_LIBDIR) - set(ICU_LDFLAGS "-L${ICU_LIBDIR}") - endif() - if(CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) - set(ICU_LDFLAGS "-licucore") - endif() - - add_library(icu_shim_objects OBJECT "${icu_shim_sources}") - set(HAVE_ICU_SHIM 1) -endif() - # # MINI # From 2bc47daa65b32a18da9f830b35aab4243e4a4ed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Thu, 22 Feb 2024 17:12:44 +0100 Subject: [PATCH 02/43] Remove last traces of icu code from the runtime --- src/mono/cmake/config.h.in | 3 --- src/mono/mono.proj | 6 ------ src/mono/mono/mini/CMakeLists.txt | 6 ------ 3 files changed, 15 deletions(-) diff --git a/src/mono/cmake/config.h.in b/src/mono/cmake/config.h.in index e484a802aed9b..7fc03a4fd25a9 100644 --- a/src/mono/cmake/config.h.in +++ b/src/mono/cmake/config.h.in @@ -183,9 +183,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_UNWIND_H 1 -/* Use static ICU */ -#cmakedefine STATIC_ICU 1 - /* Use in-tree zlib */ #cmakedefine INTERNAL_ZLIB 1 diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 5bee7d724ad79..a5e78693d2fa2 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -80,7 +80,6 @@ - <_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)"/> @@ -451,8 +447,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)"/> diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index 335867bac8eff..12d1ff859d06b 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -379,9 +379,6 @@ if(NOT DISABLE_SHARED_LIBS) if(ICU_LDFLAGS) set_property(TARGET monosgen-shared APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}") endif() - if(NOT TARGET_WASM AND STATIC_ICU) - set_property(TARGET monosgen-shared APPEND_STRING PROPERTY LINKER_LANGUAGE CXX) - endif () if(TARGET_DARWIN) set_property(TARGET monosgen-shared APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-compatibility_version -Wl,2.0 -Wl,-current_version -Wl,2.0") endif() @@ -434,9 +431,6 @@ if(NOT DISABLE_SHARED_LIBS) if(ICU_LDFLAGS) set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}") endif() - if(STATIC_ICU) - set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINKER_LANGUAGE CXX) - endif () set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-compatibility_version -Wl,2.0 -Wl,-current_version -Wl,2.0") string(REPLACE "*" ";" componentsobjects-whitespace "${componentsobjects}") target_sources(${frameworkconfig} PRIVATE "${componentsobjects-whitespace}") From 13bbd3903d024e3114181068baa0dc97207e591d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Thu, 22 Feb 2024 17:27:12 +0100 Subject: [PATCH 03/43] Remove a few more icu-related logic --- src/mono/CMakeLists.txt | 3 --- src/mono/mono/eventpipe/test/CMakeLists.txt | 8 +------ src/mono/mono/mini/CMakeLists.txt | 26 ++++----------------- 3 files changed, 5 insertions(+), 32 deletions(-) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index e7db5576d3e5c..b1ee21c3adf12 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -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() @@ -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) @@ -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) diff --git a/src/mono/mono/eventpipe/test/CMakeLists.txt b/src/mono/mono/eventpipe/test/CMakeLists.txt index d867685fb2da7..d313e630adaab 100644 --- a/src/mono/mono/eventpipe/test/CMakeLists.txt +++ b/src/mono/mono/eventpipe/test/CMakeLists.txt @@ -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.") diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index 12d1ff859d06b..e81afefecfc23 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -1,6 +1,6 @@ project(mini C) -if(ENABLE_LLVM OR ENABLE_LLVM_RUNTIME OR HOST_BROWSER OR (HAVE_SYS_ICU AND NOT HOST_WASI)) +if(ENABLE_LLVM OR ENABLE_LLVM_RUNTIME OR HOST_BROWSER) enable_language(CXX) endif() @@ -362,9 +362,6 @@ if(NOT DISABLE_SHARED_LIBS) else() target_link_libraries(monosgen-shared PRIVATE monoapi eglib_objects utils_objects sgen_objects metadata_objects) endif() - if(HAVE_ICU_SHIM) - target_link_libraries(monosgen-shared PRIVATE icu_shim_objects) - endif() target_include_directories (monosgen-shared PRIVATE monoapi) if(TARGET_WIN32) # on Windows the import library for the shared mono library will have the same name as the static library, @@ -374,10 +371,7 @@ if(NOT DISABLE_SHARED_LIBS) if(CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) target_link_libraries(monosgen-shared PRIVATE ${OS_LIBS} ${LLVM_LIBS} ${Z_LIBS}) else() - target_link_libraries(monosgen-shared PRIVATE ${OS_LIBS} ${LLVM_LIBS} ${ICU_LIBS} ${Z_LIBS}) - endif() - if(ICU_LDFLAGS) - set_property(TARGET monosgen-shared APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}") + target_link_libraries(monosgen-shared PRIVATE ${OS_LIBS} ${LLVM_LIBS} ${Z_LIBS}) endif() if(TARGET_DARWIN) set_property(TARGET monosgen-shared APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-compatibility_version -Wl,2.0 -Wl,-current_version -Wl,2.0") @@ -423,14 +417,8 @@ if(NOT DISABLE_SHARED_LIBS) add_library(${frameworkconfig} SHARED $) target_compile_definitions(${frameworkconfig} PRIVATE -DMONO_DLL_EXPORT) target_link_libraries(${frameworkconfig} PRIVATE monoapi eglib_objects utils_objects sgen_objects metadata_objects) - if(HAVE_ICU_SHIM) - target_link_libraries(${frameworkconfig} PRIVATE icu_shim_objects) - endif() - target_link_libraries(${frameworkconfig} PRIVATE ${OS_LIBS} ${LLVM_LIBS} ${ICU_LIBS} ${Z_LIBS}) + target_link_libraries(${frameworkconfig} PRIVATE ${OS_LIBS} ${LLVM_LIBS} ${Z_LIBS}) - if(ICU_LDFLAGS) - set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}") - endif() set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-compatibility_version -Wl,2.0 -Wl,-current_version -Wl,2.0") string(REPLACE "*" ";" componentsobjects-whitespace "${componentsobjects}") target_sources(${frameworkconfig} PRIVATE "${componentsobjects-whitespace}") @@ -549,10 +537,7 @@ if(NOT DISABLE_EXECUTABLES) if (HOST_WASM) target_link_libraries(mono-sgen PRIVATE mono-wasm-nosimd) endif() - if(HAVE_ICU_SHIM) - target_link_libraries(mono-sgen PRIVATE icu_shim_objects) - endif() - target_link_libraries(mono-sgen PRIVATE ${OS_LIBS} ${LLVM_LIBS} ${ICU_LIBS} ${Z_LIBS}) + target_link_libraries(mono-sgen PRIVATE ${OS_LIBS} ${LLVM_LIBS} ${Z_LIBS}) # musl-libc implements ucontext in a different library on s390x if(CLR_CMAKE_TARGET_LINUX_MUSL AND TARGET_S390X) target_link_libraries(mono-sgen PRIVATE ucontext) @@ -571,9 +556,6 @@ if(NOT DISABLE_EXECUTABLES) # if components are disabled, link the fallback stubs into the runtime # fallback stubs already provided in monosgen-static when components are disabled endif() - if(ICU_LDFLAGS) - set_property(TARGET mono-sgen APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}") - endif() if(CMAKE_BUILD_TYPE STREQUAL "Debug") target_sources(mono-sgen PRIVATE ${mono_validate_apis_source}) From 7c018d908603f3c7b9a922ef28b7deed13e4fcc6 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Mon, 26 Feb 2024 10:26:17 +0100 Subject: [PATCH 04/43] revert back _MonoCFlags for wasm --- src/mono/mono.proj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index a5e78693d2fa2..82b7f698a7088 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -433,6 +433,8 @@ <_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)"/> From 89eb51f68b8b0cceba395873487ef8bb5a8265be Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Mon, 26 Feb 2024 11:41:53 +0100 Subject: [PATCH 05/43] remove icu related code --- src/mono/mono.proj | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 82b7f698a7088..a5e78693d2fa2 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -433,8 +433,6 @@ <_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)"/> From c910d58780c3172643938400b666eef25fb00fee Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Wed, 28 Feb 2024 14:30:23 +0100 Subject: [PATCH 06/43] Check on ci if test are passing --- src/mono/mono.proj | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index a5e78693d2fa2..b4df96ad8749d 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -296,6 +296,9 @@ <_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" /> @@ -310,42 +313,49 @@ <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x64" /> + <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/lib/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x64" /> + <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/boot/system/lib/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x64" /> + <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x86" /> + <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=riscv64" /> + <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/riscv64-linux-gnu/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=s390x" /> + <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/s390x-linux-gnu/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=ppc64le" /> + <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/powerpc64le-linux-gnu/pkgconfig" /> @@ -818,6 +828,21 @@ <_MonoAotBuildEnv Include="TARGET_BUILD_ARCH=$(AotHostArchitecture)" /> + + + <_MonoAotBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/x86_64-linux-gnu/pkgconfig" /> + + + + + <_MonoAotBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/aarch64-linux-gnu/pkgconfig" /> + + + + + <_MonoAotBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/pkgconfig" /> + + <_MonoAOTCFLAGSOption>-DCMAKE_C_FLAGS="@(_MonoAOTCPPFLAGS, ' ') @(_MonoAOTCFLAGS, ' ')" <_MonoAOTCXXFLAGSOption>-DCMAKE_CXX_FLAGS="@(_MonoAOTCPPFLAGS, ' ') @(_MonoAOTCXXFLAGS, ' ')" From 1eb30955668188f7d745746dc9929591ebf071c3 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Wed, 28 Feb 2024 16:40:26 +0100 Subject: [PATCH 07/43] add definitions --- src/native/libs/System.Globalization.Native/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 1959fec40a7cf..bc8a5ac9a334f 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -74,6 +74,11 @@ if (NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CM ) endif() +if(HOST_WIN32 || CLR_CMAKE_TARGET_WIN32) +add_definitions(-DTARGET_WINDOWS) +add_definitions(-DPALEXPORT=EXTERN_C) +endif() + if (CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) add_definitions(-DAPPLE_HYBRID_GLOBALIZATION) set(NATIVEGLOBALIZATION_SOURCES From c628787ba635c229ac6e7b79026dc13e27986b59 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Wed, 28 Feb 2024 17:58:00 +0100 Subject: [PATCH 08/43] test --- src/native/libs/System.Globalization.Native/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index bc8a5ac9a334f..cb686bca7feb7 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -74,7 +74,7 @@ if (NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CM ) endif() -if(HOST_WIN32 || CLR_CMAKE_TARGET_WIN32) +if(CLR_CMAKE_TARGET_WIN32) add_definitions(-DTARGET_WINDOWS) add_definitions(-DPALEXPORT=EXTERN_C) endif() From 4d673624778b1bc172aa3962f224fbbb8a3d7390 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Thu, 29 Feb 2024 14:49:19 +0100 Subject: [PATCH 09/43] remove globalization dlls from comparison --- src/tests/Common/scripts/crossgen2_comparison.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/tests/Common/scripts/crossgen2_comparison.py b/src/tests/Common/scripts/crossgen2_comparison.py index 65b0e062726a0..5ebe802ea927e 100644 --- a/src/tests/Common/scripts/crossgen2_comparison.py +++ b/src/tests/Common/scripts/crossgen2_comparison.py @@ -356,9 +356,6 @@ def run_to_completion(self, async_callback, *extra_args): 'System.Dynamic.Runtime.dll', 'System.Formats.Asn1.dll', 'System.Formats.Cbor.dll', - 'System.Globalization.Calendars.dll', - 'System.Globalization.dll', - 'System.Globalization.Extensions.dll', 'System.IO.Compression.Brotli.dll', 'System.IO.Compression.dll', 'System.IO.Compression.FileSystem.dll', From d898a4aead7999fabedf7f03024cd8bcbc29d955 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Fri, 1 Mar 2024 10:49:59 +0100 Subject: [PATCH 10/43] test --- .../CMakeLists.txt | 33 ++++++++----------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index cb686bca7feb7..b4d73150c2607 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -74,11 +74,6 @@ if (NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CM ) endif() -if(CLR_CMAKE_TARGET_WIN32) -add_definitions(-DTARGET_WINDOWS) -add_definitions(-DPALEXPORT=EXTERN_C) -endif() - if (CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) add_definitions(-DAPPLE_HYBRID_GLOBALIZATION) set(NATIVEGLOBALIZATION_SOURCES @@ -188,21 +183,19 @@ if(NOT CLR_CMAKE_TARGET_APPLE AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE endif() if(CLR_CMAKE_TARGET_WIN32) - if(STATIC_LIBS_ONLY) - add_library(System.Globalization.Native.Aot - STATIC - ${NATIVEGLOBALIZATION_SOURCES} - ) - set_target_properties(System.Globalization.Native.Aot PROPERTIES CLR_CONTROL_FLOW_GUARD OFF) - set_target_properties(System.Globalization.Native.Aot PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF) + add_library(System.Globalization.Native.Aot + SHARED + ${NATIVEGLOBALIZATION_SOURCES} + ) + set_target_properties(System.Globalization.Native.Aot PROPERTIES CLR_CONTROL_FLOW_GUARD OFF) + set_target_properties(System.Globalization.Native.Aot PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF) - add_library(System.Globalization.Native.Aot.GuardCF - STATIC - ${NATIVEGLOBALIZATION_SOURCES} - ) - set_target_properties(System.Globalization.Native.Aot.GuardCF PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF) + add_library(System.Globalization.Native.Aot.GuardCF + SHARED + ${NATIVEGLOBALIZATION_SOURCES} + ) + set_target_properties(System.Globalization.Native.Aot.GuardCF PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF) - install_static_library(System.Globalization.Native.Aot aotsdk nativeaot) - install_static_library(System.Globalization.Native.Aot.GuardCF aotsdk nativeaot) - endif() + install_static_library(System.Globalization.Native.Aot aotsdk nativeaot) + install_static_library(System.Globalization.Native.Aot.GuardCF aotsdk nativeaot) endif() From 138b22b96da224d7be36b7bd25e35f326b693581 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Fri, 1 Mar 2024 12:03:58 +0100 Subject: [PATCH 11/43] test --- src/native/libs/CMakeLists.txt | 4 +-- .../CMakeLists.txt | 28 ++++++++++--------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index 79b92e33da29e..7308c56df8d6a 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -11,7 +11,7 @@ include_directories(${CLR_SRC_NATIVE_DIR}) set(CMAKE_INCLUDE_CURRENT_DIR ON) -if (STATIC_LIBS_ONLY) +if (STATIC_LIBS_ONLY OR "${RuntimeFlavor}" STREQUAL "mono") # Suppress exporting of the PAL APIs add_definitions(-DPALEXPORT=EXTERN_C) @@ -99,7 +99,7 @@ else () set(CMAKE_SHARED_LIBRARY_PREFIX "") # we only need to build System.Globalization.Native when building static libs. - if (STATIC_LIBS_ONLY) + if (STATIC_LIBS_ONLY OR "${RuntimeFlavor}" STREQUAL "mono") add_subdirectory(System.Globalization.Native) endif () endif () diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index b4d73150c2607..55703e0e4caab 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -183,19 +183,21 @@ if(NOT CLR_CMAKE_TARGET_APPLE AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE endif() if(CLR_CMAKE_TARGET_WIN32) - add_library(System.Globalization.Native.Aot - SHARED - ${NATIVEGLOBALIZATION_SOURCES} - ) - set_target_properties(System.Globalization.Native.Aot PROPERTIES CLR_CONTROL_FLOW_GUARD OFF) - set_target_properties(System.Globalization.Native.Aot PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF) + if(STATIC_LIBS_ONLY OR "${RuntimeFlavor}" STREQUAL "mono") + add_library(System.Globalization.Native.Aot + STATIC + ${NATIVEGLOBALIZATION_SOURCES} + ) + set_target_properties(System.Globalization.Native.Aot PROPERTIES CLR_CONTROL_FLOW_GUARD OFF) + set_target_properties(System.Globalization.Native.Aot PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF) - add_library(System.Globalization.Native.Aot.GuardCF - SHARED - ${NATIVEGLOBALIZATION_SOURCES} - ) - set_target_properties(System.Globalization.Native.Aot.GuardCF PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF) + add_library(System.Globalization.Native.Aot.GuardCF + STATIC + ${NATIVEGLOBALIZATION_SOURCES} + ) + set_target_properties(System.Globalization.Native.Aot.GuardCF PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF) - install_static_library(System.Globalization.Native.Aot aotsdk nativeaot) - install_static_library(System.Globalization.Native.Aot.GuardCF aotsdk nativeaot) + install_static_library(System.Globalization.Native.Aot aotsdk nativeaot) + install_static_library(System.Globalization.Native.Aot.GuardCF aotsdk nativeaot) + endif() endif() From 3b726c6c43e179cb301415b3fd9690105e6c1cde Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Fri, 1 Mar 2024 15:49:43 +0100 Subject: [PATCH 12/43] test --- src/native/libs/CMakeLists.txt | 8 ++------ .../libs/System.Globalization.Native/CMakeLists.txt | 3 +-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index 7308c56df8d6a..cba0ce782610e 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -11,7 +11,7 @@ include_directories(${CLR_SRC_NATIVE_DIR}) set(CMAKE_INCLUDE_CURRENT_DIR ON) -if (STATIC_LIBS_ONLY OR "${RuntimeFlavor}" STREQUAL "mono") +if (STATIC_LIBS_ONLY) # Suppress exporting of the PAL APIs add_definitions(-DPALEXPORT=EXTERN_C) @@ -97,11 +97,7 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) endif () else () set(CMAKE_SHARED_LIBRARY_PREFIX "") - - # we only need to build System.Globalization.Native when building static libs. - if (STATIC_LIBS_ONLY OR "${RuntimeFlavor}" STREQUAL "mono") - add_subdirectory(System.Globalization.Native) - endif () + add_subdirectory(System.Globalization.Native) endif () add_subdirectory(System.IO.Compression.Native) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 55703e0e4caab..eb413a30701e6 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -113,7 +113,6 @@ elseif (CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET else() set(NATIVEGLOBALIZATION_SOURCES ${NATIVEGLOBALIZATION_SOURCES} pal_icushim.c) endif() - if (CLR_CMAKE_TARGET_APPLE) set(NATIVEGLOBALIZATION_SOURCES_OBJC pal_locale.m @@ -183,7 +182,7 @@ if(NOT CLR_CMAKE_TARGET_APPLE AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE endif() if(CLR_CMAKE_TARGET_WIN32) - if(STATIC_LIBS_ONLY OR "${RuntimeFlavor}" STREQUAL "mono") + if(STATIC_LIBS_ONLY) add_library(System.Globalization.Native.Aot STATIC ${NATIVEGLOBALIZATION_SOURCES} From 496bdf51f49ab47cefb7ac0f59c328662b483bb8 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Fri, 1 Mar 2024 15:59:02 +0100 Subject: [PATCH 13/43] test --- src/native/libs/System.Globalization.Native/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index eb413a30701e6..90f093f422cc1 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -61,6 +61,7 @@ set(NATIVEGLOBALIZATION_SOURCES pal_idna.c pal_common.c ) + if (NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS) set(NATIVEGLOBALIZATION_SOURCES ${NATIVEGLOBALIZATION_SOURCES} From 03d1a2926c10269d2f6f776addcc2dfa28197c51 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Fri, 1 Mar 2024 16:02:14 +0100 Subject: [PATCH 14/43] remove more not used code --- src/mono/mono.proj | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index b4df96ad8749d..6abcc2c71a863 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -296,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" /> @@ -313,49 +310,42 @@ <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x64" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/lib/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x64" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/boot/system/lib/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x64" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x86" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=riscv64" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/riscv64-linux-gnu/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=s390x" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/s390x-linux-gnu/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=ppc64le" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/powerpc64le-linux-gnu/pkgconfig" /> @@ -827,21 +817,6 @@ <_MonoAotBuildEnv Include="TARGET_BUILD_ARCH=$(AotHostArchitecture)" /> - - - - <_MonoAotBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/x86_64-linux-gnu/pkgconfig" /> - - - - - <_MonoAotBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/aarch64-linux-gnu/pkgconfig" /> - - - - - <_MonoAotBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/pkgconfig" /> - <_MonoAOTCFLAGSOption>-DCMAKE_C_FLAGS="@(_MonoAOTCPPFLAGS, ' ') @(_MonoAOTCFLAGS, ' ')" From 5fd82c26d6af54eced774f20378d7c7597688aa7 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Fri, 1 Mar 2024 17:42:34 +0100 Subject: [PATCH 15/43] test --- src/native/libs/CMakeLists.txt | 7 ++++--- src/native/libs/System.Globalization.Native/CMakeLists.txt | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index cba0ce782610e..ca0493af56073 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -11,8 +11,7 @@ include_directories(${CLR_SRC_NATIVE_DIR}) set(CMAKE_INCLUDE_CURRENT_DIR ON) -if (STATIC_LIBS_ONLY) - # Suppress exporting of the PAL APIs +if(STATIC_LIBS_ONLY OR "${__RuntimeFlavor}" STREQUAL "mono" OR "${__RuntimeFlavor}" STREQUAL "") # Suppress exporting of the PAL APIs add_definitions(-DPALEXPORT=EXTERN_C) set(GEN_SHARED_LIB 0) @@ -97,7 +96,9 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) endif () else () set(CMAKE_SHARED_LIBRARY_PREFIX "") - add_subdirectory(System.Globalization.Native) + if(STATIC_LIBS_ONLY OR "${__RuntimeFlavor}" STREQUAL "mono" OR "${__RuntimeFlavor}" STREQUAL "") + add_subdirectory(System.Globalization.Native) + endif () endif () add_subdirectory(System.IO.Compression.Native) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 90f093f422cc1..3b7e26f152e80 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -183,7 +183,7 @@ if(NOT CLR_CMAKE_TARGET_APPLE AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE endif() if(CLR_CMAKE_TARGET_WIN32) - if(STATIC_LIBS_ONLY) + if(STATIC_LIBS_ONLY OR "${__RuntimeFlavor}" STREQUAL "mono" OR "${__RuntimeFlavor}" STREQUAL "") add_library(System.Globalization.Native.Aot STATIC ${NATIVEGLOBALIZATION_SOURCES} From 6f971eccd110ac3da18696f3aeae11c71fbea557 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Mon, 4 Mar 2024 08:40:00 +0100 Subject: [PATCH 16/43] test --- src/native/libs/CMakeLists.txt | 4 ++-- src/native/libs/System.Globalization.Native/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index ca0493af56073..831166946743f 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -96,9 +96,9 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) endif () else () set(CMAKE_SHARED_LIBRARY_PREFIX "") - if(STATIC_LIBS_ONLY OR "${__RuntimeFlavor}" STREQUAL "mono" OR "${__RuntimeFlavor}" STREQUAL "") + # if(STATIC_LIBS_ONLY OR "${__RuntimeFlavor}" STREQUAL "mono" OR "${__RuntimeFlavor}" STREQUAL "") add_subdirectory(System.Globalization.Native) - endif () + # endif () endif () add_subdirectory(System.IO.Compression.Native) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 3b7e26f152e80..90f093f422cc1 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -183,7 +183,7 @@ if(NOT CLR_CMAKE_TARGET_APPLE AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE endif() if(CLR_CMAKE_TARGET_WIN32) - if(STATIC_LIBS_ONLY OR "${__RuntimeFlavor}" STREQUAL "mono" OR "${__RuntimeFlavor}" STREQUAL "") + if(STATIC_LIBS_ONLY) add_library(System.Globalization.Native.Aot STATIC ${NATIVEGLOBALIZATION_SOURCES} From 9af61a90d0d513483a454ef5366ad31a3ab3e3b6 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Mon, 4 Mar 2024 09:23:08 +0100 Subject: [PATCH 17/43] test --- src/mono/CMakeLists.txt | 8 ++++++++ src/native/libs/CMakeLists.txt | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index b1ee21c3adf12..2d3d8e1e0dd03 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -707,6 +707,14 @@ if(LLVM_PREFIX) add_definitions(-DLLVM_API_VERSION=${llvm_api_version}) endif() +## + +if(NOT CLR_CROSS_COMPONENTS_BUILD) + set(STATIC_LIBS_ONLY 1) + add_subdirectory(${CLR_SRC_NATIVE_DIR}/libs libs-native) +endif(NOT CLR_CROSS_COMPONENTS_BUILD) +## + ###################################### # GC CHECKS ###################################### diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index 831166946743f..86d5a78ca5d43 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -11,7 +11,7 @@ include_directories(${CLR_SRC_NATIVE_DIR}) set(CMAKE_INCLUDE_CURRENT_DIR ON) -if(STATIC_LIBS_ONLY OR "${__RuntimeFlavor}" STREQUAL "mono" OR "${__RuntimeFlavor}" STREQUAL "") # Suppress exporting of the PAL APIs +if(STATIC_LIBS_ONLY) # Suppress exporting of the PAL APIs add_definitions(-DPALEXPORT=EXTERN_C) set(GEN_SHARED_LIB 0) @@ -96,9 +96,9 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) endif () else () set(CMAKE_SHARED_LIBRARY_PREFIX "") - # if(STATIC_LIBS_ONLY OR "${__RuntimeFlavor}" STREQUAL "mono" OR "${__RuntimeFlavor}" STREQUAL "") + if(STATIC_LIBS_ONLY) add_subdirectory(System.Globalization.Native) - # endif () + endif () endif () add_subdirectory(System.IO.Compression.Native) From 059af7ae4ce574438735433aa678d9c9942e9748 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Mon, 4 Mar 2024 09:44:33 +0100 Subject: [PATCH 18/43] test --- src/mono/CMakeLists.txt | 4 ++-- src/native/libs/CMakeLists.txt | 5 ++++- src/native/libs/System.Globalization.Native/CMakeLists.txt | 2 +- src/tests/Common/scripts/crossgen2_comparison.py | 3 +++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index 2d3d8e1e0dd03..d0c74ec13158e 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -709,10 +709,10 @@ endif() ## -if(NOT CLR_CROSS_COMPONENTS_BUILD) +if(NOT MONO_CROSS_COMPILE) set(STATIC_LIBS_ONLY 1) add_subdirectory(${CLR_SRC_NATIVE_DIR}/libs libs-native) -endif(NOT CLR_CROSS_COMPONENTS_BUILD) +endif(NOT MONO_CROSS_COMPILE) ## ###################################### diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index 86d5a78ca5d43..b0d13db9865ea 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -11,7 +11,8 @@ include_directories(${CLR_SRC_NATIVE_DIR}) set(CMAKE_INCLUDE_CURRENT_DIR ON) -if(STATIC_LIBS_ONLY) # Suppress exporting of the PAL APIs +if(STATIC_LIBS_ONLY) + # Suppress exporting of the PAL APIs add_definitions(-DPALEXPORT=EXTERN_C) set(GEN_SHARED_LIB 0) @@ -96,6 +97,8 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) endif () else () set(CMAKE_SHARED_LIBRARY_PREFIX "") + + # we only need to build System.Globalization.Native when building static libs. if(STATIC_LIBS_ONLY) add_subdirectory(System.Globalization.Native) endif () diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 90f093f422cc1..1959fec40a7cf 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -61,7 +61,6 @@ set(NATIVEGLOBALIZATION_SOURCES pal_idna.c pal_common.c ) - if (NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS) set(NATIVEGLOBALIZATION_SOURCES ${NATIVEGLOBALIZATION_SOURCES} @@ -114,6 +113,7 @@ elseif (CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET else() set(NATIVEGLOBALIZATION_SOURCES ${NATIVEGLOBALIZATION_SOURCES} pal_icushim.c) endif() + if (CLR_CMAKE_TARGET_APPLE) set(NATIVEGLOBALIZATION_SOURCES_OBJC pal_locale.m diff --git a/src/tests/Common/scripts/crossgen2_comparison.py b/src/tests/Common/scripts/crossgen2_comparison.py index 5ebe802ea927e..65b0e062726a0 100644 --- a/src/tests/Common/scripts/crossgen2_comparison.py +++ b/src/tests/Common/scripts/crossgen2_comparison.py @@ -356,6 +356,9 @@ def run_to_completion(self, async_callback, *extra_args): 'System.Dynamic.Runtime.dll', 'System.Formats.Asn1.dll', 'System.Formats.Cbor.dll', + 'System.Globalization.Calendars.dll', + 'System.Globalization.dll', + 'System.Globalization.Extensions.dll', 'System.IO.Compression.Brotli.dll', 'System.IO.Compression.dll', 'System.IO.Compression.FileSystem.dll', From 68f673f1076c2102e57d66e53da952645db5faba Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Mon, 4 Mar 2024 09:56:12 +0100 Subject: [PATCH 19/43] test --- src/mono/CMakeLists.txt | 2 +- src/native/libs/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index d0c74ec13158e..1e9ba464194e0 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -710,7 +710,7 @@ endif() ## if(NOT MONO_CROSS_COMPILE) - set(STATIC_LIBS_ONLY 1) + set(Mono 1) add_subdirectory(${CLR_SRC_NATIVE_DIR}/libs libs-native) endif(NOT MONO_CROSS_COMPILE) ## diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index b0d13db9865ea..e4b18baee700e 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -11,7 +11,7 @@ include_directories(${CLR_SRC_NATIVE_DIR}) set(CMAKE_INCLUDE_CURRENT_DIR ON) -if(STATIC_LIBS_ONLY) +if(STATIC_LIBS_ONLY OR Mono) # Suppress exporting of the PAL APIs add_definitions(-DPALEXPORT=EXTERN_C) @@ -99,7 +99,7 @@ else () set(CMAKE_SHARED_LIBRARY_PREFIX "") # we only need to build System.Globalization.Native when building static libs. - if(STATIC_LIBS_ONLY) + if(STATIC_LIBS_ONLY OR Mono) add_subdirectory(System.Globalization.Native) endif () endif () From 748557cef2deb31378eb9fc7d11447095f1500b1 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Mon, 4 Mar 2024 10:09:10 +0100 Subject: [PATCH 20/43] test --- src/mono/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index 1e9ba464194e0..3c3404459c7df 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -709,10 +709,10 @@ endif() ## -if(NOT MONO_CROSS_COMPILE) +#if(NOT MONO_CROSS_COMPILE) set(Mono 1) - add_subdirectory(${CLR_SRC_NATIVE_DIR}/libs libs-native) -endif(NOT MONO_CROSS_COMPILE) + #add_subdirectory(${CLR_SRC_NATIVE_DIR}/libs libs-native) +#endif(NOT MONO_CROSS_COMPILE) ## ###################################### From 0cb32dc0e3b26d264f64c0abe6d46feba30d0304 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Mon, 4 Mar 2024 11:26:31 +0100 Subject: [PATCH 21/43] test --- src/mono/mono/mini/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index e81afefecfc23..af08ad3aaa192 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -12,7 +12,7 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../.. ${PROJECT_SOURCE_DIR}/../ ) - +set(Mono 1) if(HOST_DARWIN) set(OS_LIBS "-framework CoreFoundation" "-framework Foundation") From 0f565ce96e808ac4b435095877b70b8b60f7a6b1 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Mon, 4 Mar 2024 12:44:15 +0100 Subject: [PATCH 22/43] test --- src/native/libs/System.Globalization.Native/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 1959fec40a7cf..c2f07d652a3dc 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -183,7 +183,7 @@ if(NOT CLR_CMAKE_TARGET_APPLE AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE endif() if(CLR_CMAKE_TARGET_WIN32) - if(STATIC_LIBS_ONLY) + if(STATIC_LIBS_ONLY OR Mono) add_library(System.Globalization.Native.Aot STATIC ${NATIVEGLOBALIZATION_SOURCES} From db58cb7e05611b26c8edcdd73cd43bfe4243f8a3 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Mon, 4 Mar 2024 16:59:28 +0100 Subject: [PATCH 23/43] test --- src/coreclr/CMakeLists.txt | 2 +- src/mono/CMakeLists.txt | 9 +-------- src/native/libs/CMakeLists.txt | 4 ++-- .../libs/System.Globalization.Native/CMakeLists.txt | 2 +- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/coreclr/CMakeLists.txt b/src/coreclr/CMakeLists.txt index 1c314d9bf624e..6b3dd7e38f104 100644 --- a/src/coreclr/CMakeLists.txt +++ b/src/coreclr/CMakeLists.txt @@ -70,7 +70,7 @@ endif() if (MSVC) set_property(DIRECTORY PROPERTY CLR_EH_OPTION /EHa) # enable C++ EH (w/ SEH exceptions) endif() - +set(Core_CLR 1) #------------------------------- # Include libraries native shims #------------------------------- diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index 3c3404459c7df..5f2b741e7c02d 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -32,6 +32,7 @@ set(CMAKE_C_FLAGS_CHECKED "") set(CMAKE_CXX_FLAGS_CHECKED "") set(CMAKE_EXE_LINKER_FLAGS_CHECKED "") set(CMAKE_SHARED_LINKER_FLAGS_CHECKED "") +set(Mono 1) if(NOT MONO_LIB_NAME) set(MONO_LIB_NAME "monosgen-2.0") @@ -707,14 +708,6 @@ if(LLVM_PREFIX) add_definitions(-DLLVM_API_VERSION=${llvm_api_version}) endif() -## - -#if(NOT MONO_CROSS_COMPILE) - set(Mono 1) - #add_subdirectory(${CLR_SRC_NATIVE_DIR}/libs libs-native) -#endif(NOT MONO_CROSS_COMPILE) -## - ###################################### # GC CHECKS ###################################### diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index e4b18baee700e..d87a4936cd2e6 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -11,7 +11,7 @@ include_directories(${CLR_SRC_NATIVE_DIR}) set(CMAKE_INCLUDE_CURRENT_DIR ON) -if(STATIC_LIBS_ONLY OR Mono) +if(STATIC_LIBS_ONLY OR NOT Core_CLR) # Suppress exporting of the PAL APIs add_definitions(-DPALEXPORT=EXTERN_C) @@ -99,7 +99,7 @@ else () set(CMAKE_SHARED_LIBRARY_PREFIX "") # we only need to build System.Globalization.Native when building static libs. - if(STATIC_LIBS_ONLY OR Mono) + if(STATIC_LIBS_ONLY OR NOT Core_CLR) add_subdirectory(System.Globalization.Native) endif () endif () diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index c2f07d652a3dc..586c8e89a07ac 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -183,7 +183,7 @@ if(NOT CLR_CMAKE_TARGET_APPLE AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE endif() if(CLR_CMAKE_TARGET_WIN32) - if(STATIC_LIBS_ONLY OR Mono) + if(STATIC_LIBS_ONLY OR NOT Core_CLR) add_library(System.Globalization.Native.Aot STATIC ${NATIVEGLOBALIZATION_SOURCES} From 35e8f7411220115740910efe6d483201dee633b8 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Mon, 4 Mar 2024 17:32:13 +0100 Subject: [PATCH 24/43] test --- src/native/libs/System.Globalization.Native/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 586c8e89a07ac..1959fec40a7cf 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -183,7 +183,7 @@ if(NOT CLR_CMAKE_TARGET_APPLE AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE endif() if(CLR_CMAKE_TARGET_WIN32) - if(STATIC_LIBS_ONLY OR NOT Core_CLR) + if(STATIC_LIBS_ONLY) add_library(System.Globalization.Native.Aot STATIC ${NATIVEGLOBALIZATION_SOURCES} From 18fc3559927fa70d3cc84df6d318392f81a18751 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Mon, 4 Mar 2024 17:52:35 +0100 Subject: [PATCH 25/43] test --- src/native/libs/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index d87a4936cd2e6..09c069f72ac51 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -11,7 +11,7 @@ include_directories(${CLR_SRC_NATIVE_DIR}) set(CMAKE_INCLUDE_CURRENT_DIR ON) -if(STATIC_LIBS_ONLY OR NOT Core_CLR) +if(STATIC_LIBS_ONLY) # Suppress exporting of the PAL APIs add_definitions(-DPALEXPORT=EXTERN_C) From c03761cba57f48113cf3bde3d8780dd697867af3 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Mon, 4 Mar 2024 18:14:19 +0100 Subject: [PATCH 26/43] test --- src/native/libs/CMakeLists.txt | 2 +- src/native/libs/System.Globalization.Native/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index 09c069f72ac51..b0d13db9865ea 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -99,7 +99,7 @@ else () set(CMAKE_SHARED_LIBRARY_PREFIX "") # we only need to build System.Globalization.Native when building static libs. - if(STATIC_LIBS_ONLY OR NOT Core_CLR) + if(STATIC_LIBS_ONLY) add_subdirectory(System.Globalization.Native) endif () endif () diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 1959fec40a7cf..586c8e89a07ac 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -183,7 +183,7 @@ if(NOT CLR_CMAKE_TARGET_APPLE AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE endif() if(CLR_CMAKE_TARGET_WIN32) - if(STATIC_LIBS_ONLY) + if(STATIC_LIBS_ONLY OR NOT Core_CLR) add_library(System.Globalization.Native.Aot STATIC ${NATIVEGLOBALIZATION_SOURCES} From 16389e07774ec311c60bb2cdd1bfc81e9be0f773 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Tue, 5 Mar 2024 09:48:47 +0100 Subject: [PATCH 27/43] test --- src/native/libs/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index b0d13db9865ea..09c069f72ac51 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -99,7 +99,7 @@ else () set(CMAKE_SHARED_LIBRARY_PREFIX "") # we only need to build System.Globalization.Native when building static libs. - if(STATIC_LIBS_ONLY) + if(STATIC_LIBS_ONLY OR NOT Core_CLR) add_subdirectory(System.Globalization.Native) endif () endif () From 160956a78b636319365f31f7d53d354c075ba29b Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Tue, 5 Mar 2024 10:32:18 +0100 Subject: [PATCH 28/43] test --- src/native/libs/CMakeLists.txt | 4 ++-- src/native/libs/System.Globalization.Native/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index 09c069f72ac51..b5f026fa94a75 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -11,7 +11,7 @@ include_directories(${CLR_SRC_NATIVE_DIR}) set(CMAKE_INCLUDE_CURRENT_DIR ON) -if(STATIC_LIBS_ONLY) +if (STATIC_LIBS_ONLY OR NOT Core_CLR) # Suppress exporting of the PAL APIs add_definitions(-DPALEXPORT=EXTERN_C) @@ -99,7 +99,7 @@ else () set(CMAKE_SHARED_LIBRARY_PREFIX "") # we only need to build System.Globalization.Native when building static libs. - if(STATIC_LIBS_ONLY OR NOT Core_CLR) + if (STATIC_LIBS_ONLY OR NOT Core_CLR) add_subdirectory(System.Globalization.Native) endif () endif () diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 586c8e89a07ac..e447b20451bb7 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -183,7 +183,7 @@ if(NOT CLR_CMAKE_TARGET_APPLE AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE endif() if(CLR_CMAKE_TARGET_WIN32) - if(STATIC_LIBS_ONLY OR NOT Core_CLR) + if (STATIC_LIBS_ONLY) add_library(System.Globalization.Native.Aot STATIC ${NATIVEGLOBALIZATION_SOURCES} From 9078d1e663cecd3d40cc264db8be7fdfeb8ecf41 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Tue, 5 Mar 2024 12:35:44 +0100 Subject: [PATCH 29/43] test --- src/native/libs/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index b5f026fa94a75..364386afbd7de 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -11,7 +11,7 @@ include_directories(${CLR_SRC_NATIVE_DIR}) set(CMAKE_INCLUDE_CURRENT_DIR ON) -if (STATIC_LIBS_ONLY OR NOT Core_CLR) +if (STATIC_LIBS_ONLY OR (NOT Core_CLR AND CLR_CMAKE_TARGET_WIN32)) # Suppress exporting of the PAL APIs add_definitions(-DPALEXPORT=EXTERN_C) @@ -99,7 +99,7 @@ else () set(CMAKE_SHARED_LIBRARY_PREFIX "") # we only need to build System.Globalization.Native when building static libs. - if (STATIC_LIBS_ONLY OR NOT Core_CLR) + if (STATIC_LIBS_ONLY OR (NOT Core_CLR AND CLR_CMAKE_TARGET_WIN32)) add_subdirectory(System.Globalization.Native) endif () endif () From 495ad871332b3ff9ea99df90113fa21ca9088559 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Tue, 5 Mar 2024 12:59:01 +0100 Subject: [PATCH 30/43] test --- src/native/libs/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index 364386afbd7de..a527ba17ce40e 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -11,7 +11,7 @@ include_directories(${CLR_SRC_NATIVE_DIR}) set(CMAKE_INCLUDE_CURRENT_DIR ON) -if (STATIC_LIBS_ONLY OR (NOT Core_CLR AND CLR_CMAKE_TARGET_WIN32)) +if (STATIC_LIBS_ONLY) # Suppress exporting of the PAL APIs add_definitions(-DPALEXPORT=EXTERN_C) From b3277c36ac1eec4af3653c42dfb825de885c9be8 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Tue, 5 Mar 2024 13:20:00 +0100 Subject: [PATCH 31/43] test --- src/native/libs/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index a527ba17ce40e..79b92e33da29e 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -99,7 +99,7 @@ else () set(CMAKE_SHARED_LIBRARY_PREFIX "") # we only need to build System.Globalization.Native when building static libs. - if (STATIC_LIBS_ONLY OR (NOT Core_CLR AND CLR_CMAKE_TARGET_WIN32)) + if (STATIC_LIBS_ONLY) add_subdirectory(System.Globalization.Native) endif () endif () From 6227984a5afebc8933e1ced13ff7fca38c48ffb3 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Tue, 5 Mar 2024 14:33:22 +0100 Subject: [PATCH 32/43] test --- src/native/libs/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index 79b92e33da29e..4abe58e819a27 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -11,6 +11,12 @@ include_directories(${CLR_SRC_NATIVE_DIR}) set(CMAKE_INCLUDE_CURRENT_DIR ON) +if (CLR_CMAKE_TARGET_WIN32 AND NOT Core_CLR) +# Suppress exporting of the PAL APIs +add_definitions(-DPALEXPORT=EXTERN_C) +# set_source_files_properties(${NATIVEGLOBALIZATION_SOURCES} PROPERTIES LANGUAGE CXX) +endif() + if (STATIC_LIBS_ONLY) # Suppress exporting of the PAL APIs add_definitions(-DPALEXPORT=EXTERN_C) From 90cda7e5f8b3b977f328990079a12ae66522d521 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Tue, 5 Mar 2024 16:02:44 +0100 Subject: [PATCH 33/43] test --- src/native/libs/CMakeLists.txt | 11 +--------- .../CMakeLists.txt | 20 +++++++++++++------ 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index 4abe58e819a27..dc66bc6939d74 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -11,12 +11,6 @@ include_directories(${CLR_SRC_NATIVE_DIR}) set(CMAKE_INCLUDE_CURRENT_DIR ON) -if (CLR_CMAKE_TARGET_WIN32 AND NOT Core_CLR) -# Suppress exporting of the PAL APIs -add_definitions(-DPALEXPORT=EXTERN_C) -# set_source_files_properties(${NATIVEGLOBALIZATION_SOURCES} PROPERTIES LANGUAGE CXX) -endif() - if (STATIC_LIBS_ONLY) # Suppress exporting of the PAL APIs add_definitions(-DPALEXPORT=EXTERN_C) @@ -104,10 +98,7 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) else () set(CMAKE_SHARED_LIBRARY_PREFIX "") - # we only need to build System.Globalization.Native when building static libs. - if (STATIC_LIBS_ONLY) - add_subdirectory(System.Globalization.Native) - endif () + add_subdirectory(System.Globalization.Native) endif () add_subdirectory(System.IO.Compression.Native) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index e447b20451bb7..81edb39c81e0d 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -142,12 +142,20 @@ if (GEN_SHARED_LIB) include(CMakeFindFrameworks) find_library(FOUNDATION Foundation REQUIRED) endif() - - add_library(System.Globalization.Native - SHARED - ${NATIVEGLOBALIZATION_SOURCES} - ${VERSION_FILE_PATH} - ) + + if (CLR_CMAKE_TARGET_WIN32) + add_library(System.Globalization.Native + SHARED + ${NATIVEGLOBALIZATION_SOURCES} + ${VERSION_HEADER_PATH} + ) + else() + add_library(System.Globalization.Native + SHARED + ${NATIVEGLOBALIZATION_SOURCES} + ${VERSION_FILE_PATH} + ) + endif() target_link_libraries(System.Globalization.Native PRIVATE From adfc482cae5e69c32869336c12f207235ec56cd9 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Tue, 5 Mar 2024 16:35:13 +0100 Subject: [PATCH 34/43] test --- src/native/libs/System.Globalization.Native/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 81edb39c81e0d..881653da69c82 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -3,6 +3,10 @@ cmake_minimum_required(VERSION 3.10..3.20) project(System.Globalization.Native C) +if (CLR_CMAKE_TARGET_WIN32) + enable_language(CXX) +endif() + if(CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_WASI) if (ANDROID_FORCE_ICU_DATA_DIR) add_definitions(-DANDROID_FORCE_ICU_DATA_DIR) From 98155edf9f00e5a5a2ffd0a568d5105a9844ad49 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Tue, 5 Mar 2024 17:02:42 +0100 Subject: [PATCH 35/43] test --- src/native/libs/System.Globalization.Native/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 881653da69c82..c68b8321ac1c3 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.10..3.20) project(System.Globalization.Native C) if (CLR_CMAKE_TARGET_WIN32) - enable_language(CXX) + set_source_files_properties(${NATIVEGLOBALIZATION_SOURCES} PROPERTIES LANGUAGE CXX) endif() if(CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_WASI) From 1ea989677472208cc392e1d6b676eddbc1950fa5 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Tue, 5 Mar 2024 17:08:57 +0100 Subject: [PATCH 36/43] test --- src/native/libs/System.Globalization.Native/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index c68b8321ac1c3..46f0430c0372b 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -5,6 +5,7 @@ project(System.Globalization.Native C) if (CLR_CMAKE_TARGET_WIN32) set_source_files_properties(${NATIVEGLOBALIZATION_SOURCES} PROPERTIES LANGUAGE CXX) + enable_language(CXX) endif() if(CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_WASI) From 2f1c321510e3ed003e5f7139052b730c5b02cf8f Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Tue, 5 Mar 2024 17:42:13 +0100 Subject: [PATCH 37/43] test --- src/native/libs/System.Globalization.Native/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 46f0430c0372b..6557968f5a322 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -5,7 +5,7 @@ project(System.Globalization.Native C) if (CLR_CMAKE_TARGET_WIN32) set_source_files_properties(${NATIVEGLOBALIZATION_SOURCES} PROPERTIES LANGUAGE CXX) - enable_language(CXX) + enable_language(%CMAKE_LANGS%) endif() if(CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_WASI) From 2ab36d7b871127b11a562c24d144439c15cc5fbb Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Tue, 5 Mar 2024 18:16:09 +0100 Subject: [PATCH 38/43] test --- src/native/libs/System.Globalization.Native/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 6557968f5a322..9a315f62469a6 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -4,8 +4,7 @@ cmake_minimum_required(VERSION 3.10..3.20) project(System.Globalization.Native C) if (CLR_CMAKE_TARGET_WIN32) - set_source_files_properties(${NATIVEGLOBALIZATION_SOURCES} PROPERTIES LANGUAGE CXX) - enable_language(%CMAKE_LANGS%) + enable_language(C CXX) endif() if(CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_WASI) From 79ede015a5015da4d3a99aaf7086fbd0d9cbb646 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Wed, 6 Mar 2024 06:17:54 +0100 Subject: [PATCH 39/43] test --- src/native/libs/CMakeLists.txt | 5 +++++ src/native/libs/System.Globalization.Native/CMakeLists.txt | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index dc66bc6939d74..c4ae5d53e4876 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -5,6 +5,11 @@ include(CheckCCompilerFlag) project(CoreFX C) include(../../../eng/native/configurepaths.cmake) + +if (CLR_CMAKE_TARGET_WIN32) + enable_language(CXX) +endif() + include(${CLR_ENG_NATIVE_DIR}/configurecompiler.cmake) include_directories(${CLR_SRC_NATIVE_DIR}) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 9a315f62469a6..81edb39c81e0d 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -3,10 +3,6 @@ cmake_minimum_required(VERSION 3.10..3.20) project(System.Globalization.Native C) -if (CLR_CMAKE_TARGET_WIN32) - enable_language(C CXX) -endif() - if(CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_WASI) if (ANDROID_FORCE_ICU_DATA_DIR) add_definitions(-DANDROID_FORCE_ICU_DATA_DIR) From 065f7d2067dc26ac30c96c8b6becd3c7f52bfcf8 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Wed, 6 Mar 2024 06:38:40 +0100 Subject: [PATCH 40/43] test --- src/native/libs/CMakeLists.txt | 4 ---- src/native/libs/System.Globalization.Native/CMakeLists.txt | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index c4ae5d53e4876..310cab96bf7c7 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -6,10 +6,6 @@ project(CoreFX C) include(../../../eng/native/configurepaths.cmake) -if (CLR_CMAKE_TARGET_WIN32) - enable_language(CXX) -endif() - include(${CLR_ENG_NATIVE_DIR}/configurecompiler.cmake) include_directories(${CLR_SRC_NATIVE_DIR}) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 81edb39c81e0d..06a45ae2f9b7d 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -1,7 +1,7 @@ # Required for StaticICULinking cmake_minimum_required(VERSION 3.10..3.20) -project(System.Globalization.Native C) +project(YourProjectName C CXX) if(CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_WASI) if (ANDROID_FORCE_ICU_DATA_DIR) From f224d53574df6383ba33df148a0f49f0eda3e2a1 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Wed, 6 Mar 2024 06:42:56 +0100 Subject: [PATCH 41/43] test --- src/native/libs/System.Globalization.Native/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 06a45ae2f9b7d..75ff3051e5f06 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -1,7 +1,8 @@ # Required for StaticICULinking cmake_minimum_required(VERSION 3.10..3.20) -project(YourProjectName C CXX) +project(System.Globalization.Native C CXX) + if(CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_WASI) if (ANDROID_FORCE_ICU_DATA_DIR) From 3846f50c2c8d66d5bb3b63239018b80bb712739e Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Wed, 6 Mar 2024 07:34:47 +0100 Subject: [PATCH 42/43] test --- src/native/libs/CMakeLists.txt | 2 ++ src/native/libs/System.Globalization.Native/CMakeLists.txt | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index 310cab96bf7c7..f569ac55f7b74 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -6,6 +6,8 @@ project(CoreFX C) include(../../../eng/native/configurepaths.cmake) +enable_language(CXX) + include(${CLR_ENG_NATIVE_DIR}/configurecompiler.cmake) include_directories(${CLR_SRC_NATIVE_DIR}) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 75ff3051e5f06..81edb39c81e0d 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -1,8 +1,7 @@ # Required for StaticICULinking cmake_minimum_required(VERSION 3.10..3.20) -project(System.Globalization.Native C CXX) - +project(System.Globalization.Native C) if(CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_WASI) if (ANDROID_FORCE_ICU_DATA_DIR) From 0026875d6959a7796d2ca9768deefcbf0c8421eb Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Wed, 6 Mar 2024 11:19:44 +0100 Subject: [PATCH 43/43] test --- .../pkg/sfx/Microsoft.NETCore.App/Directory.Build.props | 1 + 1 file changed, 1 insertion(+) diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props b/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props index 4a1a720cf6a0d..aedd89c6147df 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props @@ -128,6 +128,7 @@ +