From c6a768c12ce7e83631d08f53937a075c4f76e2d5 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 12 Aug 2019 11:10:15 +0200 Subject: use LD_LIBRARY_PATH for glibc instead of calling its loader Calling the loader fails on non ELF executables. Exec, formerly run_cmd, now takes two options: -l LD_LIBRARY_PATH, -p LD_PRELOAD. -p sets LD_PRELOAD and -l LD_LIBRARY_PATH before executing the rest of argv. glibc no longer uses cmd_prefix in favor of LD_LIBRARY_PATH. --- src/allocator.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/allocator.py') diff --git a/src/allocator.py b/src/allocator.py index 73f2777..ae22620 100644 --- a/src/allocator.py +++ b/src/allocator.py @@ -89,7 +89,8 @@ class Allocator_Sources (object): class Allocator (object): allowed_attributes = ["binary_suffix", "version", "sources", "build_cmds", - "LD_PRELOAD", "cmd_prefix", "color", "patches"] + "LD_PRELOAD", "cmd_prefix", "color", "patches", + "LD_LIBRARY_PATH"] def __init__(self, name, **kwargs): self.name = name @@ -151,7 +152,7 @@ class Allocator (object): f.write(str(datetime.now().timestamp())) print_info2("Create allocator dictionary") - for attr in ["LD_PRELOAD", "cmd_prefix"]: + for attr in ["LD_PRELOAD", "LD_LIBRARY_PATH", "cmd_prefix"]: value = getattr(self, attr, "") or "" paths = {"dir": self.dir} paths["srcdir"] = self.sources.dir if self.sources is not None else "" @@ -162,6 +163,7 @@ class Allocator (object): res_dict = {"cmd_prefix": self.cmd_prefix, "binary_suffix": self.binary_suffix or "", "LD_PRELOAD": self.LD_PRELOAD, + "LD_LIBRARY_PATH": self.LD_LIBRARY_PATH, "color": self.color} print_debug("Resulting dictionary:", res_dict) return res_dict -- cgit v1.2.3