https://bugs.kde.org/show_bug.cgi?id=369723
Benoit Jacob <benoitja...@google.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |benoitja...@google.com --- Comment #7 from Benoit Jacob <benoitja...@google.com> --- Created attachment 120388 --> https://bugs.kde.org/attachment.cgi?id=120388&action=edit Implement VG_MINIMAL_SETJMP in inline assembly on Android/arm64 Here is another patch written from scratch / from first principles, separate from the bionic code that was discussed earlier here. It is available under the current licensing terms of the valgrind file it modifies. Comments should explain the details / why I think it's correct, but let me know if I missed something. I did take very literally the comment at the top of this file saying that it was enough to save only integer registers, so this patch does only that (the patch that had been considered earlier in this bug was also saving floating-point registers). I've also noticed that VG_MINIMAL_LONGJMP was hardcoding the value 1 for the second parameter, so this patch hardcodes that. So I really think this implementation is minimal. Together with the patch on bug 339861, this allows building Valgrind on Android NDK r19c, arm64 (clang toolchain). I've tested this manually on some testcases, this does seem to work as intended. The choice of inline assembly to implement this directly in the header was partly because it allowed to keep everything local (the definition of the jmpbuf struct and the two functions, setjmp and longjmp, that it's private to), partly because that saved me the hassle of touching the buildsystem and partly because I'm just more familiar with inline assembly. Let me know if you require an out-of-line implementation in a .S file but then please advise on the path of that file and give some pointers to integrate that in the build system (conditionally compiling that file on android/arm64). Technically, this code should be correct on arm64 regardless of OS(android) but there were just enough scary notes about some registers' special roles depending on the OS in section 5.1.1. of the Aaarch PCS document (link in comment in the patch) that I thought it safer to keep this restricted to android for now, which is all I've tested. -- You are receiving this mail because: You are watching all bug changes.