Building RUNPATH into ghc binaries for 3rd-party libraries

Albert Chin ghc-devs at mlists.thewrittenword.com
Thu Jan 19 02:53:49 UTC 2017


Hi. I am building ghc-8.0.2 on RHEL 6 and trying to get the runtime
path for 3rd-party libraries outside of the system search path
embedded into the ghc binaries. Specifically, this is for libffi and
libgmp. I am using the attached patch for this and it seems to work
for the most part. It does not work for ghc-iserv through:
  $ cd /usr/local/ghc80/lib/ghc-8.0.2/bin
  $ ldd ghc-iserv
        linux-vdso.so.1 =>  (0x00007fffba3ff000)
        librt.so.1 => /lib64/librt.so.1 (0x00000033e0e00000)
        libutil.so.1 => /lib64/libutil.so.1 (0x00000033f0200000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00000033e0600000)
        libgmp.so.10 => not found
        libm.so.6 => /lib64/libm.so.6 (0x00000033e0200000)
        libffi.so.6 => not found
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00000033e0a00000)
        libc.so.6 => /lib64/libc.so.6 (0x00000033dfe00000)
        /lib64/ld-linux-x86-64.so.2 (0x00000033dfa00000)

I presume I need to add something like the following to iserv/ghc.mk
somewhere?
  -optl-Wl,-rpath,$(FFILibDir) \
  -optl-Wl,-rpath,$(GMP_LIB_DIRS) \

-- 
albert chin (china at thewrittenword.com)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ghc.patch
Type: text/x-diff
Size: 1055 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20170118/6721613d/attachment.patch>


More information about the ghc-devs mailing list