Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 888055 - www-client/firefox, mail-client/thunderbird: ELF hack needs to be disabled if using -Wl,-z,pack-relative-relocs
Summary: www-client/firefox, mail-client/thunderbird: ELF hack needs to be disabled if...
Status: RESOLVED FIXED
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: 818376
  Show dependency tree
 
Reported: 2022-12-23 05:37 UTC by David Korth
Modified: 2024-04-05 13:06 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Korth 2022-12-23 05:37:55 UTC
The upcoming 23.0 profile has -Wl,-z,pack-relative-relocs in LDFLAGS, which enables DT_RELR. This essentially supercedes Firefox's and Thunderbird's built-in "ELF hack" feature, but it's not compatible with it, so ELF hack needs to be disabled if DT_RELR is enabled.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-23 05:43:49 UTC
Right, it is indeed a generic version of "ELF hack" (see e.g. https://maskray.me/blog/2021-10-31-relative-relocations-and-relr).
Comment 2 Joonas Niilola gentoo-dev 2023-01-04 11:05:09 UTC
Since elf-hack is currently disabled anyway when using clang, I think something like this could work?

elif tc-is-gcc ; then
	filter-ldflags pack-relative-relocs

which will enable upstream's elf-hack when using gcc. Another option is to always disable elf-hack anyway, since clang should be used to compile these mozilla products.
Comment 3 Joonas Niilola gentoo-dev 2023-01-04 11:06:45 UTC
Or it can be matched with "is-ldflag pack-relative-relocs" and then disable/enable upstream's elf-hack whichever way we desire to have it.
Comment 4 Arsen Arsenović gentoo-dev 2023-01-04 11:50:20 UTC
hmm, how does this fail?  currently, I'm using both pack-relative-relocs and Firefox and see no issue.
Comment 5 Arsen Arsenović gentoo-dev 2023-01-04 11:50:49 UTC
ah - disregard.  I forgot firefox uses clang to build :/
Comment 6 Larry the Git Cow gentoo-dev 2023-08-01 10:04:30 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fd128403bb5b3b4619b07e4964f7dfff635f41c

commit 1fd128403bb5b3b4619b07e4964f7dfff635f41c
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2023-08-01 10:03:51 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2023-08-01 10:04:27 +0000

    www-client/firefox: add 116.0
    
    Closes: https://bugs.gentoo.org/910689
    Bug: https://bugs.gentoo.org/910290
    Closes: https://bugs.gentoo.org/888055
    Bug: https://bugs.gentoo.org/909724
    Closes: https://bugs.gentoo.org/904354
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 www-client/firefox/Manifest             |  101 +++
 www-client/firefox/firefox-116.0.ebuild | 1466 +++++++++++++++++++++++++++++++
 2 files changed, 1567 insertions(+)
Comment 7 Larry the Git Cow gentoo-dev 2024-03-24 17:39:19 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=88ead78a85613171465a92233bc811612ab98ea1

commit 88ead78a85613171465a92233bc811612ab98ea1
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2024-03-24 16:33:37 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2024-03-24 17:39:15 +0000

    www-client/firefox: filter pack-relative-relocs on 124.0.1
    
     - let the build system handle it via configure.
    
    Bug: https://bugs.gentoo.org/916405
    Bug: https://bugs.gentoo.org/888055
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 www-client/firefox/firefox-124.0.1.ebuild | 3 +++
 1 file changed, 3 insertions(+)