This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author zmwangx
Recipients barry, benjamin.peterson, methane, ned.deily, ronaldoussoren, tdsmith, zmwangx
Date 2018-02-08.18:59:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1518116355.58.0.467229070634.issue32616@psf.upfronthosting.co.za>
In-reply-to
Content
Yeah, Apple LLVM versions are a major headache. I resorted to feature detection, using C++ coroutines support as the clang 5 distinguisher[1]:

$ cat /tmp/test/stub.cc
#include <experimental/coroutine>

int main() {
    return 0;
}

$ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

$ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -o stub stub.cc -fcoroutines-ts -stdlib=libc++
stub.cc:1:10: fatal error: 'experimental/coroutine' file not found
#include <experimental/coroutine>
         ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

$ /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v
Apple LLVM version 9.1.0 (clang-902.0.31)
Target: x86_64-apple-darwin17.4.0
Thread model: posix
InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

$ /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -o stub stub.cc -fcoroutines-ts -stdlib=libc++

Here Xcode.app is Xcode 9.2 and Xcode-beta.app is Xcode 9.3 beta 2.

The conclusion here seems to be that Apple LLVM 9.0.0 is based on LLVM 4, while Apple LLVM 9.1.0 is based on LLVM 5.

[1] http://releases.llvm.org/5.0.0/tools/clang/docs/ReleaseNotes.html#major-new-features
History
Date User Action Args
2018-02-08 18:59:15zmwangxsetrecipients: + zmwangx, barry, ronaldoussoren, benjamin.peterson, ned.deily, methane, tdsmith
2018-02-08 18:59:15zmwangxsetmessageid: <1518116355.58.0.467229070634.issue32616@psf.upfronthosting.co.za>
2018-02-08 18:59:15zmwangxlinkissue32616 messages
2018-02-08 18:59:15zmwangxcreate