summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2024-10-31 11:40:17 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-11-01 12:13:18 +0000
commitb67dce7ed011eebabc81eca7a6be5a5afc924cfb (patch)
tree2ae9417dff52033b0e85ece59e0acdd8c115b8a0 /meta/lib
parent94e03dc42015df4fab4c0440d3f7c05f7eddd337 (diff)
downloadpoky-b67dce7ed011eebabc81eca7a6be5a5afc924cfb.tar.gz
lib/oe/package: remove PACKAGE_SNAP_LIB_SYMLINKS
This was added to OpenEmbedded in 2011[1] for the micro distro[2] and subsequently ported to oe-core[3]. This feature aims to improve runtime link speed by removing intermediate symlinks, i.e. libstdc++.so.6 is not a symlink but the actual library. However, there are several issues here: - The meta-micro distribution has been unmaintained since 2012[4] - The original creator of this function has confirmed that it is not in use anymore because the renaming doesn't affect the -dev packages, so on-target development or use of SDKs isn't possible. Whilst the latter is possible to fix, the performance impact of removing a single symlink resolution is negliable at best and the packaging code is already very complex. So, remove this functionality as it is known to be broken, isn't tested, and removing it reduces complexity. [1] https://git.openembedded.org/openembedded/commit/?id=cf7114179ead8ddff8f66e84d630811920ac9add [2] https://git.openembedded.org/openembedded/tree/conf/distro/micro.conf [3] https://git.openembedded.org/openembedded-core/commit/?id=600dbb7cb384c2290af38b993a9bea3a4dfc4494 [4] https://git.openembedded.org/meta-micro/ (From OE-Core rev: 9bfdf4c9eff16804588942a13ac7484059197f99) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/package.py25
1 files changed, 5 insertions, 20 deletions
diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index 16359232ec..1af10b7eb0 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -1623,7 +1623,6 @@ def process_shlibs(pkgfiles, d):
1623 needs_ldconfig = False 1623 needs_ldconfig = False
1624 needed = set() 1624 needed = set()
1625 sonames = set() 1625 sonames = set()
1626 renames = []
1627 ldir = os.path.dirname(file).replace(pkgdest + "/" + pkg, '') 1626 ldir = os.path.dirname(file).replace(pkgdest + "/" + pkg, '')
1628 cmd = d.getVar('OBJDUMP') + " -p " + shlex.quote(file) + " 2>/dev/null" 1627 cmd = d.getVar('OBJDUMP') + " -p " + shlex.quote(file) + " 2>/dev/null"
1629 fd = os.popen(cmd) 1628 fd = os.popen(cmd)
@@ -1651,11 +1650,9 @@ def process_shlibs(pkgfiles, d):
1651 sonames.add(prov) 1650 sonames.add(prov)
1652 if libdir_re.match(os.path.dirname(file)): 1651 if libdir_re.match(os.path.dirname(file)):
1653 needs_ldconfig = True 1652 needs_ldconfig = True
1654 if needs_ldconfig and snap_symlinks and (os.path.basename(file) != this_soname): 1653 return (needs_ldconfig, needed, sonames)
1655 renames.append((file, os.path.join(os.path.dirname(file), this_soname)))
1656 return (needs_ldconfig, needed, sonames, renames)
1657 1654
1658 def darwin_so(file, needed, sonames, renames, pkgver): 1655 def darwin_so(file, needed, sonames, pkgver):
1659 if not os.path.exists(file): 1656 if not os.path.exists(file):
1660 return 1657 return
1661 ldir = os.path.dirname(file).replace(pkgdest + "/" + pkg, '') 1658 ldir = os.path.dirname(file).replace(pkgdest + "/" + pkg, '')
@@ -1707,7 +1704,7 @@ def process_shlibs(pkgfiles, d):
1707 if name and name not in needed[pkg]: 1704 if name and name not in needed[pkg]:
1708 needed[pkg].add((name, file, tuple())) 1705 needed[pkg].add((name, file, tuple()))
1709 1706
1710 def mingw_dll(file, needed, sonames, renames, pkgver): 1707 def mingw_dll(file, needed, sonames, pkgver):
1711 if not os.path.exists(file): 1708 if not os.path.exists(file):
1712 return 1709 return
1713 1710
@@ -1726,11 +1723,6 @@ def process_shlibs(pkgfiles, d):
1726 if dllname: 1723 if dllname:
1727 needed[pkg].add((dllname, file, tuple())) 1724 needed[pkg].add((dllname, file, tuple()))
1728 1725
1729 if d.getVar('PACKAGE_SNAP_LIB_SYMLINKS') == "1":
1730 snap_symlinks = True
1731 else:
1732 snap_symlinks = False
1733
1734 needed = {} 1726 needed = {}
1735 1727
1736 shlib_provider = oe.package.read_shlib_providers(d) 1728 shlib_provider = oe.package.read_shlib_providers(d)
@@ -1749,16 +1741,15 @@ def process_shlibs(pkgfiles, d):
1749 1741
1750 needed[pkg] = set() 1742 needed[pkg] = set()
1751 sonames = set() 1743 sonames = set()
1752 renames = []
1753 linuxlist = [] 1744 linuxlist = []
1754 for file in pkgfiles[pkg]: 1745 for file in pkgfiles[pkg]:
1755 soname = None 1746 soname = None
1756 if cpath.islink(file): 1747 if cpath.islink(file):
1757 continue 1748 continue
1758 if hostos.startswith("darwin"): 1749 if hostos.startswith("darwin"):
1759 darwin_so(file, needed, sonames, renames, pkgver) 1750 darwin_so(file, needed, sonames, pkgver)
1760 elif hostos.startswith("mingw"): 1751 elif hostos.startswith("mingw"):
1761 mingw_dll(file, needed, sonames, renames, pkgver) 1752 mingw_dll(file, needed, sonames, pkgver)
1762 elif os.access(file, os.X_OK) or lib_re.match(file): 1753 elif os.access(file, os.X_OK) or lib_re.match(file):
1763 linuxlist.append(file) 1754 linuxlist.append(file)
1764 1755
@@ -1768,14 +1759,8 @@ def process_shlibs(pkgfiles, d):
1768 ldconfig = r[0] 1759 ldconfig = r[0]
1769 needed[pkg] |= r[1] 1760 needed[pkg] |= r[1]
1770 sonames |= r[2] 1761 sonames |= r[2]
1771 renames.extend(r[3])
1772 needs_ldconfig = needs_ldconfig or ldconfig 1762 needs_ldconfig = needs_ldconfig or ldconfig
1773 1763
1774 for (old, new) in renames:
1775 bb.note("Renaming %s to %s" % (old, new))
1776 bb.utils.rename(old, new)
1777 pkgfiles[pkg].remove(old)
1778
1779 shlibs_file = os.path.join(shlibswork_dir, pkg + ".list") 1764 shlibs_file = os.path.join(shlibswork_dir, pkg + ".list")
1780 if len(sonames): 1765 if len(sonames):
1781 with open(shlibs_file, 'w') as fd: 1766 with open(shlibs_file, 'w') as fd: