Closed NOhs closed 4 years ago
From what I understand about binaries, there should not be different linkers, because object files should be independent of the original language. You could link together object files from C, C++ and Objective-C/C++ into a single binary. I am also not aware of any language-specific link flags. Therefore, I think we should only address this issue if we find a hint that we should make a distinction.
Also, instead of using different compiler frontends, it might be better to always set language flags, e.g. -x c -std=c11
or -x c++ -std=c++17
.
I'm not sure. This would make the output more verbose, which is against clang-builds "it just works, and looks reasonable" approach.
Only if the output is on debug level, at which point it makes sense that this information be included. Compared to include directories etc. it would take up very little space, but the user could be sure of the language and language version that is being used.
To address the original question, there is actually a difference: https://stackoverflow.com/a/8441942/4069571
clangpp
apparently links the C++ standard library, meaning we should actually not necessarily be using it (though it probably only hurts binary size or something like that). To definitely figure out what we should be doing, some more research is needed.
After discussions based on https://stackoverflow.com/a/173007/2305545 we decided to use clangpp for any target containing C++ sources until there is a good reason not to.
In
single_source.py
the file extension will decide which compiler to use. For the linker, there is no such thing (seetarget.py
), but I am not sure if the clangpp and clang linker are different.