Skip to content

Commit

Permalink
feat(): entirely hide rapidjson symbols
Browse files Browse the repository at this point in the history
It is used only internally, so they must be hidden from the global
scope, but GCC exports them anyway, because of forced default
visibility for all templates within std namespace.

This commit applies custom symbol versioning mapping directly to the
linker eliminating all rapidjson symbols from the global scope.

Closes #78.
  • Loading branch information
3Hren committed Feb 9, 2016
1 parent 3e4c618 commit 2086d6b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ else ()
COMPILE_FLAGS "-Wswitch"
COMPILE_FLAGS "-Wunreachable-code"
COMPILE_FLAGS "-pedantic"
COMPILE_FLAGS "-pedantic-errors")
COMPILE_FLAGS "-pedantic-errors"
LINK_FLAGS -Wl,--version-script=${PROJECT_SOURCE_DIR}/libblackhole1.version
)
endif ()

target_link_libraries(${LIBRARY_NAME}
Expand Down
4 changes: 4 additions & 0 deletions libblackhole1.version
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
global: *;
local: *rapidjson*;
};

0 comments on commit 2086d6b

Please sign in to comment.