Closed martasp closed 3 years ago
Yes, the samples could be adapted to that. The build scripts need to be modified to either pass --targetos linux
to ilc.exe or just invoke ilc on Linux from the Linux nuget package (the default target os is always the one the compiler is running on but it can crosscompile). Once you do that, you'll get an ELF object file.
That object file can be passed to ld.
Of course the samples here call Windows apis so you need to change them to e.g. call into libc.
I've updated the samples in https://github.com/MichalStrehovsky/zerosharp/commit/26b8800c63f2ddbbfc1927861299008a59f916d9. It's possible to build the no-runtime sample for Linux now.
Is it possible to compile it down to a single ELF binary file?.