google / tcmalloc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compiling Issues on aarch64

SteveBuscemi88 opened this issue · comments

Hi all,
I'm trying to compile tcmalloc for aarch64 architecture using the toolchain aarch64-none-linux-gnu-gcc version 10.3-2021.07.
I'm using the command:
CC=/opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc bazel build --cxxopt='-std=c++17' //tcmalloc:tcmalloc

I obtain the error:

INFO: Analyzed target //tcmalloc:tcmalloc (0 packages loaded, 0 targets configured).
ERROR: /workspaces/my_project/Source/tcmalloc/tcmalloc/BUILD:96:11: Compiling tcmalloc/tcmalloc.cc failed: (Exit 1): aarch64-none-linux-gnu-gcc failed: error executing CppCompile command (from target //tcmalloc:tcmalloc) /opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object ... (remaining 37 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
during RTL pass: expand
In file included from ./tcmalloc/cpu_cache.h:51,
                 from tcmalloc/tcmalloc.cc:84:
./tcmalloc/internal/percpu_tcmalloc.h: In function 'void* TCMallocInternalMalloc(size_t)':
./tcmalloc/internal/percpu_tcmalloc.h:833:3: internal compiler error: 'asm' clobber conflict with output operand
  833 |   asm(
      |   ^~~
0x7fe465c3b082 __libc_start_main
        ../csu/libc-start.c:308
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://bugs.linaro.org/> for instructions.
Target //tcmalloc:tcmalloc failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 4.053s, Critical Path: 3.92s
INFO: 43 processes: 10 internal, 33 linux-sandbox.
ERROR: Build did NOT complete successfully

Does someone have similar issue and be able to solve this?
Thanks

I hit the same issue. It has been reported and fixed several times in tcmalloc. The issue is cc should not be reported as something as clobbered as it is also something gcc knows is part of the output. My fix for GCC is here - markbenvenuto@592534d

Amazing, thank you so much!