Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106617 from S-NA/wip/firefox-improvements
firefox: fix running wayland firefox built with LTO and some miscellaneous improvements
- Loading branch information
Showing
3 changed files
with
82 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
pkgs/applications/networking/browsers/firefox/lto-dependentlibs-generation-ffx83.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- a/toolkit/library/build/dependentlibs.py | ||
+++ b/toolkit/library/build/dependentlibs.py | ||
@@ -36,26 +36,17 @@ def dependentlibs_win32_objdump(lib): | ||
proc.wait() | ||
return deps | ||
|
||
-def dependentlibs_readelf(lib): | ||
+def dependentlibs_elf_objdump(lib): | ||
'''Returns the list of dependencies declared in the given ELF .so''' | ||
- proc = subprocess.Popen([substs.get('TOOLCHAIN_PREFIX', '') + 'readelf', '-d', lib], stdout = subprocess.PIPE, | ||
+ proc = subprocess.Popen([substs['LLVM_OBJDUMP'], '--private-headers', lib], stdout = subprocess.PIPE, | ||
universal_newlines=True) | ||
deps = [] | ||
for line in proc.stdout: | ||
- # Each line has the following format: | ||
- # tag (TYPE) value | ||
- # or with BSD readelf: | ||
- # tag TYPE value | ||
- # Looking for NEEDED type entries | ||
- tmp = line.split(' ', 3) | ||
- if len(tmp) > 3 and 'NEEDED' in tmp[2]: | ||
- # NEEDED lines look like: | ||
- # 0x00000001 (NEEDED) Shared library: [libname] | ||
- # or with BSD readelf: | ||
- # 0x00000001 NEEDED Shared library: [libname] | ||
- match = re.search('\[(.*)\]', tmp[3]) | ||
- if match: | ||
- deps.append(match.group(1)) | ||
+ # We are looking for lines with the format: | ||
+ # NEEDED libname | ||
+ tmp = line.split() | ||
+ if len(tmp) == 2 and tmp[0] == 'NEEDED': | ||
+ deps.append(tmp[1]) | ||
proc.wait() | ||
return deps | ||
|
||
@@ -110,7 +101,7 @@ def gen_list(output, lib): | ||
libpaths = [os.path.join(substs['DIST'], 'bin')] | ||
binary_type = get_type(lib) | ||
if binary_type == ELF: | ||
- func = dependentlibs_readelf | ||
+ func = dependentlibs_elf_objdump | ||
elif binary_type == MACHO: | ||
func = dependentlibs_mac_objdump | ||
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters