Apple clang uses a different versioning scheme, so if we enable or
disable certain warnings for Clang 11+, those might not be supported
in Apple Clang 11+. This adds 'apple-clang' to COMPILER_FEATURES, so that
bootstrap tools Makefiles can avoid warnings on macOS.
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
share/mk/bsd.compiler.mk | ||
---|---|---|
186 | IMO we should explicitly mention Apple's versioning scheme to explain why there's a special apple-clang. Is there some site that cross-references Apple and upstream Clang revisions? |
share/mk/bsd.compiler.mk | ||
---|---|---|
186 | Wikipedia has a table at https://en.wikipedia.org/wiki/Xcode#Toolchain_versions which ultimately just gets the information from Apple's Swift LLVM fork via e.g. https://github.com/apple/llvm-project/blob/swift-5.3.2-RELEASE/llvm/CMakeLists.txt. |
share/mk/bsd.compiler.mk | ||
---|---|---|
186 | Seems like there is a table here: https://en.wikipedia.org/wiki/Xcode#Xcode_7.0_-_12.x_(since_Free_On-Device_Development) |
The new version uses COMPILER_FEATURES instead.
bmake[2]: "/Users/alex/cheri/cheribsd/share/mk/bsd.compiler.mk" line 253: COMPILER_FEATURES=apple-clang c++11 c++14 c++17 retpoline init-all bmake[2]: "/Users/alex/cheri/cheribsd/share/mk/bsd.compiler.mk" line 254: COMPILER_TYPE=clang bmake[2]: "/Users/alex/cheri/cheribsd/share/mk/bsd.compiler.mk" line 255: COMPILER_VERSION=120000 bmake[2]: "/Users/alex/cheri/cheribsd/share/mk/bsd.compiler.mk" line 256: X_COMPILER_FEATURES=c++11 c++14 c++17 retpoline init-all bmake[2]: "/Users/alex/cheri/cheribsd/share/mk/bsd.compiler.mk" line 257: X_COMPILER_TYPE=clang bmake[2]: "/Users/alex/cheri/cheribsd/share/mk/bsd.compiler.mk" line 258: X_COMPILER_VERSION=130000
This looks good as is, though I'd be inclined to use += in the place I tagged to future proof.
share/mk/bsd.compiler.mk | ||
---|---|---|
213 | Do you want to use = or += here? |
share/mk/bsd.compiler.mk | ||
---|---|---|
213 | Good point, might as well use += everywhere. Will make that change before committing |
share/mk/bsd.compiler.mk | ||
---|---|---|
213 | Looking at it again, it's guarded by !defined(${X_}COMPILER_FEATURES) so assigning might make more sense than using += |
share/mk/bsd.compiler.mk | ||
---|---|---|
213 | Sounds good to me then. I hadn't noticed that would make = fine. |