diff --git a/src/relenv_gdb/build.py b/src/relenv_gdb/build.py index 2e8bd67..60b0b7f 100644 --- a/src/relenv_gdb/build.py +++ b/src/relenv_gdb/build.py @@ -88,24 +88,21 @@ def build_gdb(prefix): "--without-nss", ] ) + # os.environ[ + # "LDFLAGS" + # ] += f" -Wl,-rpath={os.environ['TOOLCHAIN_PATH']}/{os.environ['TRIPLET']}/sysroot/lib" subprocess.run(["make"]) # subprocess.run(["patchelf", "--add-rpath", "$ORIGIN/../lib", "gdb/gdb"]) - subprocess.run( - [ - "patchelf", - "--add-rpath", - f"{os.environ['TOOLCHAIN_PATH']}/{os.environ['TRIPLET']}/sysroot/lib", - "gdb/gdb", - ] - ) - subprocess.run( - [ - "patchelf", - "--add-rpath", - f"{os.environ['TOOLCHAIN_PATH']}/{os.environ['TRIPLET']}/sysroot/lib", - "gdbserver/gdbserver", - ] - ) + bins = ["gdb/gdb", "gdbserver/gdbserver", "gdbserver/libinproctrace.so"] + for _ in bins: + subprocess.run( + [ + "patchelf", + "--add-rpath", + f"{os.environ['TOOLCHAIN_PATH']}/{os.environ['TRIPLET']}/sysroot/lib", + _, + ] + ) subprocess.run(["make", "install"]) # relenv.relocate.main(os.environ["RELENV_PATH"])