Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Fix building jnidispatch with Android NDK 18+ using Clang/LLVM

Abierto
#1,659 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
20/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
android, c, java

Línea de trabajo

Comienza revisando la rama y el commit propuestos de android-ndk-llvm y, a continuación, compara sus cambios de compilación con la configuración de compilación actual de jnidispatch. Prueba la compilación con las versiones compatibles de Android NDK, incluida r27c, y determina si la transición de GCC a Clang funciona en todos los targets mencionados.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

More of a place for discussion than an urgent need to be resolved, I have specifically not made a PR yet as this is nowhere near comprehensively tested. It would be very helpful if anyone with libffi experience in other projects knows about any tricks moving from gcc to clang.

Anyway, here is a branch with my proposed changes: https://github.com/BugsBeGone/jna/commits/android-ndk-llvm/
Actual commit, which may be out of date if branch is rebased to sync with master: https://github.com/BugsBeGone/jna/commit/2be472422f4ea1c479ef1322253b9a1ab7d356e0

Some initial observations:

  • ARMv5 and MIPS (32 & 64) targets were removed in NDK r17. In theory the Play Store still supports versions of Android that could be running on those architectures, so it is a bit soon to drop them entirely if the old toolchains do still work. At the very least I would expect a major JNA version bump to indicate the removed targets (Edit: I guess those libs can always still be built with older NDKs, in which case no need for a breaking change by dropping support).

  • Standalone toolchains are a mess for detecting the version. I cannot think of a way that does not involve the user manually setting either the NDK major version, or a USE_CLANG define to work out which compiler suite to use. I would be in favour of officially not supporting the use of standalone toolchains, as you need approximately 1GB of extra disk space per target, so even testing it is a pain.

  • More to the point, NDKs between r17 & r21 generally seem to be unstable, requiring unholy combinations of GCC/Binutils & Clang/LLVM to work at all. Since the existing build environment has never worked with anything after r15, because of the switch to unified headers, we probably do not need to worry too much so long as everyone is happy to jump from let's say r15 to r22.

I have mostly been testing with NDK r27c, since that was the latest LTS release (Edit: r27d is still the latest LTS, the only differences from r27c are a couple of macOS-specific fixes).

Lenguaje dominante
Java
Estrellas
8.9k
Forks
1.7k
Merge medio
1 d 13 h
PR fusionados (30 d)
1

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de java-native-access/jna

Todos los issues de java-native-access/jna

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.