Haiku: Build and test dotnet runtime - #1
#1Haiku: Build and test dotnet runtime#1trungnt2910 wants to merge 2440 commits into
Conversation
|
Status update: PAL tests are running now, with errors. I'll fix them one by one. |
169c11a to
9f05c5c
Compare
|
|
jessicah
left a comment
There was a problem hiding this comment.
getexepath can be simplified.
8be8ca8 to
324d0b7
Compare
|
Status update: Currently trying to build LLVM's From what I read in the source code, as well as discussions in issues across the dotnet repo:
So, if LLVM's libunwind somehow works on Haiku, we can install and use that library instead. |
This adds support for EnC on arm64. A couple of notes on the implementation compared to x64: - On x64 we get the fixed stack size from unwind info. However, for the frames we set up on arm64 for EnC it is not possible to extract the frame size from there because their prologs generally look like stp fp, lr, [sp,#-16]! mov fp, sp sub sp, sp, dotnet#144 with unwind codes like the following: set_fp; mov fp, sp save_fplr_x #1 (0x01); tp fp, lr, [sp, #-16]! As can be seen, it is not possible to get the fixed stack size from unwind info in this case. Instead we pass it through the GC info that already has a section for EnC data. - On arm64 the JIT is required to place the PSPSym at the same offset from caller-SP for both the main function and for funclets. Due to this we try to allocate the PSPSym as early as possible in the main function and we must take some care in funclets. However, this conflicts with the EnC frame header that the JIT uses to place values that must be preserved on EnC transitions. This is currently callee-saved registers and the MonitorAcquired boolean. Before this change we were allocating PSPSym above (before) the monitor acquired boolean, but we now have to allocate MonitorAcquired first, particularly because the size of the preserved header cannot change on EnC transitions, while the PSPSym can disappear or appear. This changes frame allocation slightly for synchronized functions.
These helpers are used to report names of things in warnings. The functional changes are: * For method parameters, use the parameter name if available (and only if not fallback to the #1 notation) * For property accessor methods, use the C# naming scheme, so for example Type.Property.get instead of Type.get_Property. Both of these changes are in preparation to bring NativeAOT closer in behavior to ILLink and the trim analyzers. For this I moved some of the helpers to the common shared code. Some unrelated code cleanup as well. Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
44257a1 to
6abdeba
Compare
|
I seem to have found the cause of the exception handling problem: The Why this function is not called for this specific binary (and not other normal Haiku binaries) is currently under investigation. |
08f87b4 to
7e68616
Compare
* fold reference to SslContextHandle to prevent crashes * Update src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs Co-authored-by: Stephen Toub <stoub@microsoft.com> Co-authored-by: Dan Moseley <danmose@microsoft.com> Co-authored-by: Stephen Toub <stoub@microsoft.com>
…rsion for libraries dependencies (dotnet#73871)
…815.4 (dotnet#74004) Microsoft.NET.ILLink.Tasks From Version 7.0.100-1.22412.4 -> To Version 7.0.100-1.22415.4 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…otnet#74019) * Disable the ConnectCallback_UseNamedPipe_Success test for NativeAOT * Attribute form
* eng/Versions.props * Directory.Build.props * src/libraries/Microsoft.VisualBasic.Core/Directory.Build.props * Apply suggestions from code review Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com> Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com> Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
…3955) * [mono] Implement missing functionality for cctor invocation * [mono] Re-enable test
* Optimized string.Replace(char, char) vector code path * Optimized code pathes even further * Do vectorized operation at the end of the string only once When the remaining length is a multiple of the vector size, then the remainder is processed twice. This is redundant, and not needed. This commit changes that, so that the remainder is processed only once when the remaining elements match. * Don't use trick for collapsed epilogs Cf. dotnet#67049 (comment) * Handle remainder vectorized even if remainingLength <= Vector<ushort>.Count and added tests for this * Introduce (internal) Vector.LoadUnsafe and Vector.StoreUnsafe and use it in string.Replace(char, char) * Avoid Unsafe.As<char, ushort> reinterpret casts by introducing string.GetRawStringDataAsUshort() internal method * Fixed copy/paste error (from local dev to repo) * PR Feedback * Fixed bug and added tests for this * Make condition about lengthToExamine clearer as suggested
* Remove reflection from AppHostUpdateTests * Address CR feedback * Make template binary readonly for macOS
We can delay the string allocation until it's actually requested.
Fuzzlyn now supports a "known errors" list that will not be reported as failing examples and will thus not cause the pipeline to fail. The list can be specified either as a path to a file containing a JSON array of error strings, or as a built-in list "dotnet/runtime" that is maintained in Fuzzlyn itself. This PR hooks the support up on the runtime side.
Reference is not needed; was causing build issues for some platforms. Fixes dotnet#73792
* [LoongArch64] amend the tests' building on LA64. * Move the `-DTARGET_ARMARCH` and `-DTARGET_ARMARCH` to the `Common/Platform/platformdefines.h`.
* "pal.h" includes both "pal_mstypes.h" and "pal_error.h", but does so in the correct order, such that size_t is defined properly. * Previously, it would result in size_t being undefined due to how "pal_internal.h" redefines everything
* libroot provides libc, libm, libpthread, and libdl
…al_mount functions.
The two functions added here, SystemNative_TeamInfo and SystemNative_NextAreaInfo, are neither cross-platform nor used by unmanaged CoreCLR code, and therefore can be directly called from managed C# code. The previous configuration broke Linux builds.
While all Haiku binaries are linked to libroot by default, the cross compile toolchain for Haiku has some bug in weak symbol resolution that prevents __register_frame_info from being called unless a library containing that symbol is explicitly referenced during compile time. This ensures that __register_frame_info is called and unwind information is properly registered for C++ exception handling.
Haiku does not support fchmod for sockets.
Haiku seems to have a problem reserving 256GiB of virtual memory. Disable this feature for now until we can investigate on this.
- Cleaned up toolchain.cmake. - Fix missing headers for System.Native. - Properly locate Haiku's libunwind.
* Initial implementation for contract customization fix build errors Move converter rooting to DefaultJsonTypeInfoResolver so that it can be used standalone Fix ConfigurationList.IsReadOnly Minor refactorings (#1) * Makes the following changes: * Move singleton initialization for DefaultTypeInfoResolver behind a static property. * Consolidate JsonSerializerContext & IJsonTypeInfoResolver values to a single field. * Move reflection fallback logic away from JsonSerializerContext and into JsonSerializerOptions * Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs * remove testing of removed field Simplify the JsonTypeInfo.CreateObject implemenetation (#2) * Simplify the JsonTypeInfo.CreateObject implemenetation * Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfoOfT.cs * Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfoOfT.cs Co-authored-by: Krzysztof Wicher <mordotymoja@gmail.com> Co-authored-by: Krzysztof Wicher <mordotymoja@gmail.com> Tests and fixes for JsonTypeInfoKind.None TypeInfo type mismatch tests Allow setting NumberHandling on JsonTypeInfoKind.None test resolver returning wrong type of options JsonTypeInfo/JsonPropertyInfo mutability tests rename test file Move default converter rooting responsibility behind DefaultJsonTypeInfoResolver (#3) * Move default converter rooting responsibility behind DefaultJsonTypeInfoResolver * address feedback Add simple test for using JsonTypeInfo<T> with APIs directly taking it fix and tests for untyped/typed CreateObject uncomment test cases, remove todo More tests and tiny fixes Add a JsonTypeInfoResolver.Combine test for JsonSerializerContext (#4) * Fix JsonTypeInfoResolver.Combine for JsonSerializerContext * Break up failing test Fix simple scenarios for combining contexts (#6) * Fix simple scenarios for combining contexts * feedback JsonSerializerContext combine test with different camel casing Remove unneeded virtual calls & branching when accessing Get & Set delegates (#7) JsonPropertyInfo tests everything minus ShouldSerialize & NumberHandling Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs throw InvalidOperationException rather than ArgumentNullException for source gen when PropertyInfo.Name is assigned through JsonPropertyInfoValues tests for duplicated property names and JsonPropertyInfo.NumberHandling Add tests for NumberHandling and failing tests for ShouldSerialize disable the failing test and add extra checks disable remainder of the failing ShouldSerialize tests, fix working one Fix ShouldSerialize and IgnoreCondition interop Add failing tests for CreateObject + parametrized constructors Fix CreateObject support for JsonConstructor types (#10) * Fix CreateObject support for JsonConstructor types * address feedback Make contexts more combinator friendly (#9) * Make contexts more combinator friendly * remove converter cache * redesign test to account for JsonConstructorAttribute * Combine unit tests * address feedback * Add acceptance tests for DataContract attributes & Specified pattern (#11) * Add private field serialization acceptance test (dotnet#13) * tests, PR feedback (dotnet#14) * PR feedback and extra tests * Shorten class name, remove incorrect check (not true for polimorphic cases) * Make parameter matching for custom properties map property Name with parameter (dotnet#16) * Test static initialization with JsonTypeInfo (dotnet#17) * Fix test failures and proper fix this time (dotnet#18) * Fix test failures and proper fix this time * reinstate ActiveIssueAttribute * PR feedback and adjust couple of tests which don't set TypeInfoResolver * fix IAsyncEnumerable tests * Lock JsonSerializerOptions in JsonTypeInfo.EnsureConfigured() Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com> Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
3d48155 to
17b3bc5
Compare
E.g., Update LSRA "Allocating Registers" table description. Dump nodes added during resolution, e.g.: ``` BB29 bottom (BB08->BB08): move V25 from STK to rdi (Critical) N001 ( 1, 1) [001174] ----------z t1174 = LCL_VAR int V25 cse4 rdi REG rdi ``` Dump more data in the LSRA block sequence data: ``` -BB03( 16 ) -BB04( 4 ) +BB03 ( 16 ) critical-in critical-out +BB04 ( 4 ) critical-out ``` When dumping various flow bitvectors, annotate the bitvectors better: ``` -BB25 in gen out -0000000000000000 -0000000000000003 CSE #1.c -0000000000000003 CSE #1.c +BB25 + in: 0000000000000000 +gen: 0000000000000003 CSE #1.c +out: 0000000000000003 CSE #1.c ``` Dump hoisting bitvectors using the sorting number: ``` - USEDEF (5)={V04 V00 V01 V02 V03} + USEDEF (5)={V00 V01 V02 V03 V04} ``` Also, fix various typos and formatting.
…tnet#87189) This fixes a startup crash on Big Sur: > error: * Assertion at /Users/runner/work/1/s/src/mono/mono/utils/mono-hwcap-arm64.c:35, condition `res == 0' not met Because sysctl can't find some of these options: $ sysctl hw.optional.armv8_crc32 hw.optional.armv8_crc32: 1 $ sysctl hw.optional.arm.FEAT_RDM sysctl: unknown oid 'hw.optional.arm.FEAT_RDM' $ sysctl hw.optional.arm.FEAT_DotProd sysctl: unknown oid 'hw.optional.arm.FEAT_DotProd' $ sysctl hw.optional.arm.FEAT_SHA1 sysctl: unknown oid 'hw.optional.arm.FEAT_SHA1' $ sysctl hw.optional.arm.FEAT_SHA256 sysctl: unknown oid 'hw.optional.arm.FEAT_SHA256' $ sysctl hw.optional.arm.FEAT_AES sysctl: unknown oid 'hw.optional.arm.FEAT_AES' Full stack trace: * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 2.1 * frame #0: 0x0000010ef37560 libmonosgen-2.0.dylib`monoeg_assertion_message frame #1: 0x0000010ef375cc libmonosgen-2.0.dylib`mono_assertion_message + 32 frame #2: 0x0000010ef40d6c libmonosgen-2.0.dylib`mono_hwcap_arch_init + 544 frame #3: 0x0000010ef54bd8 libmonosgen-2.0.dylib`mono_hwcap_init + 72 frame #4: 0x0000010ee14dc0 libmonosgen-2.0.dylib`parse_optimizations + 52 frame #5: 0x0000010edbed48 libmonosgen-2.0.dylib`mono_init frame #6: 0x0000010ee18968 libmonosgen-2.0.dylib`mono_jit_init_version frame #7: 0x0000010f48a300 libxamarin-dotnet-debug.dylib`xamarin_bridge_initialize + 216 frame #8: 0x0000010f4900a4 libxamarin-dotnet-debug.dylib`xamarin_main + 376

Now all the targets mentioned here should compile.