2022-08-31 17:34:35 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# This is a workaround for bug in llvm/clang,
|
|
|
|
# that does not produce .debug_aranges with LTO
|
|
|
|
#
|
2022-10-18 19:06:03 +00:00
|
|
|
# NOTE: this is a temporary solution, that should be removed after upgrading to
|
|
|
|
# clang-16/llvm-16.
|
2022-08-31 17:34:35 +00:00
|
|
|
#
|
2022-10-18 19:06:03 +00:00
|
|
|
# Refs: https://reviews.llvm.org/D133092
|
2022-08-31 17:34:35 +00:00
|
|
|
|
|
|
|
# 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
|
2022-10-18 19:06:03 +00:00
|
|
|
exec "@LLD_PATH@" -plugin-opt=-generate-arange-section "$@"
|
2022-08-31 17:34:35 +00:00
|
|
|
else
|
|
|
|
exec "@LLD_PATH@" "$@"
|
|
|
|
fi
|