3 ms·
Suppose you want to port to some architecture not supported by libc. If you were using libc you would have to find a replacement that works and targets that arc
by lolisamurai 10y ago
Suppose you want to port to some architecture not supported by libc. If you were using libc you would have to find a replacement that works and targets that arch or port libc yourself.
If you wrote everything from scratch, instead, you just have to read the specification and add support to your code.
That's what I meant.
Of course, if your target archs are all supported by libc, porting is much easier with libc.
- sqeaky 10y agoDepending on the scope of your project porting libc itself might be good idea. Then you simplify porting any tools you need that also use libc. Then you can port a few extra dependencies, then more tools...
- bogomipz 10y agoWhat are some archs that arent't supported by libc? Just embedded systems?
- time4tea 10y agoWell, not if you expect that you will have exactly the same time/space behaviour and pre/post conditions. This is why lots of embedded, secure and defense software doesn't use standard libraries, and printf will instead be called sio04583 or something.... Also.. Don't forget that you can get gcc to get rid of unused code when compiling static executables, and use sstrip (yes, two 's' - it's a different program) to strip even more, if it's an ELF binary...