-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Fix Linux x86 build #50836
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 Linux x86 build #50836
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -594,6 +594,7 @@ class CMiniMdBase : public IMetaModelCommonRO | |
|
||
|
||
protected: | ||
DAC_ALIGNAS(8) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc: @sdmaclea There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure why alignment to 8 is needed. I would rather expect DAC_ALIGNAS(IMetaModelCommonRO). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In
This check started to fail after recent changes to CMiniMdBase and CMiniMdSchema, where new class fields were added. So, I've added explicit 8 byte alignment |
||
CMiniMdSchema m_Schema; // data header. | ||
ULONG m_TblCount; // Tables in this database. | ||
BOOL m_fVerifiedByTrustedSource; // whether the data was verified by a trusted source | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -367,6 +367,7 @@ inline void ClrRestoreNonvolatileContext(PCONTEXT ContextRecord) | |
#include "pefile.inl" | ||
#include "excep.h" | ||
#include "method.hpp" | ||
#include "field.h" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which part of the change needs to have the field.h include here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is required on linux x86, because
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please instead move the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still get the original build error this way, because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I am sorry, I've found I've forgotten to add "cross" to my command line when trying to build for x86. Please keep it as you had it. |
||
#include "callingconvention.h" | ||
#include "frames.h" | ||
#include "qcall.h" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -483,22 +483,7 @@ class FieldDesc | |
return *(OBJECTREF *)GetCurrentStaticAddress(); | ||
} | ||
|
||
VOID SetStaticOBJECTREF(OBJECTREF objRef) | ||
{ | ||
CONTRACTL | ||
{ | ||
THROWS; | ||
GC_TRIGGERS; | ||
MODE_COOPERATIVE; | ||
INJECT_FAULT(COMPlusThrowOM()); | ||
} | ||
CONTRACTL_END | ||
|
||
GCPROTECT_BEGIN(objRef); | ||
OBJECTREF *pObjRef = (OBJECTREF *)GetCurrentStaticAddress(); | ||
SetObjectReference(pObjRef, objRef); | ||
GCPROTECT_END(); | ||
} | ||
VOID SetStaticOBJECTREF(OBJECTREF objRef); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the reason for moving this method out of the header? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also related to access to FieldDesc on linux x86 in |
||
|
||
void* GetStaticValuePtr() | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5471,7 +5471,7 @@ NOINLINE static void JIT_ReversePInvokeEnterRare2(ReversePInvokeFrame* frame, vo | |
// As a result, we specially decorate this method to have the correct calling convention | ||
// and argument ordering for an HCALL, but we don't use the HCALL macros and contracts | ||
// since this method doesn't follow the contracts. | ||
void F_CALL_CONV HCCALL3(JIT_ReversePInvokeEnterTrackTransitions, ReversePInvokeFrame* frame, CORINFO_METHOD_HANDLE handle, void* secretArg) | ||
HCIMPL3_RAW(void, JIT_ReversePInvokeEnterTrackTransitions, ReversePInvokeFrame* frame, CORINFO_METHOD_HANDLE handle, void* secretArg) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand the reason for switching some of the helpers calling convention. Can you please explain the purpose of these changes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Calling convention doesn't change here. Actual problem is incorrect usage of |
||
{ | ||
_ASSERTE(frame != NULL && handle != NULL); | ||
|
||
|
@@ -5520,8 +5520,9 @@ void F_CALL_CONV HCCALL3(JIT_ReversePInvokeEnterTrackTransitions, ReversePInvoke | |
INSTALL_EXCEPTION_HANDLING_RECORD(&frame->record.m_ExReg); | ||
#endif | ||
} | ||
HCIMPLEND_RAW | ||
|
||
void F_CALL_CONV HCCALL1(JIT_ReversePInvokeEnter, ReversePInvokeFrame* frame) | ||
HCIMPL1_RAW(void, JIT_ReversePInvokeEnter, ReversePInvokeFrame* frame) | ||
{ | ||
_ASSERTE(frame != NULL); | ||
|
||
|
@@ -5552,8 +5553,9 @@ void F_CALL_CONV HCCALL1(JIT_ReversePInvokeEnter, ReversePInvokeFrame* frame) | |
INSTALL_EXCEPTION_HANDLING_RECORD(&frame->record.m_ExReg); | ||
#endif | ||
} | ||
HCIMPLEND_RAW | ||
|
||
void F_CALL_CONV HCCALL1(JIT_ReversePInvokeExitTrackTransitions, ReversePInvokeFrame* frame) | ||
HCIMPL1_RAW(void, JIT_ReversePInvokeExitTrackTransitions, ReversePInvokeFrame* frame) | ||
{ | ||
_ASSERTE(frame != NULL); | ||
_ASSERTE(frame->currentThread == GetThread()); | ||
|
@@ -5574,8 +5576,9 @@ void F_CALL_CONV HCCALL1(JIT_ReversePInvokeExitTrackTransitions, ReversePInvokeF | |
} | ||
#endif | ||
} | ||
HCIMPLEND_RAW | ||
|
||
void F_CALL_CONV HCCALL1(JIT_ReversePInvokeExit, ReversePInvokeFrame* frame) | ||
HCIMPL1_RAW(void, JIT_ReversePInvokeExit, ReversePInvokeFrame* frame) | ||
{ | ||
_ASSERTE(frame != NULL); | ||
_ASSERTE(frame->currentThread == GetThread()); | ||
|
@@ -5589,6 +5592,7 @@ void F_CALL_CONV HCCALL1(JIT_ReversePInvokeExit, ReversePInvokeFrame* frame) | |
UNINSTALL_EXCEPTION_HANDLING_RECORD(&frame->record.m_ExReg); | ||
#endif | ||
} | ||
HCIMPLEND_RAW | ||
|
||
//======================================================================== | ||
// | ||
|
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.
@BruceForstall is the __stdcall removal ok?
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.
Yes, it is ok. We preffer to just use default calling convention whenever possible.