On a sys-devel/binutils-config[-native-symlinks] system firefox fails to build as: """ 28:09.83 /usr/lib/ccache/bin/x86_64-pc-linux-gnu-gcc -std=gnu99 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -march=sandybridge -mtune=sandybridge -pipe -fdiagnostics-show-option -frecord-gcc-switches -Wall -Wextra -Wstack-protector -frecord-gcc-switches -fno-strict-aliasing -ffunction-sections -fdata-sections -fno-math-errno -pthread -fPIC -pipe -freorder-blocks -O2 -fomit-frame-pointer -funwind-tables -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wduplicated-cond -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wno-multistatement-macros -Wno-error=class-memaccess -Wno-error=deprecated-copy -Wformat -Wformat-security -Wformat-overflow=2 -fPIC -shared -Wl,-z,defs -Wl,--gc-sections -Wl,-h,libmozavutil.so -o libmozavutil.so /tmp/portage-tmpdir/portage/www-client/firefox-77.0.1/work/firefox-77.0.1/ff/media/ffvpx/libavutil/libmozavutil_so.list -lpthread -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,-rpath=/usr/lib64/firefox,--enable-new-dtags -Wl,--compress-debug-sections=zlib -fuse-ld=bfd -Wl,-z,noexecstack -Wl,-z,text -Wl,-z,relro -Wl,-z,nocopyreloc -Wl,-Bsymbolic-functions -fstack-protector-strong -Wl,-rpath-link,/tmp/portage-tmpdir/portage/www-client/firefox-77.0.1/work/firefox-77.0.1/ff/dist/bin -Wl,-rpath-link,/usr/lib -fdiagnostics-color -Wl,--version-script,libmozavutil.so.symbols -ldl -lm 28:09.83 /tmp/portage-tmpdir/portage/www-client/firefox-77.0.1/work/firefox-77.0.1/ff/_virtualenvs/init_py3/bin/python -m mozbuild.action.check_binary --target libmozavutil.so 28:09.83 Traceback (most recent call last): 28:09.83 File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main 28:09.83 "__main__", mod_spec) 28:09.83 File "/usr/lib/python3.7/runpy.py", line 85, in _run_code 28:09.83 exec(code, run_globals) 28:09.83 File "/tmp/portage-tmpdir/portage/www-client/firefox-77.0.1/work/firefox-77.0.1/python/mozbuild/mozbuild/action/check_binary.py", line 359, in <module> 28:09.83 sys.exit(main(sys.argv[1:])) 28:09.83 File "/tmp/portage-tmpdir/portage/www-client/firefox-77.0.1/work/firefox-77.0.1/python/mozbuild/mozbuild/action/check_binary.py", line 355, in main 28:09.83 return checks(TARGET, options.binary) 28:09.84 File "/tmp/portage-tmpdir/portage/www-client/firefox-77.0.1/work/firefox-77.0.1/python/mozbuild/mozbuild/action/check_binary.py", line 311, in checks 28:09.84 c(target, binary) 28:09.84 File "/tmp/portage-tmpdir/portage/www-client/firefox-77.0.1/work/firefox-77.0.1/python/mozbuild/mozbuild/action/check_binary.py", line 195, in check_textrel 28:09.84 for tag, value in at_least_one(iter_readelf_dynamic(target, binary)): 28:09.84 File "/tmp/portage-tmpdir/portage/www-client/firefox-77.0.1/work/firefox-77.0.1/python/mozbuild/mozbuild/action/check_binary.py", line 72, in at_least_one 28:09.84 for item in iter: 28:09.84 File "/tmp/portage-tmpdir/portage/www-client/firefox-77.0.1/work/firefox-77.0.1/python/mozbuild/mozbuild/action/check_binary.py", line 150, in iter_readelf_dynamic 28:09.84 for line in get_output(target['readelf'], '-d', binary): 28:09.84 File "/tmp/portage-tmpdir/portage/www-client/firefox-77.0.1/work/firefox-77.0.1/python/mozbuild/mozbuild/util.py", line 1009, in __call__ 28:09.84 self[args] = self.func(*args) 28:09.84 File "/tmp/portage-tmpdir/portage/www-client/firefox-77.0.1/work/firefox-77.0.1/python/mozbuild/mozbuild/action/check_binary.py", line 59, in get_output 28:09.84 return subprocess.check_output(cmd, env=env, universal_newlines=True).splitlines() 28:09.84 File "/usr/lib/python3.7/subprocess.py", line 411, in check_output 28:09.84 **kwargs).stdout 28:09.84 File "/usr/lib/python3.7/subprocess.py", line 488, in run 28:09.84 with Popen(*popenargs, **kwargs) as process: 28:09.84 File "/usr/lib/python3.7/subprocess.py", line 800, in __init__ 28:09.84 restore_signals, start_new_session) 28:09.84 File "/usr/lib/python3.7/subprocess.py", line 1551, in _execute_child 28:09.84 raise child_exception_type(errno_num, err_msg, err_filename) 28:09.84 FileNotFoundError: [Errno 2] No such file or directory: 'readelf': 'readelf' 28:09.84 gmake[4]: *** [/tmp/portage-tmpdir/portage/www-client/firefox-77.0.1/work/firefox-77.0.1/config/rules.mk:611: libmozavutil.so] Error 1 28:09.84 gmake[4]: Leaving directory '/tmp/portage-tmpdir/portage/www-client/firefox-77.0.1/work/firefox-77.0.1/ff/media/ffvpx/libavutil' 28:09.84 gmake[3]: *** [/tmp/portage-tmpdir/portage/www-client/firefox-77.0.1/work/firefox-77.0.1/config/recurse.mk:74: media/ffvpx/libavutil/target] Error 2 28:09.84 gmake[3]: *** Waiting for unfinished jobs.... """ Ideally firefox should use $(tc-getREADELF) when accesses tools from binutils. https://wiki.gentoo.org/wiki/Project:Toolchain/use_native_symlinks has a few hints.
Looking at firefox's python/mozbuild/mozbuild/action/check_binary.py it already attempts to prepend TOOLCHAIN_PREFIX if that exists at least for target: TARGET = { 'MOZ_LIBSTDCXX_VERSION': buildconfig.substs.get('MOZ_LIBSTDCXX_TARGET_VERSION'), 'platform': buildconfig.substs['OS_TARGET'], 'readelf': '{}readelf'.format( buildconfig.substs.get('TOOLCHAIN_PREFIX', '')), }
This seems to be enough to build firefox: --- a/www-client/firefox/firefox-77.0.1.ebuild +++ b/www-client/firefox/firefox-77.0.1.ebuild @@ -540,6 +540,7 @@ src_configure() { # Set both --target and --host as mozilla uses python to guess values otherwise mozconfig_annotate '' --target="${CHOST}" mozconfig_annotate '' --host="${CBUILD:-${CHOST}}" + mozconfig_annotate '' --with-toolchain-prefix="${CHOST}-" if use system-libevent ; then mozconfig_annotate '' --with-system-libevent="${SYSROOT}${EPREFIX}"/usr fi
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f38cb9616612f5550b6e285e3af8ad3f31053a6 commit 2f38cb9616612f5550b6e285e3af8ad3f31053a6 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-06-05 10:36:04 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2020-06-05 10:36:21 +0000 mail-client/thunderbird: fix building against sys-devel/binutils-config[-native-symlinks] Bug: https://bugs.gentoo.org/727160 Package-Manager: Portage-2.3.100, Repoman-2.3.22 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> mail-client/thunderbird/thunderbird-68.9.0.ebuild | 1 + 1 file changed, 1 insertion(+) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de520cd80fa8eb3c0b1adfaecbdf2b8060c95d27 commit de520cd80fa8eb3c0b1adfaecbdf2b8060c95d27 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-06-05 10:31:36 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2020-06-05 10:33:04 +0000 www-client/firefox: fix building against sys-devel/binutils-config[-native-symlinks] Bug: https://bugs.gentoo.org/727160 Package-Manager: Portage-2.3.100, Repoman-2.3.22 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> www-client/firefox/firefox-68.9.0.ebuild | 1 + www-client/firefox/firefox-77.0.1.ebuild | 1 + 2 files changed, 2 insertions(+)
Thank you!