Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1648537

Summary: ghc-8.6 fails to build on s390x
Product: [Fedora] Fedora Reporter: Jens Petersen <petersen>
Component: ghcAssignee: Jens Petersen <petersen>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: medium    
Version: rawhideCC: bugproxy, dan, hannsj_uhl, petersen
Target Milestone: ---   
Target Release: ---   
Hardware: s390x   
OS: Linux   
Whiteboard:
Fixed In Version: ghc-8.6-2820190330091454.9c690d0e ghc-8.6-3020190330091454.a5b0195c ghc-8.6-2920190330091454.6c81f848 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-04-10 06:33:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 467765, 485231    

Description Jens Petersen 2018-11-10 12:34:03 UTC
Description of problem:
ghc-8.6 fails to build on s390x.

"/usr/bin/ghc" -hisuf hi -osuf  o -hcsuf hc -static  -H32m -O -Wall  -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -package-db libra\
ries/bootstrapping.conf  -this-unit-id ghc-8.6.2 -hide-all-packages -i -icompiler/backpack -icompiler/basicTypes -icompiler/cmm -icompiler/codeGen -icompiler/coreSyn -icompiler/deSugar -ico\
mpiler/ghci -icompiler/hsSyn -icompiler/iface -icompiler/llvmGen -icompiler/main -icompiler/nativeGen -icompiler/parser -icompiler/prelude -icompiler/profiling -icompiler/rename -icompiler/\
simplCore -icompiler/simplStg -icompiler/specialise -icompiler/stgSyn -icompiler/stranal -icompiler/typecheck -icompiler/types -icompiler/utils -icompiler/stage1/build -Icompiler/stage1/bui\
ld -icompiler/stage1/build/./autogen -Icompiler/stage1/build/./autogen -Icompiler/. -Icompiler/parser -Icompiler/utils -Icompiler/stage1 -Icompiler/stage1/build/. -Icompiler/stage1/build/pa\
rser -Icompiler/stage1/build/utils -Icompiler/stage1/build/stage1    -optP-include -optPcompiler/stage1/build/./autogen/cabal_macros.h -package-id array-0.5.2.0 -package-id base-4.11.1.0 -p\
ackage-id binary-0.8.6.0 -package-id bytestring-0.10.8.2 -package-id containers-0.5.11.0 -package-id deepseq-1.4.3.0 -package-id directory-1.3.1.5 -package-id filepath-1.4.2 -package-id ghc\
-boot-8.6.2 -package-id ghc-boot-th-8.6.2 -package-id ghc-heap-8.6.2 -package-id ghci-8.6.2 -package-id hpc-0.6.0.3 -package-id process-1.6.3.0 -package-id template-haskell-2.14.0.0 -packag\
e-id terminfo-0.4.1.2 -package-id time-1.8.0.2 -package-id transformers-0.5.5.0 -package-id unix-2.7.2.2 -Wall -Wno-name-shadowing -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-in\
stances -Wnoncanonical-monoid-instances -this-unit-id ghc -XHaskell2010 -XNoImplicitPrelude -DNO_REGS -DNOSMP -optc-DNOSMP -DSTAGE=1 -Rghc-timing  -Wcpp-undef  -no-user-package-db -rtsopts \
       -odir compiler/stage1/build -hidir compiler/stage1/build -stubdir compiler/stage1/build    -c compiler/utils/Binary.hs -o compiler/stage1/build/Binary.o
/tmp/ghc17964_0/ghc_3.hc: In function ‘_cP0l’:

/tmp/ghc17964_0/ghc_3.hc:59053:61: error:
     error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’?
     ((struct {W_ x;} __attribute__((packed))*) _sIxm)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                 stg_MUT_ARR_PTRS_FROZEN_DIRTY_info
      |
59053 | ((struct {W_ x;} __attribute__((packed))*) _sIxm)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
      |                                                             ^

/tmp/ghc17964_0/ghc_3.hc:59053:61: error:
     note: each undeclared identifier is reported only once for each function it appears in
      |
59053 | ((struct {W_ x;} __attribute__((packed))*) _sIxm)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
      |                                                             ^
/tmp/ghc17964_0/ghc_3.hc: In function ‘_cP0x’:

/tmp/ghc17964_0/ghc_3.hc:59151:61: error:
     error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’?
     ((struct {W_ x;} __attribute__((packed))*) _sIxm)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                 stg_MUT_ARR_PTRS_FROZEN_DIRTY_info
      |
59151 | ((struct {W_ x;} __attribute__((packed))*) _sIxm)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
      |                                                             ^
/tmp/ghc17964_0/ghc_3.hc: In function ‘sIUt_entry’:

