简体   繁体   English

为什么ndk-build会修改prebuild所以库?

[英]Why ndk-build will modify prebuild so libraries?

I use some prebuilded so in the prebuild directory of an Android JNI project. 我在Android JNI项目的prebuild目录中使用了一些prebuilded。 The Android mk file for the prebuild libs are like this: 预建库的Android mk文件是这样的:

include  $(CLEAR_VARS)
LOCAL_MODULE := foo-prebuild
LOCAL_SRC_FILES := libfoo.so
include $(PREBUILT_SHARED_LIBRARY)

But each time when I run ndk-build -B , the so files generated in libs/armeabi changed. 但每次运行ndk-build -B ,libs / armeabi中生成的so文件都会发生变化。 So I realized that ndk-build modified the so files rather than simplely copied them. 所以我意识到ndk-build修改了so文件而不是简单地复制它们。 This is annoying when I have to manage these so files with version control software like git, since it is hard to kown if the comitted version is consistent with the so in the prebuild directory. 当我必须使用像git这样的版本控制软件来管理这些文件时,这很烦人,因为如果预编译版本与prebuild目录中的版本一致,则很难知道。 Can I keep them the same? 我可以保持不变吗?

To check what exactly NDK does on your binary - run it with verbose output: ndk-build V=1 . 要检查NDK对二进制文件的确切作用 - 使用详细输出运行它: ndk-build V=1 This will print all commands, that NDK does under the hood. 这将打印NDK所做的所有命令。 Probably it strips debug info, non-exported entries in symbol table with strip . 可能它会剥离带有strip符号表中的调试信息,非导出条目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM