I tried to build jemalloc without +universal on my M1 Mac on Big Sur and did
not encounter any errors. When I tried to build it with +universal, I saw the
same error as in the log file attached to the trac case.
The clang messages suggest that an express cast will solve the compile problem:
include/jemalloc/internal/rtree.h:118:3: error: constant expression evaluates
to -12 which cannot be narrowed to type 'unsigned int' [-Wc++11-narrowing]
{RTREE_NSB, RTREE_NHIB + RTREE_NSB}
^~~~~~~~~
include/jemalloc/internal/rtree.h:22:19: note: expanded from macro 'RTREE_NSB'
#define RTREE_NSB (LG_VADDR - RTREE_NLIB)
^~~~~~~~~~~~~~~~~~~~~~~
include/jemalloc/internal/rtree.h:118:3: note: insert an explicit cast to
silence this issue
{RTREE_NSB, RTREE_NHIB + RTREE_NSB}
^~~~~~~~~
static_cast<unsigned int>( )
However, given the nature of the error (converting a negative int to a unsigned
int), while a cast might get the code to compile, there is probably an
underlying problem that needs to be fixed for this code to actually work
properly.
> On Aug 22, 2022, at 18:57, Ken Cunningham <[email protected]>
> wrote:
>
> it builds OK universal on Monterey Intel:
>
> % port -v installed jemalloc
> The following ports are currently installed:
> jemalloc @5.3.0_2+universal (active) requested_variants='+universal'
> platform='darwin 21' archs='arm64 x86_64' date='2022-08-22T17:31:05-0700’
>
>
> There are many combinations and permutations that can make strange things
> happen.
>
> If someone else reproduces your universal build failure on an arm Mac,
> perhaps we can sort it out. Usually we do.
>
> I don’t have an arm Mac, though, so will defer to someone who does.