Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: build failure with ndk 27-beta1 due to use of deprecated ALooper_pollAll #9792

Closed
madebr opened this issue May 15, 2024 · 4 comments
Milestone

Comments

@madebr
Copy link
Contributor

madebr commented May 15, 2024

Building SDL3 with ndk 27-beta1 fails with the following error:

/home/maarten/projects/SDL/src/sensor/android/SDL_androidsensor.c:73:13: error: 'ALooper_pollAll' is unavailable: obsoleted in Android 1
   73 |         if (ALooper_pollAll(-1, NULL, &events, (void **)&source) == LOOPER_ID_USER) {
      |             ^

Configuring with -DCMAKE_C_FLAGS="-Wno-error=deprecated" -DSDL_WERROR=OFF does not turn the error in a warning.

ALooper_pollAll documentation

@edo9300
Copy link
Contributor

edo9300 commented May 15, 2024

android/ndk#2020 this seems to be the proper handling, suggested by the ndk maintainers, to be used to replace poolAll with poolOnce

@slouken slouken modified the milestones: 2.32.0, 3.2.0 May 15, 2024
1bsyl added a commit to 1bsyl/SDL that referenced this issue May 16, 2024
…due to use of deprecated ALooper_pollAll

replace ALooper_pollAll by ALooper_pollOnce
@AntTheAlchemist
Copy link
Contributor

I rolled back to NDK 25.1.8937393 for this reason.

slouken pushed a commit that referenced this issue May 16, 2024
… of deprecated ALooper_pollAll

replace ALooper_pollAll by ALooper_pollOnce
slouken added a commit that referenced this issue May 16, 2024
…e to use of deprecated ALooper_pollAll"

This reverts commit ee16d2f.

@madebr's change was simpler and correct.
@slouken slouken closed this as completed May 16, 2024
@jsm174
Copy link

jsm174 commented Aug 3, 2024

Looks like github runners are removing NDK 25 very soon: actions/runner-images#10342. While trying to compile 2.30.6, I started seeing this issue:

./src/sensor/android/SDL_androidsensor.c:164:9: error: 'ALooper_pollAll' is unavailable: obsoleted in Android 1 - ALooper_pollAll may ignore wakes. Use ALooper_pollOnce instead. See The API documentation for more information
  164 |     if (ALooper_pollAll(0, NULL, &events, (void **)&source) == LOOPER_ID_USER) {
      |         ^
/usr/local/lib/android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/android/looper.h:228:5: note: 'ALooper_pollAll' has been explicitly marked unavailable here
  228 | int ALooper_pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData)
      |     ^
1 warning and 1 error generated.

@slouken
Copy link
Collaborator

slouken commented Aug 5, 2024

This is fixed for the next release in 4222ceb, thanks!

kichikuou added a commit to kichikuou/xsystem4-android that referenced this issue Aug 5, 2024
SDL2 does not compile with NDK 27 yet.
libsdl-org/SDL#9792
kichikuou added a commit to kichikuou/xsystem4 that referenced this issue Sep 2, 2024
This fixes build with Android NDK 27.
libsdl-org/SDL#9792
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants