google / tcmalloc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bazel build error

NuclearRazor opened this issue · comments

Hey, I got a problem with tcmalloc building from sources by bazel. Please suggest something to resolve the next issue.

My build command:
bazel test //tcmalloc/... --cxxopt='-std=c++17'

Output:

INFO: Build option --cxxopt has changed, discarding analysis cache.
INFO: Analyzed 772 targets (1 packages loaded, 3315 targets configured).
INFO: Found 129 targets and 643 test targets...
INFO: From Compiling src/google/protobuf/message_lite.cc [for tool]:
In file included from /usr/include/string.h:638,
                 from external/com_google_protobuf/src/google/protobuf/stubs/port.h:39,
                 from external/com_google_protobuf/src/google/protobuf/stubs/common.h:48,
                 from external/com_google_protobuf/src/google/protobuf/message_lite.h:45,
                 from external/com_google_protobuf/src/google/protobuf/message_lite.cc:36:
In function 'void* memcpy(void*, const void*, size_t)',
    inlined from 'uint8_t* google::protobuf::io::EpsCopyOutputStream::WriteRaw(const void*, int, uint8_t*)' at external/com_google_protobuf/src/google/protobuf/io/coded_stream.h:706:16,
    inlined from 'virtual uint8_t* google::protobuf::internal::ImplicitWeakMessage::_InternalSerialize(uint8_t*, google::protobuf::io::EpsCopyOutputStream*) const' at external/com_google_protobuf/src/google/protobuf/implicit_weak_message.h:84:28,
    inlined from 'bool google::protobuf::MessageLite::SerializePartialToZeroCopyStream(google::protobuf::io::ZeroCopyOutputStream*) const' at external/com_google_protobuf/src/google/protobuf/message_lite.cc:412:30:
/usr/include/bits/string3.h:51:33: warning: 'void* __builtin___memcpy_chk(void*, const void*, long unsigned int, long unsigned int)' specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   51 |   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
      |          ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR: /usr/src/tcmalloc/tcmalloc/internal/BUILD:557:8: Compiling tcmalloc/internal/percpu_tcmalloc_test.cc failed: (Exit 1): gcc failed: error executing command (from target //tcmalloc/internal:percpu_tcmalloc_test) /opt/rh/devtoolset-11/root/usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF ... (remaining 56 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
tcmalloc/internal/percpu_tcmalloc_test.cc: In function 'void tcmalloc::tcmalloc_internal::subtle::percpu::{anonymous}::ResizeSlabsThread(tcmalloc::tcmalloc_internal::subtle::percpu::{anonymous}::Context&, tcmalloc::tcmalloc_internal::subtle::percpu::TcmallocSlab<4>::DrainHandler, absl::Span<std::pair<void*, long unsigned int> >)':
tcmalloc/internal/percpu_tcmalloc_test.cc:804:29: error: 'KPF_ZERO_PAGE' was not declared in this scope; did you mean 'KPF_NOPAGE'?
  804 |             (uint64_t{1} << KPF_ZERO_PAGE) | (uint64_t{1} << KPF_NOPAGE);
      |                             ^~~~~~~~~~~~~
      |                             KPF_NOPAGE
INFO: Elapsed time: 418.185s, Critical Path: 11.96s
INFO: 522 processes: 17 internal, 505 processwrapper-sandbox.
FAILED: Build did NOT complete successfully
...
Executed 0 out of 643 tests: 1 fails to build and 642 were skipped.

bazel 6.3.2
gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
Python 3.8.1 (default, Sep 12 2023, 08:17:16)
java 18.0.2.1 2022-08-18
Java(TM) SE Runtime Environment (build 18.0.2.1+1-1)
Java HotSpot(TM) 64-Bit Server VM (build 18.0.2.1+1-1, mixed mode, sharing)

Some additional info:
I got same results for devtoolset's:
scl enable devtoolset-8 bash
scl enable devtoolset-11 bash