Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 676988 - www-client/firefox USE="clang pgo" should depend on sys-libs/compiler-rt-sanitizers[profile]
Summary: www-client/firefox USE="clang pgo" should depend on sys-libs/compiler-rt-sani...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-31 14:36 UTC by Aidan Thornton
Modified: 2019-02-10 21:50 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.ff.pgo.log,244.00 KB, text/x-log)
2019-02-02 09:47 UTC, Vincent de Phily
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aidan Thornton 2019-01-31 14:36:14 UTC
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.
Comment 1 Vincent de Phily 2019-02-02 09:47:14 UTC
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.
Comment 2 Thomas Deutschmann gentoo-dev Security 2019-02-10 00:28:30 UTC
(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?
Comment 3 Aidan Thornton 2019-02-10 19:09:20 UTC
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.
Comment 4 Larry the Git Cow gentoo-dev 2019-02-10 21:50:19 UTC
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(-)