FS#55658 - [ghc] Compilation with ghc broken

Attached to Project: Community Packages
Opened by Tim Rakowski (racko) - Sunday, 17 September 2017, 10:16 GMT
Last edited by Doug Newgard (Scimmia) - Sunday, 17 September 2017, 14:09 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

package versions: 8.0.2-3, 8.2.1-1

Steps to reproduce:

$ echo 'main = putStrLn "Hello World!"' > main.hs
$ ghc main.hs
Linking main ...
/usr/bin/ld.gold: error: cannot find -lHSbase-4.10.0.0
/usr/bin/ld.gold: error: cannot find -lHSinteger-gmp-1.0.1.0
/usr/bin/ld.gold: error: cannot find -lHSghc-prim-0.5.1.0
/usr/bin/ld.gold: error: cannot find -lHSrts
main.o:s18M_info: error: undefined reference to 'newCAF'
main.o:s18M_info: error: undefined reference to 'stg_bh_upd_frame_info'
main.o:s18M_info: error: undefined reference to 'ghczmprim_GHCziCString_unpackCStringzh_closure'
main.o:Main_main_info: error: undefined reference to 'newCAF'
main.o:Main_main_info: error: undefined reference to 'stg_bh_upd_frame_info'
main.o:Main_main_info: error: undefined reference to 'base_SystemziIO_putStrLn_closure'
main.o:ZCMain_main_info: error: undefined reference to 'newCAF'
main.o:ZCMain_main_info: error: undefined reference to 'stg_bh_upd_frame_info'
main.o:ZCMain_main_info: error: undefined reference to 'base_GHCziTopHandler_runMainIO_closure'
main.o:s18M_info: error: undefined reference to 'stg_ap_n_fast'
main.o:Main_main_info: error: undefined reference to 'stg_ap_p_fast'
main.o:ZCMain_main_info: error: undefined reference to 'stg_ap_p_fast'
main.o(.data+0x60): error: undefined reference to 'ghczmprim_GHCziTypes_TrNameS_con_info'
main.o(.data+0x70): error: undefined reference to 'ghczmprim_GHCziTypes_TrNameS_con_info'
main.o(.data+0x80): error: undefined reference to 'ghczmprim_GHCziTypes_Module_con_info'
main.o(.data.rel.ro+0x0): error: undefined reference to 'ghczmprim_GHCziCString_unpackCStringzh_closure'
main.o(.data.rel.ro+0x8): error: undefined reference to 'base_SystemziIO_putStrLn_closure'
main.o(.data.rel.ro+0x18): error: undefined reference to 'base_GHCziTopHandler_runMainIO_closure'
/tmp/ghc19924_0/ghc_2.o:ghc_1.c:function main: error: undefined reference to 'defaultRtsConfig'
/tmp/ghc19924_0/ghc_2.o:ghc_1.c:function main: error: undefined reference to 'defaultRtsConfig'
/tmp/ghc19924_0/ghc_2.o:ghc_1.c:function main: error: undefined reference to 'defaultRtsConfig'
/tmp/ghc19924_0/ghc_2.o:ghc_1.c:function main: error: undefined reference to 'defaultRtsConfig'
/tmp/ghc19924_0/ghc_2.o:ghc_1.c:function main: error: undefined reference to 'hs_main'
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)

Expected (tested on another system):

$ ghc main.hs
[1 of 1] Compiling Main ( main.hs, main.o )
Linking main ...
$ ./main
Hello World!

ghci works fine:
$ ghci main.hs
GHCi, version 8.2.1: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( main.hs, interpreted )
Ok, 1 module loaded.
*Main> main
Hello World
> ^D
Leaving GHCi.

I gues this is caused by the duplication in the ghc library file names:

$ pacman -Ql ghc ghc-libs | grep HSghc
ghc /usr/lib/ghc-8.2.1/ghc-8.2.1/libHSghc-8.2.1-ghc8.2.1.so
ghc-libs /usr/lib/ghc-8.2.1/ghc-boot-8.2.1/libHSghc-boot-8.2.1-ghc8.2.1.so
ghc-libs /usr/lib/ghc-8.2.1/ghc-boot-th-8.2.1/libHSghc-boot-th-8.2.1-ghc8.2.1.so
ghc-libs /usr/lib/ghc-8.2.1/ghc-compact-0.1.0.0/libHSghc-compact-0.1.0.0-ghc8.2.1.so
ghc-libs /usr/lib/ghc-8.2.1/ghc-prim-0.5.1.0/libHSghc-prim-0.5.1.0-ghc8.2.1.so
ghc-libs /usr/lib/ghc-8.2.1/ghci-8.2.1/libHSghci-8.2.1-ghc8.2.1.so

I wasn't able to figure out the cause of this duplication yet.

I observed the same error with 8.0.2-3 but hoped that the issue might get fixed with 8.2.
This task depends upon

Closed by  Doug Newgard (Scimmia)
Sunday, 17 September 2017, 14:09 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Was missing --dynamic

Loading...