Zhiming Wang <zmwa...@gmail.com> added the comment:

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

----------
status: pending -> open

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32616>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to