Am 20.04.25 um 19:01 schrieb Thomas Klausner:
Ok, so should we choose one or the other depending on what the default C compiler on the operating system is?
It's a bit more complicated and a problem I haven't found a good solution to ever since I imported it into pkgsrc. So I'll elaborate a bit and maybe someone has a good idea.
devel/objfw can be built with both GCC and Clang. However, when built with GCC, it has a different ABI than when built with Clang. This is because of the Objective-C support in GCC being quite dated and missing all of the modern features. Now, if software wants to use any of the modern features, it needs to use Clang. However, since the ABI as used by GCC and Clang is not compatible, it means devel/objfw must be built with Clang for that software to work - and also because some features will not be built when built with GCC, simply because GCC does not support them.
So what's clear is that on platforms that have no Clang, it should always be built with GCC (currently that is not being done, but is something I certainly want to add - and is how e.g. Debian handles it).
What is unclear is what to do on systems that do support Clang: Should it always depend on Clang (which is what it does now) to enable all features?
What I could imagine working is having a package option for clang that defaults to on, and when somebody does not want to have clang as a dependency, they can set it to off. However, packages depending on it and needing clang then would need to have a way to specify that they need it built with the clang option.
-- Jonathan