Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracepoints break shared library linking for downstream projects #1395

Open
aliher1911 opened this issue Jun 23, 2020 · 1 comment
Open

Tracepoints break shared library linking for downstream projects #1395

aliher1911 opened this issue Jun 23, 2020 · 1 comment

Comments

@aliher1911
Copy link

When building fbthrift with BUILD_SHARED_LIBS=ON (which is required for logdevice or openr)

one would get errors like: facebook/fbthrift#384 (CMakeFiles/thriftcpp2.dir/util/ScopedServerInterfaceThread.cpp.o(.note.stapsdt+0x14): error: relocation refers to local symbol "" [3032], which is defined in a discarded section
section group signature: "ZN6apache6thrift11concurrency13ThreadManager5ImplTIN5folly11LifoSemImplISt6atomicNS4_19SaturatingSemaphoreILb1ES6_EEEEE15reportTaskStatsERKNS2_4TaskERKNSt6chrono10time_pointINSE_3_V212steady_clockENSE_8durationIlSt5ratioILl1ELl1000000000EEEEEESO"
prevailing definition is from CMakeFiles/thriftcpp2.dir/server/ThriftServer.cpp.o)

This is caused by .note section generated for SDT not being part of the same section group as symbol of a traced function. If subsequently this section is omitted as duplicate by linker (which happens because trace is added to a templated function) relocation reference would become dangling and linking will fail.

@aliher1911
Copy link
Author

Anyone?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant