Updated: Mon Apr 18 06:44:45 PM CEST 2022

This commit is contained in:
2022-04-18 18:44:45 +02:00
parent 326e8f7132
commit 5a98b19696
6 changed files with 2830 additions and 13 deletions

View File

@@ -186,7 +186,10 @@ FLAG_FILTER_NONGNU=(
'-mfunction-return*'
'-mindirect-branch*'
'-mvectorize*'
'-Waggressive-loop-optimizations'
'-Wclobbered'
'-Wl,-z,retpolineplt' # does not work, currently
'-Wreturn-local-addr'
)
FLAG_FILTER_GNU=(
@@ -196,7 +199,7 @@ FLAG_FILTER_GNU=(
'-flto-jobs=*'
'-fopenmp=*'
'-frewrite-includes'
'-fsanitize=cfi'
'-fsanitize=cfi*'
'-fsanitize=safe-stack'
'-mllvm'
'-mretpoline*'
@@ -204,6 +207,11 @@ FLAG_FILTER_GNU=(
'-Wl,-z,retpolineplt'
)
FLAG_FILTER_CLANG_LTO_DEP=(
'-fsanitize=cfi*'
'-fwhole-program-vtables'
)
FlagEval() {
case $- in
*f*) eval "$*";;
@@ -582,6 +590,7 @@ FlagScanDir() {
}
FlagSetUseNonGNU() {
has clang ${IUSE//+} && use clang && return 0
case $CC$CXX in
*clang*)
return 0;;
@@ -594,6 +603,12 @@ FlagSetNonGNU() {
FlagSubAllFlags "${FLAG_FILTER_NONGNU[@]}"
FlagReplaceAllFlags '-fstack-check*' '-fstack-check'
# FlagAddCFlags '-flto' '-emit-llvm'
case " $LDFLAGS $CFLAGS $CXXFLAGS" in
*[[:space:]]'-flto'*)
;;
*)
FlagSubAllFlags "${FLAG_FILTER_CLANG_LTO_DEP[@]}";;
esac
}
FlagSetGNU() {