2 ms·
By "from the loader", do you mean the linker? Most of us regard that as part of compiling. Or are using .dll or .so files? For a static C program, regarding
by AnimalMuppet 9y ago
By "from the loader", do you mean the linker? Most of us regard that as part of compiling.
Or are using .dll or .so files?
For a static C program, regarding compiling and linking as part of the same (build) process, I see only two possible outcomes. Either I get an error at build time, or I get an executable that I can drop on the target that will run.
The one exception I can see to this is if the program is going to make an OS call that some versions of the OS don't support.
- wyldfire 9y ago> By "from the loader", do you mean the linker? Most of us regard that as part of compiling. No, I meant from the dynamic loader (like ld.so). > Or are using .dll or .so files? Yes, that's a very common idiom for libc and libstdc++/libc++. Yes, you're right that statically linked binaries will not suffer this dependency and usually end up more portable (often at a cost of some memory and security/maintenance). > The one exception I can see to this is if the program is going to make an OS call that some versions of the OS don't support. Exactly. This is actually a little less rare than C library features, from what I've seen. But, here, like ImportError and providing weak impls, you can handle ENOSYS.