Undefined symbol errors when consuming the library as shared/dynamic
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- cmake, cpp
- Domain
- build-system
Research direction
Start with the visibility setting at CMakeLists.txt#L77 and reproduce the undefined-symbol errors when consuming the library as a shared object. Compare the listed visibility approaches and confirm that the chosen change preserves static-library use while exposing the symbols required by shared-library consumers.
Written by the indexing model from the issue text.
Description
The "-fvisibility=hidden" (see CMakeLists.txt#L77) in CMakeLists.txt causes undefined symbols errors when using this library as shared object.
It's not a problem when using it as a static library because visibility settings doesn't affect that by design.
There are multiple solutions for this problem:
- Just remove
"-fvisibility=hidden". We are currently using this approach as a workaround because we currently don't have many symbols to be considered private, this may be a viable option. - Keep
"-fvisibility=hidden"and manually annotate symbols intended to be public with:__attribute__((visibility("default"))), however, this will require a significant amount of effort. - Replace
"-fvisibility=hidden"with"-fvisibility=default"and manually annotate symbols intended to be private with__attribute__((visibility("hidden")))
- Dominant language
- C++
- Stars
- 465
- Forks
- 98
- Avg merge
- 1h 16m
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from awslabs/aws-lambda-cpp
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
awslabs/aws-lambda-cpp#196 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
awslabs/aws-lambda-cpp#195 · 11 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
awslabs/aws-lambda-cpp#194 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
awslabs/aws-lambda-cpp#188 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
awslabs/aws-lambda-cpp#170 ·
All issues in awslabs/aws-lambda-cpp
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·