三個可以查看庫文件的linux下工具。man或者--help查看更多
readelf
nm
ldd
關於Android.bp如何使用,查閱androidout目錄下的生成doc
$ROOT/out/soong/docs
error example:
ld.lld: error: undefined symbol:
鏈接過程找不到對應函數定義:確定對應鏈接庫函數是否寫明。如需置爲未定義函數,Android.bp可使用allow_undefined_symbols: true,
Android.bp對應的doc文件:Out/soong/docs/*.html
https://android.googlesource.com/platform/build/soong/+/HEAD/docs/best_practices.md
個人理解
1.Android.bp放在相對上層目錄,因爲android構建規則不允許../../這樣的相對引用。
2.LOCAL_COPY_HEADERS被棄用,如果想將頭文件之類export出去,你要手寫一個虛擬的庫,讓別人引用即可。
3.LOCAL_COPY_HEADERS_TO被棄用,想將頭文件copy到指定目錄,你需要使用cmd命令實現,參考例子$ROOT/libcore/Android.bp#12
6 genrule {
7 name: "notices-for-framework-stubs",
8 tool_files: [
9 "NOTICE",
10 "ojluni/NOTICE",
11 ],
12 cmd: "cp -f $(location NOTICE) $(genDir)/NOTICES/libcore-NOTICE && cp -f $(location ojluni/NOTICE) $(genDir)/NOTICES/ojluni-NOTICE",
13 out: [
14 "NOTICES/libcore-NOTICE",
15 "NOTICES/ojluni-NOTICE",
16 ],
17 }
CMake
Cmakelists.txt裏面的變量都應該能在build/CmakeCache.txt裏面有清楚的定義。