Files
odfstudio/bridges
Michael Weghorn 1ccb2ecd4e linux_aarch64: Fix Android build with NDK 29
An Android build including autogen options

    --with-android-ndk=$HOME/Android/Sdk/ndk/29.0.14206865
    --with-distro=LibreOfficeAndroidAarch64

failed like this:

    .../bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx:604:29: error: cannot initialize a parameter of type 'char *' with an rvalue of type 'unsigned char *'
      604 |     __builtin___clear_cache(const_cast<unsigned char *>(begin), const_cast<unsigned char *>(end));
          |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

Tweak the version check introduced in

    commit 28e542dc61
    Date:   Wed Apr 23 13:17:21 2025 +0200

        Avoid loplugin:redundantcast on macOS with recent LLVM 21 trunk

        ...including
        <https://github.com/llvm/llvm-project/commit/b6b025797245a5e5416b522df041252e3c4ff868>
        "Fix the signature for __builtin___clear_cache (#134376)", which now caused

        > bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx:601:9: error: redundant reinterpret_cast, result is implicitly cast to void pointer [loplugin:redundantcast]
        >   601 |         reinterpret_cast<char *>(const_cast<unsigned char *>(begin)),
        >       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        > bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx:602:9: error: redundant reinterpret_cast, result is implicitly cast to void pointer [loplugin:redundantcast]
        >   602 |         reinterpret_cast<char *>(const_cast<unsigned char *>(end)));
        >       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

to not expect the new signature for Android NDK <= 29,
for which __clang_major__ is 21, but which doesn't have the
relevant commit mentioned in the commit message quoted above.

The NDK 29 release notes mention [1]:

> Updated LLVM to clang-r563880c. See clang_source_info.md in the toolchain
> directory for version information.

~/Android/Sdk/ndk/29.0.14206865/toolchains/llvm/prebuilt/linux-x86_64/clang_source_info.md
contains this:

> Base revision: [386af4a5c64ab75eaee2448dc38f2e34a40bfed0](https://github.com/llvm/llvm-project/commits/386af4a5c64ab75eaee2448dc38f2e34a40bfed0)

That referenced llvm-projects commit
386af4a5c64ab75eaee2448dc38f2e34a40bfed0 is indeed before
the b6b025797245a5e5416b522df041252e3c4ff868 one mentioned
above.

[1] https://github.com/android/ndk/wiki/Changelog-r29

Change-Id: I88419d0d8d47563d6d0d236dc17806979e56c831
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192378
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-10-14 17:42:20 +02:00
..
2024-11-10 10:50:15 +01:00
…
…

UNO Bridges

Bridges from various C++ ABIs, Java JNI, MS .NET to UNO and back. A bridge for .NET is in cli_ure.

Also implementation of the UNO Remote Protocol.