[GHC] #13845: Runtime linker too eagerly checks for symbol names
GHC
ghc-devs at haskell.org
Sat Jun 17 17:08:24 UTC 2017
#13845: Runtime linker too eagerly checks for symbol names
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Runtime | Version: 8.0.1
System (Linker) |
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
I discovered this bug in https://github.com/haskell-
foundation/foundation/issues/326. Take this file:
{{{#!hs
module Main (main) where
foreign import ccall "notAThing"
notAThing :: IO ()
main :: IO ()
main = putStrLn "Hello, World!"
}}}
Compiling and running this file works without issue. But if you try to use
the runtime linker, things go haywire:
{{{
$ C:\Users\RyanGlScott\Software\ghc\inplace\bin\runghc Bug.hs
ghc-stage2.exe: ^^ Could not load 'notAThing', dependency unresolved. See
top entry above.
Bug.hs:
ByteCodeLink: can't find label
During interactive linking, GHCi couldn't find the following symbol:
notAThing
This may be due to you not asking GHCi to load extra object files,
archives or DLLs needed by your current session. Restart GHCi, specifying
the missing library using the -L/path/to/object/dir and -lmissinglibname
flags, or simply by naming the relevant files on the GHCi command line.
Alternatively, this link failure might indicate a bug in GHCi.
If you suspect the latter, please send a bug report to:
glasgow-haskell-bugs at haskell.org
}}}
This isn't just limited to Windows, since the same thing happens on Linux.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13845>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list