This patch also updates the jemalloc version.
Note, that I've enabled page_id for jemalloc
PR_SET_VMA/PR_SET_VMA_ANON_NAME, that requires linux 5.17+ (but ignores
EINVAL anyway).
v2: add -isystem to fix reserved name for JEMALLOC_OVERRIDE___LIBC_PVALLOC
Refs: https://github.com/jemalloc/jemalloc/pull/2304
Refs: https://github.com/ClickHouse/ClickHouse/issues/31531
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
jemalloc provides support for two different libunwind flavors: the original HP libunwind and the one coming with gcc / g++ / libstdc++.
The latter is identified by `JEMALLOC_PROF_LIBGCC` and provides `_Unwind_Backtrace` method instead of `unw_backtrace`.
At the time ClickHouse uses LLVM libunwind which follows libgcc's way of backtracing.
ClickHouse has to provide `unw_backtrace` method by the means of [commit 8e2b31e](8e2b31e766).
While this PR does not allow complete remove of the patch (as ClickHouse itself uses unw_backtrace directly), it definitely sorts the things out.
If you had jemalloc build in contrib/jemalloc, and not current version
but some outdated, then compiler will pick incorrect file and may fail.
Also SYSTEM should be removed since regular -I is in the different list,
and will be checked before -isystem.
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
Note, that there is no need to disable JEMALLOC_PURGE_MADVISE_FREE,
since jemalloc does check in runtime, and ClickHouse already
successfully works w/o this change.
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
- remove GNU_SOURCE it is done in common CMakeLists.txt
- remove JEMALLOC_OVERRIDE___POSIX_MEMALIGN (there is no need to since
__posix_memalign() does not exists in linux)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
v2: update jemalloc one more time
v3:
- do not include jemalloc_mangle*.h
- do not change jemalloc.h
- fix for JEMALLOC_NOTHROW/JEMALLOC_SYS_NOTHROW
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
Make ClickHouse compilable and runnable on risc-v 64
So far only basic functionality was tested (on real hw),
clickhouse server runs, exceptions works, client works,
simple tests works.
What doesn't work:
1. traces - they are always empty
2. system.stack_trace only have first frame