fix mingw build and crashing bugs for Python Windows ARM64#496
fix mingw build and crashing bugs for Python Windows ARM64#496atgreen merged 2 commits intolibffi:masterfrom
Conversation
|
Please merge this change. The travis failure appears to be unrelated to these changes. |
|
The cpython project uses mingw to build libffi-7.dll for Python: see prepare_libffi.bat. Currently the Windows ARM64 version of libffi can't be built using mingw because configure.host and Makefile.am are missing support for this. Also, structured exception handling (SEH) tests using libffi in Python are failing because the current use of frame macros and bad pointer path with the constant The current implementation calls ffi_data_to_code_pointer which is incorrect since the Windows implementation uses the CRTs malloc and not dlmalloc. |
tromey
left a comment
There was a problem hiding this comment.
Thank you for the patch. I don't know aarch64 assembly, but I figured I could at least review parts of it. It looks pretty reasonable overall to me, just some nits to address.
|
@tromey Thanks for the review. I made the changes you requested and tested them on a Windows arm64 machine. |
|
Thanks! |
…o master Reviewed-by: Mike Ash <[email protected]> Reviewed-by: Matt Reda <[email protected]> * commit '2284bfc111229c3af01722d9aab23056025a8e01': (22 commits) darwin arm64e: libunwind requires that the CFA match the value used to sign LR arm64e: Fix frame size to 40b to match earlier change in aarch64/ffi.c Add missing arch guards around ffi_find_closure_for_code_np fix mingw build and crashing bugs for Python Windows ARM64 (libffi#496) Clear the apt cache More debugging output Debug moxie builds in travis libffi: added ARM64 support for Windows (libffi#486) uuencode compressed log files for travis hppa: avoid TEXTREL in .eh_frame section (libffi#447) fix x86/x64 MSVC build (libffi#487) add support for 32-bit ARM on Windows (libffi#477) fix check for Linux/aarch64 Cleanup symbol exports on darwin and add architecture preprocessor checks to assist in building fat binaries (eg: i386+x86_64 on macOS or arm+aarch64 on iOS) (libffi#450) Fix cfi checks for old compiler (libffi#453) changes for win32 on windows (libffi#468) aarch64: Flush code mapping in addition to data mapping (libffi#471) Remove -Os testing. No ABI impact, and helps trim log lengths. fix(configure): Correctly detect visibility("hidden") support on Darwin Fix Q registers parameter passing on ARM64 ...
Fix Windows arm64 build via mingw. This is needed for Python builds.
Fix crashing bug in ffi.c. Calling dlmalloc functions on Windows results in a crash, since dlmalloc isn't used in the build.
Fix crashing bug in SEH exception unrolling in win64_armasm.S. The current code results in stack corruption because the 32 byte offsets write in the wrong location.