How to run ranlib on an archive built through Android.mk?

三世轮回 提交于 2019-11-28 09:17:46

问题


This has come up on a couple of libraries I work with regularly. See, for example:

  • Error SSL archive symbol table (run ranlib)
  • no archive symbol table (run ranlib) while building libcryptopp.a through ndk-build

In the questions, the users created an Android.mk for the OpenSSL and Crypto++ libraries. The pain point seems to be users adding the Android.mk wrapper to the sources.

Outside of Android, each project is Makefile based, each project builds a static archive, and each project builds a shared object based on the static archive. Each project also runs ranlib on the static archive. Crypto++ is especially sensitive to the need for ranlib because its a C++ library and One Definition Rule violations lead to undefined behavior.

When using Android.mk to build a static archive, how do we run ranlib on an archive through Android.mk?


回答1:


I was running into similar issues and found a command on this website which fixed it for me

# The -E is important. Root needs some of the user's environment
$ sudo -E make install CC=$ANDROID_TOOLCHAIN/arm-linux-androideabi-gcc RANLIB=$ANDROID_TOOLCHAIN/arm-linux-androideabi-ranlib


来源:https://stackoverflow.com/questions/36340060/how-to-run-ranlib-on-an-archive-built-through-android-mk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!