-
Notifications
You must be signed in to change notification settings - Fork 401
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
Hide all symbols by default #2469
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 Hi,
This is a reminder message to assign an extra build label to this Pull Request if needed.
By default, this PR will be build with minimal build options (URDF support and Python bindings)
The possible extra labels are:
- build_collision (build Pinocchio with coal support)
- build_casadi (build Pinocchio with CasADi support)
- build_autodiff (build Pinocchio with CppAD support)
- build_codegen (build Pinocchio with CppADCodeGen support)
- build_extra (build Pinocchio with extra algorithms)
- build_mpfr (build Pinocchio with Boost.Multiprecision support)
- build_sdf (build Pinocchio with SDF parser)
- build_accelerate (build Pinocchio with APPLE Accelerate framework support)
- build_all (build Pinocchio with ALL the options stated above)
Thanks.
The Pinocchio development team.
6bff393
to
0eaf355
Compare
When working on this PR, I found the following issue with GCC, explicit template instantiation and symbol visibility. template <typename T>
struct MyClass
{
void bar(MyClass<int>);
int getContacts() const
{
return m_value;
}
int m_value;
};
#ifndef BUG
extern template struct __attribute__((visibility("default"))) MyClass<int>;
#endif
template <typename T>
void MyClass<T>::bar(MyClass<int>) {}
#ifdef BUG
extern template struct __attribute__((visibility("default"))) MyClass<int>;
#endif
template struct MyClass<int>; When builded with the following command line: CC=g++
FLAGS=-DBUG
$CC -fPIC -Wall -Wextra -pedantic -fvisibility=hidden -fvisibility-inlines-hidden $FLAGS -c test.cpp -o test.o
$CC -fPIC -Wall -Wextra -pedantic -fvisibility=hidden -fvisibility-inlines-hidden -shared -Wl,-soname,libtest.so test.o -o libtest.so
nm -C libtest.so | grep MyClass We have the following output:
The visibility attribute is ignored. When build with
The symbols are well exported. There is no issue with clang++. |
6f3a04f
to
e9fb11f
Compare
e9fb11f
to
88a4c81
Compare
Another interesting case. I think there is an issue with clang on osx and thread-local symbol visibility. We can reproduce the issue by compiling this code (test.cpp): struct Toto {Toto(int* ptr) {}};
template<class Base>
struct CGOStreamFunc {
static thread_local Toto FUNC;
};
template<class Base>
thread_local Toto CGOStreamFunc<Base>::FUNC(nullptr);
template struct CGOStreamFunc<double>; Then building it with:
If we run
If we run ... The This create a linking error when building Pinocchio in Debug mode with codegen activated.
I don't really know how to manage this issue… |
…efinition on Unix
74a50e0
to
65730a6
Compare
Fixe #2462
TODO:
pinocchio::python::buildModel
is exported by all bindingsdevelopment/misc/common_symbols.py
scripts to detect common symbols in many libraries