Skip to content

Commit

Permalink
Fix aarch64 build by always using vectorcall
Browse files Browse the repository at this point in the history
Summary: aarch64 builds are failing due to the x64 inline assembly.  We don't support the JIT there, so this just makes our vectorcall entry points == standard entry points.  We also don't currently use static Python there so really I'm just making sure the build works :)

Reviewed By: jbower-fb

Differential Revision: D45707919

fbshipit-source-id: 68b45c14fb4c48987686c1652c6245436f071e92
  • Loading branch information
DinoV authored and facebook-github-bot committed May 9, 2023
1 parent e6cdf24 commit 4b69be1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Jit/pyjit.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,12 @@ PyAPI_FUNC(PyObject*) _PyJIT_GenYieldFromValue(PyGenObject* gen);
/*
* Specifies the offset from a JITed function entry point where the static
* entry point lives */
#if defined(_M_X64) || defined(_M_AMD64) || defined(__x86_64__)
#define JITRT_STATIC_ENTRY_OFFSET (-11)
#else
/* Without JIT support there's no entry offset */
#define JITRT_STATIC_ENTRY_OFFSET (0)
#endif

/*
* Fixes the JITed function entry point up to be the static entry point after
Expand Down
10 changes: 9 additions & 1 deletion Python/classloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ invoke_from_native(PyObject *original, PyObject *func, void **args)
// entry points into the v-table and can easily switch to the vector call
// form when we're invoking from the interpreter or somewhere that can't use
// the native calling convention.
#if defined(_M_X64) || defined(_M_AMD64) || defined(__x86_64__)
#define VTABLE_THUNK(name) \
void name##_dont_bolt(void) { \
__asm__( \
Expand Down Expand Up @@ -736,7 +737,14 @@ invoke_from_native(PyObject *original, PyObject *func, void **args)
"leave\n" \
); \
}

#else
#define VTABLE_THUNK(name) \
PyObject *name##_dont_bolt(PyObject *state, \
PyObject *const *args, \
size_t nargsf) { \
return name##_vectorcall(state, args, nargsf); \
}
#endif

PyObject *
type_vtable_coroutine_property_vectorcall(_PyClassLoader_TypeCheckState *state,
Expand Down

0 comments on commit 4b69be1

Please sign in to comment.