Symbol "aligned_alloc" missing when loading OpenAL Soft

514 Views Asked by At

I've compiled OpenAL Soft with the NDK r17.1.4828580 using the following command:

cmake -DCMAKE_SYSTEM_NAME=Android -DANDROID_NDK=$$ANDROID_NDK_HOME \
    -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DALSOFT_BACKEND_OSS=OFF \
    -DCMAKE_BUILD_TYPE=Release -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang \
    -DALSOFT_BACKEND_WAVE=OFF ..

In OpenAL Soft's CMakeLists.txt there's a check for aligned_alloc which seems to be a new function in C11. The check and the build succeed, but when I'm trying to load the resulting libopenal.so with dlopen, I'm getting the following error message:

dlopen(libopenal.so): dlopen failed: cannot locate symbol "aligned_alloc" referenced by "/data/app/com.bixense.jngl_test-2/lib/arm/libopenal.so"...

Is there some kind of C11 stdlib shared object file I need to load first?

1

There are 1 best solutions below

0
jhasse On

Passing -DCMAKE_ANDROID_API=23 to CMake fixed it, since it will result in:

-- Looking for aligned_alloc - not found

I guess I would have been able to load the shared library on an Android phone with Oreo (API level 26) or newer.