[GHC] #7813: Fix mismatched visibility of StgRun

GHC cvs-ghc at haskell.org
Fri Apr 5 09:12:15 CEST 2013


#7813: Fix mismatched visibility of StgRun
--------------------------------+-------------------------------------------
Reporter:  PHO                  |          Owner:                  
    Type:  bug                  |         Status:  new             
Priority:  normal               |      Component:  Runtime System  
 Version:  7.7                  |       Keywords:                  
      Os:  Unknown/Multiple     |   Architecture:  Unknown/Multiple
 Failure:  Building GHC failed  |      Blockedby:                  
Blocking:                       |        Related:                  
--------------------------------+-------------------------------------------
 [http://www.haskell.org/pipermail/ghc-devs/2013-April/000932.html From
 Gabor Greif]:
 {{{
 I am getting linker errors when bootstrapping HEAD with a recent
 v7.7-20130220 GHC. This is a RHEL5 system:

 "inplace/bin/ghc-stage1" -package-name rts -shared -dynamic -dynload
 deploy -no-auto-link-packages -Lrts/dist/build -lffi  -optl-Wl,-rpath
 -optl-Wl,'$ORIGIN' `cat rts/libs.depend`
 <<snip>>
 rts/dist/build/AutoApply.debug_dyn_o  -o
 rts/dist/build/libHSrts_debug-ghc7.7.20130402.so
 /usr/bin/ld: rts/dist/build/Schedule.dyn_o: relocation R_X86_64_PC32
 against `StgRun' can not be used when making a shared object;
 recompile with -fPIC
 /usr/bin/ld: final link failed: Bad value
 collect2: ld returned 1 exit status
 }}}

 [http://www.haskell.org/pipermail/ghc-devs/2013-April/000966.html From
 PHO]:
 {{{
 The old binutils comes with RHEL5 fails to link a shared library if
 there is a reference to a hidden symbol that isn't locally
 defined. See: https://gist.github.com/phonohawk/5308015

 Personally I don't think this is an old binutils' fault, because the
 newer one is essentially turning an otherwise global symbol to a local
 one depending on its call site, which feels rather wrong to me.

 The attached patch should fix the problem anyway.
 }}}

 From Gabor Greif:
 {{{
 Thanks a lot! This worked, but now we have the libffi-related problem
 on install:

 /home/ggreif/lib/ghc-7.7.20130403/bin/ghc-pkg: error while loading
 shared libraries: libHSterminfo-0.3.2.5-ghc7.7.20130403.so: cannot
 open shared object file: No such file or directory
 make[1]: *** [install_packages] Error 127

 This is described in another mail thread, so I'll relax now.
 }}}

 My patch is to change the visibility of `StgRun`/`StgReturn` for each and
 every platforms, but I've only tested it on my NetBSD/amd64, Linux/x86_64
 and FreeBSD/i386 boxes. I hope I've not broken other platforms namely
 Darwin/i386, Darwin/x86_64, Darwin/PPC32, Linux/PPC32, Linux/PPC64,
 Linux/ARM, iOS/ARM and Sparc.

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



More information about the ghc-tickets mailing list