Skip to content

Ask for suggestion of building a liblkl.so without libc #264

@liuyuan10

Description

@liuyuan10

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions