Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple Clang 14.0 lacks support for std::is_eq #29918

Closed
hebasto opened this issue Apr 19, 2024 · 13 comments
Closed

Apple Clang 14.0 lacks support for std::is_eq #29918

hebasto opened this issue Apr 19, 2024 · 13 comments

Comments

@hebasto
Copy link
Member

hebasto commented Apr 19, 2024

% cat test.cpp                   
#include <compare>

int main()
{
  double foo = -0.0;
  double bar = 0.0;
  return std::is_eq(foo <=> bar);
}
% clang++ -std=c++20 test.cpp        
test.cpp:7:15: error: no member named 'is_eq' in namespace 'std'
  return std::is_eq(foo <=> bar);
         ~~~~~^
1 error generated.
% clang -v                           
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

https://developer.apple.com/xcode/cpp/#c++20 didn't help much.

std::is_eq were added in #29242.

@hebasto hebasto added the macOS label Apr 19, 2024
@fanquake
Copy link
Member

We'll be dropping support for this compiler as soon as oss-fuzz rolls their Clang, and we bump our minimum.

@furszy
Copy link
Member

furszy commented Apr 20, 2024

Faced this too. Updating to 14.0.3 fixes the problem.

@hebasto
Copy link
Member Author

hebasto commented Apr 20, 2024

Faced this too. Updating to 14.0.3 fixes the problem.

Well, that's actually means switching to the toolchain based on LLVM 15.

@hebasto
Copy link
Member Author

hebasto commented Apr 20, 2024

@furszy

Faced this too. Updating to 14.0.3 fixes the problem.

Just to clarify, what macOS version did you update your clang on?

@furszy
Copy link
Member

furszy commented Apr 20, 2024

Ventura 13.1.

@hebasto
Copy link
Member Author

hebasto commented Apr 20, 2024

Ventura 13.1.

Well. It seems Apple does not suggest any upgrade paths for Big Sur and Monterey, which are still supported platforms for Bitcoin Core 27.0.

@maflcko
Copy link
Member

maflcko commented Apr 21, 2024

supported platforms

My understanding is that you can run Bitcoin Core on those platforms. However, compiling Bitcoin Core from source may not work out of the box.

If macOS does not offer an upgrade path for the system compiler, can you try to use a compiler provided by brew?

Another alternative would be to compile the compiler you need yourself.

@maflcko
Copy link
Member

maflcko commented Apr 21, 2024

Faced this too. Updating to 14.0.3 fixes the problem.

Just to clarify the confusing versioning here, this corresponds to Xcode 14.3, llvm 15, and Apple Clang 14.0.3, according to https://en.wikipedia.org/wiki/Xcode#Xcode_11.0_-_14.x_%28since_SwiftUI_framework%29

@fanquake
Copy link
Member

Yea. I think this can be closed with "use a compiler that better supports C++20". We still support the mentioned systems, and as far as I'm aware, installing and using a newer compiler would also work fine.

@Sjors
Copy link
Member

Sjors commented Apr 22, 2024

I was going to suggest changing doc/dependencies.md to clarify the minimum clang version is 14.0.3 rather than 14.0, but #29165 bumps it to 15.0 anyway.

@maflcko
Copy link
Member

maflcko commented Apr 22, 2024

I was going to suggest changing doc/dependencies.md to clarify the minimum clang version is 14.0.3 rather than 14.0, but #29165 bumps it to 15.0 anyway.

That would not be accurate. Clang 14 is indeed supported, see also https://godbolt.org/z/61seKv74b

The problem here is that Apple Clang 14.0.0 is apparently not based on llvm 14.0.0. I don't have further insights into Apples versioning nonsense, so I can't help here.

@Sjors
Copy link
Member

Sjors commented Apr 22, 2024

I see, so Apple clang needs to be >=14.0.3, but for other operating systems 14.0 is fine.

fanquake added a commit that referenced this issue May 2, 2024
2257404 doc: add LLVM instruction for macOS < 13 (Sjors Provoost)

Pull request description:

  #29208 bumped clang to 14, which users of old macOS versions need to install manually. This PR adds instructions.

  Xcode 14.3.1 ships clang 14.0.3 (14.0.0 is broken, see #29918):
  https://en.wikipedia.org/wiki/Xcode#Xcode_11.0_-_14.x_(since_SwiftUI_framework)

  The system requirements for that is macOS Ventura 13.0 or later: https://developer.apple.com/documentation/xcode-release-notes/xcode-14_3_1-release-notes#

  Homebrew itself officially supports macOS 12 or later, but _may_ still work on macOS 11: https://docs.brew.sh/Installation

  Fwiw macOS 11 Big Sur last got an update in September 2023, so Apple has not _entirely_ written it off: https://en.wikipedia.org/wiki/MacOS_Big_Sur

ACKs for top commit:
  maflcko:
    utACK 2257404
  TheCharlatan:
    ACK 2257404

Tree-SHA512: 5b4bcc71966d1da84bc4da32da89e0dea9f519f37d9e14e169140c92af044b33f404f01ae7d10f53ab5345dd51ac404c161389efef93da5cacbfd52a43881695
@maflcko
Copy link
Member

maflcko commented May 7, 2024

Anything left to be done here?

@maflcko maflcko closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants