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,326
    • Issues 4,326
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 390
    • Merge Requests 390
  • 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
  • #5240

Closed
Open
Opened Jun 06, 2011 by Bertram Felgenhauer@int-eReporter

help GNU ld to use less memory when linking libraries compiled with -split-objs.

This is a well-known problem, but I didn't find a previous report here, probably because it is mainly a GNU ld issue. The problem is that with -split-objs, linking, say, ghc, takes a trememndous amount of memory.

Part of this problem will be fixed in ld:

http://sourceware.org/bugzilla/show_bug.cgi?id=12682

In this bug report, Nick Clifton suggests to use '--hash-size=31' and possibly '--reduce-memory-overhead' when invoking ld. Since ghc is invoking gcc for linking, that would mean passing '-Xlinker --hash-size=31' and perhaps '-Xlinker --reduce-memory-overhead' to gcc.

Can we do that? Care needs to be taken if people use the -pgmL option, and we should make sure that gcc is actually using GNU ld.

In my experiments (linking ghc), --hash-size=31 helps, reducing memory usage by about a factor of 1/2; --reduce-memory-overhead without --hash-size=31 also helps (saving about 1/3), but has no noticable effect in connection with --hash-size=31. Based on that I'd suggest to only use --hash-size=31.

Trac metadata
Trac field Value
Version 7.0.3
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
7.4.1
Milestone
7.4.1
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#5240