Remix.run Logo
steveklabnik 15 hours ago

You can only skip libc on Linux. Other unices and Windows don’t let you.

immibis 13 hours ago | parent [-]

You can skip libc on Windows - you can't skip the system DLLs like kernel32. (In fact, Microsoft provided several mutually incompatible libcs in the past.)

Well, you can non-portably skip kernel32, and use ntdll, but then your program won't work in the next Windows version (same as on any platform really - you can include the topmost API layers in your code, but they won't match the layers underneath of the next version).

But system DLLs are DLLs, so also don't cause your .exe to get bloated.

steveklabnik 12 hours ago | parent [-]

Yes, it's not literally libc on windows, but the point is that directly calling syscalls is not supported, you have to call through the platform's library for doing so.

On some systems, this is just not a supported configuration (like what you're talking about with Windows) and on some, they go further, and actually try and prevent you from doing so, even in assembly.)

immibis 11 hours ago | parent [-]

There's still something on the platform that you can call without extra indirection in the way on your side of the handoff. That is true on all platforms; whether it's an INT or SYSCALL instruction or a CALL or JMP instruction is irrelevant.

int_19h 7 hours ago | parent [-]

If it's a CALL instruction into a user-space DLL, that's still an extra indirection.