Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 916405 - www-client/firefox fails to build using -Wl,-z,pack-relative-relocs
Summary: www-client/firefox fails to build using -Wl,-z,pack-relative-relocs
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 818376
  Show dependency tree
 
Reported: 2023-10-28 15:44 UTC by Sven B.
Modified: 2024-04-05 13:06 UTC (History)
2 users (show)

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


Attachments
Build log ff120b3 (build.log.xz,437.90 KB, application/x-xz)
2023-10-28 15:44 UTC, Sven B.
Details
untested patch (firefox-119.0.ebuild.patch,676 bytes, patch)
2023-10-28 15:48 UTC, Sven B.
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sven B. 2023-10-28 15:44:42 UTC
Created attachment 873574 [details]
Build log ff120b3

Setting --enable-elf-hack=legacy on gcc forces using the elf-hack even if already using -Wl,-z,pack-relative-relocs. Resulting in a failed build.

Disabling elf-hack resolves the issue.
Comment 1 Sven B. 2023-10-28 15:48:08 UTC
Created attachment 873579 [details, diff]
untested patch
Comment 2 Joonas Niilola gentoo-dev 2023-10-29 08:22:33 UTC
Hmm I wonder if we should just filter -z,pack-relative-relocs from LDFLAGS and let the build system do its thing instead.
Comment 3 Sven B. 2023-10-29 10:35:36 UTC
(In reply to Joonas Niilola from comment #2)
> Hmm I wonder if we should just filter -z,pack-relative-relocs from LDFLAGS
> and let the build system do its thing instead.

From what i understand if --enable-elf-hack=legacy or --enable-elf-hack=relr is set the build system will use exactly these methods. No idea what is chosen if these are not set at all. 

From the configuration output it definitely detects -z,pack-relative-relocs and handles it in some matter, but adds the legacy elf hack anyways since it was specifically configured. Filtering those flags will result in using the legacy elf hack then (with current ebuild), so no relr on gcc. I guess the configure step should error out if both (flag+legacy/relr) is detected.
Comment 4 An Müller 2024-03-23 15:40:33 UTC
With profile-23.0 announced and the new defaults on amd64, the --enable-elf-hack=legacy setting for USE=-clang breaks the build.

The build works fine with --enable-elf-hack=relro. It also works with not setting the build flag at all, the upstream build system gets that right since ~August, if I remember right.

Untested here, but according to upstream bugzilla, the clang build would not require passing the flag as well. So setting the flag could probably be dropped altogether (which is what I do in my overlay), but for mold, I don't know. If I understand things right, this should also work fine for 17.1, but have not tested.

The same goes for the thunderbird ebuild, handling gcc like clang works fine.

I'm happy to help with testing (in 23.0 :).
Comment 5 Larry the Git Cow gentoo-dev 2024-03-23 17:02:47 UTC
The bug has been referenced in the following commit(s):

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

commit d8557d20e509d1492e659aea36f2c12bb9c0691a
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2024-03-23 17:01:20 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2024-03-23 17:02:44 +0000

    www-client/firefox: add 124.0.1
    
     - since an upgrade to profile 23.0 breaks elf-hack=legacy, use elf-hack=relr
       even with gcc now. "-z,pack-relative-relocs" will be handled later, but it
       is enabled by the build system's elf-hack=relr already.
    
    Bug: https://bugs.gentoo.org/916405
    Bug: https://bugs.gentoo.org/927559
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 www-client/firefox/Manifest               |  100 ++
 www-client/firefox/firefox-124.0.1.ebuild | 1421 +++++++++++++++++++++++++++++
 2 files changed, 1521 insertions(+)
Comment 6 Larry the Git Cow gentoo-dev 2024-03-23 20:49:49 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=62c46990c64099e750d9339d7e0971fbd2f55d3f

commit 62c46990c64099e750d9339d7e0971fbd2f55d3f
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2024-03-23 20:47:56 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2024-03-23 20:49:46 +0000

    www-client/firefox: add 115.9.1
    
     - with profile 23.0 elf-hack=legacy is broken with gcc. With Firefox-115esr
       elf-hack=relr isn't available (only in rapid). Solution: Disable build
       system's elf-hack completely, and add "-z,pack-relative-relocs" manually
       with gcc.
    
    Bug: https://bugs.gentoo.org/916405
    Bug: https://bugs.gentoo.org/927559
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 www-client/firefox/Manifest               |  100 +++
 www-client/firefox/firefox-115.9.1.ebuild | 1394 +++++++++++++++++++++++++++++
 2 files changed, 1494 insertions(+)
Comment 7 Larry the Git Cow gentoo-dev 2024-03-24 17:39:17 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b392831019eb177fc3579e62343c251067d0ec8

commit 7b392831019eb177fc3579e62343c251067d0ec8
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2024-03-24 17:37:30 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2024-03-24 17:39:15 +0000

    mail-client/thunderbird: handle "-z,pack-relative-relocs" like in ff
    
    Closes: https://bugs.gentoo.org/916405
    Closes: https://bugs.gentoo.org/927559
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 mail-client/thunderbird/thunderbird-115.9.0.ebuild | 28 +++++++---------------
 1 file changed, 8 insertions(+), 20 deletions(-)

Additionally, it 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(+)