[SERVER-44270] Compilation fails with --libc++ and clang 8.0+ Created: 26/Oct/19  Updated: 29/Oct/23  Resolved: 30/Oct/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Bug Priority: Major - P3
Reporter: Mark Benvenuto Assignee: Mark Benvenuto
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Security 2019-11-18
Participants:

 Description   

MongoDB fails to compile with clang 8.0 and libc++. It also affects clang 9.0.

Libc++ 8.0+ defines the feature flag __cpp_lib_hardware_interference_size even though it has no support for the feature. See https://bugs.llvm.org/show_bug.cgi?id=41423.

This bug is only hit on stock libc++ because Apple has not integrated https://github.com/llvm/llvm-project/commit/f56972e22489c92028e5147344ab8b31b0b4fed5 yet. I do not believe this feature will ever be supported in clang or gcc

Error

In file included from src/mongo/db/pipeline/document_source_match.cpp:32:
In file included from src/mongo/db/pipeline/document_source_match.h:37:
In file included from src/mongo/db/pipeline/document_source.h:45:
In file included from src/mongo/db/commands.h:47:
In file included from src/mongo/db/query/explain.h:36:
In file included from src/mongo/db/query/plan_executor.h:35:
In file included from src/mongo/db/catalog/util/partitioned.h:44:
In file included from src/mongo/util/with_alignment.h:34:
src/mongo/stdx/new.h:53:12: error: no member named 'hardware_constructive_interference_size' in namespace 'std'
using std::hardware_constructive_interference_size;
      ~~~~~^
src/mongo/stdx/new.h:54:12: error: no member named 'hardware_destructive_interference_size' in namespace 'std'
using std::hardware_destructive_interference_size;
      ~~~~~^



 Comments   
Comment by Githook User [ 19/Nov/19 ]

Author:

{'name': 'Mark Benvenuto', 'username': 'markbenvenuto', 'email': 'mark.benvenuto@mongodb.com'}

Message: SERVER-44270 Compilation fails with --libc++ and clang 8.0+

(cherry picked from commit aac59681b3ae4d3806174227ba4c88aaf8e89ea2)
Branch: v4.2
https://github.com/mongodb/mongo/commit/23ebd3daa3a9ca8f5a1a495caa9e1bb1bc4563cf

Comment by Githook User [ 30/Oct/19 ]

Author:

{'username': 'markbenvenuto', 'email': 'mark.benvenuto@mongodb.com', 'name': 'Mark Benvenuto'}

Message: SERVER-44270 Compilation fails with --libc++ and clang 8.0+
Branch: master
https://github.com/mongodb/mongo/commit/aac59681b3ae4d3806174227ba4c88aaf8e89ea2

Generated at Thu Feb 08 05:05:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.