[GHC] #7813: Fix mismatched visibility of StgRun

#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

#7813: Fix mismatched visibility of StgRun --------------------------------+------------------------------------------- Reporter: PHO | Owner: Type: bug | Status: patch Priority: normal | Component: Runtime System Version: 7.7 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Building GHC failed | Blockedby: Blocking: | Related: --------------------------------+------------------------------------------- Changes (by PHO): * status: new => patch -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7813#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7813: Fix mismatched visibility of StgRun --------------------------------+------------------------------------------- Reporter: PHO | Owner: Type: bug | Status: patch Priority: normal | Component: Runtime System Version: 7.7 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Building GHC failed | Blockedby: Blocking: | Related: --------------------------------+------------------------------------------- Comment(by PHO): Correction of my explanation: Wrong: 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. Correct: 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, but defined in some other object as an exposed symbol i.e. `__attribute__((__visibility__("default")))` -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7813#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7813: Fix mismatched visibility of StgRun --------------------------------+------------------------------------------- Reporter: PHO | Owner: Type: bug | Status: patch Priority: normal | Component: Runtime System Version: 7.7 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Building GHC failed | Blockedby: Blocking: | Related: --------------------------------+------------------------------------------- Changes (by kazu-yamamoto): * cc: kazu@… (added) -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7813#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7813: Fix mismatched visibility of StgRun ---------------------------------+------------------------------------------ Reporter: PHO | Owner: Type: bug | Status: patch Priority: normal | Milestone: 7.8.1 Component: Runtime System | Version: 7.7 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: Building GHC failed Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Changes (by igloo): * difficulty: => Unknown * milestone: => 7.8.1 -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7813#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7813: Fix mismatched visibility of StgRun
---------------------------------+------------------------------------------
Reporter: PHO | Owner:
Type: bug | Status: patch
Priority: normal | Milestone: 7.8.1
Component: Runtime System | Version: 7.7
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: Building GHC failed
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------+------------------------------------------
Comment(by ian@…):
commit f6e0dbf32bb19e79690f2233bb925a404f3ab1b6
{{{
Author: Ian Lynagh

#7813: Fix mismatched visibility of StgRun ----------------------------------+----------------------------------------- Reporter: PHO | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.8.1 Component: Runtime System | Version: 7.7 Resolution: fixed | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Building GHC failed | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: ----------------------------------+----------------------------------------- Changes (by igloo): * status: patch => closed * resolution: => fixed Comment: Thanks, I've applied most of the patch. I don't think we should need to do anything to the platforms on which we use a C implementation, but let me know if you're still running into problems. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7813#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC