ClickHouse/dbms
Azat Khuzhin 6cb5d0046b
Add missing linking with jemalloc for clickhouse_common_io
clickhouse_common_io incudes new_delete.cpp, that uses memory.h, which
uses sdallocx (jemalloc).

And since there is -Wl,--no-undefined every undefined symbols are not
allowed, hence clickhouse_common_io must know about sdallocx symbol.

For the default build (-DUNBUNDLED=OFF) everything is good, because
jemalloc is static, and clickhouse_common_io linked with libcommon
(which is linked with jemalloc)

But if jemalloc will be shared, and clickhouse_common_io and libcommon
is different shared libraries then clickhouse_common_io should be linked
with jemalloc, otherwise you will undefined reference to sdallocx error.

This can be reproduced using the following build configuration:
   -DUSE_STATIC_LIBRARIES=OFF -DCLICKHOUSE_SPLIT_BINARY=ON -DSPLIT_SHARED_LIBRARIES=ON -DUNBUNDLED=ON
Provided that you have systemd-wide jemalloc>=4 (see memory.h).

Refs: https://github.com/yandex/ClickHouse/pull/6878#discussion_r324902295
v2: do not link jemalloc if it is static
2019-09-18 21:26:23 +03:00
..
benchmark
cmake Auto version update to [19.15.1.1] [54426] 2019-09-06 17:58:33 +03:00
programs Merge pull request #6939 from dimarub2000/perfomance_test_all_of 2019-09-16 13:04:23 +03:00
src Merge pull request #6907 from PerformanceVision/dict_allow_databases 2019-09-16 11:52:25 +03:00
tests Merge pull request #6934 from abyss7/CLICKHOUSE-4643 2019-09-15 09:46:10 +03:00
CMakeLists.txt Add missing linking with jemalloc for clickhouse_common_io 2019-09-18 21:26:23 +03:00