[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - bridges/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 4 11:40:57 UTC 2020


 bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 666fb8d3c6f5af94450d1f1b2249293fec0fe722
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Jan 7 17:35:18 2020 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Aug 4 13:40:23 2020 +0200

    aarch64 r18 is reserved at least on Android
    
    <https://github.com/ARM-software/software-standards/blob/master/abi/aapcs64/
    aapcs64.rst> states:  "The role of register r18 is platform specific.  If a
    platform ABI has need of a dedicated general purpose register to carry inter-
    procedural state (for example, the thread context) then it should use this
    register for that purpose.  If the platform ABI has no such requirements, then
    it should use r18 as an additional temporary register."
    
    For a --host=aarch64-linux-android build, Clang warned
    
    > bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx:39:9: error: inline asm clobber list contains reserved registers: X18 [-Werror,-Winline-asm]
    >         "ldp x0, x1, [%[gpr_]]\n\t"
    >         ^
    > <inline asm>:1:1: note: instantiated into assembly here
    >         ldp x0, x1, [x20]
    > ^
    > bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx:39:9: note: Reserved registers on the clobber list may not be preserved across the asm statement, and clobbering them may lead to undefined behaviour.
    >         "ldp x0, x1, [%[gpr_]]\n\t"
    >         ^
    > <inline asm>:1:1: note: instantiated into assembly here
    >         ldp x0, x1, [x20]
    > ^
    
    and <https://github.com/llvm/llvm-project/commit/
    9c9c8b22d2ea150cc889232871b0c8303d3644d9> "Start reserving x18 by default on
    Android targets" shows that at least LLVM/Clang claims that the Android ABI
    reserves it (though it doesn't cite any sources for that).
    
    (If this bridges/source/cpp_uno/ implementation is used for other non-Linux OS
    like Fuchsia, we may need to extend the #if accordingly; see the above LLVM
    commit for which platforms it claims reserve the register.)
    
    Change-Id: I62a5210ddc4784eee2ab56ee134b9e195827b9dd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86366
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100012
    Tested-by: Jan Holesovsky <kendy at collabora.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx
index 2f7188ea4f99..ba5194d6f8c8 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx
@@ -54,8 +54,11 @@ void callVirtualFunction(
            [ret_]"m" (ret),
            "m" (stackargs) // dummy input to prevent optimizing the alloca away
         : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",
-          "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18"/*TODO?*/, "v0",
-          "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "v11",
+          "r11", "r12", "r13", "r14", "r15", "r16", "r17",
+#if !defined ANDROID
+          "r18"/*TODO?*/,
+#endif
+          "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "v11",
           "v12", "v13", "v14", "v15", "v16", "v17", "v18", "v19", "v20", "v21",
           "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31",
           "memory"


More information about the Libreoffice-commits mailing list