mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
Merge updates from master
This commit is contained in:
@@ -1230,4 +1230,25 @@ tc-get-build-ptr-size() {
|
||||
die "Could not determine CBUILD pointer size"
|
||||
}
|
||||
|
||||
# @FUNCTION: tc-is-lto
|
||||
# @RETURN: Shell true if we are using LTO, shell false otherwise
|
||||
tc-is-lto() {
|
||||
local f="${T}/test-lto.o"
|
||||
|
||||
case $(tc-get-compiler-type) in
|
||||
clang)
|
||||
$(tc-getCC) ${CFLAGS} -c -o "${f}" -x c - <<<"" || die
|
||||
# If LTO is used, clang will output bytecode and llvm-bcanalyzer
|
||||
# will run successfully. Otherwise, it will output plain object
|
||||
# file and llvm-bcanalyzer will exit with error.
|
||||
llvm-bcanalyzer "${f}" &>/dev/null && return 0
|
||||
;;
|
||||
gcc)
|
||||
$(tc-getCC) ${CFLAGS} -c -o "${f}" -x c - <<<"" || die
|
||||
[[ $($(tc-getREADELF) -S "${f}") == *.gnu.lto* ]] && return 0
|
||||
;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user