# symbol **Repository Path**: lizhanhui/symbol ## Basic Information - **Project Name**: symbol - **Description**: 展示C/C++中符号隐藏 展示cc_shared_library的用法 展示Bazel中version_script的用法 - **Primary Language**: C++ - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-09-18 - **Last Updated**: 2022-09-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## Goal Goal of this project is to demonstrate that it is possible and actually easy to build exported library using Bazel. Aka, Bazel has required features to build a static linked shared library for other application developers, with symobl visibility properly managed. ## Directory Layout 1. adder The `adder` directory (package in Bazel's term) contains internal implementation of the `calc` library. 2. calc The `calc` directory contains the main library source files, which will build a shared library that is accessible to traditional users, aka, those who prefer `configure && make && make install` `calc` package hides all symbols from `adder` through version script. To verify, execute `nm -C libcalc.so | grep ' T '` after targets are built 3. bin The bin directory contains an example program, that would consume the exported shared library. ## Reference 0. https://abseil.io/resources/swe-book/html/ch18.html 1. https://www.man7.org/conf/lca2006/shared_libraries/slide4b.html 2. https://github.com/bazelbuild/rules_cc/issues/83