Since building sys-devel/gcc with USE=jit will slow down the compiler by a few percent, it's recommended to build GCC twice as described at the following URL: https://gcc.gnu.org/onlinedocs/gcc-11.2.0/jit/internals/index.html#packaging-notes This could be made optional with an USE flag as it will double the build time.
It's been on my mind but I needed a push to do it. Thanks. It should be doable with multibuild. We can try strip down the PGO build.
(In reply to Sam James from comment #1) > We can try strip down the PGO build. JIT, I meant, obviously.
I've started hacking something up for this.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3910f2d8719d8cb8fbb19572cb524b0472429c81 commit 3910f2d8719d8cb8fbb19572cb524b0472429c81 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-05-27 04:31:52 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-05-28 23:32:15 +0000 toolchain.eclass: build JIT variant separately to avoid slowdown It's what GCC upstream recommend to avoid slowing down the main GCC binaries which need to be built w/ -fPIC for JIT. We build twice but do an extremely minimal build for the JIT part which is rather quick. Install the JIT version first, then the main GCC variant, so the overlapping binaries come from the main build => more featureful, correct build options/needed ones for a full GCC build, etc. Closes: https://bugs.gentoo.org/843341 Signed-off-by: Sam James <sam@gentoo.org> eclass/toolchain.eclass | 79 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 65 insertions(+), 14 deletions(-)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5bed0c77a1c54ac9297db4bb54af2e45c0558ec7 commit 5bed0c77a1c54ac9297db4bb54af2e45c0558ec7 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-05-27 04:31:52 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-05-29 00:11:07 +0000 toolchain.eclass: build JIT variant separately to avoid slowdown It's what GCC upstream recommend to avoid slowing down the main GCC binaries which need to be built w/ -fPIC for JIT. We build twice but do an extremely minimal build for the JIT part which is rather quick. Install the JIT version first, then the main GCC variant, so the overlapping binaries come from the main build => more featureful, correct build options/needed ones for a full GCC build, etc. Closes: https://bugs.gentoo.org/843341 Signed-off-by: Sam James <sam@gentoo.org> eclass/toolchain.eclass | 81 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 65 insertions(+), 16 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=058b3ccb597a5b9a087cf3262f0a86155b52443e commit 058b3ccb597a5b9a087cf3262f0a86155b52443e Author: Sam James <sam@gentoo.org> AuthorDate: 2022-09-27 15:53:52 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-09-27 15:53:52 +0000 sys-devel/gcc: fix obsolete USE=jit warning There's no slowdown anymore as we built libgccjit separately in toolchain.eclass. Bug: https://bugs.gentoo.org/843341 Signed-off-by: Sam James <sam@gentoo.org> sys-devel/gcc/metadata.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)