diff --git a/portage-2.2.10/pym/portage/util/env_update.py b/portage-2.2.10/pym/portage/util/env_update.py index c0a93a8..93f1ffc 100644 --- a/portage-2.2.10/pym/portage/util/env_update.py +++ b/portage-2.2.10/pym/portage/util/env_update.py @@ -9,6 +9,8 @@ import io import stat import sys import time +import re +import platform import portage from portage import os, _encodings, _unicode_decode, _unicode_encode @@ -189,11 +191,29 @@ def _env_update(makelinks, target_root, prev_mtimes, contents, env, if (oldld != newld): #ld.so.conf needs updating and ldconfig needs to be run myfd = atomic_ofstream(ldsoconf_path) + if ostype == "FreeBSD" and platform.machine() == "amd64": + ld32soconf_path = os.path.join(eroot, "etc", "ld32.so.conf") + myfd32 = atomic_ofstream(ld32soconf_path) myfd.write("# ld.so.conf autogenerated by env-update; make all changes to\n") myfd.write("# contents of /etc/env.d directory\n") for x in specials["LDPATH"]: - myfd.write(x + "\n") + if ostype == "FreeBSD" and platform.machine() == "amd64": + if re.search("lib32", x) != None: + myfd32.write(x + "\n") + elif re.search("gcc", x) != None: + gccldconf = x.split('\n') + for y in gccldconf: + if re.search("gcc.*/32", y) != None: + myfd32.write(y + "\n") + else: + myfd.write(y + "\n") + else: + myfd.write(x + "\n") + else: + myfd.write(x + "\n") myfd.close() + if ostype == "FreeBSD" and platform.machine() == "amd64": + myfd32.close() potential_lib_dirs = set() for lib_dir_glob in ('usr/lib*', 'lib*'): @@ -328,6 +348,12 @@ def _env_update(makelinks, target_root, prev_mtimes, contents, env, os.system(("cd / ; %s -elf -i " + \ "-f '%svar/run/ld-elf.so.hints' '%setc/ld.so.conf'") % \ (ldconfig, target_root, target_root)) + if ostype == "FreeBSD" and platform.machine() == "amd64": + writemsg_level(_(">>> Regenerating %svar/run/ld-elf32.so.hints...\n") % \ + target_root) + os.system(("cd / ; %s -32 -elf -i " + \ + "-f '%svar/run/ld-elf32.so.hints' '%setc/ld32.so.conf'") % \ + (ldconfig, target_root, target_root)) del specials["LDPATH"]