mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
2d3fb36a62
Wrap a linker into a script that will add some settings (`-mllvm -generate-arange-section`) in case of ThinLTO to emit `.debug_aranges` symbols. Dicussion in the LLVM can be found here [1]. [1]: https://discourse.llvm.org/t/clang-does-not-produce-full-debug-aranges-section-with-thinlto/64898 Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
18 lines
574 B
Bash
Executable File
18 lines
574 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# This is a workaround for bug in llvm/clang,
|
|
# that does not produce .debug_aranges with LTO
|
|
#
|
|
# NOTE: this is a temporary solution, that should be removed once [1] will be
|
|
# resolved.
|
|
#
|
|
# [1]: https://discourse.llvm.org/t/clang-does-not-produce-full-debug-aranges-section-with-thinlto/64898/8
|
|
|
|
# NOTE: only -flto=thin is supported.
|
|
# NOTE: it is not possible to check was there -gdwarf-aranges initially or not.
|
|
if [[ "$*" =~ -plugin-opt=thinlto ]]; then
|
|
exec "@LLD_PATH@" -mllvm -generate-arange-section "$@"
|
|
else
|
|
exec "@LLD_PATH@" "$@"
|
|
fi
|