Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NativeAOT-LLVM Merge sep 23 #2396

Merged
merged 1,552 commits into from
Oct 6, 2023
Merged

Conversation

yowl
Copy link
Contributor

@yowl yowl commented Sep 6, 2023

This PR moves forward to fe88e1b. There's 2 resolving of merge conflicts as we added unaligned relocs as part of this merge.

  • remove assert (use_frozen_segments_p); and ETW::GCLog::WalkHeap() - upstreamed
  • remove CORINFO_TYPE_BOOL and add CORINFO_HELP_THROW_ENTRYPOINT_NOT_FOUND_EXCEPTION
  • remove StackTraces test
  • #if out PalCreateDumpInitialize and add stub for PalCreateCrashDumpIfEnabled. Not sure I've solved this the cleanest way possible.
  • disable the new test StackTraceMetadata for WASI. For browser -Wl,--strip-all allows this to pass.
  • take the lowMemoryP ? Interop.BOOL.TRUE : Interop.BOOL.FALSE from upstream.

cc @dotnet/nativeaot-llvm

mdh1418 and others added 30 commits August 24, 2023 10:47
* [Android][Test] Add Profiled AOT Functional Test

* [docs][mono] Add profiled aot on mono docs

* Address feedback

* Attempt to fix build

* Profile only with .mibc
* Upgrade all VMs to Ubuntu 22.04

* Update display names

* Revert wasm and mono back to 18.04

* Update eng/pipelines/coreclr/templates/helix-queues-setup.yml

Co-authored-by: Jeremy Koritzinsky <[email protected]>

* Fix merge conflicts

* Update Android queue

* Removed an Ubuntu.1804.Tiger queue I accidentally enabled when merging with main earlier.

* Restored the Ubuntu 18.04 OS for the crossgen tiger perf queue due to a requirement currently unavailable on 22.04

* Restored Ubuntu 18.04 in source-build.yml because those changes come from the arcade repo.

* Fix bad merge

---------

Co-authored-by: Jeremy Koritzinsky <[email protected]>
Co-authored-by: Alexander Köplinger <[email protected]>
Co-authored-by: Ivan Diaz Sanchez <[email protected]>
When there is no RID graph and the host is configured to use the RID graph, it will discard the computed machine RID (because it is not in the RID graph) and use the fallback RID (compile-time define) to look for assets. This adds a test that exact matches to the fallback RID should be resolved in that case.
* Adding missing System.Buffers documentation

* Insert the word "contains" to be consistent with the docs changes
Physical promotion could in some cases create uses overlapping illegally
with defs when faced with seemingly last uses of structs. This is a
result of a mismatch between our model for liveness and the actual model
of local uses in the backend. In the actual model, the uses of LCL_VARs
occur at the user, which means that it is possible for there to be no
place at which to insert IR between to local uses.

The example looks like the following. Physical promotion would be faced
with a tree like

```
▌  CALL      void   Program:Foo(Program+S,Program+S)
├──▌  LCL_VAR   struct<Program+S, 4> V01 loc0
└──▌  LCL_VAR   struct<Program+S, 4> V01 loc0
```

When V01 was fully promoted, both of these are logically last uses since
all state of V01 is stored in promoted field locals. Because of that we
would make the following transformation:

```
▌  CALL      void   Program:Foo(Program+S,Program+S)
├──▌  LCL_VAR   struct<Program+S, 4> V01 loc0          (last use)
└──▌  COMMA     struct
   ├──▌  STORE_LCL_FLD int    V01 loc0         [+0]
   │  └──▌  LCL_VAR   int    V02 tmp0
   └──▌  LCL_VAR   struct<Program+S, 4> V01 loc0          (last use)
```

This creates an illegally overlapping use and def; additionally, it is
correct only in a world where the store actually would happen between
the two uses. It is also moderately dangerous to mark both of these as
last uses given the implicit byref transformation.

The fix is to avoid marking a struct use as a last use if we see more
struct uses in the same statement.

Fix #91056
* [wasm] Add a dependency on dotnet/installer to get the latest

.. version, and use that for testing the workloads.

* [wasm] add note about upgrading node in perf pipeline
* Fix stack_limit handling

There is a problem with computing stack_limit in the presence of
inactive InlinedCallFrame. We were trying to call GetCallSiteSP on that
frame to get the call site SP. But when the inlined call frame is not
active (there is no call to native code in progress), that method
returns random junk.

