Jeffrey Walton noloader@gmail.com writes:
Hi Everyone,
I build OpenSSH for downlevel machines, like OS X and Solaris. I install into /opt/ssh, and I use a runpath of $ORIGIN/../lib. The LDFLAGS are:
-Wl,-runpath,'$ORIGIN/../lib' -Wl,-runpath,$(prefix)/lib
-Wl,--enable-new-dtags
I noticed Nettle does not handle the ORIGIN-based runpath properly:
/opt/ssh/lib/libhogweed.so.6: RUNPATH: RIGIN/../lib:/opt/ssh/lib RPATH: RIGIN/../lib:/opt/ssh/lib
Indeed looks like missing a quote/escape problem. Does it work with other packages using autconf? How? I would suggest adding the quotes in the input, i.e., set
LDFLAGS='-Wl,-runpath,'$$ORIGIN/../lib' -Wl,-runpath,$(prefix)/lib ...'
when running configure.
Since you specify $(prefix), a Makefile-level substitution, and expect that to work, it seems reasonable to me to use Makefile-style syntax, including needed escapes, also for $ORIGIN.
I believe the fix is to escape the dollar sign in the makefile. That is, when Nettle creates its makefiles, it must use:
-Wl,-runpath,'$$ORIGIN/../lib' ...
Where do you suggest that substitution be made? And how would Nettle's configure script or Makefile know that you intend the $ in '$ORIGIN' to be escaped, but not the $ in '$(prefix)' ?
I admit I'm quite skeptical, and I also think it's important to stay consistent with how LDFLAGS is handled in other GNU packages. But if you can suggest a good way to do it, I'm happy to listen.
Regards, /Niels