/tmp/ghc17964_0/ghc_3.hc:64450:61: error:
     error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’?
     ((struct {W_ x;} __attribute__((packed))*) _sIUr)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                 stg_MUT_ARR_PTRS_FROZEN_DIRTY_info
      |
64450 | ((struct {W_ x;} __attribute__((packed))*) _sIUr)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
      |                                                             ^
/tmp/ghc17964_0/ghc_3.hc: In function ‘_cPBL’:

/tmp/ghc17964_0/ghc_3.hc:64777:61: error:
     error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’?
     ((struct {W_ x;} __attribute__((packed))*) _sIUr)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                 stg_MUT_ARR_PTRS_FROZEN_DIRTY_info
      |
64777 | ((struct {W_ x;} __attribute__((packed))*) _sIUr)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
      |                                                             ^
/tmp/ghc17964_0/ghc_3.hc: In function ‘_cPCg’:

/tmp/ghc17964_0/ghc_3.hc:64865:61: error:
     error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’?
     ((struct {W_ x;} __attribute__((packed))*) _sIUr)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                 stg_MUT_ARR_PTRS_FROZEN_DIRTY_info
      |
64865 | ((struct {W_ x;} __attribute__((packed))*) _sIUr)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
      |                                                             ^
`gcc' failed in phase `C Compiler'. (Exit code: 1)
<<ghc: 5357855672 bytes, 422 GCs, 45617667/116070576 avg/max bytes residency (13 samples), 286M in use, 0.001 INIT (0.001 elapsed), 6.855 MUT (7.660 elapsed), 3.171 GC (3.169 elapsed) :ghc>\
>
make[1]: *** [compiler/ghc.mk:446: compiler/stage1/build/Binary.o] Error 1

Version-Release number of selected component (if applicable):
ghc-8.6.1
ghc-8.6.2

How reproducible:
100%

Steps to Reproduce:
1. Build (unregisterized) ghc-8.6 on s390x with (unregisterized) ghc-8.2 or 8.4.

Actual results:
Fails as above

Expected results:
No failure

Additional info:
Apparently this is due to RTS symbol name choices.
Seems somehow the old and new symbol names are getting mixed up,
likely due to relative include paths...

Comment 1 Jens Petersen 2018-11-10 14:56:03 UTC
I mentioned this issue upstream in:
https://ghc.haskell.org/trac/ghc/ticket/8040#comment:10
https://ghc.haskell.org/trac/ghc/ticket/15201#comment:8

but I think I will report it separately.

Comment 2 Jens Petersen 2018-11-10 14:59:17 UTC
This affects the Fedora ghc:8.6 module.

Comment 3 Jens Petersen 2018-11-20 03:05:56 UTC
https://ghc.haskell.org/trac/ghc/ticket/15913

Comment 4 Jens Petersen 2019-03-08 01:47:08 UTC
I wish we had better (first class) s390x support in ghc.

Hanns-Joachim, any thoughts?

Comment 5 Jens Petersen 2019-03-22 08:26:44 UTC
I think I have a workaround for this.

Comment 6 Fedora Update System 2019-03-31 09:44:43 UTC
ghc-8.6-3020190330091454.a5b0195c has been submitted as an update to Fedora 30 Modular. https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2019-4e78483146

Comment 7 Fedora Update System 2019-03-31 09:44:48 UTC
ghc-8.6-2920190330091454.6c81f848 has been submitted as an update to Fedora 29 Modular. https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2019-9b064be4b3

Comment 8 Fedora Update System 2019-03-31 09:44:52 UTC
ghc-8.6-2820190330091454.9c690d0e has been submitted as an update to Fedora 28 Modular. https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2019-da55b0090f

Comment 9 Fedora Update System 2019-03-31 19:48:54 UTC
ghc-8.6-3020190330091454.a5b0195c has been pushed to the Fedora 30 Modular testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2019-4e78483146

Comment 10 Fedora Update System 2019-04-01 02:30:12 UTC
ghc-8.6-2920190330091454.6c81f848 has been pushed to the Fedora 29 Modular testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2019-9b064be4b3

Comment 11 Fedora Update System 2019-04-01 02:55:46 UTC
ghc-8.6-2820190330091454.9c690d0e has been pushed to the Fedora 28 Modular testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2019-da55b0090f

Comment 12 Fedora Update System 2019-04-10 06:33:57 UTC
ghc-8.6-2820190330091454.9c690d0e has been pushed to the Fedora 28 Modular stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2019-04-10 07:12:59 UTC
ghc-8.6-3020190330091454.a5b0195c has been pushed to the Fedora 30 Modular stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2019-04-10 07:32:54 UTC
ghc-8.6-2920190330091454.6c81f848 has been pushed to the Fedora 29 Modular stable repository. If problems still persist, please make note of it in this bug report.