Undefined symbol PLT #697 posix_memalign in ./libhexagon_rpc_skel.so

Hi,I build hexagon_api for dsp v66, but encounting an error “undefined symbol PLT #697 posix_memalign in ./libhexagon_rpc_skel.so” my cmake options are :

cmake -DANDROID_ABI=arm64-v8a
-DANDROID_PLATFORM=android-24 -DUSE_ANDROID_TOOLCHAIN=xxx/android.toolchain.cmake -DUSE_HEXAGON_ARCH=v66 -DUSE_HEXAGON_SDK=xxx -DUSE_HEXAGON_TOOLCHAIN=xxx/Tools myCode/TVM/apps/hexagon_api

And I get following error:

What SDK are you using? The function has been there for a while… Does this happen when you do a clean build? Are you using the main branch of TVM?

the version of hexagon sdk is 5.0.0.0, and the version of ndk is r19c.I use the main branch of TVM. I can build and run successfully if I let the dsp arch to be v68. But it will fail to open skel when runing in phone, if the dsp arch setted to be v66 when using the cmake option(can build successfully, but can not run successfully for “undefined-symbol plt posix_memalign in libhexagonrpcskel.so”)

hello,I doubt that if there is missing the lib which contain “posix_memalign” function.The phone is android 11,and I find libc.so that has “posix_memalign” function in the path “/system/lib” and “/system/lib64”.Can you help me figure out the question?

hello, I use posix_memalign in skel.so, but meet the same fialure.If use memalign, it can run successfully.I check the "libhexagon_rpc_skel.so”, it link to libc++.so, then the libc++.so link to libc.so which defined the function “posix_memalign” and “memalign”, can you tell me where the place of libc.so in the phone?

posix_memalign should be defined in the FastRPC shell. I don’t think that there is a separate libc for Hexagon libraries. What device are you using?

I do not find where the posix_meamalign to be defined. I use honor 畅玩30. I have made some attempts to change posix_memalign to memalign:

  1. I change the some code:

the result is that it can compile successfully and open the skel.so successfully without saying “posix_memalign is undefined”

  1. base the change in 1, I tried next:

the result is that it can not compile successfully for undefined memalign
then I change ${tvm_root}/apps/hexagon_api/CMakeList.txt


and it can compile successfully and can open the skel.so without saying “posix_memalign is undefined”

With the above attempts, I got hexagon_rpc_send failed :rofl:

After I change posix_memalign to memalign, the skel.so can be opened successfully, but I get some error when execute a_tvm = tvm.nd.array(a_numpy, device=session.device), the device is dsp.The error is showed in the picture

Do you have some advices for me?