-
Notifications
You must be signed in to change notification settings - Fork 143
Description
dlmopen of liblkl.so brings so many troubles and one that I can't get around is limitation of static TLS. Now liblkl.so depends on libc which may use static TLS. At runtime, the amount of static TLS is fixed so dlmopen may fail.
To overcome this, I'd like to introduce another layer like struct lkl_libc. It's similar to lkl_host_ops but only accessible in tools/lkl/lib. So struct lkl_libc looks like:
struct lkl_libc {
memcpy
memset
strcpy...
}
And there will be a lkl_libc.c which is shared by both posix-host and nt-host.
A new host called nonlibc-host is added that provides empty lkl_host_ops and lkl_libc so the final liblkl.so doesn't depends on libc at all. In application, at run time, after dlmopen it, lkl_host_ops and lkl_libc is properly set so all liblkl.so instances share the same libc/libpthread.
I guess it may also simplify the work in #255 where a new libc implementation can be easily integrated.
Please let me know your opinions. Thanks