[GHC] #5240: help GNU ld to use less memory when linking libraries compiled with -split-objs.

GHC ghc-devs at haskell.org
Mon Jun 17 03:07:05 CEST 2013


#5240: help GNU ld to use less memory when linking libraries compiled with -split-
objs.
-------------------------------+--------------------------------------------
  Reporter:  int-e             |          Owner:  igloo           
      Type:  feature request   |         Status:  closed          
  Priority:  high              |      Milestone:  7.4.1           
 Component:  Compiler          |        Version:  7.0.3           
Resolution:  fixed             |       Keywords:                  
        Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown      |     Difficulty:  Unknown         
  Testcase:                    |      Blockedby:                  
  Blocking:                    |        Related:                  
-------------------------------+--------------------------------------------

Comment(by aseipp@…):

 commit 71a194d8ca2efd075a5c000be0b378c8706ca0b3
 {{{
 Author: Austin Seipp <aseipp at pobox.com>
 Date:   Sat May 4 16:07:22 2013 -0500

     Detect linker information at runtime. Fixes Trac #6063

     Previously, we did ./configure time checks to see if 'GNU ld'
 supported
     certain options. If it does, we bake those options into the link step.
     See Trac #5240.

     Unfortunately, the linker we use at runtime can change for several
     reasons. One is that the user specifies -pgml 'foo'. The other is if
     /usr/bin/ld or whatnot changes from when GHC was built.  Those options
     mentioned earlier are specific to GNU ld, but many systems support GNU
     gold too. This is Trac #6063.

     So we need to check at runtime what linker we're using. This is
 actually
     a little bit complicated because we normally use the C compiler as our
     linker. Windows and OS X are also special here.

     Finally, this patch also unconditionally gives '--hash-size=31' and
     '--reduce-memory-overheads' to the system linker if it's GNU ld. These
     options have been supported for 8+ years from what I can see, and
 there
     are probably a lot of other reasons why GHC would not work with such
 an
     ancient binutils, all things considered.

     See Note [Run-time linker info] in SysTools for details. There are
     plenty of comments as well in the surrounding code.

     Signed-off-by: Austin Seipp <aseipp at pobox.com>

  aclocal.m4                 |   33 ------------
  compiler/main/DynFlags.hs  |   26 +++++++++-
  compiler/main/SysTools.lhs |  117
 ++++++++++++++++++++++++++++++++++++++++++-
  configure.ac               |    2 -
  distrib/configure.ac.in    |    2 -
  5 files changed, 137 insertions(+), 43 deletions(-)
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5240#comment:20>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list