But even if we checked for an active call before reading the value, it
would not get correct stack limit on x86 windows when there was no
active call with the inlined call frame being the topmost one. That
can happen with hardware exception handling on Windows x86. On other
targets, we always have other explicit frame on top of the explicit
frames stack, but on windows x86, we don't use the FaultingExceptionFrame for
hardware exceptions, so the inactive inlined call frame could be the
topmost one when GC starts to scan stack roots.

Since the stack_limit was introduced to fix a Unix specific problem, I
have fixed that by disabling the stack_limit usage for x86 windows.

Close #86265

* Add back the stack_limit field to keep contract unchanged

* Reflect PR feedback - Minimalize the number of ifdefs

* Reflect PR feedback
* Port NativeAOT exception handling to CoreCLR

This change ports NativeAOT exception handling to CoreCLR, resulting in
3.5..4 times speedup in exception handling. Due to time constraints and
various complexities, thread abort and debugger support is not
completed yet, so this change is enabled only when
`DOTNET_EnableNewExceptionHandling` env variable is set. By default,
the old way is used.
This change supports all OSes and targets we support except of x86
Windows. That may be doable too in the future, but the difference in
exception handling on x86 Windows adds quite a lot of complexity into
the picture.

Notes for the PR:
* I have left the `ExceptionHandling.cs` and `StackFrameIterator.cs` in
  the nativeaot folder to simplify the review. I can move it to some
  common location after the change is reviewed. Also it was not clear to
  me where that should be, so advise would be welcome here.
* Naming of the native helpers like `RhpCallCatchFunclet` was left the
  same as in the NativeAOT for now.
* There are still some little things I'd like to eventually clean up,
  like `ExInfo` encapsulation and possibly moving `REGDISPLAY` and
  `CONTEXT` it uses into the `ExInfo` itself or moving debug members of
  `StackFrameIterator` and `REGDISPLAY` to the end of those structures
  so that the `AsmOffsets.cs` can be simplified. It also may be possible
  to unify the exception handling callback that's used for ObjectiveC to
  use the managed version. I've tried and there were some ugly
  complications, so I've left it separated.
* There are two bug fixes for bugs unrelated to this PR and a removal of
  unused parameter in existing code that could be made as separate PRs
  before this PR.
  * `ProfilerEnter` and `ProfilerLeave` for the case of
    `UnmanagedCallersOnly` method were being called in preemptive mode.
  * NativeAOT code for rethrowing exception was incorrectly calling
    `DispatchEx` with last argument set to `activeExInfo._idxCurClause`
    to start at the last clause processed when the rethrown exception
    was originally thrown instead of starting from the first one again.
    I have a accidentally came with a simple test that discovered this
    bug and causes failures in  the original NativeAOT too.
* Changes in  the stackwalk.cpp add support for
  * Usage of `ExInfo` instead of `ExceptionTracker`
  * Handling of case when GC runs while finally funclet is on the stack
    and then again when the code is back in the new exception handling
    code in managed code before other finally or catch funclet is
    called. The NativeAOT solves that by disabling GC for the 2nd pass
    of EH, for this change it would not be reasonable.
  * Handling the GC reporting when funclet is found while walking the
    stack. It needs to scan frames of the managed code that handles the
    exception too,  since it contains live references. The old EH way
    doesn't have this case.
* I needed to add `GCFrame::Remove` method that can remove the `GCFrame`
  from any location in the chain. There is a managed runtime method that
  calls `GCReporting::Unregister` that was popping it with my changes
  out of order due to the exception handling code being managed.

Fix context initialization after rebase

* Remove Rhp prefix from the native helpers

* Fix handling of exceptions from JIT

The `UNINSTALL_UNWIND_AND_CONTINUE_HANDLER_NO_PROBE` in the
`EE_TO_JIT_TRANSITION` needs to rethrow an exception (if any) using native
exception handling mechanism instead of calling the new managed
exception handling, as the native exception needs to propagate through
some native code layers from there.
This change adds parameter to the
`UNINSTALL_UNWIND_AND_CONTINUE_HANDLER_NO_PROBE` macro to select whether
to rethrow the exception as native or to invoke the new managed
exception handling.

This problem didn't show up until I ran the coreclr tests with tiered
compilation disabled.

* Update UNINSTALL_UNWIND_AND_CONTINUE_HANDLER usage

There were three places where the UNINSTALL_UNWIND_AND_CONTINUE_HANDLER
needed to be replaced by
UNINSTALL_UNWIND_AND_CONTINUE_HANDLER_NO_PROBE(true).

