Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

[x86/Linux] Fix unknown type name 'PTR_RUNTIME_FUNCTION'#8272

Merged
janvorli merged 1 commit into
dotnet:masterfrom
seanshpark:x86pal10
Nov 28, 2016
Merged

[x86/Linux] Fix unknown type name 'PTR_RUNTIME_FUNCTION'#8272
janvorli merged 1 commit into
dotnet:masterfrom
seanshpark:x86pal10

Conversation

@seanshpark
Copy link
Copy Markdown

@seanshpark seanshpark commented Nov 23, 2016

Fix compile error for x86/Linux

  • add PTR_RUNTIME_FUNCTION and others in daccess.h, clrnt.h and palrt.h
  • these are copy of !FEATURE_PAL in corecompile.h

@seanshpark
Copy link
Copy Markdown
Author

@janvorli , @jkotas , @gkhanna79 , PTAL

Comment thread src/pal/inc/pal.h Outdated
DWORD UnwindData;
} RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;

#if defined(_X86_)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These should be defined elsewhere to match the other architectures.
The PTR_RUNTIME_FUNCTION should rather be defined in daccess.h, extending the #ifdef for TARGET_X86 && FEATURE_PAL:
https://github.com/dotnet/coreclr/blob/master/src/inc/daccess.h#L2404
The RUNTIME_FUNCTION__BeginAddress should go to clrnt.h close to where it is defined for TARGET_AMD64.
As for the RUNTIME_FUNCTION_INDIRECT, I would put it into palrt.h, next to the definition for TARGET_AMD64

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

OK, thank you :)

@seanshpark
Copy link
Copy Markdown
Author

If it is ok, I'd like to move PTR_RUNTIME_FUNCTION, RUNTIME_FUNCTION__BeginAddress and RUNTIME_FUNCTION_INDIRECT in corcompile.h also.

@janvorli
Copy link
Copy Markdown
Member

@seanshpark we need to have these in corcompile.h for Windows x86, since neither pal.h nor palrt.h are included for Windows builds.
So thinking about it more, I would recommend reverting the change you did to corcompile.h before and only wrap the RUNTIME_FUNCTION definition in #ifndef FEATURE_PAL there and drop the current change completely.

@seanshpark
Copy link
Copy Markdown
Author

@janvorli , oh, it's not a good idea to change. OK then, could you review current changes? I hope these are what you meant.

@janvorli
Copy link
Copy Markdown
Member

@seanshpark I cannot see any new changes here - maybe you've forgotten to push?

@seanshpark
Copy link
Copy Markdown
Author

@janvorli , um... isn't current change e943f06 has what you pointed in #8272 (comment) ?

@janvorli
Copy link
Copy Markdown
Member

I've said in my next comment:
So thinking about it more, I would recommend reverting the change you did to corcompile.h before and only wrap the RUNTIME_FUNCTION definition in #ifndef FEATURE_PAL there (meaning in the corcompile.h) and drop the current change completely

Fix compile error for x86/Linux
- wrap only RUNTIME_FUNCTION in corcompile.h with !FEATURE_PAL
@seanshpark
Copy link
Copy Markdown
Author

@janvorli , OK, got it. I am sorry for my misunderstanding. I've dropped previous adding defines and changed to your guide. Now the code is better with smaller changes from what it was. If this is also going in a wrong direction, please point out again.

Copy link
Copy Markdown
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, that's what I've meant. Thank you!

@seanshpark
Copy link
Copy Markdown
Author

@dotnet-bot test Windows_NT x86 legacy_backend Checked Build and Test please
@dotnet-bot test Windows_NT x86 compatjit Checked Build and Test please

@RussKeldorph
Copy link
Copy Markdown

Please ignore the x86 compatjit and x86 legacy_backend job failures. They have been removed from future PRs.

Comment thread src/inc/corcompile.h
#ifdef _TARGET_X86_
#ifndef FEATURE_PAL
//
// x86 ABI does not define RUNTIME_FUNCTION. Define our own to allow unification between x86 and other platforms.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Make sure that the definition that we end up picking up from the PAL has the same two fields like this one - it does not appear to be the case.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sorry, I have difficulties understanding. Before the change it had only #ifdef _TARGET_X86_ so I rolled back what it was and added #ifndef FEATURE_PAL for not PAL.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@jkotas I have asked @seanshpark to do it this way to use the three field version on all Unix platforms, assuming we can converge to the same structure. Do you think it is a problem?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We are not converged to the three field version even on non-x86 platforms today:

The only platform that uses the three field version is amd64 (on both Windows and Unix).

arm and arm64 (on both Windows and Unix) use the two field version. Maybe that actually get compiled with the three field version on Unix, but the third field is just a dead weight. It is not used for anything. We should get rid of it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok, then we should also modify the definition in PAL to ifdef out the third field for other than AMD64.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Hope #8305 is the one.

@seanshpark
Copy link
Copy Markdown
Author

@dotnet-bot test Windows_NT x86 legacy_backend Checked Build and Test please
@dotnet-bot test Windows_NT x86 compatjit Checked Build and Test please

@seanshpark
Copy link
Copy Markdown
Author

Can this be merged? or do I have anything else to do?

@janvorli
Copy link
Copy Markdown
Member

@seanshpark sure, I am sorry, I have somehow confused myself into thinking that #8305 contained this chagne.

@janvorli janvorli merged commit eedc7cb into dotnet:master Nov 28, 2016
@seanshpark
Copy link
Copy Markdown
Author

Thank you :)

@seanshpark seanshpark deleted the x86pal10 branch November 28, 2016 11:44
@karelz karelz modified the milestone: 2.0.0 Aug 28, 2017
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…clr#8272)

Fix compile error for x86/Linux
- wrap only RUNTIME_FUNCTION in corcompile.h with !FEATURE_PAL

Commit migrated from dotnet/coreclr@eedc7cb
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants