Some symbols now need to be explicitly exported#44
Merged
tqchen merged 2 commits intodmlc:masterfrom Jan 18, 2019
Merged
Conversation
By default, compilation of Linux shared library modules (*.so files)
exports all symbols. This creates large module files as the export
symbol tables contains too many entries. The correct approach is
export nothing by default and anything that needs to be exported
must be explicitly specified. This is accomplished by the following
steps:
1. In the Makefile, add "-fvisibility=hidden" flag. You can search
for "-fPIC" to find the appropriate place to add the flag. This
hides symbols by default if not explicitly specified otherwise.
2. To declaration of any symbol to be exported, add this attribute:
__attribute__((visibility("default")))
The attribute string can be added using a macro definition. It
should be added right before the return type for functions, or
right after the 'class' or 'struct' keyword for class/struct.
For more info on shared module export symbol visibility read:
http://anadoxin.org/blog/control-over-symbol-exports-in-gcc.html
… all symbols which is inefficient, and change was make to do explicit exports. So now some of the symbols become unresolved external symbols and need to be explicitly exported.
Contributor
Author
|
The issue was discovered by: ir_functor_test.cc:(.text._ZN3tvm2ir11ExprFunctorIFiRKN8HalideIR4ExprEiEE10InitVTableEv[_ZN3tvm2ir11ExprFunctorIFiRKN8HalideIR4ExprEiEE10InitVTableEv]+0x1b72): undefined reference to `tvm::Node::TypeIndex2Key(unsigned int)' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previous the build default to export all symbols, which is inefficient, and a change was made
to do explicit exports. So now some of the symbols become unresolved external symbols and
need to be explicitly exported.