<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - cannot create opengl by dynamically loading wayland symbols from library"
href="https://bugs.freedesktop.org/show_bug.cgi?id=77521">77521</a>
</td>
</tr>
<tr>
<th>Assignee</th>
<td>wayland-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Summary</th>
<td>cannot create opengl by dynamically loading wayland symbols from library
</td>
</tr>
<tr>
<th>Severity</th>
<td>blocker
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Reporter</th>
<td>pulkitnandan@gmail.com
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Version</th>
<td>1.3.0
</td>
</tr>
<tr>
<th>Component</th>
<td>wayland
</td>
</tr>
<tr>
<th>Product</th>
<td>Wayland
</td>
</tr></table>
<p>
<div>
<pre>I was trying to implement a window system agnostic library which will be used
in creating opengl apps with different windows systems. Lets name that library
as WSAL.Now to achieve this WSAL implements window system interfaces which is
used in creating native windows etc of specific window system while egl calls
are in main WSAL library.Consider wayland and X as examples of such two
libraries. As I separate several implementations of wayland and and X from
different team members.So to test them efficiently I have to create several
function pointers and object pointers that are present in those library
implementations and load them with symbols from libraries using dlsym utility
so that at compile time I donot have to link with any library.
For X I was successfully in creating X backend.
For wayland I first got stuck at functions which are inline in
wayland_client_protocol.h. For them I cannot do the same.Instead I created a
function pointer which these functions actually calls in inline definition.
Like when wl_display_get_registry is called wl_proxy_marshal_constructor is
ultimately called.
The terrible fucntions are wl_proxy_marshal_constructor and wl_proxy_marshal as
they are defined with variable arguments.So I declared
new_wl_proxy_marshal_constructor a function pointer of same type as
wl_proxy_marshal_constructor and loaded the symbol from library using dlsym
into new_wl_proxy_marshal_constructor.
But faced a fundamental problem of determing argument types as these terrible
functions (TFs) don't have constant argument signature i.e it may sometime pass
a int as its 4th aguments in one inline expansion while a char * in some other
inline function.
So I explored this wl_proxy_marshal_constructor which actually calls
wl_proxy_marshal_array_constructor after forming a variable arguments to a
single argument using some wl_proxy object signature which I have no access to
in main wayland interface.
dlsym option of using rtld_now doesnot work.
How to implement such functionality in wayland or provide a way to create a app
with no linking at build time.
Thanks
Rohit Nandan</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>