[GHC] #14856: GHC API: Linker failure on loading target multiple times

#14856: GHC API: Linker failure on loading target multiple times ----------------------------------------+--------------------------- Reporter: fizzixnerd | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHC API | Version: 8.2.2 Keywords: GHC API Linker | Operating System: Linux Architecture: Unknown/Multiple | Type of failure: Other Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: ----------------------------------------+--------------------------- Minimum Working Example: https://github.com/Fizzixnerd/ghc-bug `stack exec -- ghc --version`
The Glorious Glasgow Haskell Compilation System, version 8.2.2
`uname --all`
Linux <REDACTED> 4.14.0-3-amd64 #1 SMP Debian 4.14.13-1 (2018-01-14) x86_64 GNU/Linux
Description: Loading a dynamic module more than once causes a linker failure with the following message: ''' /usr/bin/ld.gold: error: cannot find -lghc_2 collect2: error: ld returned 1 exit status `gcc' failed in phase `Linker'. (Exit code: 1) *** Exception: ExitFailure 1 ''' `-lghc_2' sometimes is `-lghc_5' or other numbers. Steps to Reproduce: 1) Clone above repo. 2) `stack build` 3) `stack exec mwe-exe` The repo code will use the GHC API to load a string from the file contained in scripts/ named `val'. There are three functions defined in src/Lib.hs. `anotherFunc' should behave normally. `someFunc' should display the bad behavior. Notes: - When using `intero`: intero must be restarted if this bug is encountered at the prompt, or else you will keep getting it over and over again. - I could not figure out how to load it up without using the `-dynamic' flag, but that should probably be checked out too. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14856 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14856: GHC API: Linker failure on loading target multiple times -------------------------------+---------------------------------------- Reporter: fizzixnerd | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHC API | Version: 8.2.2 Resolution: | Keywords: GHC API Linker Operating System: Linux | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------+---------------------------------------- Old description:
Minimum Working Example: https://github.com/Fizzixnerd/ghc-bug
`stack exec -- ghc --version`
The Glorious Glasgow Haskell Compilation System, version 8.2.2
`uname --all`
Linux <REDACTED> 4.14.0-3-amd64 #1 SMP Debian 4.14.13-1 (2018-01-14) x86_64 GNU/Linux
Description: Loading a dynamic module more than once causes a linker failure with the following message:
''' /usr/bin/ld.gold: error: cannot find -lghc_2 collect2: error: ld returned 1 exit status `gcc' failed in phase `Linker'. (Exit code: 1) *** Exception: ExitFailure 1 '''
`-lghc_2' sometimes is `-lghc_5' or other numbers.
Steps to Reproduce: 1) Clone above repo. 2) `stack build` 3) `stack exec mwe-exe`
The repo code will use the GHC API to load a string from the file contained in scripts/ named `val'. There are three functions defined in src/Lib.hs. `anotherFunc' should behave normally. `someFunc' should display the bad behavior.
Notes: - When using `intero`: intero must be restarted if this bug is encountered at the prompt, or else you will keep getting it over and over again.
- I could not figure out how to load it up without using the `-dynamic' flag, but that should probably be checked out too.
New description: Minimum Working Example: https://github.com/Fizzixnerd/ghc-bug `stack exec -- ghc --version`
The Glorious Glasgow Haskell Compilation System, version 8.2.2
`uname --all`
Linux <REDACTED> 4.14.0-3-amd64 #1 SMP Debian 4.14.13-1 (2018-01-14) x86_64 GNU/Linux
Description: Loading a dynamic module more than once causes a linker failure with the following message: ''' /usr/bin/ld.gold: error: cannot find -lghc_2 collect2: error: ld returned 1 exit status `gcc' failed in phase `Linker'. (Exit code: 1) *** Exception: ExitFailure 1 ''' `-lghc_2' sometimes is `-lghc_5' or other numbers. Steps to Reproduce: 1) Clone above repo. 2) `stack build` 3) `stack exec mwe-exe` The repo code will use the GHC API to load a string from the file contained in scripts/ named `val`. There are three functions defined in src/Lib.hs. `anotherFunc` should behave normally. `someFunc' should display the bad behavior. Notes: - When using `intero`: intero must be restarted if this bug is encountered at the prompt, or else you will keep getting it over and over again. - I could not figure out how to load it up without using the `-dynamic' flag, but that should probably be checked out too. -- Comment (by fizzixnerd): fixed formatting. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14856#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14856: GHC API: Linker failure on loading target multiple times -------------------------------+-------------------------------------- Reporter: fizzixnerd | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.4.1 Component: GHC API | Version: 8.4.1-alpha3 Resolution: | Keywords: GHC API Linker Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------+-------------------------------------- Changes (by fizzixnerd): * version: 8.2.2 => 8.4.1-alpha3 * architecture: Unknown/Multiple => x86_64 (amd64) * milestone: => 8.4.1 Comment: Checked this against ghc 8.4.0.20180224, and found it still exists. Updating ticket. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14856#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC