From 6cba3ecb98a36bdf7000d63c8bc6894ab996eb88 Mon Sep 17 00:00:00 2001 From: yejianwu Date: Fri, 20 Jul 2018 15:22:35 +0800 Subject: [PATCH] add version script docs --- docs/user_guide/advanced_usage.rst | 2 +- docs/user_guide/basic_usage.rst | 23 +++++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/docs/user_guide/advanced_usage.rst b/docs/user_guide/advanced_usage.rst index c0607d9e..d88ff14b 100644 --- a/docs/user_guide/advanced_usage.rst +++ b/docs/user_guide/advanced_usage.rst @@ -382,4 +382,4 @@ Reduce Library Size library may also contain model graph and model datas if the configs ``model_graph_format`` and ``model_data_format`` in deployment file are set to ``code``. - - It is recommended to use ``version script`` for ultimate binary. The effect is remarkable. + - It is recommended to use ``version script`` and ``strip`` feature when linking mace static library. The effect is remarkable. diff --git a/docs/user_guide/basic_usage.rst b/docs/user_guide/basic_usage.rst index 3da9126b..487aa33a 100644 --- a/docs/user_guide/basic_usage.rst +++ b/docs/user_guide/basic_usage.rst @@ -192,7 +192,7 @@ Use bazel to build MACE source code into a library. # output lib path: builds/lib bash tools/build-standalone-lib.sh -The above command will generate dynamic library ``builds/lib/${ABI}/libmace.so`` and static library ``builds/lib/${ABI}/libmace.a``. +The above command will generate dynamic library ``builds/lib/${ABI}/${DEVICES}/libmace.so`` and static library ``builds/lib/${ABI}/${DEVICES}/libmace.a``. .. warning:: @@ -242,6 +242,12 @@ header files. ``${library_name}`` is the name you defined in the first line of your deployment YAML file. +.. note:: + + When linking generated ``libmace.a`` into shared library, + `version script `__ + is helpful for reducing a specified set of symbols to local scope. + - The generated ``static`` library files are organized as follows, .. code:: @@ -254,12 +260,17 @@ header files. │   └── mace_runtime.h ├── lib │   ├── arm64-v8a - │   │   ├── libmace.a - │   │   └── libmace.so + │   │ └── cpu_gpu + │   │   ├── libmace.a + │   │   └── libmace.so │   ├── armeabi-v7a - │   │   ├── libhexagon_controller.so - │   │   ├── libmace.a - │   │   └── libmace.so + │   │ ├── cpu_gpu + │   │   │ ├── libmace.a + │   │   │ └── libmace.so + │   │ └── cpu_gpu_dsp + │   │   ├── libhexagon_controller.so + │   │   ├── libmace.a + │   │   └── libmace.so │   └── linux-x86-64 │   ├── libmace.a │   └── libmace.so -- GitLab