4 ms·
You can literally emit runtime assembly in C in any C toolchain, what are you on about?
by thysultan 6y ago
You can literally emit runtime assembly in C in any C toolchain, what are you on about?
- tylerhou 6y agoHow do you dynamically generate machine code without linking something like LLVM?
- sgtnoodle 6y agoI believe that's actually what folk are doing these days, literally linking in LLVM and using it to compile C into machine code then executing it during runtime.
- tylerhou 6y agoThat's what I mean by "alternative toolchain," though; some of the code that you are executing at runtime isn't being generated by the normal GCC/Clang toolchain. It's being generated by your custom setup which links in LLVM. You'd still need to compile your code with a regular toolchain, but you also need additional tools to compile, optimize, and debug code at runtime. That's what I meant by toolchain, even if it is not the conventional (static) definition.
- thysultan 6y agosame way you would with llvm, you can map executable memory without llvm and execute it.