Since libtsan.a provides new/delete overrides too:
ld.lld: error: duplicate symbol: operator new[](unsigned long, std::nothrow_t const&)
>>> defined at new_delete.cpp:64 (../src/Common/new_delete.cpp:64)
>>> new_delete.cpp.o:(operator new[](unsigned long, std::nothrow_t const&)) in archive src/libclickhouse_new_delete.a
>>> defined at tsan_new_delete.o:(.text+0xE0) in archive /usr/lib/gcc/x86_64-linux-gnu/10/libtsan.a
v2: Fix order of src vs programs for clickhouse_new_delete target detection
gcc with -nodefaultlibs does not add sanitizers library during linkage
with -static-libasan and similar, fix this, by add them explicitly.
From the gcc(1) about -nodefaultlibs:
Do not use the standard system libraries when linking. Only the
libraries you specify are passed to the linker, and options specifying
linkage of the system libraries, such as -static-libgcc or
-shared-libgcc, are ignored. The standard startup files are used
normally, unless -nostartfiles is used.
Plus checked it manually, w/o -nodefaultlibs everything works without
this explicit linkage.
After this patch UBSAN under gcc compiled successfully.
v2: freebsd and darwin
Yes clickhosue set gnu++2a globally, but this will not work, since
default -std=c++11 will be added later, look:
clang++ -std=gnu++2a ... -std=c++11 -Wall -Wextra contrib/llvm/...
Use -std=gnu++2a regardless of whether UNBUNDLED or not, because __int128
is a non-standard builtin and GCC, unlike Clang, only considers it to be
an integral type when GNU extensions are enabled.
Squashed:
- cmake: move USE_INTERNAL_POCO_LIBRARY option to separate file
- point contrib/poco to "add <atomic> to TCPServerDispatcher"
Signed-off-by: Konstantin Podshumok <kpp.live+signed@gmail.com>
Squashed:
- ENABLE_THINLTO shouldn't be enabled by default when tests or sanitizers are enabled
Signed-off-by: Konstantin Podshumok <kpp.live+signed@gmail.com>
This reverts commit 89419ceb9b
(curl part moved to separate commit)
Squashed:
- termcap removed
- fix for cassandra on apple merged
- cmake: fix "Can't find system zlib library" in unbundled build
- cmake: fix condition when testing for rdkafka platform
- cmake: PROTOBUF_OLD_ABI_COMPAT shouldn't be enabled for internal protobuf
Signed-off-by: Konstantin Podshumok <kpp.live+signed@gmail.com>