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

Problems with de-mangled names (Linux) #67

Open
loopless opened this issue May 6, 2024 · 0 comments
Open

Problems with de-mangled names (Linux) #67

loopless opened this issue May 6, 2024 · 0 comments

Comments

@loopless
Copy link

loopless commented May 6, 2024

Using Boost 1.83.0
Using boost::dll::experimental::smart_library
Calling get_function(name)

The library does not seem to be generating correct de-mangled names for a C++ function, so it fails to find a "match" in the actual .so
This is only occurring on Linux, on Windows there are no issues. On Linux we are compiling with _GLIBCXX_USE_CXX11_ABI=1

The C++ prototype is

Run (
	std::string const&         	filename,
 	bool const&			 flag,
	std::size_t const           numThreads,
	std::atomic< bool > const&  stopToken,
	std::vector<int64_t> const& selected);

The actual signature is as follows ( using nm to query the .so )

Run( std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool const&, unsigned long, std::atomic<bool> const&, std::vector<long, std::allocator<long> > const&)

When compiled with the Intel ICX (clang) compiler, smart_library makes a mistake with the std::string type
smart_library sees the first parameter as std::basic_string ( not std::__cxx11::basic_string)
Run( std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool const&, unsigned long, std::atomic<bool> const&, std::vector<long"...

When compiled with gcc 11 , it gets the "string" type correct, but comes up with "long unsigned int" as the 4th parameter ( which is size_t)

Run(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool const&, long unsigned int, std::atomic<bool> const&, std"...

I am able to see the failures in the function
template<typename Func> std::string mangled_storage_impl::get_function(const std::string &name) const

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