flag-o-matic.eclass: add filter-lto function

Bug: https://bugs.gentoo.org/618550
Closes: https://github.com/gentoo/gentoo/pull/26036
Signed-off-by: Jannik Glückert <jannik.glueckert@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Jannik Glückert
2022-06-28 08:34:35 +01:00
committed by Sam James
parent 6bc3d59410
commit cd9e814fc8
+8
View File
@@ -218,6 +218,14 @@ filter-lfs-flags() {
filter-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_TIME_BITS=64
}
# @FUNCTION: filter-lto
# @DESCRIPTION:
# Remove flags that enable LTO and those that depend on it
filter-lto() {
[[ $# -ne 0 ]] && die "filter-lto takes no arguments"
filter-flags '-flto*' -fwhole-program-vtables '-fsanitize=cfi*'
}
# @FUNCTION: filter-ldflags
# @USAGE: <flags>
# @DESCRIPTION: