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 28, 2023
1 parent 271ced3 commit fcd6374
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions src/relenv_gdb/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ def build_gdb(prefix):
dir_name = archive_name.split(".tar")[0]
# os.environ["LDFLAGS"] = f"{os.environ['LDFLAGS']} '-Wl,-rpath=$$ORIGIN/../lib'"
# os.environ["LDFLAGS"] += f" -Wl,-rpath={os.environ['TOOLCHAIN_PATH']}/{os.environ['TRIPLET']}/sysroot/lib"
os.environ[
"LDFLAGS"
] += f" -Wl,-rpath={os.environ['TOOLCHAIN_PATH']}/{os.environ['TRIPLET']}/sysroot/lib"
with pushd(src / dir_name):
subprocess.run(
[
Expand All @@ -90,22 +93,22 @@ def build_gdb(prefix):
)
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"])
Expand Down

0 comments on commit fcd6374

Please sign in to comment.