Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPATH for installed libraries #851

Open
rswarbrick opened this issue Mar 11, 2020 · 0 comments
Open

RPATH for installed libraries #851

rswarbrick opened this issue Mar 11, 2020 · 0 comments
Assignees

Comments

@rswarbrick
Copy link

If I build coreir like this:

cmake .. -DCMAKE_INSTALL_PATH=/opt/coreir
make -j4
make install

The RPATH-hacking code in src/CMakeLists.txt seems to successfully populate DT_RUNPATH in /opt/coreir/lib/libcoreir.so, but not in /opt/coreir/lib/libcoreir-c.so and friends. Specifically, I see:

$ for lib in /opt/coreir/lib/*.so; do echo $lib; readelf -a $lib | grep RUNPATH; done
/opt/coreir/lib/libcoreir-aetherlinglib.so
 0x000000000000001d (RUNPATH)            Library runpath: [/src/lr/cosa/coreir/build/lib]
/opt/coreir/lib/libcoreir-commonlib.so
 0x000000000000001d (RUNPATH)            Library runpath: [/src/lr/cosa/coreir/build/lib]
/opt/coreir/lib/libcoreir-c.so
 0x000000000000001d (RUNPATH)            Library runpath: [/src/lr/cosa/coreir/build/lib]
/opt/coreir/lib/libcoreir-float_CW.so
 0x000000000000001d (RUNPATH)            Library runpath: [/src/lr/cosa/coreir/build/lib]
/opt/coreir/lib/libcoreir-float_DW.so
 0x000000000000001d (RUNPATH)            Library runpath: [/src/lr/cosa/coreir/build/lib]
/opt/coreir/lib/libcoreir-float.so
 0x000000000000001d (RUNPATH)            Library runpath: [/src/lr/cosa/coreir/build/lib]
/opt/coreir/lib/libcoreir-ice40.so
 0x000000000000001d (RUNPATH)            Library runpath: [/src/lr/cosa/coreir/build/lib]
/opt/coreir/lib/libcoreir-rtlil.so
 0x000000000000001d (RUNPATH)            Library runpath: [/src/lr/cosa/coreir/build/lib]
/opt/coreir/lib/libcoreirsim-c.so
 0x000000000000001d (RUNPATH)            Library runpath: [/src/lr/cosa/coreir/build/lib]
/opt/coreir/lib/libcoreirsim.so
 0x000000000000001d (RUNPATH)            Library runpath: [/src/lr/cosa/coreir/build/lib]
/opt/coreir/lib/libcoreir.so
 0x000000000000001d (RUNPATH)            Library runpath: [/opt/coreir/lib]
/opt/coreir/lib/libverilogAST.so

I think that all the RUNPATHs should have been fixed up.

rswarbrick added a commit to rswarbrick/pycoreir that referenced this issue Mar 11, 2020
Suppose you installed coreir to somewhere non-standard (/opt/coreir,
for example) and added the relevant bin directory (/opt/coreir/bin) to
your PATH.

Then the existing code would set COREIR_BINARY_PATH to
/opt/coreir/bin/coreir (good!) and then just try to load
'libcoreir.so' or similar. It should load
/opt/coreir/lib/libcoreir.so.

This isn't quite as useful as you might hope, because of coreir issue
number #851[1], but it gets most of the way (as a work-around for the
coreir bug, it suffices to leave the coreir build directory
uncleaned!).

[1] rdaly525/coreir#851
@rdaly525 rdaly525 self-assigned this Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants