Page MenuHomePhabricator

Remove symbols exported by jemalloc from the symbols check
ClosedPublic

Authored by Fabien on Jun 4 2020, 09:16.

Details

Summary

This diff replaces the --exclude-libs ALL linker flag with a the more
narrow scoped exclusion of the symbols from the libstdc++.

The only remaining exported symbols are the global symbols from
jemalloc, that will be linked in place of the libc equivalents
(malloc, free, etc.). Allowing these symbols to remain exported make
it possible for the loader to use them for dynamic libraries also. This
fixes the segfault issue with bitcoin-qt on linux when
-DENABLE_REDUCE_EXPORTS=ON is set.

Test Plan

Reproduce the Gitian build conditions + jemalloc:

cmake -GNinja .. \
  -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/Linux64.cmake \
  -DENABLE_REDUCE_EXPORTS=ON \
  -DENABLE_STATIC_LIBSTDCXX=ON \
  -DENABLE_GLIBC_BACK_COMPAT=ON \
  -DUSE_LD_GOLD=OFF \
  -DUSE_JEMALLOC_EXPERIMENTAL=ON
ninja symbol-check

Run the Gitian builds.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable