Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,251
    • Issues 4,251
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 394
    • Merge Requests 394
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #2933

Closed
Open
Opened Jan 09, 2009 by duncan@trac-duncan

LDFLAGS ignored by build system

I have required libs installed in /opt/csw/lib which is not on the ordinary system linker path. This includes things like libgmp etc. That means that to link ghc I want to pass -R/opt/csw/lib so that at runtime I do not need to set LD_LIBRARY_PATH.

The ./configure --help mentions LDFLAGS however this is ignored. When building gcc the equivalent makes everything work out fine. It would be nice if this were supported.

Note also that --with-gmp-includes and --with-gmp-libraries are only half helpful. They add -L and -I options during the build only. That lets ghc link stuff using gmp. There are still two problems however:

  • Running such programs does not work if the gmp lib dir is not on the standard runtime linker path (which is quite likely given that it was not on the standard compile-time linker path).
  • It does not cause the final built ghc to automatically use -L/path/to/gmp/lib. Again I think if it's using -L/path/to/gmp/lib it should also use -R/path/to/gmp/lib or it'll link but not run.

Some people claim that -R is evil. If we think it is evil and we choose not to use it for --with-gmp-includes and --with-gmp-libraries then those two become less than useful and it becomes more important to support LD_OPTIONS/LDFLAGS properly so that distros like the Solaris CSW can use it. For example, see http://www.opencsw.org/standards/pkg-walkthrough which recommends:

export LD_OPTIONS='-R/opt/csw/lib/$ISALIST -R/opt/csw/lib -L/opt/csw/lib'

Note: the workaround is to modify the driver script of the bootstrapping ghc and add -optl-R/the/extra/lib and then do the same for the script template that will get used by the stage1/2 inplace and final ghc, or to temporarily use LD_LIBRARY_PATH and modify the final ghc driver script during/after install.

Trac metadata
Trac field Value
Version 6.10.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Build System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
8.0.1
Milestone
8.0.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#2933