After upgrading today to xcode 7, a bunch of my cmake build files stopped working, because we went from $ clang --version Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) to $ clang --version Apple LLVM version 7.0.0 (clang-700.0.72) See, so now anything that parsed this output to make decisions based on the underlying llvm/clang version no longer works, especially if interacting with non-Apple clang builds. So... First of all, can anybody say definitively which LLVM/Clang version corresponds to what Apple calls 7.0.0? Is there a web page somewhere with the list of correspondences? And second, is there anything that the clang devs (or the Apple devs lurking) can do to make sure this doesn't happen again in the future? Those of us working on cross-platform products (or even solely on Apple, if switching back and forth between xcode's clang and custom built clang from source), really need a consistent way of determining which underlying version is being used. Or am I missing something obvious that I should be doing to detect versions more robustly? -- Larry Gritz lg at larrygritz.com
Hi Larry, On 18 September 2015 at 00:02, Larry Gritz via llvm-dev <llvm-dev at lists.llvm.org> wrote:> First of all, can anybody say definitively which LLVM/Clang version corresponds to what Apple calls 7.0.0? Is there a web page somewhere with the list of correspondences?I'm afraid there is no real correspondence. Xcode's clang & LLVM gets branched at a fairly arbitrary point in time, and then many patches are cherry-picked over time before it actually gets released. That 3.6.0 just means that the initial branch happened some time between the release of OSS 3.5 and OSS 3.6; it says nothing about what bugs were fixed (or added!) before release, what features were ported before release, or what features were implemented first in Xcode and then made their way to OSS LLVM. Because there's virtually no useful information to be gained from the "based on LLVM ...", we've stopped reporting it in the version string.> Or am I missing something obvious that I should be doing to detect versions more robustly?Checking for the actual features you need is usually recommended. But if that's not possible for some reason, you'll probably have to treat Xcode Clang and OSS Clang as two different compilers. Cheers. Tim.
It is also worth pointing out that when upgrading Xcode you will almost always need to clear out your CMake build directory. CMake only runs the compiler & SDK checks once, and changing Xcode can change compilers, headers, and libraries. -Chris> On Sep 18, 2015, at 12:00 PM, Tim Northover via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi Larry, > > On 18 September 2015 at 00:02, Larry Gritz via llvm-dev > <llvm-dev at lists.llvm.org> wrote: >> First of all, can anybody say definitively which LLVM/Clang version corresponds to what Apple calls 7.0.0? Is there a web page somewhere with the list of correspondences? > > I'm afraid there is no real correspondence. Xcode's clang & LLVM gets > branched at a fairly arbitrary point in time, and then many patches > are cherry-picked over time before it actually gets released. > > That 3.6.0 just means that the initial branch happened some time > between the release of OSS 3.5 and OSS 3.6; it says nothing about what > bugs were fixed (or added!) before release, what features were ported > before release, or what features were implemented first in Xcode and > then made their way to OSS LLVM. > > Because there's virtually no useful information to be gained from the > "based on LLVM ...", we've stopped reporting it in the version string. > >> Or am I missing something obvious that I should be doing to detect versions more robustly? > > Checking for the actual features you need is usually recommended. But > if that's not possible for some reason, you'll probably have to treat > Xcode Clang and OSS Clang as two different compilers. > > Cheers. > > Tim. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Thanks, I understand now. Instead of struggling to unify them, I'll just detect the "Apple" and break it out as a totally separate compiler case.> On Sep 18, 2015, at 12:00 PM, Tim Northover <t.p.northover at gmail.com> wrote: > > Hi Larry, > > On 18 September 2015 at 00:02, Larry Gritz via llvm-dev > <llvm-dev at lists.llvm.org> wrote: >> First of all, can anybody say definitively which LLVM/Clang version corresponds to what Apple calls 7.0.0? Is there a web page somewhere with the list of correspondences? > > I'm afraid there is no real correspondence. Xcode's clang & LLVM gets > branched at a fairly arbitrary point in time, and then many patches > are cherry-picked over time before it actually gets released. > > That 3.6.0 just means that the initial branch happened some time > between the release of OSS 3.5 and OSS 3.6; it says nothing about what > bugs were fixed (or added!) before release, what features were ported > before release, or what features were implemented first in Xcode and > then made their way to OSS LLVM. > > Because there's virtually no useful information to be gained from the > "based on LLVM ...", we've stopped reporting it in the version string. > >> Or am I missing something obvious that I should be doing to detect versions more robustly? > > Checking for the actual features you need is usually recommended. But > if that's not possible for some reason, you'll probably have to treat > Xcode Clang and OSS Clang as two different compilers. > > Cheers. > > Tim.-- Larry Gritz lg at larrygritz.com