Skip to content

Commit

Permalink
Set rpath via ldflags
Browse files Browse the repository at this point in the history
  • Loading branch information
dwoz committed Oct 29, 2023
1 parent 271ced3 commit 7019fef
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions src/relenv_gdb/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down

0 comments on commit 7019fef

Please sign in to comment.