File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
infra/base-images/base-builder/indexer Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -131,13 +131,24 @@ def patch_binary_rpath_and_interpreter(
131131 binary_path : os .PathLike [str ],
132132 lib_mount_path : pathlib .Path ,
133133 ld_binary_path : pathlib .Path = LD_BINARY_PATH_X86_64 ,
134+ extra_rpath_entries : Sequence [pathlib .Path ] = (),
134135):
135- """Patches the binary rpath and interpreter."""
136+ """Patches the binary rpath and interpreter.
137+
138+ Args:
139+ binary_path: Path to the ELF binary to patch.
140+ lib_mount_path: Primary library directory. Used as the main RPATH entry and
141+ to resolve the ELF interpreter (ld-linux).
142+ ld_binary_path: Basename / path of the dynamic linker.
143+ extra_rpath_entries: Additional directories prepended to the RPATH (searched
144+ before ``lib_mount_path``).
145+ """
146+ rpath = ":" .join (p .as_posix () for p in [* extra_rpath_entries , lib_mount_path ])
136147 subprocess .run (
137148 [
138149 "patchelf" ,
139150 "--set-rpath" ,
140- lib_mount_path . as_posix () ,
151+ rpath ,
141152 "--force-rpath" ,
142153 binary_path ,
143154 ],
You can’t perform that action at this time.
0 commit comments