Better handle LINK_ALL_SYMBOLS option in cmake/generic.cmake
- Dominant language
- C++
- Stars
- 1.1k
- Forks
- 159
- PR merge metrics
- No merged PRs in 30d
Description
We implemented two methods(cc_library, cc_binary) that accept LINK_ALL_SYMBOLS (which means export all symbols when linking, by wrapping the libs with gcc options "-Wl,--whole-archive" and "-Wl,--no-whole-archive" around) as argument in `cmake/generic.cmake`.
1. A binary or a library can use `ALL_SYMBOLS_DEPS` to tell the linker that it needs all the symbols in its deps.
2. A library who have `LINK_ALL_SYMBOLS` attribute should export all symbols to the ones that depend on it. We expect these symbols can be exported recursively, however only the ones that depend this library directly will link all the symbols currently.
3. cc_test don't have similar functionality.
So, cmake/generic.cmake's cc_library/cc_binary/cc_test needs improvements to handle LINK_ALL_SYMBOLS.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in cmake/generic.cmake by reading the cc_library and cc_binary handling of LINK_ALL_SYMBOLS and ALL_SYMBOLS_DEPS. Trace how dependent libraries are linked, then examine cc_test for the missing equivalent. Done means LINK_ALL_SYMBOLS exports symbols recursively through dependents and cc_test supports the same functionality.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100