Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 913130 - www-client/firefox-116.0.3: checking for -z pack-relative-relocs option to ld.. fails with READELF="readelf"
Summary: www-client/firefox-116.0.3: checking for -z pack-relative-relocs option to ld...
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: PullRequest
Depends on:
Blocks: 818376
  Show dependency tree
 
Reported: 2023-08-28 06:18 UTC by Alfred Wingate
Modified: 2023-11-22 00:47 UTC (History)
0 users

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


Attachments
www-client/firefox-116.0.3 build.log (build.log,45.19 KB, text/plain)
2023-08-28 06:20 UTC, Alfred Wingate
Details
emerge --info (emerge_info.txt,21.17 KB, text/plain)
2023-08-28 06:20 UTC, Alfred Wingate
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alfred Wingate 2023-08-28 06:18:39 UTC
Output of llvm-readelf and readelf are slightly different, leading to an IndexError when firefox configure tries to split an empty string.

Reproducible: Always

Steps to Reproduce:
1. READELF="readelf"
2. emerge \=www-client/firefox-116.0.3
Actual Results:  
Failure during the configure stage

Expected Results:  
Success

0:10.20 checking for -z pack-relative-relocs option to ld...
 0:10.20 DEBUG: Creating `/var/tmp/portage/www-client/firefox-116.0.3/temp/conftest.goa60_uf.c` with content:
 0:10.20 DEBUG: | int main() { return 0; }
 0:10.20 DEBUG: Executing: `/usr/lib/llvm/16/bin/x86_64-pc-linux-gnu-clang-16 -std=gnu99 /var/tmp/portage/www-client/firefox-116.0.3/temp/conftest.goa60_uf.c -Wl,-z,pack-relative-relocs -o /var/tmp/portage/www-client/firefox-116.0.3/temp/conftest.mfi72t5i -fuse-ld=lld`
 0:10.20 DEBUG: Executing: `/usr/bin/readelf -d /var/tmp/portage/www-client/firefox-116.0.3/temp/conftest.mfi72t5i`
 0:10.20 Traceback (most recent call last):
 0:10.20   File "/var/tmp/portage/www-client/firefox-116.0.3/work/firefox-116.0.3/configure.py", line 345, in <module>
 0:10.20     sys.exit(main(sys.argv))
 0:10.20              ^^^^^^^^^^^^^^
 0:10.20   File "/var/tmp/portage/www-client/firefox-116.0.3/work/firefox-116.0.3/configure.py", line 126, in main
 0:10.20     sandbox.run(os.path.join(os.path.dirname(__file__), "moz.configure"))
 0:10.20   File "/var/tmp/portage/www-client/firefox-116.0.3/work/firefox-116.0.3/python/mozbuild/mozbuild/configure/__init__.py", line 569, in run
 0:10.20     func(*args)
 0:10.20   File "/var/tmp/portage/www-client/firefox-116.0.3/work/firefox-116.0.3/python/mozbuild/mozbuild/configure/__init__.py", line 620, in _value_for
 0:10.20     return self._value_for_depends(obj)
 0:10.20            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 0:10.20   File "/var/tmp/portage/www-client/firefox-116.0.3/work/firefox-116.0.3/python/mozbuild/mozbuild/util.py", line 1063, in method_call
 0:10.20     cache[args] = self.func(instance, *args)
 0:10.20                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
 0:10.20   File "/var/tmp/portage/www-client/firefox-116.0.3/work/firefox-116.0.3/python/mozbuild/mozbuild/configure/__init__.py", line 629, in _value_for_depends
 0:10.20     value = obj.result()
 0:10.20             ^^^^^^^^^^^^
 0:10.20   File "/var/tmp/portage/www-client/firefox-116.0.3/work/firefox-116.0.3/python/mozbuild/mozbuild/util.py", line 1063, in method_call
 0:10.20     cache[args] = self.func(instance, *args)
 0:10.20                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
 0:10.20   File "/var/tmp/portage/www-client/firefox-116.0.3/work/firefox-116.0.3/python/mozbuild/mozbuild/configure/__init__.py", line 161, in result
 0:10.20     return self._func(*resolved_args)
 0:10.20            ^^^^^^^^^^^^^^^^^^^^^^^^^^
 0:10.20   File "/var/tmp/portage/www-client/firefox-116.0.3/work/firefox-116.0.3/python/mozbuild/mozbuild/configure/__init__.py", line 1313, in wrapped
 0:10.20     return new_func(*args, **kwargs)
 0:10.20            ^^^^^^^^^^^^^^^^^^^^^^^^^
 0:10.20   File "/var/tmp/portage/www-client/firefox-116.0.3/work/firefox-116.0.3/python/mozbuild/mozbuild/configure/__init__.py", line 912, in wrapper
 0:10.20     ret = template(*args, **kwargs)
 0:10.20           ^^^^^^^^^^^^^^^^^^^^^^^^^
 0:10.20   File "/var/tmp/portage/www-client/firefox-116.0.3/work/firefox-116.0.3/build/moz.configure/checks.configure", line 59, in wrapped
 0:10.20     ret = func(*args, **kwargs)
 0:10.20           ^^^^^^^^^^^^^^^^^^^^^
 0:10.20   File "/var/tmp/portage/www-client/firefox-116.0.3/work/firefox-116.0.3/python/mozbuild/mozbuild/configure/__init__.py", line 1313, in wrapped
 0:10.20     return new_func(*args, **kwargs)
 0:10.20            ^^^^^^^^^^^^^^^^^^^^^^^^^
 0:10.20   File "/var/tmp/portage/www-client/firefox-116.0.3/work/firefox-116.0.3/toolkit/moz.configure", line 1666, in pack_relative_relocs
 0:10.20     needed = [l for l in dyn if l.split()[1] == "(NEEDED)"]
 0:10.20              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 0:10.20   File "/var/tmp/portage/www-client/firefox-116.0.3/work/firefox-116.0.3/toolkit/moz.configure", line 1666, in <listcomp>
 0:10.20     needed = [l for l in dyn if l.split()[1] == "(NEEDED)"]
 0:10.20                                 ~~~~~~~~~^^^
 0:10.20 IndexError: list index out of range
 
