New issue
Advanced search Search tips

Issue 914377 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Dawn: Make the C++ API to be binary compatible when used with a different compiler.

Project Member Reported by arthurso...@chromium.org, Dec 12

Issue description

When linking libdawn_native.so with a different compiler toolchain, I get the error:

~~~
CMakeFiles/Test.dir/src/utils/VulkanBinding.cpp.o : Dans la fonction « utils::VulkanBinding::CreateDevice() » :
VulkanBinding.cpp:(.text._ZN5utils13VulkanBinding12CreateDeviceEv[_ZN5utils13VulkanBinding12CreateDeviceEv]+0x6a) : undefined reference to " dawn_native::vulkan::CreateDevice(std::vector<char const*, std::allocator<char const*> > const&) "
clang: error: linker command failed with exit code 1 (use -v to see invocation)
~~~

dawn_native::vulkan::CreateDevice(std::vector<char const*, std::allocator<char const*> > const&) name mangling algorithm differs depending on which compiler you are using.

Using |extern "C"| in front of the method declaration fixes the problem. It makes the compiler to use "unmangled" symbol for this function.
 
Summary: Dawn: Make the C++ API to be binary compatible when used with a different compiler. (was: Dawn: Make the C++ API to be binary compatible when libdawn_native.so)

Sign in to add a comment