I’ve been working on a bigger soon to be released project, and wanted again to cross compile and dynamic link against shared objects i do not have on the build host.
So, to do that you can create a stub object based on the library that only contains the info the linker needs.
I used to use llvm-ifs for that, but as i’m currently stuck on windows that is annoying to use and is not available on all llvm builds.
I also don’t want to commit the stub files all the time, even if they are only small stubs.
So here is the my new ELF stub generator. converting ELF linking information to a textual .zon file, from which the tool can generate an ELF again. Hopefully zig may support apples text based link format ore something better in a cross platform manner;)
Until then, you can use this tool on committed interface descriptions.
I just published it, so the stubborn-elf may help with cross compiling.
![]()