google / google/tcmalloc

Compilation error on Alpine Linux

Open
#150 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5.3k
Forks
570
Avg merge
23h 43m
Merged PRs (30d)
172

Description

tcmalloc doesn't compile on Alpine Linux due to missing attributes, see [this]( https://github.com/daanx/mimalloc-bench/actions/runs/3518860962/jobs/5898217002 ) [mimalloc-bench]( https://github.com/daanx/mimalloc-bench) log.

```
--------------------------------------------
build tcg: version 41fc1266a08d9662a7e3dd76aebd0a3587f4cc36
--------------------------------------------

/__w/mimalloc-bench/mimalloc-bench/extern /__w/mimalloc-bench/mimalloc-bench
Cloning into 'tcg'...
HEAD is now at 41fc126 Remove unused internal ID
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
Loading:
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
DEBUG: /github/home/.cache/bazel/_bazel_root/73e4315fd1aa3d904e5ced823bbfc603/external/rules_python/python/repositories.bzl:32:10: py_repositories is a no-op and is deprecated. You can remove this from your WORKSPACE file
Loading: 0 packages loaded
currently loading: tcmalloc
Analyzing: target //tcmalloc:tcmalloc (1 packages loaded, 0 targets configured)
Analyzing: target //tcmalloc:tcmalloc (34 packages loaded, 131 targets configured)
Analyzing: target //tcmalloc:tcmalloc (46 packages loaded, 180 targets configured)
INFO: Analyzed target //tcmalloc:tcmalloc (58 packages loaded, 703 targets configured).
INFO: Found 1 target...
[0 / 4] [Prepa] Creating source manifest for //tcmalloc:tcmalloc
[4 / 143] Compiling tcmalloc/tcmalloc.cc; 1s processwrapper-sandbox ... (2 actions running)
[5 / 143] Compiling tcmalloc/tcmalloc.cc; 2s processwrapper-sandbox ... (2 actions, 1 running)
[6 / 143] Compiling tcmalloc/tcmalloc.cc; 4s processwrapper-sandbox ... (2 actions, 1 running)
[8 / 143] Compiling tcmalloc/tcmalloc.cc; 6s processwrapper-sandbox ... (2 actions running)
ERROR: /__w/mimalloc-bench/mimalloc-bench/extern/tcg/tcmalloc/BUILD:95:10: Compiling tcmalloc/tcmalloc.cc failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 37 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from tcmalloc/tcmalloc.cc:1160:
./tcmalloc/libc_override.h:208:8: error: 'size_t malloc_usable_size(void*)' specifies less restrictive attribute than its target 'size_t TCMallocInternalMallocSize(void*)': 'nothrow' [-Werror=missing-attributes]
208 | size_t malloc_usable_size(void* p) TCMALLOC_NOTHROW
| ^~~~~~~~~~~~~~~~~~
tcmalloc/tcmalloc.cc:1553:19: note: 'size_t malloc_usable_size(void*)' target declared here
1553 | extern "C" size_t TCMallocInternalMallocSize(void* ptr) noexcept {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from tcmalloc/tcmalloc.cc:1160:
./tcmalloc/libc_override.h:206:8: error: 'size_t malloc_size(void*)' specifies less restrictive attribute than its target 'size_t TCMallocInternalMallocSize(void*)': 'nothrow' [-Werror=missing-attributes]
206 | size_t malloc_size(void* p) TCMALLOC_NOTHROW
| ^~~~~~~~~~~
tcmalloc/tcmalloc.cc:1553:19: note: 'size_t malloc_size(void*)' target declared here
1553 | extern "C" size_t TCMallocInternalMallocSize(void* ptr) noexcept {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.