summaryrefslogtreecommitdiff
path: root/eclass/toolchain.eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass/toolchain.eclass')
-rw-r--r--eclass/toolchain.eclass20
1 files changed, 12 insertions, 8 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 2d7801259019..8ffdd9e26f1e 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1090,6 +1090,14 @@ toolchain_src_configure() {
confgcc+=( --enable-libstdcxx-time )
fi
+ # This only controls whether the compiler *supports* LTO, not whether
+ # it's *built using* LTO. Hence we do it without a USE flag.
+ if tc_version_is_at_least 4.6 ; then
+ confgcc+=( --enable-lto )
+ elif tc_version_is_at_least 4.5 ; then
+ confgcc+=( --disable-lto )
+ fi
+
# Build compiler itself using LTO
if tc_version_is_at_least 9.1 && _tc_use_if_iuse lto ; then
build_config_targets+=( bootstrap-lto )
@@ -1164,6 +1172,10 @@ toolchain_src_configure() {
avr)
confgcc+=( --enable-shared --disable-threads )
;;
+ nvptx*)
+ # "LTO is not supported for this target"
+ confgcc+=( --disable-lto )
+ ;;
esac
if [[ -n ${needed_libc} ]] ; then
@@ -1485,14 +1497,6 @@ toolchain_src_configure() {
confgcc+=( $(use_with zstd) )
fi
- # This only controls whether the compiler *supports* LTO, not whether
- # it's *built using* LTO. Hence we do it without a USE flag.
- if tc_version_is_at_least 4.6 ; then
- confgcc+=( --enable-lto )
- elif tc_version_is_at_least 4.5 ; then
- confgcc+=( --disable-lto )
- fi
-
# graphite was added in 4.4 but we only support it in 6.5+ due to external
# library issues. bug #448024, bug #701270
if tc_version_is_at_least 6.5 && in_iuse graphite ; then