-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Line 17 in 9f5c3a9
pkg-config = "0.3.9" |
When the libpcsclite.so library, which pcsc-rust is linked against, lives in a non-default library directory, such as /opt/local/lib or /usr/pkg/lib, it is not enough for pcsc-rust to be built with -L/opt/local/lib -- that only tells the build-time linker where to find the library; it doesn't tell the run-time loader where to load the libpcsclite.so.N shared library file from. This requires specifying rpath with -Wl,-R/opt/local/lib or -Wl,-rpath,/opt/local/lib, which instructs the build-time linker to bake that path into the resulting executable or library so the run-time loader knows where to find the libraries it depends on.
(Note that the -L and -R arguments may be different -- for example, when cross-compiling, one might use -L/home/riastradh/obj.powerpc/destdir/opt/local/lib -Wl,-R/opt/local/lib.)
pkg-config-rs, used by pcsc-sys to find libpcsclite.so build options, sprouted support for rpath last year to take advantage of .pc files with rpath options, but only in version 0.3.25. The current version is 0.3.26. pcsc-sys is pinned to 0.3.9, which just silently ignores any rpath options in .pc files.
There is also no environment variable to pass through compiler or linker options explicitly when overriding pkg-config, which could be used to specify an rpath manually.