Skip to content

Conversation

@uweigand
Copy link
Contributor

  • Add PAL implementation for Linux on s390x

  • Define BIGENDIAN on s390x when compiling coreclr

  • Do not run HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES cmake test when
    cross-compiling

Note to reviewers:

  • The primary intent of this patch is to enable building ilasm/ildasm on s390x (even though we do not support coreclr VM/JIT)
  • However, the PAL support provided here is still complete and passes all paltests
  • As there is no Windows on s390x, there is no pre-existing CONTEXT structure, so I made one up. In particular, the CONTEXT_S390X define re-uses the same value as CONTEXT_AMD64. Let me know if I should instead choose another bit.
  • Similarly, there is no s390x PE file format, so IMAGE_FILE_MACHINE_NATIVE is defined to IMAGE_FILE_MACHINE_UNKNOWN

@ghost ghost added the area-PAL-coreclr label May 26, 2021
@AaronRobinsonMSFT
Copy link
Member

/cc @janvorli

Copy link
Member

Choose a reason for hiding this comment

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

This is never executed while cross compiling, cmake skips all check_*_source_runs during cross compilation. The HAVE_xxx values for cross compilation are taken from the tryrun.cmake file. So this change should not be needed, but you'll need to update the eng/native/tryrun.cmake

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I missed that, sorry. Patch updated accordingly.

@uweigand
Copy link
Contributor Author

uweigand commented Jun 7, 2021

Ping? Anything else that needs to be addressed?

Copy link
Member

Choose a reason for hiding this comment

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

I have just noticed this #if has a wrong condition (event before your change). Since you are touching this code, could you please fix it? It should be

#if (HAVE_GREGSET_T || HAVE___GREGSET_T) && !defined(HOST_S390X)

Actually, the related #endif comment need to be updated to match your change (and this fix) to

#endif // HAVE_GREGSET_T || HAVE___GREGSET_T || !HOST_S390X

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Member

Choose a reason for hiding this comment

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

Can you please update the matching @endif comment?

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.

Copy link
Member

Choose a reason for hiding this comment

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

A nit - in the #endif comments, the convention we use is just !HOST_S390X instead of !defined(HOST_S390X)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I see. Updated.

* Add PAL implementation for Linux on s390x

* Define BIGENDIAN on s390x when compiling coreclr

* Provide a default HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE
  value in eng/native/tryrun.cmake
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!

@ghost
Copy link

ghost commented Jun 7, 2021

Hello @janvorli!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@uweigand
Copy link
Contributor Author

uweigand commented Jun 7, 2021

Thanks for the review! Would you mind having a look the two related PRs as well:
#53286
#53289
Both are required to get the PAL to actually build on s390x.

@marek-safar marek-safar merged commit 5d6278a into dotnet:main Jun 8, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jul 8, 2021
@uweigand uweigand deleted the s390x-clr-pal branch July 14, 2021 22:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants