[GHC] #8770: ghci dynamic loading on MacOSX assumes .dylib extension (should check .so also)

#8770: ghci dynamic loading on MacOSX assumes .dylib extension (should check .so also) -----------------------------------+--------------------------------- Reporter: z9p | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Keywords: dlopen dylib so | Operating System: MacOS X Architecture: x86_64 (amd64) | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | -----------------------------------+--------------------------------- I am using ghc-7.6.3 on MacOSX 10.9.1. I noticed that when -l foo option is specified to ghci, it assumes the shared library extension is .dylib and tries to load foo.dylib. Even though a valid foo.so is present while foo.dylib is not, ghci ignores the .so and signals an error. This is in contradiction to the behavior of gcc and python on MacOSX. gcc would check the existence of both .so and .dylib and try to link them. Python is able to load the .so as well. Notice that here the .so is simply a renamed Mach-O .dylib. The reason I raise this issue is, in my case, I use macports to install cern ROOT and its shared libraries are all installed as .so files under /opt/local/lib. I would like to use them without change or creating .dylib -> .so links. $ ghci -lGui GHCi, version 7.6.3: 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 object (dynamic) Gui ... failed. <command line>: user specified .o/.so/.DLL could not be loaded (dlopen(libGui.dylib, 9): image not found) Whilst trying to load: (dynamic) Gui Additional directories searched: (none) $ ln -s libGui.so libGui.dylib $ ghci -lGui GHCi, version 7.6.3: 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 object (dynamic) Gui ... done final link ... done Prelude> -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8770 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8770: ghci dynamic loading on MacOSX assumes .dylib extension (should check .so also) ---------------------------------+----------------------------------- Reporter: z9p | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: GHCi | Version: 7.8.1-rc1 Resolution: | Keywords: dlopen dylib so Operating System: MacOS X | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------+----------------------------------- Changes (by thoughtpolice): * version: 7.6.3 => 7.8.1-rc1 * milestone: => 7.8.1 Comment: I have a fix for this anyway in the course of fixing #8736, so I'll go ahead and mark this... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8770#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8770: ghci dynamic loading on MacOSX assumes .dylib extension (should check .so
also)
---------------------------------+-----------------------------------
Reporter: z9p | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.8.1
Component: GHCi | Version: 7.8.1-rc1
Resolution: | Keywords: dlopen dylib so
Operating System: MacOS X | Architecture: x86_64 (amd64)
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
---------------------------------+-----------------------------------
Comment (by Austin Seipp

#8770: ghci dynamic loading on MacOSX assumes .dylib extension (should check .so also) ---------------------------------+----------------------------------- Reporter: z9p | Owner: Type: bug | Status: merge Priority: normal | Milestone: 7.8.1 Component: GHCi | Version: 7.8.1-rc1 Resolution: | Keywords: dlopen dylib so Operating System: MacOS X | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------+----------------------------------- Changes (by thoughtpolice): * status: new => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8770#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8770: ghci dynamic loading on MacOSX assumes .dylib extension (should check .so also) ---------------------------------+----------------------------------- Reporter: z9p | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.8.1 Component: GHCi | Version: 7.8.1-rc1 Resolution: fixed | Keywords: dlopen dylib so Operating System: MacOS X | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------+----------------------------------- Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed Comment: Merged in 7.8. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8770#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC