From 96e57ccfbb61d56b889800acacb7fa368181e5cc Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Sat, 28 Oct 2023 13:42:48 -0700 Subject: [PATCH] Set rpath via ldflags --- src/relenv_gdb/build.py | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/relenv_gdb/build.py b/src/relenv_gdb/build.py index 2e8bd67..481ca38 100644 --- a/src/relenv_gdb/build.py +++ b/src/relenv_gdb/build.py @@ -88,24 +88,27 @@ 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", - ] - ) + # 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", + # ] + # ) subprocess.run(["make", "install"]) # relenv.relocate.main(os.environ["RELENV_PATH"])