-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[LoongArch64] add the coreclr/pal directory #62887
Conversation
update from runtime.
@shushanhf, I assume you have just applied libunwind/libunwind@c5f1d12 on v1.6.2 and not copied the upstream master branch, right? If not please only apply the commit which is needed. Also, please update the version file so we can keep track of changes. This helps us when updating libunwind dependency. e.g. in
|
It may make sense to submit the libunwind update as separate PR. |
In fact we used the first version libunwind for .NET6 and passed, then our company commits it to the upstream. |
|
I think if you could create a separate PR just for libunwind, as @jkotas suggested (collecting only the libunwind related changes from #62889 and this PR), i.e. everything under In terms of bash: # start fresh
git remote add dotnet https://github.com/dotnet/runtime
git checkout -b feature/loongarch64/libunwind
git fetch --all
git reset --hard dotnet/main
# apply a clean patch
curl -sSL https://github.com/libunwind/libunwind/commit/c5f1d12.patch |\
git apply - --directory src/coreclr/pal/src/libunwind
# manually update src/coreclr/pal/src/libunwind/libunwind-version.txt
# manually update CMakeLists.txt etc. (as you did in this PR: #62092)
git commit -m "Add loongarch64 support in libunwind"
git push -u origin feature/loongarch64/libunwind
# create a new PR from branch 'feature/loongarch64/libunwind' The next time someone will update this lib, it will save them trouble to compare files and instead they will just follow our regular steps (#62092 (comment)). I am working on improving it a little bit so we don't modify CMakeLists.txt and friends in vendor's directory and changing libunwind's location to |
Thanks for your review and advices, |
It will be commited within a new PR.
Had pushed the libunwind separately by #62979 |
if(NOT CLR_CMAKE_TARGET_ARCH_LOONGARCH64) | ||
target_link_libraries(coreclrtraceptprovider | ||
${LTTNG} | ||
) | ||
else() | ||
target_link_libraries(coreclrtraceptprovider | ||
lttng-ust-tracepoint | ||
urcu | ||
urcu-bp | ||
urcu-cds | ||
urcu-common | ||
${LTTNG} | ||
) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious, what is the error if we don't make this change? lttng-ust-tracepoint is actually a soft dependency, i.e. this library gets loaded via dlopen()
during the run time of application. Even the existing target_link_libraries
is not needed, it is a leftover from past refactoring, we can just delete it altogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious, what is the error if we don't make this change? lttng-ust-tracepoint is actually a soft dependency, i.e. this library gets loaded via
dlopen()
during the run time of application. Even the existingtarget_link_libraries
is not needed, it is a leftover from past refactoring, we can just delete it altogether.
Yes, I thinks so.
I check it within my machine now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review!
I had deleted the modification. (I guess that it's old code from the mips64 when we porting it.)
Now this PR can be compiled sucessfully on the native mode. What should I do next ? |
Now the compiling errors are within the manged product. |
The native and managed jitinterfaces used by crossgen2 are not in synchronized state anymore. If |
The JIT interface changes should be excluded from this PR. This PR should be only touching the PAL. |
Agreed with @jkotas. PAL changes in a separate PR as a first component during a platform port makes things much clearer for coreclr partition. @shushanhf, could you please revert changes in files which are not under
|
Thanks, I will do it. |
@janvorli Is this something you could review? @shushanhf Looks like some jobs failed. Maybe you need to make sure the branch is up to date and retrigger the testing. |
Yes, I will take a look today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks good, I have just two comments.
CONTEXT_CaptureContext(lpContext); | ||
#else | ||
_ASSERT(!"unimplemented on LOONGARCH64 yet"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be implemented in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.
I had delete the assert for having implements of the CONTEXT_CaptureContext
.
src/coreclr/pal/inc/pal.h
Outdated
@@ -2453,6 +2601,9 @@ PALIMPORT BOOL PALAPI PAL_VirtualUnwindOutOfProc(CONTEXT *context, KNONVOLATILE_ | |||
#define PAL_CS_NATIVE_DATA_SIZE 56 | |||
#elif defined(__sun) && defined(__x86_64__) | |||
#define PAL_CS_NATIVE_DATA_SIZE 48 | |||
#elif defined(__linux__) && defined(__loongarch64) | |||
////TODO for LOONGARCH64: should confirm !!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to confirm this before merging this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
I have update it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
The CI failures look like unrelated infrastructure. Merging. |
[LoongArch64] add the coreclr/pal and libunwind directory.