Bug 726744 (ghc-libs-symlink) - ghc does not set RUNPATH on libraries
Summary: ghc does not set RUNPATH on libraries
Status: RESOLVED FIXED
Alias: ghc-libs-symlink
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Development (show other bugs)
Version: 13.1 Beta 1
Hardware: PC SUSE Other
: P4 - Low : Minor (vote)
Target Milestone: ---
Assignee: Peter Trommler
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-26 22:56 UTC by Damien Radtke
Modified: 2016-06-30 14:16 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Damien Radtke 2011-10-26 22:56:03 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
Comment 1 Peter Trommler 2011-11-28 07:46:19 UTC
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 ***
Comment 2 Peter Trommler 2013-02-06 09:00:12 UTC
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.
Comment 3 Peter Trommler 2014-09-29 08:00:28 UTC
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.
Comment 4 Peter Trommler 2015-10-15 16:01:23 UTC
This issue is fixed in ghc 7.8.4 in openSUSE 13.2.
Comment 5 Swamp Workflow Management 2015-11-02 15:53:15 UTC
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