Index: pym/portage/const.py =================================================================== --- pym/portage/const.py (revision 15361) +++ pym/portage/const.py (revision 15362) @@ -71,6 +71,7 @@ REPO_NAME_LOC = "profiles" + "/" + REPO_NAME_FILE PORTAGE_PACKAGE_ATOM = "sys-apps/portage" +LIBC_PACKAGE_ATOM = "virtual/libc" INCREMENTALS = ("USE", "USE_EXPAND", "USE_EXPAND_HIDDEN", "FEATURES", "ACCEPT_KEYWORDS", Index: pym/_emerge/depgraph.py =================================================================== --- pym/_emerge/depgraph.py (revision 15361) +++ pym/_emerge/depgraph.py (revision 15362) @@ -3335,6 +3335,15 @@ runtime_deps.update(atom for atom in atoms \ if not atom.blocker) + # Merge libc asap, in order to account for implicit + # dependencies. See bug #303567. + libc_pkg = self._dynamic_config.mydbapi[running_root].match_pkgs( + portage.const.LIBC_PACKAGE_ATOM) + if libc_pkg: + libc_pkg = libc_pkg[0] + if libc_pkg.operation == 'merge': + asap_nodes.append(libc_pkg) + def gather_deps(ignore_priority, mergeable_nodes, selected_nodes, node): """