Bugzilla – Bug 726744
ghc does not set RUNPATH on libraries
Last modified: 2016-06-30 14:16:06 UTC
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1 After installing cabal-install (version 0.8.2) and ghc-libs (version 6.12.3) from the openSUSE 11.4 Haskell repo, trying to run cabal results in a missing library error. Two libraries need to be located before cabal works, through either symlinking or editing LD_LIBRARY_PATH. The quickfix is to run this command: $ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib64/ghc-6.12.3/syb-0.1.0.2/:/usr/lib64/ghc-6.12.3/old-locale-1.0.0.2/ After these paths are added to the path, cabal works fine. The more permanent fix would be to symlink them to /usr/lib64 in the package's spec file: $ cd /usr/lib64 $ sudo ln -s /usr/lib64/ghc-6.12.3/old-locale-1.0.0.2/libHSold-locale-1.0.0.2-ghc6.12.3.so libHSold.so $ sudo ln -s /usr/lib64/ghc-6.12.3/syb-0.1.0.2/libHSsyb-0.1.0.2-ghc6.12.3.so libHSsyb.so $ sudo /sbin/ldconfig /usr/lib64 After these libraries are symlinked, everything will work fine without having to update LD_LIBRARY_PATH. These are the only libraries required by cabal, but it wouldn't hurt to make sure every library provided by ghc-libs is symlinked properly. Reproducible: Always Steps to Reproduce: 1. Install cabal-install and ghc-libs and try to run cabal 2. 3. Actual Results: libHSold and libHSsyb cannot be found Expected Results: Cabal should run normally
Shared libraries are being found through rpath. OBS included rpath only for some libraries. This is a duplicate of 683898. The current version in devel:languages:haskell:platform-2010.2 works. *** This bug has been marked as a duplicate of bug 683898 ***
The root cause is that ghc's build system does not add RUNPATHs to its libraries. This issue has been fixed upstream (see http://hackage.haskell.org/trac/ghc/ticket/7062 and http://hackage.haskell.org/trac/ghc/ticket/3072). Those fixes will be included in the upcoming 7.8.1 release of ghc. In Factory, where we have ghc 7.4.2, we currently override ld's default to use RUNPATH and rely on RPATH which does not have this issue. All binaries linked by ghc will have an RPATH and no RUNPATH. I will reopen this ticket with low priority as the issue might affect users that wish to link ghc objects using ld directly. If you need this fixed, please increase priority on this ticket and I will backport the upstream fixes.
Haskell Platform 2014.2.0.0 contains ghc 7.8.3, where the issue has been fixed upstream. The packages currently live in devel:languages:haskell:platform.
This issue is fixed in ghc 7.8.4 in openSUSE 13.2.
openSUSE-RU-2015:1865-1: An update that has three recommended fixes can now be installed. Category: recommended (moderate) Bug References: 711489,726744,845572 CVE References: Sources used: SUSE Package Hub for SUSE Linux Enterprise 12 (src): ghc-7.10.2-2.1, ghc-bootstrap-7.8.3-2.1, ghc-rpm-macros-1.4.94-2.1