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

#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@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

#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 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------+---------------------------------- Comment (by rwbarton): I just noticed that the "-llvm" build flavours have DYNAMIC_BY_DEFAULT = NO and DYNAMIC_GHC_PROGRAMS = NO, so presumably that's the cause of the difference. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8270#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: #8282 ---------------------------------+---------------------------------- Changes (by rwbarton): * related: => #8282 Comment: This also affects ordinary Windows builds, see #8282. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8270#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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
Resolution: | Keywords:
Operating System: Linux | Architecture: x86_64 (amd64)
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets: #8282
---------------------------------+----------------------------------
Comment (by Austin Seipp

#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 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: #8282 ---------------------------------+---------------------------------- Comment (by thoughtpolice): This should now be fixed (yell if it isn't!) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8270#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8270: unknown symbol "atomic_inc" in GHCi when loading package ghc ---------------------------------+---------------------------------- Reporter: rwbarton | Owner: Type: bug | Status: merge Priority: normal | Milestone: Component: GHCi | Version: 7.7 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: #8282 ---------------------------------+---------------------------------- Changes (by thoughtpolice): * status: new => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8270#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8270: unknown symbol "atomic_inc" in GHCi when loading package ghc ---------------------------------+---------------------------------- Reporter: rwbarton | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: GHCi | Version: 7.7 Resolution: fixed | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: #8282 ---------------------------------+---------------------------------- Changes (by thoughtpolice): * cc: hvr (added) * status: merge => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8270#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8270: unknown symbol "atomic_inc" in GHCi when loading package ghc ---------------------------------+---------------------------------- Reporter: rwbarton | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: GHCi | Version: 7.7 Resolution: fixed | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: #8282 ---------------------------------+---------------------------------- Comment (by thoughtpolice): Fixed and merged in HEAD. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8270#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC