![]() My main motivation is to have memory mapping statically determined and controlled by the program. You may wonder why I am talking about static linking. Read Linus’ “WE DO NOT BREAK USERSPACE!” arguments here. ![]() Linux kernel keeps very good compatibility. One more note: this is not problems from the Linux kernel. For a detailed explanation of common techniques for building portable binaries, I suggest Creating portable Linux binaries which discusses the “secret sauce”. Static linking is one of the techniques to build portable binaries. However, there are many companies that supply portable Linux binaries that run on a wide range of Linux systems of various versions. Linux binaries are not portable if they are built in normal way even with full static linking. ![]() ![]() A comparison of C/POSIX standard library implementations for Linux can be found here. ![]() You can even use other libc implementation like uClibc or musl libc which are more friendly for static linking. And you have ways to avoid some problems like setting GCONV_PATH, enabling -enable-static-nss for glibc, using other DNS libraries rather than NSS and never use dlopen. That said, you can choose to statically link C and C++ programs on Linux, only when you know what you are doing and why. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |