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 to Sep 24 #2688

Merged
merged 666 commits into from
Oct 8, 2024

Conversation

yowl
Copy link
Contributor

@yowl yowl commented Sep 17, 2024

This PR merges from upstream to Sep 2024.

I made acdHelper public so we can access it from llvm codegen

See the comments at the end re non-running tests and failure on linux to find libz

pavelsavara and others added 30 commits September 4, 2024 20:14
…es instead of aborting the trace (#107323)

Better diagnostic output when jiterp hits an invalid opcode
* Fix getting SSP for threadabort in funceval

Diagnostics test that test threadabort during funceval crashes on
machines with CET enabled. The reason is that when a thread is
redirected to the RedirectForThrowControl, the original instruction
address from which we've redirected is not on the shadow stack.
That causes the exception handling propagating the related
thread abort to fail finding that instruction address on the shadow
stack. It walks out of its range and then crashes with access
violation.

This change fixes it by storing the SSP in the FaultingExceptionFrame
and copying it to the REGDISPLAY when UpdateRegDisplay is called on
that frame. That way the correct SSP is already known in the SfiInit and
we don't need to look it up.

* Clear rax before rdsspq for proper behavior on non-cet devices

---------

Co-authored-by: Jan Vorlicek <jan.vorlicek@volny,cz>
This was added in #101666 to address a point in time issue. It should not be needed anymore.
* Fix meter/instrument filtering in MetricsEventSource

* Address the feedback
Due to an apparent typo, The CrossGen2SynthesizePgo test flag simply always skipped tests on Windows, instead of just skipping tests when synthesize pgo testing was enabled.
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
…move separate allocate load level (#107224)

There is no logical distinction between creating a `DomainAssembly` and an `Assembly` now. Making `DomainAssembly` create the `Assembly` as soon as it is constructed should make it so that we can switch assorted things that currently store/use `DomainAssembly` to `Assembly`, since they will be created at the same time.
* Provide System.Composition.AttributedModel package readme

* Improve after feedback

* Set correct PackageDescription
…local with the exact type and assigning to/from it (#107219)
- docs/
- test/
- arch/s390/self-hosted-builder/
This patch fixes System.Text.Json.Serialization.Tests.CacheTests on Debug build.
* ARM64-SVE: Delay free all ops within conditional select

* Fix comment

* Add test header

* don't delay prefUseOpNum

* Fix FMA

* Add assert checks for delay free

* Merge embedded op build code

* fix formatting

* simplify assert

* simplify FMA code

* Add tests for 106867

* ARM64-SVE: Allow op inside conditionselect to be non HWintrinsic

TEST_IMG: ubuntu/dotnet-build
TEST_CMD: safe ./projects/dotnet/build-runtime.sh

Jira: ENTLLT-7634
Change-Id: I337a291be6661f104fe90c7cdc27150eede43647

* Add Sve.IsSupported to tests

* Add Sve.IsSupported to test

* fix formatting

* Revert "ARM64-SVE: Allow op inside conditionselect to be non HWintrinsic"

* Revert "ARM64-SVE: Allow op inside conditionselect to be non HWintrinsic"

* Revert "ARM64-SVE: Allow op inside conditionselect to be non HWintrinsic"
… (#107009)

* Check CancellationToken before TimeSpan.Zero in TimeProviderTaskExtensions

This makes the down-level behavior for Delay and WaitAsync match the
behavior in .NET 8 and later, prefering to return a Canceled task over
a Completed task or TimeoutException when the TimeSpan is Zero and the
CancellationToken is already Canceled.

Fixes #106996

* Test improvements based on feedback

---------

Co-authored-by: Tarek Mahmoud Sayed <10833894+tarekgh@users.noreply.github.com>
…in ilc.exe for native aot (#106716)

* Fix a case in MethodImpl overriding which wasn't handled as expected in ilc.exe for native aot
- This was causing real C# applications to fail to behave correctly on NativeAOT builds
- Enable testing for covariant byref returns on nativeaot (split testing up so that the tests do not expect TypeLoadException, which NativeAOT doesn't reliably generate)
- Put copy of attributetesting.il test into the managed type system unit test suite
- Add regression test of issue noted in #96175 into managed type system unit test suite
- Update workflow documentation to include a better path to finding details on how to run CoreCLR and Libraries tests for Native AOT

Fixes #96175
fix occurrences typo
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
There is a problem with the variant of the stack overflow test that can
overflow in a native function on ARM. The EHABI unwind info is not
present for leaf functions and libunwind is unable to unwind from the
failure location to the first managed frame.

I've created an issue (#107184) for the underlying problem. This PR
disables that test variant until the problem is fixed.

Close #106742
* Fix stack overflow reporting with multiple PALs

A recently reported issue in the stack overflow test running with
superpmi collect has revealed that there is a problem when multiple
shared libraries using coreclr PAL are loaded into the process.
Each such library registers signal handlers, including the SIGSEGV
one. The unexpected thing in the SIGSEGV handler in this scenario
is the fact that the GetCurrentPalThread() returns NULL in the
non-coreclr shared libraries in case the library didn't invoke
any function that would create the thread object.
That leads to the handler just writing "Stack overflow." to
the console and then calling PROCAbort(). This abort causes the process
to be torn down without reporting the stack overflow with full stack
trace by the coreclr.

This change fixes it by calling the previous registered handler instead
aborting in this case. That gives the coreclr SIGSEGV handler a chance to
do the reporting as expected.

* Reflect PR feedback - move comment
@yowl
Copy link
Contributor Author

yowl commented Oct 6, 2024

Got there finally. Can be reviewed again, thanks!

Comment on lines 1632 to 1634
nonNullReturn = true;
break;

Choose a reason for hiding this comment

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

Suggested change
nonNullReturn = true;
break;
noThrow = true;
nonNullReturn = true;
break;
case CORINFO_HELP_READYTORUN_GENERIC_HANDLE:
// Typically this is a no-throw call, but may become always-throw when fetching an unavailable handle.
isPure = true;
nonNullReturn = true;
break;

And take out case CORINFO_HELP_READYTORUN_GENERIC_HANDLE from above. There is no need to pessimize the other helpers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks.

Comment on lines 170 to 173

internal ClientCertificateOption ClientCertificateOptions;


Choose a reason for hiding this comment

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

Whitespace changes should 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.

Done.

<ItemGroup>
<ILLinkSubstitutionsXmls Include="$(ILLinkDirectory)ILLink.Substitutions.xml" />
<ILLinkSubstitutionsXmls Include="$(ILLinkDirectory)ILLink.Substitutions.xml" Condition="'$(TargetPlatformIdentifier)' != 'wasi'"/>

Choose a reason for hiding this comment

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

Condition="'$(TargetPlatformIdentifier)' != 'wasi'" still needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, removed. Thanks.

@@ -8,6 +8,7 @@ parameters:
testFilter: tree nativeaot
isOfficialBuild: false
librariesConfiguration: Debug
crossArg: $(crossArg)

Choose a reason for hiding this comment

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

Why indirect through the parameters template arguments, instead of using $(crossArg) directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no reason, removed.

<Target Name="GenerateExecutionScriptsInternal"
Condition="$(_CLRTestNeedsToRun) or $(_CLRTestBuildsExecutable)"
DependsOnTargets="FetchExternalProperties;Generate@(ExecutionScriptKind, 'ExecutionScript;Generate')ExecutionScript;" />

<Target Name="GenerateLocalRunnerScript" DependsOnTargets="GenerateRunScript" AfterTargets="PublishTestAsSelfContained" />

<Import Project="$(RepositoryEngineeringDir)testing\tests.targets" />

Choose a reason for hiding this comment

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

Revert this file?

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/tests/Directory.Build.targets Outdated Show resolved Hide resolved
src/coreclr/inc/jithelpers.h Show resolved Hide resolved
</ItemGroup>

Choose a reason for hiding this comment

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

Suggested change

Reducing diffs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, spaes added.

yowl and others added 8 commits October 7, 2024 14:09
Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
revert mergedrunnermobile.targets change
revert mergedrunnermobile.targets change
remoe wasi condition in System.System.Net.Http.csproj
revert ws removal
@yowl
Copy link
Contributor Author

yowl commented Oct 8, 2024

Latest feedback addressed, thanks!

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, thank you!

@jkotas
Copy link
Member

jkotas commented Oct 8, 2024

Thank you all!

@jkotas jkotas merged commit 21054eb into dotnet:feature/NativeAOT-LLVM Oct 8, 2024
15 checks passed
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.