-
Notifications
You must be signed in to change notification settings - Fork 48
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
Make static inline
optional
#128
Comments
I'll have to think about it some more but my initial thoughts are that we probably do not want to do this. Given how small the libmicrokit header is, and that is mainly wrappers over seL4 system calls, I think it is okay to reproduce it for languages if necessary (as mentioned here before #8 (comment)). The friction with Since the Rust bindings do already exist, I think we would need this problem to come up with a number of languages being used with Microkit to implement a non |
@Ivan-Velickovic thank you for your response!
I don't want to sound harsh, but this is quite likely the most useless example you could have brought on. Zig has an incredible good cross-compilation story, and zig contains a fully working C frontend (which at least in the past was implemented by having most of a My personal interest in this of course was Rust motivated, and reading about your recent work on this solves the issue for me. Still I think the C-ABI is the defacto quasi standard of FFIs, and |
I understand that Zig is perhaps an outlier, but I was just trying to show that there are systems languages that make it possible. Zig has put in the work to do it, Rust has not. I can’t make a general statement since I don’t know enough about other systems languages, I was just trying to say that I would not want to prematurely generalise without knowing what other languages (if any) people want to use with Microkit and how they integrate with C. |
Sure, happy to keep it open until something is decided. |
Currently, most of the microkit API is defined
static inline
. This is nice for lean binaries and good performance, but not so nice for bindings to other programming languages. The reason is as follows:When all functions were already pre-compiled into
libmicrokit.a
, then one just needs to match their ABI and linklibmicrokit.a
to call them.However as things stand right now, one needs to grab a (cross-compiler) c toolchain, manually write header file that contains all
static inline
functions but withstatic inline
removed, compile that into a static archive and link it. The big denominator is having to have (and run!) a C-cross-compilation toolchain.Now here I'm not 100% sure, but I would expect that a nice path in between could be found:
static inline
through a macrolibmicrokit.a
withoutstatic inline
From this I would hope for the following behavior:
static inline
makes all the symbols static to the current compilation unit.static inline
using a macro define and thus get all the unspoiled function declarations. When linking withlibmicrokit.a
, implementation for the functions is found.If this does not work (i.e. this creates collisions during linking), one could of course always just compile a
libmicrokit.a
andlibmicrokit_fat.a
, where the latter is with all the functions (static inline
removed).The text was updated successfully, but these errors were encountered: