[SERVER-17461] 32-bit clang cannot compile vendored gperftools Created: 04/Mar/15  Updated: 01/Jun/22  Resolved: 01/Jun/22

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: 3.0.0
Fix Version/s: 4.1 Desired

Type: Bug Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Alex Neben
Resolution: Won't Fix Votes: 0
Labels: build-jbr
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-17447 Failed to build on Linux i686 with clang Closed
Operating System: ALL
Steps To Reproduce:

See description

Participants:

 Description   

$ scons --cc=/usr/bin/clang --cxx=/usr/bin/clang++ CCFLAGS=-m32 LINKFLAGS=-m32 LIBS=atomic --cache --build-fast-and-loose=off -j$(grep -c ^processor /proc/cpuinfo) ./mongod
 
...
 
src/third_party/gperftools-2.2/src/malloc_hook_mmap_linux.h:108:23: error:
      non-constant-expression cannot be narrowed from type 'off_t' (aka 'long long') to 'int32'
      (aka 'int') in initializer list [-Wc++11-narrowing]
                      (off_t) offset };
                      ^~~~~~~~~~~~~~
src/third_party/gperftools-2.2/src/malloc_hook_mmap_linux.h:108:23: note: insert an explicit cast
      to silence this issue
                      (off_t) offset };
                      ^~~~~~~~~~~~~~
                      static_cast<int32>( )
/usr/bin/clang++ -o build/cached/third_party/shim_allocator.o -c -Wnon-virtual-dtor -Woverloaded-virtual -std=c++11 -m32 -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -pipe -Werror -O3 -march=nocona -mtune=generic -Wno-unused-function -Wno-unused-private-field -Wno-deprecated-declarations -Wno-tautological-constant-out-of-range-compare -Wno-unused-const-variable -Wno-missing-braces -fno-builtin-memcmp -DBOOST_ALL_NO_LIB -D_SCONS -DMONGO_EXPOSE_MACROS -DSUPPORT_UTF8 -DMONGO_OPTIMIZED_BUILD -DMONGO_BYTE_ORDER=1234 -D_FILE_OFFSET_BITS=64 -DMONGO_HAVE___THREAD -DMONGO_HAVE_HEADER_UNISTD_H -DMONGO_HAVE_POSIX_MONOTONIC_CLOCK -DMONGO_HAVE_EXECINFO_BACKTRACE -Isrc/third_party/gperftools-2.2 -Ibuild/cached -Isrc src/third_party/shim_allocator.cpp
1 error generated.
scons: *** [build/cached/third_party/gperftools-2.2/src/malloc_hook.o] Error 1
src/third_party/gperftools-2.2/src/tcmalloc.cc:425:21: warning: format specifies type
      'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
                cl, Static::sizemap()->ByteSizeForClass(cl),
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
scons: building terminated because of errors.


Generated at Thu Feb 08 03:44:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.