[GHC] #8270: unknown symbol "atomic_inc" in GHCi when loading package ghc

GHC ghc-devs at haskell.org
Thu Sep 12 06:10:34 CEST 2013


#8270: unknown symbol "atomic_inc" in GHCi when loading package ghc
----------------------------------+---------------------------------
       Reporter:  rwbarton        |             Owner:
           Type:  bug             |            Status:  new
       Priority:  normal          |         Milestone:
      Component:  GHCi            |           Version:  7.7
       Keywords:                  |  Operating System:  Linux
   Architecture:  x86_64 (amd64)  |   Type of failure:  None/Unknown
     Difficulty:  Unknown         |         Test Case:
     Blocked By:                  |          Blocking:
Related Tickets:                  |
----------------------------------+---------------------------------
 I tried to do a "quick-llvm" build of a distclean-ed tree and got an error
 when some dph package needed to load the ghc package in Template Haskell.
 I no longer have that exact error message, but I could reproduce it more
 simply as follows:
 {{{
 rwbarton at adjunction:~/dist/ghc4$ ./inplace/bin/ghc-stage2 --interactive
 -package ghc-7.7.20130910
 GHCi, version 7.7.20130910: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 Loading package array-0.4.0.2 ... linking ... done.
 Loading package deepseq-1.3.0.2 ... linking ... done.
 Loading package bytestring-0.10.3.0 ... linking ... done.
 Loading package containers-0.5.3.1 ... linking ... done.
 Loading package filepath-1.3.0.2 ... linking ... done.
 Loading package old-locale-1.0.0.5 ... linking ... done.
 Loading package time-1.4.1 ... linking ... done.
 Loading package unix-2.7.0.0 ... linking ... done.
 Loading package directory-1.2.0.1 ... linking ... done.
 Loading package pretty-1.1.1.0 ... linking ... done.
 Loading package process-1.2.0.0 ... linking ... done.
 Loading package Cabal-1.18.0 ... linking ... done.
 Loading package binary-0.7.1.0 ... linking ... done.
 Loading package bin-package-db-0.0.0.0 ... linking ... done.
 Loading package hoopl-3.10.0.0 ... linking ... done.
 Loading package hpc-0.6.0.1 ... linking ... done.
 Loading package template-haskell ... linking ... done.
 Loading package transformers-0.3.0.0 ... linking ... done.
 Loading package ghc-7.7.20130910 ... linking ... ghc-stage2:
 /home/rwbarton/dist/ghc4/compiler/stage2/build/libHSghc-7.7.20130910.a:
 unknown symbol `atomic_inc'
 ghc-stage2: unable to load package `ghc-7.7.20130910'
 }}}

 `atomic_inc` is used by `compiler/cbits/genSym.c`. It's defined in
 libHSrts of course, but apparently not all rts symbols are automatically
 available in the GHCi linker?

 I added a
 {{{
       SymI_HasProto(atomic_inc)                                         \
 }}}
 in `RTS_SYMBOLS` in `rts/Linker.c` and the problem seems to be solved. I'm
 not really sure what the difference between `SymI_` and `SymE_` is, it
 looks Windows-related. Maybe other stuff like `atomic_dec` should be added
 too.

 I'm pretty sure I didn't run into this problem with a "quick" build,
 though I have no idea how it could be specific to "quick-llvm".

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



More information about the ghc-tickets mailing list