InBetweenNames / gentooLTO

A Gentoo Portage configuration for building with -O3, Graphite, and LTO optimizations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gcc use flags active

antonellocaroli opened this issue · comments

Is that right? Or does lto also have to be enabled?

[ebuild R ] sys-devel/gcc-11.2.1_p20220115:11::gentoo USE="(cxx) fortran graphite* nls nptl openmp (pie) sanitize ssp (-ada) (-cet) -custom-cflags -d -debug -doc (-fixed-point) -go (-hardened) -jit (-libssp) -lto (-multilib) -objc -objc++ -objc-gc (-pch) -pgo -systemtap -test -valgrind -vanilla -vtv -zstd" 73,921 KiB

graphite is the gotcha. lto builds gcc with LTO, but is not required to use LTO in other compiles, the way graphite is.

that being said, I think for a gentoo system it makes to optimize gcc as much as possible and build with LTO. pgo is another good one but a tradeoff as it will take roughly twice as long to compile gcc, but the result will be faster.

So you suggest I enable lto and pgo for gcc?

mhhh...I tried it on aarch64...but it fails...

fi > tmp-fixinc_list
/bin/bash /var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/gcc/../move-if-change tmp-fixinc_list fixinc_list
echo timestamp > s-fixinc_list
/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/build/./prev-gcc/xg++ -B/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/build/./prev-gcc/ -B/usr/aarch64-unknown-linux-gnu/bin/>
/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/build/./prev-gcc/xg++ -B/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/build/./prev-gcc/ -B/usr/aarch64-unknown-linux-gnu/bin/>
/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/build/./prev-gcc/xg++ -B/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/build/./prev-gcc/ -B/usr/aarch64-unknown-linux-gnu/bin/>
  cc1-checksum.o libbackend.a main.o libcommon-target.a libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace>
^[[01m^[[Kxg++:^[[m^[[K ^[[01;31m^[[Kfatal error: ^[[m^[[KKilled signal terminated program lto1
compilation terminated.
lto-wrapper: fatal error: /var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/build/./prev-gcc/xg++ returned 1 exit status
compilation terminated.
/usr/aarch64-unknown-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[3]: *** [/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/gcc/fortran/Make-lang.in:98: f951] Error 1
make[3]: *** Waiting for unfinished jobs....
^[[01m^[[Kxg++:^[[m^[[K ^[[01;31m^[[Kfatal error: ^[[m^[[KKilled signal terminated program lto1
compilation terminated.
lto-wrapper: fatal error: /var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/build/./prev-gcc/xg++ returned 1 exit status
compilation terminated.
/usr/aarch64-unknown-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[3]: *** [/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/gcc/c/Make-lang.in:87: cc1] Error 1
^[[01m^[[Kxg++:^[[m^[[K ^[[01;31m^[[Kfatal error: ^[[m^[[KKilled signal terminated program lto1
compilation terminated.
lto-wrapper: fatal error: /var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/build/./prev-gcc/xg++ returned 1 exit status
compilation terminated.
/usr/aarch64-unknown-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[3]: *** [/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/gcc/lto/Make-lang.in:101: lto-dump] Error 1
^[[01m^[[K/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/gcc/simplify-rtx.c:^[[m^[[K In function ‘^[[01m^[[Ksimplify_const_binary_operation^[[m^[[K’:
^[[01m^[[K/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/gcc/machmode.h:569:25:^[[m^[[K ^[[01;35m^[[Kwarning: ^[[m^[[K‘^[[01m^[[KMEM[(struct scalar_int_mode *)&int>
  569 |   return mode_precision[mode];
      |                         ^[[01;35m^[[K^^[[m^[[K
^[[01m^[[K/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/gcc/simplify-rtx.c:4790:19:^[[m^[[K ^[[01;36m^[[Knote: ^[[m^[[K‘^[[01m^[[KMEM[(struct scalar_int_mode *)&i>
 4790 |   scalar_int_mode int_mode;
      |                   ^[[01;36m^[[K^^[[m^[[K
^[[01m^[[K/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/gcc/expmed.c:^[[m^[[K In function ‘^[[01m^[[Kextract_bit_field_1^[[m^[[K’:
^[[01m^[[K/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/gcc/expmed.c:1793:29:^[[m^[[K ^[[01;35m^[[Kwarning: ^[[m^[[K‘^[[01m^[[KMEM[(struct scalar_int_mode *)&imod>
 1793 |           op0 = gen_lowpart (imode, op0);
      |                             ^[[01;35m^[[K^^[[m^[[K
^[[01m^[[K/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/gcc/expmed.c:1785:19:^[[m^[[K ^[[01;36m^[[Knote: ^[[m^[[K‘^[[01m^[[KMEM[(struct scalar_int_mode *)&imode]^>
 1785 |   scalar_int_mode imode;
      |                   ^[[01;36m^[[K^^[[m^[[K

rm gfdl.pod gcc.pod gfortran.pod gcov-dump.pod gcov-tool.pod fsf-funding.pod gpl.pod cpp.pod gcov.pod lto-dump.pod
make[3]: Leaving directory '/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/build/gcc'
make[2]: *** [Makefile:4944: all-stageprofile-gcc] Error 2
make[2]: Leaving directory '/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/build'
make[1]: *** [Makefile:24603: stageprofile-bubble] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/build'
make: *** [Makefile:24873: profiledbootstrap] Error 2
 ^[[31;01m*^[[0m ERROR: sys-devel/gcc-11.2.1_p20220115::gentoo failed (compile phase):
 ^[[31;01m*^[[0m   emake failed
 ^[[31;01m*^[[0m
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=sys-devel/gcc-11.2.1_p20220115::gentoo'`,
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=sys-devel/gcc-11.2.1_p20220115::gentoo'`.
 ^[[31;01m*^[[0m The complete build log is located at '/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/temp/build.log'.
 ^[[31;01m*^[[0m The ebuild environment file is located at '/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/temp/environment'.
 ^[[31;01m*^[[0m Working directory: '/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/build'
 ^[[31;01m*^[[0m S: '/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115'
 ^[[31;01m*^[[0m
 ^[[31;01m*^[[0m Please include /var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-build-logs.tar.bz2 in your bug report.
 ^[[31;01m*^[[0m