172 ms·
As proven by musl versus glibc issues, that possibility is mostly theoric, with plenty of gotchas in practice.
by pjmlp 2y ago
As proven by musl versus glibc issues, that possibility is mostly theoric, with plenty of gotchas in practice.
- lmz 2y agoWhich musl issues are to do with GCC? Alternate C libraries are common on Linux e.g. uclibc, dietlibc, bionic... Not to mention also the other OSs GCC runs on that don't use glibc. Of course, mixing C libraries between the main executable and libraries probably won't work.
- pjmlp 2y agoAs there are common people on forums searching for problems with their C code crashing and burning, because while those libraries conform to ISO C standard, their implementation defined semantics aren't the same.
- lmz 2y agoBut the original post's meaning of "independent" runtime library was "compiler independent" (vs C++). Not that there was no difference between the C libraries.
- pjmlp 2y agoIf there is a difference, it is no longer independent.
- lmz 2y agoThis makes no sense. As I said the original poster was saying that g++ and libstdc++ are tangled together and it is not possible to use g++ with another implementation of the C++ libraries. But you can use gcc with other C libraries. As proven by gcc running on other OSs with non glibc libraries. If anything isn't "independent" here (using your definition) it's the apps that rely on implementation detail - not the C library, the C programming language, or the compiler.
- account42 2y agomusl and glibc are both compatible for the POSIX portion of the API they provide. GCC also has lots of GNU specific functions but so what?
- pjmlp 2y agoSquare peg into rectangular hole. ISO C and POSIX have plenty of implementation defined behaviours.