* Rename INSTALL_UNWIND_AND_CONTINUE_HANDLER_NO_PROBE

To INSTALL_UNWIND_AND_CONTINUE_HANDLER_EX, as the old name is obsolete
…t build time (#90978)

At present the jiterpreter has to allocate a lot of space for AOT-only optimizations. This PR flows through the RunAOTCompilation msbuild property when linking the wasm runtime JS, which allows us to skip allocating that space for applications that were not AOTed and improves startup performance.
* Update dependencies from https://github.com/dotnet/installer build 20230823.5

Microsoft.Dotnet.Sdk.Internal
 From Version 9.0.100-alpha.1.23421.9 -> To Version 9.0.100-alpha.1.23423.5

* Update dependencies from https://github.com/dotnet/installer build 20230824.7

Microsoft.Dotnet.Sdk.Internal
 From Version 9.0.100-alpha.1.23421.9 -> To Version 9.0.100-alpha.1.23424.7

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* Update dependencies from https://github.com/dotnet/runtime build 20230814.1

Microsoft.DotNet.ILCompiler , Microsoft.NET.ILLink.Tasks , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , runtime.native.System.IO.Ports , System.Text.Json
 From Version 8.0.0-rc.1.23406.6 -> To Version 8.0.0-rc.1.23414.1

* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20230808.2

Microsoft.SourceBuild.Intermediate.source-build-reference-packages
 From Version 8.0.0-alpha.1.23381.3 -> To Version 8.0.0-alpha.1.23408.2

* Update dependencies from https://github.com/dotnet/sdk build 20230814.3

Microsoft.DotNet.ApiCompat.Task
 From Version 8.0.100-preview.7.23329.3 -> To Version 8.0.100-rc.1.23414.3

* Don't use latest ILLink package

* Work around ProcessFrameworkReferences bug

* Update dependencies from https://github.com/dotnet/emsdk build 20230814.1

Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport
 From Version 8.0.0-rc.1.23411.2 -> To Version 8.0.0-rc.1.23414.1

* Update dependencies from https://github.com/dotnet/arcade build 20230814.5

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.23411.1 -> To Version 8.0.0-beta.23414.5

Dependency coherency updates

Microsoft.DotNet.XliffTasks
 From Version 1.0.0-beta.23408.1 -> To Version 1.0.0-beta.23412.1 (parent: Microsoft.DotNet.Arcade.Sdk

* Update dependencies from https://github.com/dotnet/icu build 20230814.4

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 8.0.0-rc.1.23407.2 -> To Version 9.0.0-alpha.1.23414.4

* Update dependencies from https://github.com/dotnet/cecil build 20230814.1

Microsoft.DotNet.Cecil
 From Version 0.11.4-alpha.23407.2 -> To Version 0.11.4-alpha.23414.1

* Update dependencies from https://github.com/dotnet/sdk build 20230815.5

Microsoft.DotNet.ApiCompat.Task
 From Version 8.0.100-preview.7.23329.3 -> To Version 8.0.100-rc.1.23415.5

* Update dependencies from https://github.com/dotnet/arcade build 20230815.4

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.23411.1 -> To Version 8.0.0-beta.23415.4

Dependency coherency updates

Microsoft.DotNet.XliffTasks
 From Version 1.0.0-beta.23408.1 -> To Version 1.0.0-beta.23415.1 (parent: Microsoft.DotNet.Arcade.Sdk

* Update dependencies from https://github.com/dotnet/sdk build 20230816.8

Microsoft.DotNet.ApiCompat.Task
 From Version 8.0.100-preview.7.23329.3 -> To Version 9.0.100-alpha.1.23416.8

* Attempt to fix test problems

* Update dependencies from https://github.com/dotnet/xharness build 20230816.1

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 8.0.0-prerelease.23407.2 -> To Version 8.0.0-prerelease.23416.1

* Update dependencies from https://github.com/dotnet/sdk build 20230817.3

Microsoft.DotNet.ApiCompat.Task
 From Version 8.0.100-preview.7.23329.3 -> To Version 9.0.100-alpha.1.23417.3

* Update dependencies from https://github.com/dotnet/sdk build 20230817.11

Microsoft.DotNet.ApiCompat.Task
 From Version 8.0.100-preview.7.23329.3 -> To Version 9.0.100-alpha.1.23417.11

* Update dependencies from https://github.com/dotnet/arcade build 20230817.3

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.23411.1 -> To Version 8.0.0-beta.23417.3

Dependency coherency updates

Microsoft.DotNet.XliffTasks
 From Version 1.0.0-beta.23408.1 -> To Version 1.0.0-beta.23416.1 (parent: Microsoft.DotNet.Arcade.Sdk

* Update dependencies from https://github.com/dotnet/sdk build 20230817.25

Microsoft.DotNet.ApiCompat.Task
 From Version 8.0.100-preview.7.23329.3 -> To Version 9.0.100-alpha.1.23417.25

* Add dotnet9* feeds

* Update dependencies from https://github.com/dotnet/runtime build 20230818.2

Microsoft.DotNet.ILCompiler , Microsoft.NET.ILLink.Tasks , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , runtime.native.System.IO.Ports , System.Text.Json
 From Version 8.0.0-rc.1.23406.6 -> To Version 8.0.0-rc.1.23418.2

* Update dependencies from https://github.com/dotnet/sdk build 20230818.40

Microsoft.DotNet.ApiCompat.Task
 From Version 8.0.100-preview.7.23329.3 -> To Version 9.0.100-alpha.1.23418.40

* Update dependencies from https://github.com/dotnet/arcade build 20230819.1

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.23411.1 -> To Version 8.0.0-beta.23419.1

Dependency coherency updates

Microsoft.DotNet.XliffTasks
 From Version 1.0.0-beta.23408.1 -> To Version 1.0.0-beta.23418.1 (parent: Microsoft.DotNet.Arcade.Sdk

* Update dependencies from https://github.com/dotnet/sdk build 20230819.8

Microsoft.DotNet.ApiCompat.Task
 From Version 8.0.100-preview.7.23329.3 -> To Version 9.0.100-alpha.1.23419.8

* Update dependencies from https://github.com/dotnet/runtime-assets build 20230821.1

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.23408.1 -> To Version 8.0.0-beta.23421.1

* Update dependencies from https://github.com/dotnet/sdk build 20230820.17

Microsoft.DotNet.ApiCompat.Task
 From Version 8.0.100-preview.7.23329.3 -> To Version 9.0.100-alpha.1.23420.17

* Update dependencies from https://github.com/dotnet/runtime build 20230821.1

Microsoft.DotNet.ILCompiler , Microsoft.NET.ILLink.Tasks , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , runtime.native.System.IO.Ports , System.Text.Json
 From Version 8.0.0-rc.1.23406.6 -> To Version 8.0.0-rc.1.23421.1

* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20230814.1

Microsoft.SourceBuild.Intermediate.source-build-reference-packages
 From Version 8.0.0-alpha.1.23381.3 -> To Version 8.0.0-alpha.1.23414.1

* Update dependencies from https://github.com/dotnet/icu build 20230821.1

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 8.0.0-rc.1.23407.2 -> To Version 9.0.0-alpha.1.23421.1

* Update dependencies from https://github.com/dotnet/xharness build 20230821.1

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 8.0.0-prerelease.23407.2 -> To Version 8.0.0-prerelease.23421.1

* Update dependencies from https://github.com/dotnet/hotreload-utils build 20230821.1

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 8.0.0-alpha.0.23407.2 -> To Version 8.0.0-alpha.0.23421.1

* Update dependencies from https://github.com/dotnet/cecil build 20230821.1

Microsoft.DotNet.Cecil
 From Version 0.11.4-alpha.23407.2 -> To Version 0.11.4-alpha.23421.1

* Update dependencies from https://github.com/dotnet/sdk build 20230822.1

Microsoft.DotNet.ApiCompat.Task
 From Version 8.0.100-preview.7.23329.3 -> To Version 9.0.100-alpha.1.23422.1

* Remove unused parameter (dotnet/arcade#13961)

* Try to fix NativeAOT helix correlation payload issue

* Revert a change

* Update dependencies from https://github.com/dotnet/arcade build 20230822.1

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.23411.1 -> To Version 8.0.0-beta.23422.1

Dependency coherency updates

Microsoft.DotNet.XliffTasks
 From Version 1.0.0-beta.23408.1 -> To Version 1.0.0-beta.23418.1 (parent: Microsoft.DotNet.Helix.Sdk

* Update dependencies from https://github.com/dotnet/runtime-assets build 20230823.1

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.23408.1 -> To Version 8.0.0-beta.23423.1

* Update dependencies from https://github.com/dotnet/emsdk build 20230822.1

Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport
 From Version 9.0.0-alpha.1.23415.2 -> To Version 9.0.0-alpha.1.23422.1

* Update dependencies from https://github.com/dotnet/sdk build 20230823.2

Microsoft.DotNet.ApiCompat.Task
 From Version 8.0.100-preview.7.23329.3 -> To Version 9.0.100-alpha.1.23423.2

* Dependency coherency updates

runtime.linux-arm64.Microsoft.NETCore.Runtime.ObjWriter,runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter,runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.ObjWriter,runtime.linux-musl-x64.Microsoft.NETCore.Runtime.ObjWriter,runtime.win-arm64.Microsoft.NETCore.Runtime.ObjWriter,runtime.win-x64.Microsoft.NETCore.Runtime.ObjWriter,runtime.osx-arm64.Microsoft.NETCore.Runtime.ObjWriter,runtime.osx-x64.Microsoft.NETCore.Runtime.ObjWriter,runtime.linux-arm64.Microsoft.NETCore.Runtime.JIT.Tools,runtime.linux-x64.Microsoft.NETCore.Runtime.JIT.Tools,runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.JIT.Tools,runtime.linux-musl-x64.Microsoft.NETCore.Runtime.JIT.Tools,runtime.win-arm64.Microsoft.NETCore.Runtime.JIT.Tools,runtime.win-x64.Microsoft.NETCore.Runtime.JIT.Tools,runtime.osx-arm64.Microsoft.NETCore.Runtime.JIT.Tools,runtime.osx-x64.Microsoft.NETCore.Runtime.JIT.Tools,runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk,runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools,runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk,runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools,runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk,runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools,runtime.linux-musl-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk,runtime.linux-musl-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools,runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk,runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools,runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk,runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools,runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk,runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
 From Version 16.0.5-alpha.1.23408.1 -> To Version 16.0.5-alpha.1.23414.1 (parent: Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport

* Update dependencies from https://github.com/dotnet/sdk build 20230824.6

Microsoft.DotNet.ApiCompat.Task
 From Version 8.0.100-preview.7.23329.3 -> To Version 9.0.100-alpha.1.23424.6

* Exclusion for Microsoft.NET.ILLink.Tasks

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Sven Boemer <[email protected]>
Co-authored-by: Larry Ewing <[email protected]>
Co-authored-by: Alexander Köplinger <[email protected]>
Co-authored-by: Nikola Milosavljevic <[email protected]>
janvorli and others added 5 commits September 7, 2023 01:05
For some reason lost in the past, the generated Windows and Unix
coreclr test scripts use different style of options passing.
On windows, the option and its value are passed separated by
space, e.g. `-coreroot c:\runtime\coreclr` while Unix separate
them by `=`, e.g. `-coreroot=~/runtime/coreclr`. The Unix way
has a disadvantage when I try to use command line completion
to find the coreroot path I want to pass in. Most shells
try to treat the `-coreroot=` as part of the path and so the
completion doesn't work. So I keep doing an awkward thing -
putting space after the `=` and deleting it after the completion.

This change adds the windows style option passing as an optional
way to these scripts.
# Conflicts:
#	eng/Subsets.props
#	src/coreclr/inc/targetosarch.h
#	src/coreclr/jit/morph.cpp
#	src/coreclr/nativeaot/Bootstrap/main.cpp
#	src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets
#	src/coreclr/nativeaot/Runtime/CommonMacros.h
#	src/coreclr/nativeaot/Runtime/portable.cpp
#	src/coreclr/runtime.proj
#	src/coreclr/tools/aot/ILCompiler/ILCompilerRootCommand.cs
#	src/installer/pkg/projects/nativeaot-packages.proj
#	src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
#	src/libraries/System.Private.CoreLib/src/System/Globalization/GlobalizationMode.cs
#	src/tests/Directory.Build.targets
#	src/tests/nativeaot/SmokeTests/PInvoke/PInvoke.csproj
#	src/tests/nativeaot/SmokeTests/SharedLibrary/SharedLibrary.csproj
put gc frozen segments in FEATURE_EVENT_TRACE
update ehcont config
add false for tryUnwrapException
update for libbootstrapper as object
other minor merge errors
@jkotas jkotas added the area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly) label Sep 15, 2023
…ge-sep-23

# Conflicts:
#	src/coreclr/tools/aot/ILCompiler.LLVM/CodeGen/LLVMObjectWriter.cs
remove  unix/PalCreateDump.cpp for WASM
correct merge for LLVMObjectWriter.cs
comment TestGeneration2Rooting
remove StackTraces test for WASM
reinstate Gen 2 test (applying upstream fix)
disable StackTraceMetadata for wasi
@yowl yowl marked this pull request as ready for review September 27, 2023 17:51
@@ -713,8 +713,7 @@ if (CLR_CMAKE_BUILD_LLVM_JIT)
list(FILTER JIT_SOURCES EXCLUDE REGEX regalloc\.cpp)

# We'll be linking against LLVM built without /guard:ehcont, so disable it.
string(REPLACE "/guard:ehcont" "" CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS})
string(REPLACE "/guard:ehcont" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
set_property(GLOBAL PROPERTY CLR_EH_CONTINUATION OFF)
Copy link

@SingleAccretion SingleAccretion Sep 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why GLOBAL? I would expect you only need to turn it off for the LLVM Jit targets:

set_target_properties(clrjit_browser_wasm32_${ARCH_HOST_NAME} PROPERTIES CLR_EH_CONTINUATION OFF)
# I don't know if CMake errors out on no-existent targets, so this may need to be commented.
set_target_properties(clrjit_browser_wasm64_${ARCH_HOST_NAME} PROPERTIES CLR_EH_CONTINUATION OFF)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to where we actually create the target which removes the need for commenting thewasm64

Comment on lines +158 to +161
public CliOption<string[]> WasmImport { get; } =
new("--wasmimport") { Description = "WebAssembly import module names for PInvoke functions"};
public CliOption<string[]> WasmImportList { get; } =
new("--wasmimportlist") {Description = "File with list of WebAssembly import module names for PInvoke functions"};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you manually check if these continue to work? Just to protect against changes in the meaning of the type argument...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried both wasmimport and wasmimportlist and they look fine, correctly adding the attribute in the LLVM (I just picked some imports to play with):

attributes #0 = { "wasm-import-module"="SomeModule" "wasm-import-name"="GetNativeFunctionToCall" }
attributes #1 = { "wasm-import-module"="SomeModule" "wasm-import-name"="NativeIntToDouble" }

@@ -517,6 +517,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<CustomLinkerArg Condition="'$(Optimize)' != 'true'" Include="$(WasmOptimizationSetting) -flto" />
<CustomLinkerArg Condition="'$(IlcLlvmTarget)' != ''" Include="-target $(IlcLlvmTarget)" />
<CustomLinkerArg Condition="'$(IlcLlvmExceptionHandlingModel)' == 'wasm'" Include="-fwasm-exceptions" />
<CustomLinkerArg Condition="'$(StackTraceSupport)' == 'false'" Include="-Wl,--strip-all" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this will strip all debug info, not just the stack trace data, which is not very satisfactory. Let's bundle this work into #2404 and disable the tests.

Comment on lines +622 to +626
#else
void PalCreateCrashDumpIfEnabled()
{
}
#endif // !defined(HOST_WASM)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be cleaner to create a no-op PalCreateDump.cpp under the /wasm directory and so avoid modifying upstream code.

WASM does have the concept of a core dump, but it'll likely take years before we will be able to collect one from within WASM itself (or even JS).

Comment on lines 11 to 13
#if !defined(HOST_WASM)
extern void PalCreateCrashDumpIfEnabled(int signal, siginfo_t* siginfo = nullptr, void* exceptionRecord = nullptr);
#endif // !defined(HOST_WASM)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recall CI was seeing failures to the effect of undefined siginfo_t; you could forward-declare it to avoid the #ifdef.

Copy link

@SingleAccretion SingleAccretion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo remaining feedback. Thank you!

@@ -13,10 +13,11 @@
#include <unistd.h>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <signal.h>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably all changes in this file can now be reverted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, thanks

src/coreclr/nativeaot/Runtime/unix/PalCreateDump.h Outdated Show resolved Hide resolved
src/coreclr/nativeaot/Runtime/unix/PalRedhawkUnix.cpp Outdated Show resolved Hide resolved
src/coreclr/nativeaot/Runtime/unix/PalRedhawkUnix.cpp Outdated Show resolved Hide resolved
src/coreclr/nativeaot/Runtime/wasm/PalCreateDump.cpp Outdated Show resolved Hide resolved
@jkotas
Copy link
Member

jkotas commented Oct 6, 2023

Thank you!

@jkotas jkotas merged commit 8f11462 into dotnet:feature/NativeAOT-LLVM Oct 6, 2023
11 checks passed
@yowl yowl deleted the merge-sep-23 branch October 6, 2023 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly)
Projects
None yet
Development

Successfully merging this pull request may close these issues.