Building Firefox 65.0 with clang and PGO enabled requires sys-libs/compiler-rt-sanitizers to be installed with the profile USE flag enabled. Otherwise the build fails due to not being able to find libclang_rt.profile-x86_64.a. This dependency seems to be missing from the Firefox ebuild. (The USE flag in question is enabled by default except on hardened profiles where it's masked; I suspect the mask probably wasn't intended to cover this particular instance of the profile USE flag though.) Since clang is likely also the only in-tree compiler that can build a Firefox binary with LTO which runs on x86-64 systems that don't support AVX2 (gcc bug that's been patched upstream but not made it into a release yet), this probably has a slighly wider impact than you might suspect.
Created attachment 563474 [details] build.log I'm hitting the same issue, attaching corresponding build.log. A compounding problem is that USE=profile is masked on hardened profile, apparently because of an incompatibility with PIE. Seems like an odd restriction, I wonder if it's still (or universally) valid, but in the meantime it's another stumbling block toward pgo for Firefox.
(In reply to Aidan Thornton from comment #0) > Since clang is likely also the only in-tree compiler that can build a > Firefox binary with LTO which runs on x86-64 systems that don't support AVX2 > (gcc bug that's been patched upstream but not made it into a release yet), > this probably has a slighly wider impact than you might suspect. Can you please share the GCC bug?
I'm not sure there's an official upstream bug report for the GCC bug, but it's the problem with unwanted AVX2 code in static constructors mentioned here: http://hubicka.blogspot.com/2018/12/firefox-64-built-with-gcc-and-clang.html Affects at least GCC 7, 8 and 9 as I understand it. There are likely other problems building Firefox with GCC+LTO based on the follow-up post, but this one means that the compiled binaries don't even start on non-AVX2 systems like mine. GCC just isn't really a supported build configuration for Firefox these days it seems, especially with LTO and PGO.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ecae1fb817fc89f8ba653e5a5afaf8b983cbdd4 commit 8ecae1fb817fc89f8ba653e5a5afaf8b983cbdd4 Author: Thomas Deutschmann <whissi@gentoo.org> AuthorDate: 2019-02-10 03:47:12 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2019-02-10 21:50:00 +0000 www-client/firefox: USE=pgo requires sys-libs/compiler-rt-sanitizers[profile] when Clang is used Bug: https://bugs.gentoo.org/676988 Package-Manager: Portage-2.3.59, Repoman-2.3.12 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> www-client/firefox/firefox-65.0-r1.ebuild | 1 + 1 file changed, 1 insertion(+) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d9d9de8d3772455a5f872429070d5cb0a933259 commit 2d9d9de8d3772455a5f872429070d5cb0a933259 Author: Thomas Deutschmann <whissi@gentoo.org> AuthorDate: 2019-02-10 15:42:35 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2019-02-10 21:49:59 +0000 profile: hardened: remove "profile" use.mask Acked-by: Magnus Granberg <zorry@gentoo.org> Bug: https://bugs.gentoo.org/676988 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> profiles/features/hardened/use.mask | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)