ask@bigglane ~
 $ readelf -d readelf_test 

Dynamic section at offset 0x2de0 contains 25 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000c (INIT)               0x1000
 0x000000000000000d (FINI)               0x1160
 0x0000000000000019 (INIT_ARRAY)         0x3dd0
 0x000000000000001b (INIT_ARRAYSZ)       8 (bytes)
 0x000000000000001a (FINI_ARRAY)         0x3dd8
 0x000000000000001c (FINI_ARRAYSZ)       8 (bytes)
 0x000000006ffffef5 (GNU_HASH)           0x398
 0x0000000000000005 (STRTAB)             0x450
 0x0000000000000006 (SYMTAB)             0x3c0
 0x000000000000000a (STRSZ)              154 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000015 (DEBUG)              0x0
 0x0000000000000003 (PLTGOT)             0x3fe8
 0x0000000000000007 (RELA)               0x538
 0x0000000000000008 (RELASZ)             120 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000006ffffffb (FLAGS_1)            Flags: PIE
 0x000000006ffffffe (VERNEED)            0x4f8
 0x000000006fffffff (VERNEEDNUM)         1
 0x000000006ffffff0 (VERSYM)             0x4ea
 0x0000000000000024 (RELR)               0x5b0
 0x0000000000000023 (RELRSZ)             24 (bytes)
 0x0000000000000025 (RELRENT)            8 (bytes)
 0x0000000000000000 (NULL)               0x0
ask@bigglane ~
 $ llvm-readelf -d readelf_test 
Dynamic section at offset 0x2de0 contains 25 entries:
  Tag                Type           Name/Value
  0x0000000000000001 (NEEDED)       Shared library: [libc.so.6]
  0x000000000000000c (INIT)         0x1000
  0x000000000000000d (FINI)         0x1160
  0x0000000000000019 (INIT_ARRAY)   0x3dd0
  0x000000000000001b (INIT_ARRAYSZ) 8 (bytes)
  0x000000000000001a (FINI_ARRAY)   0x3dd8
  0x000000000000001c (FINI_ARRAYSZ) 8 (bytes)
  0x000000006ffffef5 (GNU_HASH)     0x398
  0x0000000000000005 (STRTAB)       0x450
  0x0000000000000006 (SYMTAB)       0x3c0
  0x000000000000000a (STRSZ)        154 (bytes)
  0x000000000000000b (SYMENT)       24 (bytes)
  0x0000000000000015 (DEBUG)        0x0
  0x0000000000000003 (PLTGOT)       0x3fe8
  0x0000000000000007 (RELA)         0x538
  0x0000000000000008 (RELASZ)       120 (bytes)
  0x0000000000000009 (RELAENT)      24 (bytes)
  0x000000006ffffffb (FLAGS_1)      PIE 
  0x000000006ffffffe (VERNEED)      0x4f8
  0x000000006fffffff (VERNEEDNUM)   1
  0x000000006ffffff0 (VERSYM)       0x4ea
  0x0000000000000024 (RELR)         0x5b0
  0x0000000000000023 (RELRSZ)       24 (bytes)
  0x0000000000000025 (RELRENT)      8 (bytes)
  0x0000000000000000 (NULL)         0x0

ask@bigglane ~
 $ readelf --version
GNU readelf (Gentoo 2.41 p2) 2.41.0
Copyright (C) 2023 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
Comment 1 Alfred Wingate 2023-08-28 06:20:00 UTC
Created attachment 868842 [details]
www-client/firefox-116.0.3 build.log
Comment 2 Alfred Wingate 2023-08-28 06:20:28 UTC
Created attachment 868843 [details]
emerge --info
Comment 3 Larry the Git Cow gentoo-dev 2023-08-30 14:26:29 UTC
The bug has been closed via the following commit(s):

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

commit 33f8f57efd6b913eaec93e775c3eb7bcedfcf5c8
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2023-08-30 14:12:01 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2023-08-30 14:26:24 +0000

    www-client/firefox: include rust[nightly] patch on 117.0
    
     - hopefully fix misconfigured readelf usage.
    
    Closes: https://bugs.gentoo.org/913130
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 www-client/firefox/Manifest             | 2 +-
 www-client/firefox/firefox-117.0.ebuild | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
Comment 4 Alfred Wingate 2023-08-30 14:59:59 UTC
It hasn't been fixed by this. The problem is firefox not expecting readelf output as it would use llvm-readelf unless its set in the environment.

The solution for the ebuild would be to set READELF="llvm-readelf" no matter if clang or gcc is used. And seeing as USE="-clang" still works and probably uses llvm-readelf in the background you probably have to export it for it be picked up.
Comment 5 Larry the Git Cow gentoo-dev 2023-08-30 17:25:45 UTC
The bug has been closed via the following commit(s):

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

commit 10a55f5559b471e9f1967d9f66ed70a2421d549b
Author:     Alfred Wingate <parona@protonmail.com>
AuthorDate: 2023-08-30 15:01:22 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2023-08-30 17:25:42 +0000

    www-client/firefox: force use of llvm-readelf
    
    Closes: https://bugs.gentoo.org/913130
    Signed-off-by: Alfred Wingate <parona@protonmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/32531
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 www-client/firefox/firefox-117.0.ebuild | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)