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

Fix clr build on illumos-x64 #82183

Merged
merged 4 commits into from
Feb 16, 2023
Merged

Conversation

am11
Copy link
Member

@am11 am11 commented Feb 15, 2023

70e1072 relaxed the condition around add_subdirectory(nativeaot) in src/coreclr/CMakeLists.txt, which also enabled nativeaot runtime build on illumos-x64.

The inclusion chain:

/crossrootfs/x64/usr/include/sys/regset.h
/crossrootfs/x64/usr/include/ucontext.h
/runtime/src/coreclr/nativeaot/Runtime/unix/UnixContext.h
/runtime/src/coreclr/nativeaot/Runtime/thread.h
/runtime/src/coreclr/nativeaot/Runtime/startup.cpp

causes a conflict with redefinition of these constants: https://github.com/illumos/illumos-gate/blob/967a528a/usr/src/uts/intel/sys/regset.h#L103-L106. Those constants are unrelated to cpuidInfo on the platform (illumos x64 also uses 0, 1, 2, 3 for cpuid https://github.com/illumos/illumos-gate/blob/967a528a/usr/src/lib/libc/amd64/gen/proc64_id.c#L42).

I was going to update the cmake condition to exclude illumos, but since this naming conflict was the only error, I went ahead and prefixed the constant names with R_.

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Feb 15, 2023
@ghost
Copy link

ghost commented Feb 15, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

70e1072 relaxed the condition around add_subdirectory(nativeaot) in src/coreclr/CMakeLists.txt. Which also enabled nativeaot runtime build on illumos-x64.

The inclusion chain:

/crossrootfs/x64/usr/include/sys/regset.h
/crossrootfs/x64/usr/include/ucontext.h
/runtime/src/coreclr/nativeaot/Runtime/unix/UnixContext.h
/runtime/src/coreclr/nativeaot/Runtime/thread.h
/runtime/src/coreclr/nativeaot/Runtime/startup.cpp

causes a conflict with redefinition of these constants. https://github.com/illumos/illumos-gate/blob/967a528a/usr/src/uts/intel/sys/regset.h#L103-L106. Those constants are unrelated to cpuidInfo on the platform (illumos x64 also uses 0, 1, 2, 3 for cpuid https://github.com/illumos/illumos-gate/blob/967a528a/usr/src/lib/libc/amd64/gen/proc64_id.c#L42).

I was going to update the cmake condition to exclude illumos, but since this naming conflict was the only error, I went ahead and prefixed the constant names with R_.

Author: am11
Assignees: -
Labels:

community-contribution, area-NativeAOT-coreclr

Milestone: -

@am11 am11 requested a review from janvorli February 15, 2023 18:52
Copy link
Member

@janvorli janvorli 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 Feb 16, 2023

It would be nice to keep the shape in sync with

const int EAX = CPUID_EAX;

@jkotas jkotas merged commit bf5115f into dotnet:main Feb 16, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Mar 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-NativeAOT-coreclr community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants