Skip to content

Fix AbslInternalGetFileMappingHint to obey ABSL_OPTION_USE_INLINE_NAMESPACE#2098

Open
jwnimmer-tri wants to merge 1 commit into
abseil:masterfrom
jwnimmer-tri:namespace-AbslInternalGetFileMappingHint
Open

Fix AbslInternalGetFileMappingHint to obey ABSL_OPTION_USE_INLINE_NAMESPACE#2098
jwnimmer-tri wants to merge 1 commit into
abseil:masterfrom
jwnimmer-tri:namespace-AbslInternalGetFileMappingHint

Conversation

@jwnimmer-tri

Copy link
Copy Markdown
Contributor

The purpose of ABSL_OPTION_USE_INLINE_NAMESPACE is to allow multiple independent copies of abseil-cpp to be linked into the same binary, in different (linker) namespaces. For symbols marked extern "C", we need to manually mangle their names to accomplish the same effect.

Abseil provides the ABSL_INTERNAL_C_SYMBOL macro for this purpose, but it wasn't used on AbslInternalGetFileMappingHint, leading to symbol conflicts when multiple different copies are linked under the same name.

Fix this by annotating AbslInternalGetFileMappingHint with ABSL_INTERNAL_C_SYMBOL.


Note that an alternative solution is also possible: the AbslInternalGetFileMappingHint appears to be dead code in the open-source export of abseil-cpp. (I assume there is nearby google-internal code that uses it.) Instead of mangling the function name, you could also simply remove this code (declaration and definition) from the github export.

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

Successfully merging this pull request may close these issues.

3 participants