Opened 3 years ago
Last modified 2 years ago
#63101 assigned defect
clang-12 @12.0.0: error: non-constant-expression cannot be narrowed from type 'long long' to 'std::size_t' (aka 'unsigned long') in initializer list [-Wc++11-narrowing]
Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.7.99 |
Keywords: | highsierra | Cc: | jeremyhu (Jeremy Huddleston Sequoia), cooljeanius (Eric Gallager) |
Port: | clang-12 |
Description
I can't build clang-12 on High Sierra (with the universal variant in case that's relevant):
.../llvm-project-12.0.0.src/flang/lib/Evaluate/constant.cpp:254:30: error: non-constant-expression cannot be narrowed from type 'long long' to 'std::size_t' (aka 'unsigned long') in initializer list [-Wc++11-narrowing] std::size_t elementBytes{length_ * sizeof(decltype(values_[0]))}; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Attachments (3)
Change History (10)
Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Attachment: | main.log.bz2 added |
---|
comment:1 Changed 3 years ago by kencu (Ken)
comment:2 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Yes, clang-10 and clang-11 build fine with the universal variant.
$ port -v installed name:clang-1 The following ports are currently installed: clang-10 @10.0.1_5+analyzer+libstdcxx+universal (active) requested_variants='+analyzer+libstdcxx+universal' platform='darwin 17' archs='i386 x86_64' date='2021-05-08T03:37:26-0500' clang-11 @11.1.0_3+analyzer+libstdcxx+universal (active) requested_variants='+analyzer+libstdcxx+universal' platform='darwin 17' archs='i386 x86_64' date='2021-06-16T06:13:18-0500' clang-12 @12.0.0_0+libstdcxx (active) requested_variants='-universal' platform='darwin 17' archs='x86_64' date='2021-06-16T06:31:22-0500'
comment:3 Changed 3 years ago by kencu (Ken)
Will clang-12 build universal if you use clang-11 or clang-10 to build it, instead of the current default of clang-9.0?
comment:4 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Even without universal, clang-12 won't build with clang-10:
llvm/include/llvm/Demangle/ItaniumDemangle.h:955:10: error: expression is not an integral constant expression case TemplateParamKind::Type: ^~~~~~~~~~~~~~~~~~~~~~~
Nor will it build with clang-11:
llvm/include/llvm/Demangle/ItaniumDemangle.h:116:8: error: ISO C++ forbids forward references to 'enum' types enum Kind : unsigned char { ^ llvm/include/llvm/Demangle/ItaniumDemangle.h:116:24: error: expected '(' for function-style cast or type construction enum Kind : unsigned char { ~~~~~~~~ ^ llvm/include/llvm/Demangle/ItaniumDemangle.h:116:13: error: field has incomplete type 'enum Kind' enum Kind : unsigned char { ^
Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Attachment: | clang-12-compiled-with-clang-10.main.log.bz2 added |
---|
Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Attachment: | clang-12-compiled-with-clang-11.main.log.bz2 added |
---|
comment:5 Changed 3 years ago by kencu (Ken)
ugly then.
I don't have the c++ skills to fix. I can mark it as not having a universal variant of course, until such time as somebody like Marcus, Ionic, Landon, Josh, etc might get interested.
Upstream is never testing i386 builds on macOS, and has zero interest, so that's also a tough sell...
You know, even the x86_64 build can compile i386 code...it's only the clang libraries that need to be fat....otherwise we could just fake the universal, if you follow what I mean...
comment:6 Changed 3 years ago by kencu (Ken)
Owner: | changed from kencu to macports-tickets@… |
---|
comment:7 Changed 2 years ago by cooljeanius (Eric Gallager)
Cc: | cooljeanius added |
---|
The same line did get past the buildbot I note, when the buildbot built it (non-universal).
<https://build.macports.org/builders/ports-10.13_x86_64-builder/builds/112699/steps/install-port/logs/stdio>
The only differences I can see between your failing build line and the buildbot's succeeding one is:
-arch i386
and-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
addedSo it must be one of those I guess.
Would you have a moment to try with clang-11 or clang-10 and see if they work when building universal?