GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:03:42Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/15623Wrong Endian, ghc-pwd and ghc-cabal on ghc 8.0.1 for powerpc64le (IBM Power)2019-07-07T18:03:42ZfrancescantoncastroWrong Endian, ghc-pwd and ghc-cabal on ghc 8.0.1 for powerpc64le (IBM Power)I tried to compile ghc-8.0.1 from source using the powerpc64/unknown linux .tar.xz file (since the other file was for AIX).
The ghc-pwd and ghc-cabal files won't execute even after stripping them with strip.
The libraries included are ...I tried to compile ghc-8.0.1 from source using the powerpc64/unknown linux .tar.xz file (since the other file was for AIX).
The ghc-pwd and ghc-cabal files won't execute even after stripping them with strip.
The libraries included are Big Endian instead of Little Endian.
I replaced the libffi library by the local one on my system (IBM Power8 with redhatenterpriseserver).
ghc complains there is no cabal file after naming a symlink to cabal (on /bin) ghc-cabal (instead of the faulty ghc-cabal file).
See attached file.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Wrong Endian, ghc-pwd and ghc-cabal on ghc 8.0.1 for powerpc64le (IBM Power)","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I tried to compile ghc-8.0.1 from source using the powerpc64/unknown linux .tar.xz file (since the other file was for AIX).\r\n\r\nThe ghc-pwd and ghc-cabal files won't execute even after stripping them with strip.\r\n\r\nThe libraries included are Big Endian instead of Little Endian.\r\n\r\nI replaced the libffi library by the local one on my system (IBM Power8 with redhatenterpriseserver).\r\n\r\nghc complains there is no cabal file after naming a symlink to cabal (on /bin) ghc-cabal (instead of the faulty ghc-cabal file). \r\n\r\nSee attached file.\r\n\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15538GHC boot script can't handle Git remote not named origin2021-01-19T16:52:54ZChaiTRexGHC boot script can't handle Git remote not named origin## Problem
I ran the following to get the sources for GHC to build them:
```
git clone -o ghc --recursive http://git.haskell.org/ghc.git
```
Note especially the `-o ghc` part, which uses the Git remote name `ghc` instead of the defaul...## Problem
I ran the following to get the sources for GHC to build them:
```
git clone -o ghc --recursive http://git.haskell.org/ghc.git
```
Note especially the `-o ghc` part, which uses the Git remote name `ghc` instead of the default `origin`. When a custom remote name is used, `./boot` fails:
```
$ ./boot
Traceback (most recent call last):
File "./boot", line 193, in <module>
check_for_url_rewrites()
File "./boot", line 29, in check_for_url_rewrites
subprocess.check_output('git config remote.origin.url'.split()).find(b'github.com') != -1 and \
File "/usr/lib/python3.5/subprocess.py", line 626, in check_output
**kwargs).stdout
File "/usr/lib/python3.5/subprocess.py", line 708, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'config', 'remote.origin.url']' returned non-zero exit status 1
$ git config remote.origin.url
$ echo $?
1
```
## Solution
`git config remote.origin.url` can be used first. Whenever `git config remote.origin.url` fails, a `git rev-parse` command (thanks to freenode/\#git/_ikke_ for it) can be used to get the remote name and branch that would be pushed to:
```
$ git rev-parse --symbolic-full-name --abbrev-ref @{upstream}
ghc/coercible
$ git rev-parse --symbolic-full-name --abbrev-ref @{upstream} | sed 's/\/.*$//'
ghc
$ git config "remote.$( git rev-parse --symbolic-full-name --abbrev-ref @{upstream} | sed 's/\/.*$//' ).url"
http://git.haskell.org/ghc.git
```
## Workaround
Rename the remote to `origin`:
```
$ git remote rename "$( git config branch.master.remote )" origin
$ ./boot
Creating libraries/mtl/ghc.mk
Creating libraries/unix/ghc.mk
Creating libraries/text/ghc.mk
⋮
```8.6.1ChaiTRexChaiTRexhttps://gitlab.haskell.org/ghc/ghc/-/issues/15399Build failure on PowerPC 64-bit big endian2019-07-07T18:05:05ZPeter Trommlerptrommler@acm.orgBuild failure on PowerPC 64-bit big endianBuilding GHC 8.6.1 alpha 2 fails with these errors on Powerpc 64-bit big endian Linux:
```
[ 5076s] utils/check-ppr/Main.hs:44:18: error:
[ 5076s] * GHC internal error: `astFile' is not in scope during type checking, but it passed t...Building GHC 8.6.1 alpha 2 fails with these errors on Powerpc 64-bit big endian Linux:
```
[ 5076s] utils/check-ppr/Main.hs:44:18: error:
[ 5076s] * GHC internal error: `astFile' is not in scope during type checking, but it passed the renamer
[ 5076s] tcl_env of environment: [agVj :-> Identifier[libdir::FilePath, NotLetBound],
[ 5076s] agVk :-> Identifier[fileName::String, NotLetBound],
[ 5076s] agVl :-> Identifier[p::a, NotLetBound],
[ 5076s] agVo :-> Identifier[anns::ApiAnns, TopLevelLet [agVl :-> p] False],
[ 5076s] agVp :-> Identifier[pragmas::String, TopLevelLet [agVo :-> anns] False],
[ 5076s] agVq :-> Identifier[newFile::FilePath, TopLevelLet [agVk :-> fileName] False],
[ 5076s] rfRp :-> Identifier[usage::String, TopLevelLet [] True],
[ 5076s] rfU1 :-> Identifier[main::IO (), TopLevelLet [] True],
[ 5076s] rfU2 :-> Identifier[testOneFile::FilePath
[ 5076s] -> String
[ 5076s] -> IO (), TopLevelLet [] True],
[ 5076s] rfU3 :-> Identifier[parseOneFile::FilePath
[ 5076s] -> FilePath
[ 5076s] -> IO
[ 5076s] ParsedModule, TopLevelLet [] True],
[ 5076s] rfU4 :-> Identifier[getPragmas::ApiAnns -> String, TopLevelLet],
[ 5076s] rfU5 :-> Identifier[pp::forall a.
[ 5076s] Outputable a =>
[ 5076s] a -> String, TopLevelLet [] True]]
[ 5076s] * In the first argument of `writeFile', namely `astFile'
[ 5076s] In a stmt of a 'do' block: writeFile astFile origAst
[ 5076s] In the expression:
[ 5076s] do p <- parseOneFile libdir fileName
[ 5076s] let pped = pragmas ++ "\n" ++ pp (pm_parsed_source p)
[ 5076s] anns = pm_annotations p
[ 5076s] ....
[ 5076s] writeFile astFile origAst
[ 5076s] writeFile newFile pped
[ 5076s] ....
[ 5076s] |
[ 5076s] 44 | writeFile astFile origAst
[ 5076s] | ^^^^^^^
[ 5076s] utils/check-ppr/ghc.mk:18: recipe for target 'utils/check-ppr/dist-install/build/Main.o' failed
[ 5076s] make[1]: *** [utils/check-ppr/dist-install/build/Main.o] Error 1
[ 5076s] make[1]: *** Waiting for unfinished jobs....
[ 5077s]
[ 5077s] utils/check-api-annotations/Main.hs:116:32: error:
[ 5077s] * GHC internal error: `GenericQ' is not in scope during type checking, but it passed the renamer
[ 5077s] tcl_env of environment: [agZx :-> Type variable `r' = r :: k0]
[ 5077s] * In the type signature:
[ 5077s] everything :: (r -> r -> r) -> GenericQ r -> GenericQ r
[ 5077s] |
[ 5077s] 116 | everything :: (r -> r -> r) -> GenericQ r -> GenericQ r
[ 5077s] | ^^^^^^^^
[ 5077s] utils/check-api-annotations/ghc.mk:18: recipe for target 'utils/check-api-annotations/dist-install/build/Main.o' failed
[ 5077s] make[1]: *** [utils/check-api-annotations/dist-install/build/Main.o] Error 1
[ 5077s]
[ 5077s] utils/ghctags/Main.hs:61:36: error:
[ 5077s] * GHC internal error: `FoundThing' is not in scope during type checking, but it passed the renamer
[ 5077s] tcl_env of environment: [rCTr :-> ATcTyCon FileData :: *,
[ 5077s] rCTs :-> APromotionErr RecDataConPE,
[ 5077s] rCTw :-> ATcTyCon FileName :: *]
[ 5077s] * In the type `[FoundThing]'
[ 5077s] In the definition of data constructor `FileData'
[ 5077s] In the data declaration for `FileData'
[ 5077s] |
[ 5077s] 61 | data FileData = FileData FileName [FoundThing] (Map Int String)
[ 5077s] | ^^^^^^^^^^
[ 5077s] utils/ghctags/ghc.mk:18: recipe for target 'utils/ghctags/dist-install/build/Main.o' failed
```
Alpha 2 builds fine on PowerPC 64-bit little endian Linux.
I am setting version to 8.5 as there is no tag for 8.6.1 alpha 2 yet.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Build failure on PowerPC 64-bit big endian","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.5","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Building GHC 8.6.1 alpha 2 fails with these errors on Powerpc 64-bit big endian Linux:\r\n\r\n{{{\r\n[ 5076s] utils/check-ppr/Main.hs:44:18: error:\r\n[ 5076s] * GHC internal error: `astFile' is not in scope during type checking, but it passed the renamer\r\n[ 5076s] tcl_env of environment: [agVj :-> Identifier[libdir::FilePath, NotLetBound],\r\n[ 5076s] agVk :-> Identifier[fileName::String, NotLetBound],\r\n[ 5076s] agVl :-> Identifier[p::a, NotLetBound],\r\n[ 5076s] agVo :-> Identifier[anns::ApiAnns, TopLevelLet [agVl :-> p] False],\r\n[ 5076s] agVp :-> Identifier[pragmas::String, TopLevelLet [agVo :-> anns] False],\r\n[ 5076s] agVq :-> Identifier[newFile::FilePath, TopLevelLet [agVk :-> fileName] False],\r\n[ 5076s] rfRp :-> Identifier[usage::String, TopLevelLet [] True],\r\n[ 5076s] rfU1 :-> Identifier[main::IO (), TopLevelLet [] True],\r\n[ 5076s] rfU2 :-> Identifier[testOneFile::FilePath\r\n[ 5076s] -> String\r\n[ 5076s] -> IO (), TopLevelLet [] True],\r\n[ 5076s] rfU3 :-> Identifier[parseOneFile::FilePath\r\n[ 5076s] -> FilePath\r\n[ 5076s] -> IO\r\n[ 5076s] ParsedModule, TopLevelLet [] True],\r\n[ 5076s] rfU4 :-> Identifier[getPragmas::ApiAnns -> String, TopLevelLet],\r\n[ 5076s] rfU5 :-> Identifier[pp::forall a.\r\n[ 5076s] Outputable a =>\r\n[ 5076s] a -> String, TopLevelLet [] True]]\r\n[ 5076s] * In the first argument of `writeFile', namely `astFile'\r\n[ 5076s] In a stmt of a 'do' block: writeFile astFile origAst\r\n[ 5076s] In the expression:\r\n[ 5076s] do p <- parseOneFile libdir fileName\r\n[ 5076s] let pped = pragmas ++ \"\\n\" ++ pp (pm_parsed_source p)\r\n[ 5076s] anns = pm_annotations p\r\n[ 5076s] ....\r\n[ 5076s] writeFile astFile origAst\r\n[ 5076s] writeFile newFile pped\r\n[ 5076s] ....\r\n[ 5076s] |\r\n[ 5076s] 44 | writeFile astFile origAst\r\n[ 5076s] | ^^^^^^^\r\n[ 5076s] utils/check-ppr/ghc.mk:18: recipe for target 'utils/check-ppr/dist-install/build/Main.o' failed\r\n[ 5076s] make[1]: *** [utils/check-ppr/dist-install/build/Main.o] Error 1\r\n[ 5076s] make[1]: *** Waiting for unfinished jobs....\r\n[ 5077s] \r\n[ 5077s] utils/check-api-annotations/Main.hs:116:32: error:\r\n[ 5077s] * GHC internal error: `GenericQ' is not in scope during type checking, but it passed the renamer\r\n[ 5077s] tcl_env of environment: [agZx :-> Type variable `r' = r :: k0]\r\n[ 5077s] * In the type signature:\r\n[ 5077s] everything :: (r -> r -> r) -> GenericQ r -> GenericQ r\r\n[ 5077s] |\r\n[ 5077s] 116 | everything :: (r -> r -> r) -> GenericQ r -> GenericQ r\r\n[ 5077s] | ^^^^^^^^\r\n[ 5077s] utils/check-api-annotations/ghc.mk:18: recipe for target 'utils/check-api-annotations/dist-install/build/Main.o' failed\r\n[ 5077s] make[1]: *** [utils/check-api-annotations/dist-install/build/Main.o] Error 1\r\n[ 5077s] \r\n[ 5077s] utils/ghctags/Main.hs:61:36: error:\r\n[ 5077s] * GHC internal error: `FoundThing' is not in scope during type checking, but it passed the renamer\r\n[ 5077s] tcl_env of environment: [rCTr :-> ATcTyCon FileData :: *,\r\n[ 5077s] rCTs :-> APromotionErr RecDataConPE,\r\n[ 5077s] rCTw :-> ATcTyCon FileName :: *]\r\n[ 5077s] * In the type `[FoundThing]'\r\n[ 5077s] In the definition of data constructor `FileData'\r\n[ 5077s] In the data declaration for `FileData'\r\n[ 5077s] |\r\n[ 5077s] 61 | data FileData = FileData FileName [FoundThing] (Map Int String)\r\n[ 5077s] | ^^^^^^^^^^\r\n[ 5077s] utils/ghctags/ghc.mk:18: recipe for target 'utils/ghctags/dist-install/build/Main.o' failed\r\n}}}\r\n\r\nAlpha 2 builds fine on PowerPC 64-bit little endian Linux.\r\n\r\nI am setting version to 8.5 as there is no tag for 8.6.1 alpha 2 yet.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1Peter Trommlerptrommler@acm.orgPeter Trommlerptrommler@acm.orghttps://gitlab.haskell.org/ghc/ghc/-/issues/15218HEAD doesn't build without sphinx-build2019-07-07T18:13:45Zjrp2014HEAD doesn't build without sphinx-buildIf you git clone HEAD and run ./validate the system should build without further ado. It doesn't. The make all fails, complaining about an absence of sphinx-build. Using the mk .sample files doesn't help.
Installing sphinx-bulid resolve...If you git clone HEAD and run ./validate the system should build without further ado. It doesn't. The make all fails, complaining about an absence of sphinx-build. Using the mk .sample files doesn't help.
Installing sphinx-bulid resolves the issue.
So the documentation here and/or the default build are out of sync with each other.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.4.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | low |
| Resolution | Unresolved |
| Component | Build System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"HEAD doesn't build without sphinx-build","status":"New","operating_system":"","component":"Build System","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"If you git clone HEAD and run ./validate the system should build without further ado. It doesn't. The make all fails, complaining about an absence of sphinx-build. Using the mk .sample files doesn't help. \r\n\r\nInstalling sphinx-bulid resolves the issue.\r\n\r\nSo the documentation here and/or the default build are out of sync with each other.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15187HEAD: Validate failure when not TABLES_NEXT_TO_CODE2019-07-07T18:13:52ZPeter Trommlerptrommler@acm.orgHEAD: Validate failure when not TABLES_NEXT_TO_CODEOn powerpc64 validating HEAD I see the following failure:
```
libraries/ghci/GHCi/InfoTable.hsc:323:20: error: [-Wunused-matches, -Werror=unused-matches]
Defined but not used: ‘ex_ptr’
|
323 | pokeConItbl wr_ptr ex_ptr itbl = do...On powerpc64 validating HEAD I see the following failure:
```
libraries/ghci/GHCi/InfoTable.hsc:323:20: error: [-Wunused-matches, -Werror=unused-matches]
Defined but not used: ‘ex_ptr’
|
323 | pokeConItbl wr_ptr ex_ptr itbl = do
| ^^^^^^
libraries/ghci/ghc.mk:4: recipe for target 'libraries/ghci/dist-install/build/GHCi/InfoTable.o' failed
```
Patch is coming.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"HEAD: Validate failure when not TABLES_NEXT_TO_CODE","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.5","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"On powerpc64 validating HEAD I see the following failure:\r\n{{{\r\nlibraries/ghci/GHCi/InfoTable.hsc:323:20: error: [-Wunused-matches, -Werror=unused-matches]\r\n Defined but not used: ‘ex_ptr’\r\n |\r\n323 | pokeConItbl wr_ptr ex_ptr itbl = do\r\n | ^^^^^^\r\nlibraries/ghci/ghc.mk:4: recipe for target 'libraries/ghci/dist-install/build/GHCi/InfoTable.o' failed\r\n}}}\r\n\r\nPatch is coming.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1Peter Trommlerptrommler@acm.orgPeter Trommlerptrommler@acm.orghttps://gitlab.haskell.org/ghc/ghc/-/issues/15171Add HeapView functionality breaks validate (stage 0 ghc is 8.4.2)2019-07-07T18:13:56Zjrp2014Add HeapView functionality breaks validate (stage 0 ghc is 8.4.2)```
"/opt/ghc/bin/ghc" -hisuf hi -osuf o -hcsuf hc -static -O0 -H64m -Wall -package-db libraries/bootstrapping.conf -this-unit-id mtl-2.2.2 -hide-all-packages -i -ilibraries/mtl/. -ilibraries/mtl/dist-boot/build -Ilibraries/mtl/dist...```
"/opt/ghc/bin/ghc" -hisuf hi -osuf o -hcsuf hc -static -O0 -H64m -Wall -package-db libraries/bootstrapping.conf -this-unit-id mtl-2.2.2 -hide-all-packages -i -ilibraries/mtl/. -ilibraries/mtl/dist-boot/build -Ilibraries/mtl/dist-boot/build -ilibraries/mtl/dist-boot/build/./autogen -Ilibraries/mtl/dist-boot/build/./autogen -Ilibraries/mtl/. -optP-include -optPlibraries/mtl/dist-boot/build/./autogen/cabal_macros.h -package-id base-4.11.1.0 -package-id transformers-0.5.5.0 -Wall -fno-warn-unused-imports -fno-warn-warnings-deprecations -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances -XHaskell2010 -no-user-package-db -rtsopts -fno-warn-deprecated-flags -odir libraries/mtl/dist-boot/build -hidir libraries/mtl/dist-boot/build -stubdir libraries/mtl/dist-boot/build -c libraries/mtl/./Control/Monad/RWS/Lazy.hs -o libraries/mtl/dist-boot/build/Control/Monad/RWS/Lazy.o
libraries/ghc-heap/GHC/Exts/Heap.hs:119:48: error:
• Couldn't match expected type ‘ByteArray#’
with actual type ‘Array# b0’
• In the first argument of ‘sizeofByteArray#’, namely ‘dat’
In the first argument of ‘I#’, namely ‘(sizeofByteArray# dat)’
In the first argument of ‘div’, namely
‘(I# (sizeofByteArray# dat))’
• Relevant bindings include
dat :: Array# b0
(bound at libraries/ghc-heap/GHC/Exts/Heap.hs:115:18)
|
119 | let nelems = (I# (sizeofByteArray# dat)) `div` wORD_SIZE
| ^^^
libraries/ghc-heap/GHC/Exts/Heap.hs:121:47: error:
• Couldn't match expected type ‘ByteArray#’
with actual type ‘Array# b0’
• In the first argument of ‘indexWordArray#’, namely ‘dat’
In the first argument of ‘W#’, namely ‘(indexWordArray# dat i)’
In the expression: W# (indexWordArray# dat i)
• Relevant bindings include
dat :: Array# b0
(bound at libraries/ghc-heap/GHC/Exts/Heap.hs:115:18)
|
121 | rawWds = [W# (indexWordArray# dat i) | I# i <- [0.. end] ]
| ^^^
libraries/ghc-heap/GHC/Exts/Heap.hs:122:43: error:
• Couldn't match expected type ‘Array# a0’
with actual type ‘ByteArray#’
• In the first argument of ‘sizeofArray#’, namely ‘pointers’
In the first argument of ‘I#’, namely ‘(sizeofArray# pointers)’
In the expression: I# (sizeofArray# pointers)
|
122 | pelems = I# (sizeofArray# pointers)
| ^^^^^^^^
libraries/ghc-heap/GHC/Exts/Heap.hs:123:67: error:
• Couldn't match expected type ‘Array# Any’
with actual type ‘ByteArray#’
• In the fourth argument of ‘Array’, namely ‘pointers’
In the second argument of ‘($)’, namely
‘Array 0 (pelems - 1) pelems pointers’
In the expression: amap' Box $ Array 0 (pelems - 1) pelems pointers
|
123 | ptrList = amap' Box $ Array 0 (pelems - 1) pelems pointers
| ^^^^^^^^
libraries/ghc-heap/ghc.mk:3: recipe for target 'libraries/ghc-heap/dist-boot/build/GHC/Exts/Heap.o' failed
make[1]: *** [libraries/ghc-heap/dist-boot/build/GHC/Exts/Heap.o] Error 1
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 8.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Runtime System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | patrickdoc |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Add HeapView functionality breaks validate (stage 0 ghc is 8.4.2)","status":"New","operating_system":"","component":"Runtime System","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.5","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["patrickdoc"],"type":"Bug","description":"{{{\r\n\"/opt/ghc/bin/ghc\" -hisuf hi -osuf o -hcsuf hc -static -O0 -H64m -Wall -package-db libraries/bootstrapping.conf -this-unit-id mtl-2.2.2 -hide-all-packages -i -ilibraries/mtl/. -ilibraries/mtl/dist-boot/build -Ilibraries/mtl/dist-boot/build -ilibraries/mtl/dist-boot/build/./autogen -Ilibraries/mtl/dist-boot/build/./autogen -Ilibraries/mtl/. -optP-include -optPlibraries/mtl/dist-boot/build/./autogen/cabal_macros.h -package-id base-4.11.1.0 -package-id transformers-0.5.5.0 -Wall -fno-warn-unused-imports -fno-warn-warnings-deprecations -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances -XHaskell2010 -no-user-package-db -rtsopts -fno-warn-deprecated-flags -odir libraries/mtl/dist-boot/build -hidir libraries/mtl/dist-boot/build -stubdir libraries/mtl/dist-boot/build -c libraries/mtl/./Control/Monad/RWS/Lazy.hs -o libraries/mtl/dist-boot/build/Control/Monad/RWS/Lazy.o \r\n\r\nlibraries/ghc-heap/GHC/Exts/Heap.hs:119:48: error:\r\n • Couldn't match expected type ‘ByteArray#’\r\n with actual type ‘Array# b0’\r\n • In the first argument of ‘sizeofByteArray#’, namely ‘dat’\r\n In the first argument of ‘I#’, namely ‘(sizeofByteArray# dat)’\r\n In the first argument of ‘div’, namely\r\n ‘(I# (sizeofByteArray# dat))’\r\n • Relevant bindings include\r\n dat :: Array# b0\r\n (bound at libraries/ghc-heap/GHC/Exts/Heap.hs:115:18)\r\n |\r\n119 | let nelems = (I# (sizeofByteArray# dat)) `div` wORD_SIZE\r\n | ^^^\r\n\r\nlibraries/ghc-heap/GHC/Exts/Heap.hs:121:47: error:\r\n • Couldn't match expected type ‘ByteArray#’\r\n with actual type ‘Array# b0’\r\n • In the first argument of ‘indexWordArray#’, namely ‘dat’\r\n In the first argument of ‘W#’, namely ‘(indexWordArray# dat i)’\r\n In the expression: W# (indexWordArray# dat i)\r\n • Relevant bindings include\r\n dat :: Array# b0\r\n (bound at libraries/ghc-heap/GHC/Exts/Heap.hs:115:18)\r\n |\r\n121 | rawWds = [W# (indexWordArray# dat i) | I# i <- [0.. end] ]\r\n | ^^^\r\n\r\nlibraries/ghc-heap/GHC/Exts/Heap.hs:122:43: error:\r\n • Couldn't match expected type ‘Array# a0’\r\n with actual type ‘ByteArray#’\r\n • In the first argument of ‘sizeofArray#’, namely ‘pointers’\r\n In the first argument of ‘I#’, namely ‘(sizeofArray# pointers)’\r\n In the expression: I# (sizeofArray# pointers)\r\n |\r\n122 | pelems = I# (sizeofArray# pointers)\r\n | ^^^^^^^^\r\n\r\nlibraries/ghc-heap/GHC/Exts/Heap.hs:123:67: error:\r\n • Couldn't match expected type ‘Array# Any’\r\n with actual type ‘ByteArray#’\r\n • In the fourth argument of ‘Array’, namely ‘pointers’\r\n In the second argument of ‘($)’, namely\r\n ‘Array 0 (pelems - 1) pelems pointers’\r\n In the expression: amap' Box $ Array 0 (pelems - 1) pelems pointers\r\n |\r\n123 | ptrList = amap' Box $ Array 0 (pelems - 1) pelems pointers\r\n | ^^^^^^^^\r\nlibraries/ghc-heap/ghc.mk:3: recipe for target 'libraries/ghc-heap/dist-boot/build/GHC/Exts/Heap.o' failed\r\nmake[1]: *** [libraries/ghc-heap/dist-boot/build/GHC/Exts/Heap.o] Error 1\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15083cannot install GHC on CentOS2019-07-07T18:14:20Zkbrowncannot install GHC on CentOSThis is the information of my system:
```
> cat /etc/*release
CentOS Linux release 7.4.1708 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0...This is the information of my system:
```
> cat /etc/*release
CentOS Linux release 7.4.1708 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
>cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 79
model name : Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz
stepping : 1
microcode : 0xb000025
cpu MHz : 1200.035
cache size : 20480 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 8
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 20
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb cat_l3 cdp_l3 invpcid_single intel_pt spec_ctrl ibpb_support tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdt_a rdseed adx smap xsaveopt cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts
bogomips : 4200.32
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
```
I want to build a Stack project on this system, but I receive an "impossible" error even when I try to build a trivial project.
```
>wget https://www.stackage.org/stack/linux-x86_64-static
>tar -xzf linux-x86_64-static
> cp stack-1.6.5-linux-x86_64-static/stack .local/bin/
> stack new stacktest
Downloading template "new-template" to create project "stacktest" in stacktest/ ...
The following parameters were needed by the template but not provided: author-email, author-name, category, copyright, github-username
You can provide them in /home/users/ksb/.stack/config.yaml, like this:
templates:
params:
author-email: value
author-name: value
category: value
copyright: value
github-username: value
Or you can pass each one as parameters like this:
stack new stacktest new-template -p "author-email:value" -p "author-name:value" -p "category:value" -p "copyright:value" -p "github-username:value"
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- stacktest/
Selecting the best among 13 snapshots...
* Matches lts-11.6
Selected resolver: lts-11.6
Initialising configuration using resolver: lts-11.6
Total number of user packages considered: 1
Writing configuration to file: stacktest/stack.yaml
All done.
> stack build
[1 of 2] Compiling Main ( /home/users/ksb/.stack/setup-exe-src/setup-mPHDZzAJ.hs, /home/users/ksb/.stack/setup-exe-src/setup-mPHDZzAJ.o )
ghc: panic! (the 'impossible' happened)
(GHC version 8.2.2 for x86_64-unknown-linux):
toStgWord: Unknown platformWordSize: 0
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
-- While building simple Setup.hs using:
/home/users/ksb/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc -rtsopts -threaded -clear-package-db -global-package-db -hide-all-packages -package base -main-is StackSetupShim.mainOverride -package Cabal-2.0.1.0 /home/users/ksb/.stack/setup-exe-src/setup-mPHDZzAJ.hs /home/users/ksb/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs -o /home/users/ksb/.stack/setup-exe-cache/x86_64-linux/tmp-Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2
Process exited with code: ExitFailure 1
```
Can you help me identify why this build failed?8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15040DTrace enabled GHC does not work as a bootstrap compiler on FreeBSD2019-07-07T18:14:36ZraichooDTrace enabled GHC does not work as a bootstrap compiler on FreeBSDGHC 8.4.1 enables DTrace probes on FreeBSD. This currently causes issues with the using such compilers as a bootstrap compiler for building GHC itself due to the way linking of the RTS is handled. I didn't encounter any issues regarding ...GHC 8.4.1 enables DTrace probes on FreeBSD. This currently causes issues with the using such compilers as a bootstrap compiler for building GHC itself due to the way linking of the RTS is handled. I didn't encounter any issues regarding daily use on FreeBSD but suspect it might cause problems with user defined hooks.
Current workaround is to build a version of GHC with DTrace disabled and use that as a bootstrap compiler.
A patch has been merged into HEAD. I've already tested it in combination with 8.4.2-rc1 and it worked fine.
https://phabricator.haskell.org/rGHC4b831c27926d643b0b6fad82c1e946d05cde8645
I have an idea on how to fix this but haven't had the time to put that plan into action.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.4.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Build System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"DTrace enabled GHC does not work as a bootstrap compiler on FreeBSD","status":"New","operating_system":"","component":"Build System","related":[],"milestone":"8.4.2","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.1","keywords":["dtrace"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"GHC 8.4.1 enables DTrace probes on FreeBSD. This currently causes issues with the using such compilers as a bootstrap compiler for building GHC itself due to the way linking of the RTS is handled. I didn't encounter any issues regarding daily use on FreeBSD but suspect it might cause problems with user defined hooks.\r\n\r\nCurrent workaround is to build a version of GHC with DTrace disabled and use that as a bootstrap compiler.\r\n\r\nA patch has been merged into HEAD. I've already tested it in combination with 8.4.2-rc1 and it worked fine.\r\n\r\nhttps://phabricator.haskell.org/rGHC4b831c27926d643b0b6fad82c1e946d05cde8645\r\n\r\nI have an idea on how to fix this but haven't had the time to put that plan into action.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/14945Compiling error related to rts/Stats.c2019-07-07T18:14:56ZCheng ShaoCompiling error related to rts/Stats.cI'm receiving the following error message when compiling ghcHEAD:
```
"inplace/bin/ghc-stage1" -optc-fno-stack-protector -optc-Wall -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -...I'm receiving the following error message when compiling ghcHEAD:
```
"inplace/bin/ghc-stage1" -optc-fno-stack-protector -optc-Wall -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-Wpointer-arith -optc-Wmissing-noreturn -optc-Wnested-externs -optc-Wredundant-decls -optc-Wundef -optc-Iincludes -optc-Iincludes/dist -optc-Iincludes/dist-derivedconstants/header -optc-Iincludes/dist-ghcconstants/header -optc-Irts -optc-Irts/dist/build -optc-DCOMPILING_RTS -optc-fno-strict-aliasing -optc-fno-common -optc-Irts/dist/build/./autogen -optc-Werror=unused-but-set-variable -optc-Wno-error=inline -optc-O2 -optc-fomit-frame-pointer -optc-g -optc-DRtsWay=\"rts_p\" -optc-ffunction-sections -optc-fdata-sections -static -prof -eventlog -H32m -O -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -this-unit-id rts -dcmm-lint -i -irts -irts/dist/build -Irts/dist/build -irts/dist/build/./autogen -Irts/dist/build/./autogen -O2 -Wcpp-undef -Wnoncanonical-monad-instances -c rts/Stats.c -o rts/dist/build/Stats.p_o
rts/Stats.c: In function 'report_summary':
rts/Stats.c:741:39: error:
error: 'RTSSummaryStats {aka const struct RTSSummaryStats_}' has no member named 'rc_cpu_ns'; did you mean 'rp_cpu_ns'?
TimeToSecondsDbl(sum->rc_cpu_ns),
^
|
741 | TimeToSecondsDbl(sum->rc_cpu_ns),
| ^
rts/Stats.c:29:39: error:
note: in definition of macro 'TimeToSecondsDbl'
#define TimeToSecondsDbl(t) ((double)(t) / TIME_RESOLUTION)
^
|
29 | #define TimeToSecondsDbl(t) ((double)(t) / TIME_RESOLUTION)
| ^
rts/Stats.c:742:39: error:
error: 'RTSSummaryStats {aka const struct RTSSummaryStats_}' has no member named 'rc_elapsed_ns'; did you mean 'rp_elapsed_ns'?
TimeToSecondsDbl(sum->rc_elapsed_ns));
^
|
742 | TimeToSecondsDbl(sum->rc_elapsed_ns));
| ^
rts/Stats.c:29:39: error:
note: in definition of macro 'TimeToSecondsDbl'
#define TimeToSecondsDbl(t) ((double)(t) / TIME_RESOLUTION)
^
|
29 | #define TimeToSecondsDbl(t) ((double)(t) / TIME_RESOLUTION)
| ^
rts/Stats.c: In function 'report_machine_readable':
rts/Stats.c:904:58: error:
error: 'RTSSummaryStats {aka const struct RTSSummaryStats_}' has no member named 'hp_cpu_ns'; did you mean 'rp_cpu_ns'?
MR_STAT("hc_cpu_seconds", "f", TimeToSecondsDbl(sum->hp_cpu_ns));
^
|
904 | MR_STAT("hc_cpu_seconds", "f", TimeToSecondsDbl(sum->hp_cpu_ns));
| ^
rts/Stats.c:867:62: error:
note: in definition of macro 'MR_STAT'
statsPrintf(" ,(\"" field_name "\", \"%" format "\")\n", value)
^~~~~
|
867 | statsPrintf(" ,(\"" field_name "\", \"%" format "\")\n", value)
| ^
rts/Stats.c:904:36: error:
note: in expansion of macro 'TimeToSecondsDbl'
MR_STAT("hc_cpu_seconds", "f", TimeToSecondsDbl(sum->hp_cpu_ns));
^~~~~~~~~~~~~~~~
|
904 | MR_STAT("hc_cpu_seconds", "f", TimeToSecondsDbl(sum->hp_cpu_ns));
| ^
rts/Stats.c:905:59: error:
error: 'RTSSummaryStats {aka const struct RTSSummaryStats_}' has no member named 'hp_elapsed_ns'; did you mean 'rp_elapsed_ns'?
MR_STAT("hc_wall_seconds", "f", TimeToSecondsDbl(sum->hp_elapsed_ns));
^
|
905 | MR_STAT("hc_wall_seconds", "f", TimeToSecondsDbl(sum->hp_elapsed_ns));
| ^
rts/Stats.c:867:62: error:
note: in definition of macro 'MR_STAT'
statsPrintf(" ,(\"" field_name "\", \"%" format "\")\n", value)
^~~~~
|
867 | statsPrintf(" ,(\"" field_name "\", \"%" format "\")\n", value)
| ^
rts/Stats.c:905:37: error:
note: in expansion of macro 'TimeToSecondsDbl'
MR_STAT("hc_wall_seconds", "f", TimeToSecondsDbl(sum->hp_elapsed_ns));
^~~~~~~~~~~~~~~~
|
905 | MR_STAT("hc_wall_seconds", "f", TimeToSecondsDbl(sum->hp_elapsed_ns));
| ^
`cc' failed in phase `C Compiler'. (Exit code: 1)
make[1]: *** [rts/ghc.mk:295: rts/dist/build/Stats.p_o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:127: all] Error 2
builder for '/nix/store/qvidsmhk6a1a1h96q85dx1dalgqgph4l-ghc-8.5.20180319.drv' failed with exit code 2
error: build of '/nix/store/qvidsmhk6a1a1h96q85dx1dalgqgph4l-ghc-8.5.20180319.drv' failed
```
I suspect it's related to the recent commit 2d4bda2e4ac68816baba0afab00da6f769ea75a7. Currently compiling the previous revision to confirm. Has anyone confirmed similar error in another environment?
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Build System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Compiling error related to rts/Stats.c","status":"New","operating_system":"","component":"Build System","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.5","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I'm receiving the following error message when compiling ghcHEAD:\r\n\r\n{{{\r\n\"inplace/bin/ghc-stage1\" -optc-fno-stack-protector -optc-Wall -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-Wpointer-arith -optc-Wmissing-noreturn -optc-Wnested-externs -optc-Wredundant-decls -optc-Wundef -optc-Iincludes -optc-Iincludes/dist -optc-Iincludes/dist-derivedconstants/header -optc-Iincludes/dist-ghcconstants/header -optc-Irts -optc-Irts/dist/build -optc-DCOMPILING_RTS -optc-fno-strict-aliasing -optc-fno-common -optc-Irts/dist/build/./autogen -optc-Werror=unused-but-set-variable -optc-Wno-error=inline -optc-O2 -optc-fomit-frame-pointer -optc-g -optc-DRtsWay=\\\"rts_p\\\" -optc-ffunction-sections -optc-fdata-sections -static -prof -eventlog -H32m -O -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -this-unit-id rts -dcmm-lint -i -irts -irts/dist/build -Irts/dist/build -irts/dist/build/./autogen -Irts/dist/build/./autogen -O2 -Wcpp-undef -Wnoncanonical-monad-instances -c rts/Stats.c -o rts/dist/build/Stats.p_o\r\nrts/Stats.c: In function 'report_summary':\r\n\r\nrts/Stats.c:741:39: error:\r\n error: 'RTSSummaryStats {aka const struct RTSSummaryStats_}' has no member named 'rc_cpu_ns'; did you mean 'rp_cpu_ns'?\r\n TimeToSecondsDbl(sum->rc_cpu_ns),\r\n ^\r\n |\r\n741 | TimeToSecondsDbl(sum->rc_cpu_ns),\r\n | ^\r\n\r\nrts/Stats.c:29:39: error:\r\n note: in definition of macro 'TimeToSecondsDbl'\r\n #define TimeToSecondsDbl(t) ((double)(t) / TIME_RESOLUTION)\r\n ^\r\n |\r\n29 | #define TimeToSecondsDbl(t) ((double)(t) / TIME_RESOLUTION)\r\n | ^\r\n\r\nrts/Stats.c:742:39: error:\r\n error: 'RTSSummaryStats {aka const struct RTSSummaryStats_}' has no member named 'rc_elapsed_ns'; did you mean 'rp_elapsed_ns'?\r\n TimeToSecondsDbl(sum->rc_elapsed_ns));\r\n ^\r\n |\r\n742 | TimeToSecondsDbl(sum->rc_elapsed_ns));\r\n | ^\r\n\r\nrts/Stats.c:29:39: error:\r\n note: in definition of macro 'TimeToSecondsDbl'\r\n #define TimeToSecondsDbl(t) ((double)(t) / TIME_RESOLUTION)\r\n ^\r\n |\r\n29 | #define TimeToSecondsDbl(t) ((double)(t) / TIME_RESOLUTION)\r\n | ^\r\nrts/Stats.c: In function 'report_machine_readable':\r\n\r\nrts/Stats.c:904:58: error:\r\n error: 'RTSSummaryStats {aka const struct RTSSummaryStats_}' has no member named 'hp_cpu_ns'; did you mean 'rp_cpu_ns'?\r\n MR_STAT(\"hc_cpu_seconds\", \"f\", TimeToSecondsDbl(sum->hp_cpu_ns));\r\n ^\r\n |\r\n904 | MR_STAT(\"hc_cpu_seconds\", \"f\", TimeToSecondsDbl(sum->hp_cpu_ns));\r\n | ^\r\n\r\nrts/Stats.c:867:62: error:\r\n note: in definition of macro 'MR_STAT'\r\n statsPrintf(\" ,(\\\"\" field_name \"\\\", \\\"%\" format \"\\\")\\n\", value)\r\n ^~~~~\r\n |\r\n867 | statsPrintf(\" ,(\\\"\" field_name \"\\\", \\\"%\" format \"\\\")\\n\", value)\r\n | ^\r\n\r\nrts/Stats.c:904:36: error:\r\n note: in expansion of macro 'TimeToSecondsDbl'\r\n MR_STAT(\"hc_cpu_seconds\", \"f\", TimeToSecondsDbl(sum->hp_cpu_ns));\r\n ^~~~~~~~~~~~~~~~\r\n |\r\n904 | MR_STAT(\"hc_cpu_seconds\", \"f\", TimeToSecondsDbl(sum->hp_cpu_ns));\r\n | ^\r\n\r\nrts/Stats.c:905:59: error:\r\n error: 'RTSSummaryStats {aka const struct RTSSummaryStats_}' has no member named 'hp_elapsed_ns'; did you mean 'rp_elapsed_ns'?\r\n MR_STAT(\"hc_wall_seconds\", \"f\", TimeToSecondsDbl(sum->hp_elapsed_ns));\r\n ^\r\n |\r\n905 | MR_STAT(\"hc_wall_seconds\", \"f\", TimeToSecondsDbl(sum->hp_elapsed_ns));\r\n | ^\r\n\r\nrts/Stats.c:867:62: error:\r\n note: in definition of macro 'MR_STAT'\r\n statsPrintf(\" ,(\\\"\" field_name \"\\\", \\\"%\" format \"\\\")\\n\", value)\r\n ^~~~~\r\n |\r\n867 | statsPrintf(\" ,(\\\"\" field_name \"\\\", \\\"%\" format \"\\\")\\n\", value)\r\n | ^\r\n\r\nrts/Stats.c:905:37: error:\r\n note: in expansion of macro 'TimeToSecondsDbl'\r\n MR_STAT(\"hc_wall_seconds\", \"f\", TimeToSecondsDbl(sum->hp_elapsed_ns));\r\n ^~~~~~~~~~~~~~~~\r\n |\r\n905 | MR_STAT(\"hc_wall_seconds\", \"f\", TimeToSecondsDbl(sum->hp_elapsed_ns));\r\n | ^\r\n`cc' failed in phase `C Compiler'. (Exit code: 1)\r\nmake[1]: *** [rts/ghc.mk:295: rts/dist/build/Stats.p_o] Error 1\r\nmake[1]: *** Waiting for unfinished jobs....\r\nmake: *** [Makefile:127: all] Error 2\r\nbuilder for '/nix/store/qvidsmhk6a1a1h96q85dx1dalgqgph4l-ghc-8.5.20180319.drv' failed with exit code 2\r\nerror: build of '/nix/store/qvidsmhk6a1a1h96q85dx1dalgqgph4l-ghc-8.5.20180319.drv' failed\r\n}}}\r\n\r\n\r\nI suspect it's related to the recent commit 2d4bda2e4ac68816baba0afab00da6f769ea75a7. Currently compiling the previous revision to confirm. Has anyone confirmed similar error in another environment?","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/14807GHC does not pass -dstg-lint2019-07-07T18:15:30ZSergey VinokurovGHC does not pass -dstg-lintWhen building ghc-8.4 branch with -dstg-lint enabled I got a GHC panic error (please see attachment for full log as it's really big). The error is reproducible on Windows and Debian Linux 64 bit operating systems.
Short error:
```
"inp...When building ghc-8.4 branch with -dstg-lint enabled I got a GHC panic error (please see attachment for full log as it's really big). The error is reproducible on Windows and Debian Linux 64 bit operating systems.
Short error:
```
"inplace/bin/ghc-stage1" -hisuf hi -osuf o -hcsuf hc -static -O -H64m -Wall -this-unit-id ghc-prim-0.5.2.0 -hide-all-packages -i -ilibraries/ghc-prim/. -ilibraries/ghc-prim/dist-install/build -Ilibraries/ghc-prim/dist-install/build -ilibraries/ghc-prim/dist-install/build/./autogen -Ilibraries/ghc-prim/dist-install/build/./autogen -Ilibraries/ghc-prim/. -optP-include -optPlibraries/ghc-prim/dist-install/build/./autogen/cabal_macros.h -package-id rts -this-unit-id ghc-prim -XHaskell2010 -O -dcore-lint -dstg-lint -dcmm-lint -no-user-package-db -rtsopts -Wno-trustworthy-safe -Wno-deprecated-flags -Wnoncanonical-monad-instances -odir libraries/ghc-prim/dist-install/build -hidir libraries/ghc-prim/dist-install/build -stubdir libraries/ghc-prim/dist-install/build -dynamic-too -c libraries/ghc-prim/./GHC/Types.hs -o libraries/ghc-prim/dist-install/build/GHC/Types.o -dyno libraries/ghc-prim/dist-install/build/GHC/Types.dyn_o
ghc-stage1: panic! (the 'impossible' happened)
(GHC version 8.4.0.20180204 for x86_64-unknown-linux):
*** Stg Lint ErrMsgs: in Unarise ***
<no location info>: warning:
[in body of lambda with binders v_s9Xn :: (a_12 :: k0_10)
~~ (b_13 :: k1_11)]
In some algebraic case alternative, number of arguments doesn't match constructor:
Eq# (arity 1)
[]
<no location info>: warning:
[in body of lambda with binders v_s9Xp :: Coercible a_11 b_12]
In some algebraic case alternative, number of arguments doesn't match constructor:
MkCoercible (arity 1)
[]
*** Offending Program ***
... lots of lines skipped ...
*** End of Offense ***
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1150:37 in ghc:Outputable
pprPanic, called at compiler/stgSyn/StgLint.hs:68:19 in ghc:StgLint
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
libraries/ghc-prim/ghc.mk:4: recipe for target 'libraries/ghc-prim/dist-install/build/GHC/Types.o' failed
```
As a side note, it seems that it would be good to enable `-dstg-lint` and `-dcmm-lint` in `devel2` flavour, and possibly some other flavours, or at least on CI, so that they will be tested more frequently.8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/14312Head does not build on Windows with the default make config.2019-07-07T18:17:31ZAndreas KlebingerHead does not build on Windows with the default make config.Cloning head and just running:
```
./boot
./configure --enable-tarballs-autodownload
make
```
Fails since at least two weeks and still does as of a4ee28978acbcf68da9dfb6f198cb6e1ff38ccca
The main issue is the directory library fails t...Cloning head and just running:
```
./boot
./configure --enable-tarballs-autodownload
make
```
Fails since at least two weeks and still does as of a4ee28978acbcf68da9dfb6f198cb6e1ff38ccca
The main issue is the directory library fails to build.
Creating a build.mk file and setting the Flavour to quick GHC does build as expected.
What triggers the failure seems to be the windows.h file created by the directory library which in some way includes itself in a loop until the preprocessor/c-compiler gives up.
Renaming the file locally seems to be a viable workaround.
I used https://github.com/Mistuke/GhcDevelChoco to set up a build environment and it happens on both my machines so doesn't seem to be a fluke.8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/13471segmentation fault by compiling GHC2021-01-09T19:04:54Zvantosegmentation fault by compiling GHCHi,\\\\
I tried to compile GHC on my computer.\\\\
by compiling GHC under Linux I got this error message.\\\\
```
compiler/ghc.mk:588: recipe for target 'compiler/stage2/build/DynFlags.o' failed
make[1]: *** [compiler/stage2/build/DynFl...Hi,\\\\
I tried to compile GHC on my computer.\\\\
by compiling GHC under Linux I got this error message.\\\\
```
compiler/ghc.mk:588: recipe for target 'compiler/stage2/build/DynFlags.o' failed
make[1]: *** [compiler/stage2/build/DynFlags.o] segmentation fault
Makefile:122: recipe for target 'install' failed
make: *** [install] Error 2
```
on my computer Linux runs on VirtualBox.\\\\
the problem is probably with my hardware but as I know nothing I tell you this issue.\\\\
```
~/ghc/inplace/bin$ /ghc-stage1 --version
The Glorious Glasgow Haskell Compilation System, version 8.3.20170322
```
Hope this help\\\\
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.0.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Build System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"segmentation fault by compiling GHC","status":"New","operating_system":"","component":"Build System","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Hi,\\\\\r\nI tried to compile GHC on my computer.\\\\\r\nby compiling GHC under Linux I got this error message.\\\\\r\n\r\n{{{\r\ncompiler/ghc.mk:588: recipe for target 'compiler/stage2/build/DynFlags.o' failed\r\nmake[1]: *** [compiler/stage2/build/DynFlags.o] segmentation fault\r\nMakefile:122: recipe for target 'install' failed\r\nmake: *** [install] Error 2\r\n}}}\r\non my computer Linux runs on VirtualBox.\\\\\r\nthe problem is probably with my hardware but as I know nothing I tell you this issue.\\\\\r\n\r\n{{{\r\n~/ghc/inplace/bin$ /ghc-stage1 --version\r\nThe Glorious Glasgow Haskell Compilation System, version 8.3.20170322\r\n}}}\r\nHope this help\\\\\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/13378LLVM backend doesn't support MacOS dead code stripping2019-07-07T18:22:12ZMoritz AngermannLLVM backend doesn't support MacOS dead code strippingBuilding recent HEAD (e.g. 669333d8) with llvm via quick-llvm fails.
The stage2 compiler is broken.
Building the compiler with quick-llvm
```
"inplace/bin/ghc-stage1" -o ghc/stage2/build/tmp/ghc-stage2 -hisuf dyn_hi -osuf dyn_o -hcsu...Building recent HEAD (e.g. 669333d8) with llvm via quick-llvm fails.
The stage2 compiler is broken.
Building the compiler with quick-llvm
```
"inplace/bin/ghc-stage1" -o ghc/stage2/build/tmp/ghc-stage2 -hisuf dyn_hi -osuf dyn_o -hcsuf dyn_hc -fPIC -dynamic -O0 -H64m -fllvm -Wall -hide-all-packages -i -ighc/. -ighc/stage2/build -Ighc/stage2/build -ighc/stage2/build/ghc/autogen -Ighc/stage2/build/ghc/autogen -optP-DGHCI -optP-include -optPghc/stage2/build/ghc/autogen/cabal_macros.h -package-id base-4.10.0.0 -package-id array-0.5.1.2 -package-id bytestring-0.10.8.2 -package-id directory-1.3.0.2 -package-id process-1.4.3.0 -package-id filepath-1.4.1.1 -package-id ghc-boot-8.1 -package-id ghc-8.1 -package-id unix-2.7.2.1 -package-id containers-0.5.10.2 -package-id deepseq-1.4.3.0 -package-id ghci-8.1 -package-id haskeline-0.7.3.0 -package-id time-1.8 -package-id transformers-0.5.2.0 -Wall -fno-warn-name-shadowing -XHaskell2010 -O0 -no-hs-main -threaded -no-user-package-db -rtsopts -Wnoncanonical-monad-instances -odir ghc/stage2/build -hidir ghc/stage2/build -stubdir ghc/stage2/build -optl-optl-Wl,-arch -optl-optl-Wl,x86_64 -fPIC -dynamic -O0 -H64m -fllvm -Wall -hide-all-packages -i -ighc/. -ighc/stage2/build -Ighc/stage2/build -ighc/stage2/build/ghc/autogen -Ighc/stage2/build/ghc/autogen -optP-DGHCI -optP-include -optPghc/stage2/build/ghc/autogen/cabal_macros.h -package-id base-4.10.0.0 -package-id array-0.5.1.2 -package-id bytestring-0.10.8.2 -package-id directory-1.3.0.2 -package-id process-1.4.3.0 -package-id filepath-1.4.1.1 -package-id ghc-boot-8.1 -package-id ghc-8.1 -package-id unix-2.7.2.1 -package-id containers-0.5.10.2 -package-id deepseq-1.4.3.0 -package-id ghci-8.1 -package-id haskeline-0.7.3.0 -package-id time-1.8 -package-id transformers-0.5.2.0 -Wall -fno-warn-name-shadowing -XHaskell2010 -O0 -no-hs-main -threaded -no-user-package-db -rtsopts -Wnoncanonical-monad-instances -fno-use-rpaths -optl-Wl,-rpath -optl-Wl,'@loader_path/../haskeline-0.7.3.0' -optl-Wl,-rpath -optl-Wl,'@loader_path/../ghc-8.1' -optl-Wl,-rpath -optl-Wl,'@loader_path/../terminfo-0.4.0.2' -optl-Wl,-rpath -optl-Wl,'@loader_path/../hoopl-3.10.2.2' -optl-Wl,-rpath -optl-Wl,'@loader_path/../ghci-8.1' -optl-Wl,-rpath -optl-Wl,'@loader_path/../ghc-boot-8.1' -optl-Wl,-rpath -optl-Wl,'@loader_path/../transformers-0.5.2.0' -optl-Wl,-rpath -optl-Wl,'@loader_path/../hpc-0.6.0.3' -optl-Wl,-rpath -optl-Wl,'@loader_path/../template-haskell-2.12.0.0' -optl-Wl,-rpath -optl-Wl,'@loader_path/../pretty-1.1.3.3' -optl-Wl,-rpath -optl-Wl,'@loader_path/../ghc-boot-th-8.1' -optl-Wl,-rpath -optl-Wl,'@loader_path/../process-1.4.3.0' -optl-Wl,-rpath-optl-Wl,'@loader_path/../directory-1.3.0.2' -optl-Wl,-rpath -optl-Wl,'@loader_path/../unix-2.7.2.1' -optl-Wl,-rpath -optl-Wl,'@loader_path/../filepath-1.4.1.1' -optl-Wl,-rpath -optl-Wl,'@loader_path/../time-1.8' -optl-Wl,-rpath -optl-Wl,'@loader_path/../binary-0.8.4.1' -optl-Wl,-rpath -optl-Wl,'@loader_path/../containers-0.5.10.2' -optl-Wl,-rpath -optl-Wl,'@loader_path/../bytestring-0.10.8.2' -optl-Wl,-rpath -optl-Wl,'@loader_path/../deepseq-1.4.3.0' -optl-Wl,-rpath -optl-Wl,'@loader_path/../array-0.5.1.2' -optl-Wl,-rpath -optl-Wl,'@loader_path/../base-4.10.0.0' -optl-Wl,-rpath -optl-Wl,'@loader_path/../integer-gmp-1.0.0.1' -optl-Wl,-rpath -optl-Wl,'@loader_path/../ghc-prim-0.5.0.0' -optl-Wl,-rpath -optl-Wl,'@loader_path/../rts' ghc/stage2/build/Main.dyn_o ghc/stage2/build/GHCi/UI.dyn_o ghc/stage2/build/GHCi/UI/Info.dyn_o ghc/stage2/build/GHCi/UI/Monad.dyn_o ghc/stage2/build/GHCi/UI/Tags.dyn_o ghc/stage2/build/hschooks.dyn_o
Warning: -rtsopts and -with-rtsopts have no effect with -no-hs-main.
Call hs_init_ghc() from your main() function to set these options.
/usr/bin/install -c -m 755 ghc/stage2/build/tmp/ghc-stage2 inplace/lib/bin/ghc-stage2
"rm" -f inplace/bin/ghc-stage2
echo '#!/bin/sh' >> inplace/bin/ghc-stage2
echo 'executablename="/ghc/inplace/lib/bin/ghc-stage2"' >> inplace/bin/ghc-stage2
echo 'datadir="/ghc/inplace/lib"' >> inplace/bin/ghc-stage2
echo 'bindir="/ghc/inplace/bin"' >> inplace/bin/ghc-stage2
echo 'topdir="/ghc/inplace/lib"' >> inplace/bin/ghc-stage2
echo 'pgmgcc="gcc"' >> inplace/bin/ghc-stage2
echo 'export DYLD_LIBRARY_PATH="/ghc/libraries/haskeline/dist-install/build:/ghc/compiler/stage2/build:/ghc/libraries/terminfo/dist-install/build:/ghc/libraries/hoopl/dist-install/build:/ghc/libraries/ghci/dist-install/build:/ghc/libraries/ghc-boot/dist-install/build:/ghc/libraries/transformers/dist-install/build:/ghc/libraries/hpc/dist-install/build:/ghc/libraries/template-haskell/dist-install/build:/ghc/libraries/pretty/dist-install/build:/ghc/libraries/ghc-boot-th/dist-install/build:/ghc/libraries/process/dist-install/build:/ghc/libraries/directory/dist-install/build:/ghc/libraries/unix/dist-install/build:/ghc/libraries/filepath/dist-install/build:/ghc/libraries/time/dist-install/build:/ghc/libraries/binary/dist-install/build:/ghc/libraries/containers/dist-install/build:/ghc/libraries/bytestring/dist-install/build:/ghc/libraries/deepseq/dist-install/build:/ghc/libraries/array/dist-install/build:/ghc/libraries/base/dist-install/build:/ghc/libraries/integer-gmp/dist-install/build:/ghc/libraries/ghc-prim/dist-install/build:/ghc/rts/dist/build${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}"' >> inplace/bin/ghc-stage2
cat ghc/ghc.wrapper >> inplace/bin/ghc-stage2
chmod +x inplace/bin/ghc-stage2
"inplace/bin/ghc-stage2" -hisuf dyn_hi -osuf dyn_o -hcsuf dyn_hc -fPIC -dynamic -O0 -H64m -fllvm -Wall -hide-all-packages -i -iutils/ghctags/. -iutils/ghctags/dist-install/build -Iutils/ghctags/dist-install/build -iutils/ghctags/dist-install/build/ghctags/autogen -Iutils/ghctags/dist-install/build/ghctags/autogen -optP-include -optPutils/ghctags/dist-install/build/ghctags/autogen/cabal_macros.h -package-id base-4.10.0.0 -package-id containers-0.5.10.2 -package-id Cabal-2.0.0.0 -package-id ghc-8.1 -XHaskell2010 -no-user-package-db -rtsopts -Wnoncanonical-monad-instances -odir utils/ghctags/dist-install/build -hidir utils/ghctags/dist-install/build -stubdir utils/ghctags/dist-install/build -c utils/ghctags/./Main.hs -o utils/ghctags/dist-install/build/Main.dyn_o
"inplace/bin/ghc-stage2" -hisuf dyn_hi -osuf dyn_o -hcsuf dyn_hc -fPIC -dynamic -O0 -H64m -fllvm -Wall -hide-all-packages -i -iutils/check-api-annotations/. -iutils/check-api-annotations/dist-install/build -Iutils/check-api-annotations/dist-install/build -iutils/check-api-annotations/dist-install/build/check-api-annotations/autogen -Iutils/check-api-annotations/dist-install/build/check-api-annotations/autogen -optP-include -optPutils/check-api-annotations/dist-install/build/check-api-annotations/autogen/cabal_macros.h -package-id base-4.10.0.0 -package-id containers-0.5.10.2 -package-id Cabal-2.0.0.0 -package-id directory-1.3.0.2 -package-id ghc-8.1 -Wall -XHaskell2010 -no-user-package-db -rtsopts -Wnoncanonical-monad-instances -odir utils/check-api-annotations/dist-install/build -hidir utils/check-api-annotations/dist-install/build -stubdir utils/check-api-annotations/dist-install/build -c utils/check-api-annotations/./Main.hs -o utils/check-api-annotations/dist-install/build/Main.dyn_o
"inplace/bin/ghc-stage2" -hisuf dyn_hi -osuf dyn_o -hcsuf dyn_hc -fPIC -dynamic -O0 -H64m -fllvm -Wall -hide-all-packages -i -iutils/check-ppr/. -iutils/check-ppr/dist-install/build -Iutils/check-ppr/dist-install/build -iutils/check-ppr/dist-install/build/check-ppr/autogen -Iutils/check-ppr/dist-install/build/check-ppr/autogen -optP-include -optPutils/check-ppr/dist-install/build/check-ppr/autogen/cabal_macros.h -package-id base-4.10.0.0 -package-id bytestring-0.10.8.2 -package-id containers-0.5.10.2 -package-id Cabal-2.0.0.0 -package-id directory-1.3.0.2 -package-id filepath-1.4.1.1 -package-id ghc-8.1 -Wall -XHaskell2010 -no-user-package-db -rtsopts -Wnoncanonical-monad-instances -odir utils/check-ppr/dist-install/build -hidir utils/check-ppr/dist-install/build -stubdir utils/check-ppr/dist-install/build -c utils/check-ppr/./Main.hs -o utils/check-ppr/dist-install/build/Main.dyn_o
ghc-stage2: internal error: ghc-stage2: internal error: ghc-stage2: internal error: evacuate(static): strange closure type 0evacuate(static): strange closure type 0evacuate(static): strange closure type 0
(GHC version 8.1.20170304 for x86_64_apple_darwin)
(GHC version 8.1.20170304 for x86_64_apple_darwin)
(GHC version 8.1.20170304 for x86_64_apple_darwin)
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
make[1]: *** [utils/check-ppr/dist-install/build/Main.dyn_o] Abort trap: 6
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [utils/check-api-annotations/dist-install/build/Main.dyn_o] Abort trap: 6
make[1]: *** [utils/ghctags/dist-install/build/Main.dyn_o] Abort trap: 6
make: *** [all] Error 2
```
Building and linking against the debug rts, gives the following result in lldb.
```
(lldb) settings set -- target.run-args "+RTS" "-DS" "-Dl" "-Ds" "-RTS"
(lldb) run
Process 3546 launched: '/ghc/inplace/lib/bin/ghc-stage2' (x86_64)
7fffae4753c0: created capset 0 of type 2
7fffae4753c0: created capset 1 of type 3
7fffae4753c0: cap 0: initialised
7fffae4753c0: assigned cap 0 to capset 0
7fffae4753c0: assigned cap 0 to capset 1
7fffae4753c0: allocated 1 more capabilities
7fffae4753c0: new task (taskCount: 1)
7fffae4753c0: returning; I want capability 0
7fffae4753c0: resuming capability 0
7fffae4753c0: cap 0: created thread 1
7fffae4753c0: new bound thread (1)
7fffae4753c0: cap 0: schedule()
ghc-stage2: internal error: ASSERTION FAILED: file rts/sm/Sanity.c, line 88
(GHC version 8.1.20170304 for x86_64_apple_darwin)
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Process 3546 stopped
* thread #1: tid = 0x6df55a1, 0x00007fffa5756dd6 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x00007fffa5756dd6 libsystem_kernel.dylib`__pthread_kill + 10
libsystem_kernel.dylib`__pthread_kill:
-> 0x7fffa5756dd6 <+10>: jae 0x7fffa5756de0 ; <+20>
0x7fffa5756dd8 <+12>: movq %rax, %rdi
0x7fffa5756ddb <+15>: jmp 0x7fffa574fcdf ; cerror_nocancel
0x7fffa5756de0 <+20>: retq
(lldb) bt all
warning: could not load any Objective-C class information. This will significantly reduce the quality of type information available.
* thread #1: tid = 0x6df55a1, 0x00007fffa5756dd6 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
* frame #0: 0x00007fffa5756dd6 libsystem_kernel.dylib`__pthread_kill + 10
frame #1: 0x00007fffa5842787 libsystem_pthread.dylib`pthread_kill + 90
frame #2: 0x00007fffa56bc420 libsystem_c.dylib`abort + 129
frame #3: 0x0000000102d09e61 ghc-stage2`rtsFatalInternalErrorFn(s="ASSERTION FAILED: file %s, line %u\n", ap=0x00007fff5fbfefe0) + 273 at RtsMessages.c:182
frame #4: 0x0000000102d0a16a ghc-stage2`barf(s="ASSERTION FAILED: file %s, line %u\n") + 346 at RtsMessages.c:46
frame #5: 0x0000000102d0a1a7 ghc-stage2`_assertFail(filename="rts/sm/Sanity.c", linenum=88) + 39 at RtsMessages.c:61
frame #6: 0x0000000102d3358e ghc-stage2`checkClosureShallow(p=0x0000000103412930) + 62 at Sanity.c:88
frame #7: 0x0000000102d31422 ghc-stage2`checkSmallBitmap(payload=0x0000000105c05368, bitmap=0, size=1) + 66 at Sanity.c:53
frame #8: 0x0000000102d31181 ghc-stage2`checkStackFrame(c=0x0000000105c05360) + 161 at Sanity.c:114
frame #9: 0x0000000102d3157b ghc-stage2`checkStackChunk(sp=0x0000000105c05360, stack_end=0x0000000105c05388) + 43 at Sanity.c:171
frame #10: 0x0000000102d321d4 ghc-stage2`checkSTACK(stack=0x0000000105c05000) + 116 at Sanity.c:515
frame #11: 0x0000000102d32154 ghc-stage2`checkTSO(tso=0x0000000105c05388) + 372 at Sanity.c:553
frame #12: 0x0000000102d10edd ghc-stage2`schedule(initialCapability=0x000000010353b640, task=0x0000000105900c30) + 461 at Schedule.c:323
frame #13: 0x0000000102d10b7b ghc-stage2`scheduleWaitThread(tso=0x0000000105c05388, ret=0x0000000000000000, pcap=0x00007fff5fbff328) + 203 at Schedule.c:2552
frame #14: 0x0000000102d06655 ghc-stage2`rts_evalIO(cap=0x00007fff5fbff328, p=0x0000000103412930, ret=0x0000000000000000) + 69 at RtsAPI.c:460
frame #15: 0x0000000102d46860 ghc-stage2`ioManagerStartCap(cap=0x00007fff5fbff328) + 32 at Signals.c:211
frame #16: 0x0000000102d4689e ghc-stage2`ioManagerStart + 46 at Signals.c:221
frame #17: 0x0000000102d0a9cb ghc-stage2`hs_init_ghc(argc=0x00007fff5fbff558, argv=0x00007fff5fbff550, rts_config=RtsConfig @ 0x00007fff5fbff4c0) + 843 at RtsStartup.c:290
frame #18: 0x0000000102d09c8a ghc-stage2`hs_main(argc=1, argv=0x00007fff5fbff690, main_closure=0x00000001030fd720, rts_config=RtsConfig @ 0x00007fff5fbff570) + 58 at RtsMain.c:51
frame #19: 0x00000001000c2b9c ghc-stage2`main + 188
frame #20: 0x00007fffa5628255 libdyld.dylib`start + 1
thread #2: tid = 0x6df560a, 0x00007fffa5756fda libsystem_kernel.dylib`__semwait_signal + 10
frame #0: 0x00007fffa5756fda libsystem_kernel.dylib`__semwait_signal + 10
frame #1: 0x00007fffa56ddb72 libsystem_c.dylib`nanosleep + 199
frame #2: 0x00007fffa56dda66 libsystem_c.dylib`usleep + 54
frame #3: 0x0000000102d45a02 ghc-stage2`itimer_thread_func(_handle_tick=0x0000000102d1dc00) + 82 at Pthread.c:132
frame #4: 0x00007fffa583faab libsystem_pthread.dylib`_pthread_body + 180
frame #5: 0x00007fffa583f9f7 libsystem_pthread.dylib`_pthread_start + 286
frame #6: 0x00007fffa583f1fd libsystem_pthread.dylib`thread_start + 13
(lldb) dis -s 0x0000000103412930
ghc-stage2`base_GHCziConcziIO_ensureIOManagerIsRunning_closure:
0x103412930 <+0>: andb %cl, %al
0x103412932 <+2>: wait
0x103412933 <+3>: addb (%rcx), %al
0x103412935 <+5>: addb %al, (%rax)
0x103412937 <+7>: addb %al, (%rax)
0x103412939 <+9>: addb %al, (%rax)
0x10341293b <+11>: addb %al, (%rax)
0x10341293d <+13>: addb %al, (%rax)
0x10341293f <+15>: addb %dl, -0x38(%rax)
ghc-stage2`base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure:
0x103412942 <+2>: wait
0x103412943 <+3>: addb (%rcx), %al
0x103412945 <+5>: addb %al, (%rax)
0x103412947 <+7>: addb %al, (%rax)
0x103412949 <+9>: addb %al, (%rax)
0x10341294b <+11>: addb %al, (%rax)
0x10341294d <+13>: addb %al, (%rax)
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------- |
| Version | |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | bgamari, rwbarton |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"ghc-stage2 broken for quick-llvm","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.2.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["bgamari","rwbarton"],"type":"Bug","description":"Building recent HEAD (e.g. 669333d8) with llvm via quick-llvm fails.\r\n\r\nThe stage2 compiler is broken.\r\n\r\nBuilding the compiler with quick-llvm\r\n{{{\r\n\"inplace/bin/ghc-stage1\" -o ghc/stage2/build/tmp/ghc-stage2 -hisuf dyn_hi -osuf dyn_o -hcsuf dyn_hc -fPIC -dynamic -O0 -H64m -fllvm -Wall -hide-all-packages -i -ighc/. -ighc/stage2/build -Ighc/stage2/build -ighc/stage2/build/ghc/autogen -Ighc/stage2/build/ghc/autogen -optP-DGHCI -optP-include -optPghc/stage2/build/ghc/autogen/cabal_macros.h -package-id base-4.10.0.0 -package-id array-0.5.1.2 -package-id bytestring-0.10.8.2 -package-id directory-1.3.0.2 -package-id process-1.4.3.0 -package-id filepath-1.4.1.1 -package-id ghc-boot-8.1 -package-id ghc-8.1 -package-id unix-2.7.2.1 -package-id containers-0.5.10.2 -package-id deepseq-1.4.3.0 -package-id ghci-8.1 -package-id haskeline-0.7.3.0 -package-id time-1.8 -package-id transformers-0.5.2.0 -Wall -fno-warn-name-shadowing -XHaskell2010 -O0 -no-hs-main -threaded -no-user-package-db -rtsopts -Wnoncanonical-monad-instances -odir ghc/stage2/build -hidir ghc/stage2/build -stubdir ghc/stage2/build -optl-optl-Wl,-arch -optl-optl-Wl,x86_64 -fPIC -dynamic -O0 -H64m -fllvm -Wall -hide-all-packages -i -ighc/. -ighc/stage2/build -Ighc/stage2/build -ighc/stage2/build/ghc/autogen -Ighc/stage2/build/ghc/autogen -optP-DGHCI -optP-include -optPghc/stage2/build/ghc/autogen/cabal_macros.h -package-id base-4.10.0.0 -package-id array-0.5.1.2 -package-id bytestring-0.10.8.2 -package-id directory-1.3.0.2 -package-id process-1.4.3.0 -package-id filepath-1.4.1.1 -package-id ghc-boot-8.1 -package-id ghc-8.1 -package-id unix-2.7.2.1 -package-id containers-0.5.10.2 -package-id deepseq-1.4.3.0 -package-id ghci-8.1 -package-id haskeline-0.7.3.0 -package-id time-1.8 -package-id transformers-0.5.2.0 -Wall -fno-warn-name-shadowing -XHaskell2010 -O0 -no-hs-main -threaded -no-user-package-db -rtsopts -Wnoncanonical-monad-instances -fno-use-rpaths -optl-Wl,-rpath -optl-Wl,'@loader_path/../haskeline-0.7.3.0' -optl-Wl,-rpath -optl-Wl,'@loader_path/../ghc-8.1' -optl-Wl,-rpath -optl-Wl,'@loader_path/../terminfo-0.4.0.2' -optl-Wl,-rpath -optl-Wl,'@loader_path/../hoopl-3.10.2.2' -optl-Wl,-rpath -optl-Wl,'@loader_path/../ghci-8.1' -optl-Wl,-rpath -optl-Wl,'@loader_path/../ghc-boot-8.1' -optl-Wl,-rpath -optl-Wl,'@loader_path/../transformers-0.5.2.0' -optl-Wl,-rpath -optl-Wl,'@loader_path/../hpc-0.6.0.3' -optl-Wl,-rpath -optl-Wl,'@loader_path/../template-haskell-2.12.0.0' -optl-Wl,-rpath -optl-Wl,'@loader_path/../pretty-1.1.3.3' -optl-Wl,-rpath -optl-Wl,'@loader_path/../ghc-boot-th-8.1' -optl-Wl,-rpath -optl-Wl,'@loader_path/../process-1.4.3.0' -optl-Wl,-rpath-optl-Wl,'@loader_path/../directory-1.3.0.2' -optl-Wl,-rpath -optl-Wl,'@loader_path/../unix-2.7.2.1' -optl-Wl,-rpath -optl-Wl,'@loader_path/../filepath-1.4.1.1' -optl-Wl,-rpath -optl-Wl,'@loader_path/../time-1.8' -optl-Wl,-rpath -optl-Wl,'@loader_path/../binary-0.8.4.1' -optl-Wl,-rpath -optl-Wl,'@loader_path/../containers-0.5.10.2' -optl-Wl,-rpath -optl-Wl,'@loader_path/../bytestring-0.10.8.2' -optl-Wl,-rpath -optl-Wl,'@loader_path/../deepseq-1.4.3.0' -optl-Wl,-rpath -optl-Wl,'@loader_path/../array-0.5.1.2' -optl-Wl,-rpath -optl-Wl,'@loader_path/../base-4.10.0.0' -optl-Wl,-rpath -optl-Wl,'@loader_path/../integer-gmp-1.0.0.1' -optl-Wl,-rpath -optl-Wl,'@loader_path/../ghc-prim-0.5.0.0' -optl-Wl,-rpath -optl-Wl,'@loader_path/../rts' ghc/stage2/build/Main.dyn_o ghc/stage2/build/GHCi/UI.dyn_o ghc/stage2/build/GHCi/UI/Info.dyn_o ghc/stage2/build/GHCi/UI/Monad.dyn_o ghc/stage2/build/GHCi/UI/Tags.dyn_o ghc/stage2/build/hschooks.dyn_o\r\nWarning: -rtsopts and -with-rtsopts have no effect with -no-hs-main.\r\n Call hs_init_ghc() from your main() function to set these options.\r\n/usr/bin/install -c -m 755 ghc/stage2/build/tmp/ghc-stage2 inplace/lib/bin/ghc-stage2\r\n\"rm\" -f inplace/bin/ghc-stage2\r\necho '#!/bin/sh' >> inplace/bin/ghc-stage2\r\necho 'executablename=\"/ghc/inplace/lib/bin/ghc-stage2\"' >> inplace/bin/ghc-stage2\r\necho 'datadir=\"/ghc/inplace/lib\"' >> inplace/bin/ghc-stage2\r\necho 'bindir=\"/ghc/inplace/bin\"' >> inplace/bin/ghc-stage2\r\necho 'topdir=\"/ghc/inplace/lib\"' >> inplace/bin/ghc-stage2\r\necho 'pgmgcc=\"gcc\"' >> inplace/bin/ghc-stage2\r\necho 'export DYLD_LIBRARY_PATH=\"/ghc/libraries/haskeline/dist-install/build:/ghc/compiler/stage2/build:/ghc/libraries/terminfo/dist-install/build:/ghc/libraries/hoopl/dist-install/build:/ghc/libraries/ghci/dist-install/build:/ghc/libraries/ghc-boot/dist-install/build:/ghc/libraries/transformers/dist-install/build:/ghc/libraries/hpc/dist-install/build:/ghc/libraries/template-haskell/dist-install/build:/ghc/libraries/pretty/dist-install/build:/ghc/libraries/ghc-boot-th/dist-install/build:/ghc/libraries/process/dist-install/build:/ghc/libraries/directory/dist-install/build:/ghc/libraries/unix/dist-install/build:/ghc/libraries/filepath/dist-install/build:/ghc/libraries/time/dist-install/build:/ghc/libraries/binary/dist-install/build:/ghc/libraries/containers/dist-install/build:/ghc/libraries/bytestring/dist-install/build:/ghc/libraries/deepseq/dist-install/build:/ghc/libraries/array/dist-install/build:/ghc/libraries/base/dist-install/build:/ghc/libraries/integer-gmp/dist-install/build:/ghc/libraries/ghc-prim/dist-install/build:/ghc/rts/dist/build${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}\"' >> inplace/bin/ghc-stage2\r\ncat ghc/ghc.wrapper >> inplace/bin/ghc-stage2\r\nchmod +x inplace/bin/ghc-stage2\r\n\"inplace/bin/ghc-stage2\" -hisuf dyn_hi -osuf dyn_o -hcsuf dyn_hc -fPIC -dynamic -O0 -H64m -fllvm -Wall -hide-all-packages -i -iutils/ghctags/. -iutils/ghctags/dist-install/build -Iutils/ghctags/dist-install/build -iutils/ghctags/dist-install/build/ghctags/autogen -Iutils/ghctags/dist-install/build/ghctags/autogen -optP-include -optPutils/ghctags/dist-install/build/ghctags/autogen/cabal_macros.h -package-id base-4.10.0.0 -package-id containers-0.5.10.2 -package-id Cabal-2.0.0.0 -package-id ghc-8.1 -XHaskell2010 -no-user-package-db -rtsopts -Wnoncanonical-monad-instances -odir utils/ghctags/dist-install/build -hidir utils/ghctags/dist-install/build -stubdir utils/ghctags/dist-install/build -c utils/ghctags/./Main.hs -o utils/ghctags/dist-install/build/Main.dyn_o\r\n\"inplace/bin/ghc-stage2\" -hisuf dyn_hi -osuf dyn_o -hcsuf dyn_hc -fPIC -dynamic -O0 -H64m -fllvm -Wall -hide-all-packages -i -iutils/check-api-annotations/. -iutils/check-api-annotations/dist-install/build -Iutils/check-api-annotations/dist-install/build -iutils/check-api-annotations/dist-install/build/check-api-annotations/autogen -Iutils/check-api-annotations/dist-install/build/check-api-annotations/autogen -optP-include -optPutils/check-api-annotations/dist-install/build/check-api-annotations/autogen/cabal_macros.h -package-id base-4.10.0.0 -package-id containers-0.5.10.2 -package-id Cabal-2.0.0.0 -package-id directory-1.3.0.2 -package-id ghc-8.1 -Wall -XHaskell2010 -no-user-package-db -rtsopts -Wnoncanonical-monad-instances -odir utils/check-api-annotations/dist-install/build -hidir utils/check-api-annotations/dist-install/build -stubdir utils/check-api-annotations/dist-install/build -c utils/check-api-annotations/./Main.hs -o utils/check-api-annotations/dist-install/build/Main.dyn_o\r\n\"inplace/bin/ghc-stage2\" -hisuf dyn_hi -osuf dyn_o -hcsuf dyn_hc -fPIC -dynamic -O0 -H64m -fllvm -Wall -hide-all-packages -i -iutils/check-ppr/. -iutils/check-ppr/dist-install/build -Iutils/check-ppr/dist-install/build -iutils/check-ppr/dist-install/build/check-ppr/autogen -Iutils/check-ppr/dist-install/build/check-ppr/autogen -optP-include -optPutils/check-ppr/dist-install/build/check-ppr/autogen/cabal_macros.h -package-id base-4.10.0.0 -package-id bytestring-0.10.8.2 -package-id containers-0.5.10.2 -package-id Cabal-2.0.0.0 -package-id directory-1.3.0.2 -package-id filepath-1.4.1.1 -package-id ghc-8.1 -Wall -XHaskell2010 -no-user-package-db -rtsopts -Wnoncanonical-monad-instances -odir utils/check-ppr/dist-install/build -hidir utils/check-ppr/dist-install/build -stubdir utils/check-ppr/dist-install/build -c utils/check-ppr/./Main.hs -o utils/check-ppr/dist-install/build/Main.dyn_o\r\nghc-stage2: internal error: ghc-stage2: internal error: ghc-stage2: internal error: evacuate(static): strange closure type 0evacuate(static): strange closure type 0evacuate(static): strange closure type 0\r\n (GHC version 8.1.20170304 for x86_64_apple_darwin)\r\n\r\n\r\n (GHC version 8.1.20170304 for x86_64_apple_darwin)\r\n (GHC version 8.1.20170304 for x86_64_apple_darwin)\r\n Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\nmake[1]: *** [utils/check-ppr/dist-install/build/Main.dyn_o] Abort trap: 6\r\nmake[1]: *** Waiting for unfinished jobs....\r\nmake[1]: *** [utils/check-api-annotations/dist-install/build/Main.dyn_o] Abort trap: 6\r\nmake[1]: *** [utils/ghctags/dist-install/build/Main.dyn_o] Abort trap: 6\r\nmake: *** [all] Error 2\r\n}}}\r\n\r\nBuilding and linking against the debug rts, gives the following result in lldb.\r\n\r\n{{{\r\n\r\n(lldb) settings set -- target.run-args \"+RTS\" \"-DS\" \"-Dl\" \"-Ds\" \"-RTS\"\r\n(lldb) run\r\nProcess 3546 launched: '/ghc/inplace/lib/bin/ghc-stage2' (x86_64)\r\n7fffae4753c0: created capset 0 of type 2\r\n7fffae4753c0: created capset 1 of type 3\r\n7fffae4753c0: cap 0: initialised\r\n7fffae4753c0: assigned cap 0 to capset 0\r\n7fffae4753c0: assigned cap 0 to capset 1\r\n7fffae4753c0: allocated 1 more capabilities\r\n7fffae4753c0: new task (taskCount: 1)\r\n7fffae4753c0: returning; I want capability 0\r\n7fffae4753c0: resuming capability 0\r\n7fffae4753c0: cap 0: created thread 1\r\n7fffae4753c0: new bound thread (1)\r\n7fffae4753c0: cap 0: schedule()\r\nghc-stage2: internal error: ASSERTION FAILED: file rts/sm/Sanity.c, line 88\r\n\r\n (GHC version 8.1.20170304 for x86_64_apple_darwin)\r\n Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\nProcess 3546 stopped\r\n* thread #1: tid = 0x6df55a1, 0x00007fffa5756dd6 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT\r\n frame #0: 0x00007fffa5756dd6 libsystem_kernel.dylib`__pthread_kill + 10\r\nlibsystem_kernel.dylib`__pthread_kill:\r\n-> 0x7fffa5756dd6 <+10>: jae 0x7fffa5756de0 ; <+20>\r\n 0x7fffa5756dd8 <+12>: movq %rax, %rdi\r\n 0x7fffa5756ddb <+15>: jmp 0x7fffa574fcdf ; cerror_nocancel\r\n 0x7fffa5756de0 <+20>: retq\r\n(lldb) bt all\r\nwarning: could not load any Objective-C class information. This will significantly reduce the quality of type information available.\r\n* thread #1: tid = 0x6df55a1, 0x00007fffa5756dd6 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT\r\n * frame #0: 0x00007fffa5756dd6 libsystem_kernel.dylib`__pthread_kill + 10\r\n frame #1: 0x00007fffa5842787 libsystem_pthread.dylib`pthread_kill + 90\r\n frame #2: 0x00007fffa56bc420 libsystem_c.dylib`abort + 129\r\n frame #3: 0x0000000102d09e61 ghc-stage2`rtsFatalInternalErrorFn(s=\"ASSERTION FAILED: file %s, line %u\\n\", ap=0x00007fff5fbfefe0) + 273 at RtsMessages.c:182\r\n frame #4: 0x0000000102d0a16a ghc-stage2`barf(s=\"ASSERTION FAILED: file %s, line %u\\n\") + 346 at RtsMessages.c:46\r\n frame #5: 0x0000000102d0a1a7 ghc-stage2`_assertFail(filename=\"rts/sm/Sanity.c\", linenum=88) + 39 at RtsMessages.c:61\r\n frame #6: 0x0000000102d3358e ghc-stage2`checkClosureShallow(p=0x0000000103412930) + 62 at Sanity.c:88\r\n frame #7: 0x0000000102d31422 ghc-stage2`checkSmallBitmap(payload=0x0000000105c05368, bitmap=0, size=1) + 66 at Sanity.c:53\r\n frame #8: 0x0000000102d31181 ghc-stage2`checkStackFrame(c=0x0000000105c05360) + 161 at Sanity.c:114\r\n frame #9: 0x0000000102d3157b ghc-stage2`checkStackChunk(sp=0x0000000105c05360, stack_end=0x0000000105c05388) + 43 at Sanity.c:171\r\n frame #10: 0x0000000102d321d4 ghc-stage2`checkSTACK(stack=0x0000000105c05000) + 116 at Sanity.c:515\r\n frame #11: 0x0000000102d32154 ghc-stage2`checkTSO(tso=0x0000000105c05388) + 372 at Sanity.c:553\r\n frame #12: 0x0000000102d10edd ghc-stage2`schedule(initialCapability=0x000000010353b640, task=0x0000000105900c30) + 461 at Schedule.c:323\r\n frame #13: 0x0000000102d10b7b ghc-stage2`scheduleWaitThread(tso=0x0000000105c05388, ret=0x0000000000000000, pcap=0x00007fff5fbff328) + 203 at Schedule.c:2552\r\n frame #14: 0x0000000102d06655 ghc-stage2`rts_evalIO(cap=0x00007fff5fbff328, p=0x0000000103412930, ret=0x0000000000000000) + 69 at RtsAPI.c:460\r\n frame #15: 0x0000000102d46860 ghc-stage2`ioManagerStartCap(cap=0x00007fff5fbff328) + 32 at Signals.c:211\r\n frame #16: 0x0000000102d4689e ghc-stage2`ioManagerStart + 46 at Signals.c:221\r\n frame #17: 0x0000000102d0a9cb ghc-stage2`hs_init_ghc(argc=0x00007fff5fbff558, argv=0x00007fff5fbff550, rts_config=RtsConfig @ 0x00007fff5fbff4c0) + 843 at RtsStartup.c:290\r\n frame #18: 0x0000000102d09c8a ghc-stage2`hs_main(argc=1, argv=0x00007fff5fbff690, main_closure=0x00000001030fd720, rts_config=RtsConfig @ 0x00007fff5fbff570) + 58 at RtsMain.c:51\r\n frame #19: 0x00000001000c2b9c ghc-stage2`main + 188\r\n frame #20: 0x00007fffa5628255 libdyld.dylib`start + 1\r\n\r\n thread #2: tid = 0x6df560a, 0x00007fffa5756fda libsystem_kernel.dylib`__semwait_signal + 10\r\n frame #0: 0x00007fffa5756fda libsystem_kernel.dylib`__semwait_signal + 10\r\n frame #1: 0x00007fffa56ddb72 libsystem_c.dylib`nanosleep + 199\r\n frame #2: 0x00007fffa56dda66 libsystem_c.dylib`usleep + 54\r\n frame #3: 0x0000000102d45a02 ghc-stage2`itimer_thread_func(_handle_tick=0x0000000102d1dc00) + 82 at Pthread.c:132\r\n frame #4: 0x00007fffa583faab libsystem_pthread.dylib`_pthread_body + 180\r\n frame #5: 0x00007fffa583f9f7 libsystem_pthread.dylib`_pthread_start + 286\r\n frame #6: 0x00007fffa583f1fd libsystem_pthread.dylib`thread_start + 13\r\n(lldb) dis -s 0x0000000103412930\r\nghc-stage2`base_GHCziConcziIO_ensureIOManagerIsRunning_closure:\r\n 0x103412930 <+0>: andb %cl, %al\r\n 0x103412932 <+2>: wait\r\n 0x103412933 <+3>: addb (%rcx), %al\r\n 0x103412935 <+5>: addb %al, (%rax)\r\n 0x103412937 <+7>: addb %al, (%rax)\r\n 0x103412939 <+9>: addb %al, (%rax)\r\n 0x10341293b <+11>: addb %al, (%rax)\r\n 0x10341293d <+13>: addb %al, (%rax)\r\n 0x10341293f <+15>: addb %dl, -0x38(%rax)\r\n\r\nghc-stage2`base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure:\r\n 0x103412942 <+2>: wait\r\n 0x103412943 <+3>: addb (%rcx), %al\r\n 0x103412945 <+5>: addb %al, (%rax)\r\n 0x103412947 <+7>: addb %al, (%rax)\r\n 0x103412949 <+9>: addb %al, (%rax)\r\n 0x10341294b <+11>: addb %al, (%rax)\r\n 0x10341294d <+13>: addb %al, (%rax)\r\n}}}\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/12695Build failure due to MAP_NORESERVE being removed in FreeBSD 11.x and later2019-07-07T18:25:32ZabbeBuild failure due to MAP_NORESERVE being removed in FreeBSD 11.x and laterWhile trying to build GHC 8.0.1 on FreeBSD 11.x, I come across following compiler error:
```
/usr/local/bin/clang-cpp38 -DPROFILING -DTHREADED_RTS -DDEBUG -fno-stack-protector -O2 -pipe -Qunused-arguments -I/usr/local/include -fstack...While trying to build GHC 8.0.1 on FreeBSD 11.x, I come across following compiler error:
```
/usr/local/bin/clang-cpp38 -DPROFILING -DTHREADED_RTS -DDEBUG -fno-stack-protector -O2 -pipe -Qunused-arguments -I/usr/local/include -fstack-protector -fno-strict-aliasing -Wall -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Winline -Waggregate-return -Wpointer-arith -Wmissing-noreturn -Wnested-externs -Wredundant-decls -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -fno-strict-aliasing -fno-common -Irts/dist/build/autogen -Wno-unknown-pragmas -O2 -fomit-frame-pointer -g -DRtsWay=\"rts_v\" -MM -x c rts/posix/OSMem.c -MF rts/dist/build/.depend-v-p-dyn-l-debug-thr-thr_debug-thr_l-thr_p-debug_dyn-thr_dyn-thr_debug_dyn-l_dyn-thr_l_dyn.c_asm.bit
rts/posix/OSMem.c:158:5: error: USE_LARGE_ADDRESS_SPACE needs MAP_NORESERVE
# error USE_LARGE_ADDRESS_SPACE needs MAP_NORESERVE
^
1 error generated.
```
From some [investigation](https://svnweb.freebsd.org/base/head/sys/sys/mman.h?r1=273249&r2=273250&), it turns out when it was there, it was not even implemented. The value of `__FreeBSD_version` (in case you plan to add conditional based on it), where it is [changed](https://svnweb.freebsd.org/base/head/sys/sys/param.h?r1=273250&r2=273249&pathrev=273250) is `1100039`.
Let me know if you need more information.
Thanks for looking
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Build failure due to MAP_NORESERVE being removed in FreeBSD 11.x and later","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"While trying to build GHC 8.0.1 on FreeBSD 11.x, I come across following compiler error:\r\n\r\n{{{\r\n/usr/local/bin/clang-cpp38 -DPROFILING -DTHREADED_RTS -DDEBUG -fno-stack-protector -O2 -pipe -Qunused-arguments -I/usr/local/include -fstack-protector -fno-strict-aliasing -Wall -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Winline -Waggregate-return -Wpointer-arith -Wmissing-noreturn -Wnested-externs -Wredundant-decls -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -fno-strict-aliasing -fno-common -Irts/dist/build/autogen -Wno-unknown-pragmas -O2 -fomit-frame-pointer -g -DRtsWay=\\\"rts_v\\\" -MM -x c rts/posix/OSMem.c -MF rts/dist/build/.depend-v-p-dyn-l-debug-thr-thr_debug-thr_l-thr_p-debug_dyn-thr_dyn-thr_debug_dyn-l_dyn-thr_l_dyn.c_asm.bit\r\nrts/posix/OSMem.c:158:5: error: USE_LARGE_ADDRESS_SPACE needs MAP_NORESERVE\r\n# error USE_LARGE_ADDRESS_SPACE needs MAP_NORESERVE\r\n ^\r\n1 error generated.\r\n}}}\r\n\r\nFrom some [https://svnweb.freebsd.org/base/head/sys/sys/mman.h?r1=273249&r2=273250& investigation], it turns out when it was there, it was not even implemented. The value of `__FreeBSD_version` (in case you plan to add conditional based on it), where it is [https://svnweb.freebsd.org/base/head/sys/sys/param.h?r1=273250&r2=273249&pathrev=273250 changed] is `1100039`.\r\n\r\nLet me know if you need more information.\r\n\r\nThanks for looking","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/12075Fails to build on powerpcspe because of inline assembly2019-07-07T18:27:45ZglaubitzFails to build on powerpcspe because of inline assemblyHello!
I'm currently bootstrapping GHC on powerpcspe (e500v2) which is a PowerPC architecture without an FPU but with signal processing extensions (hence SPE).
When building GHC on this architecture, it detects the host architecture as...Hello!
I'm currently bootstrapping GHC on powerpcspe (e500v2) which is a PowerPC architecture without an FPU but with signal processing extensions (hence SPE).
When building GHC on this architecture, it detects the host architecture as powerpc-linux-gnuspe or short "powerpc" which works most of the time.
However, GHC contains some inline assembly in rts/StgCRunAsm.s which uses FPU instructions not available on e500v2 CPUs resulting in assembler error, here with GHC 7.10.3:
```
"inplace/bin/ghc-stage1" -optc-fno-stack-protector -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-Wpointer-arith -optc-Wmissing-noreturn -optc-Wnested-externs -optc-Wredundant-decls -optc-Iincludes -optc-Iincludes/dist -optc-Iincludes/dist-derivedconstants/header -optc-Iincludes/dist-ghcconstants/header -optc-Irts -optc-Irts/dist/build -optc-DCOMPILING_RTS -optc-DUSE_LIBFFI_FOR_ADJUSTORS -optc-fno-strict-aliasing -optc-fno-common -optc-Irts/dist/build/autogen -optc-O2 -optc-fomit-frame-pointer -optc-g -optc-DRtsWay=\"rts_v\" -optc-w -static -H32m -O -lffi -optl-pthread -lffi -optl-pthread -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -this-package-key rts -dcmm-lint -i -irts -irts/dist/build -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen -O2 -c rts/StgCRun.c -o rts/dist/build/StgCRun.o
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/tmp/ghcf20d_0/ghc_1.s: Assembler messages:
/tmp/ghcf20d_0/ghc_1.s:24:0: Error: unrecognized opcode: `stfd'
(...)
/tmp/ghcf20d_0/ghc_1.s:67:0: Error: unrecognized opcode: `lfd'
/tmp/ghcf20d_0/ghc_1.s:68:0: Error: unrecognized opcode: `lfd'
/tmp/ghcf20d_0/ghc_1.s:69:0: Error: unrecognized opcode: `lfd'
rts/ghc.mk:236: recipe for target 'rts/dist/build/StgCRun.o' failed
make[3]: *** [rts/dist/build/StgCRun.o] Error 1
Makefile:71: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/usr/src/ghc-7.10.3'
dh_auto_build: make -j1 returned exit code 2
debian/rules:109: recipe for target 'override_dh_auto_build' failed
make[1]: *** [override_dh_auto_build] Error 2
make[1]: Leaving directory '/usr/src/ghc-7.10.3'
debian/rules:47: recipe for target 'binary-arch' failed
make: *** [binary-arch] Error 2
(sid2-powerpcspe-sbuild)root@atlantis:/usr/src/ghc-7.10.3#
```
This can be verified by commenting out the assembly which will make the above compile command execute without any problems. Trying to continue compiling GHC will still fail with:
```
"inplace/bin/ghc-stage1" -static -H32m -O -lffi -optl-pthread -lffi -optl-pthread -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -this-package-key rts -dcmm-lint -i -irts -irts/dist/build -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen -O2 -c rts/HeapStackCheck.cmm -o rts/dist/build/HeapStackCheck.o
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/tmp/ghcca51_0/ghc_3.s: Assembler messages:
/tmp/ghcca51_0/ghc_3.s:525:0: Error: unrecognized opcode: `lfs'
/tmp/ghcca51_0/ghc_3.s:538:0: Error: unrecognized opcode: `lfd'
/tmp/ghcca51_0/ghc_3.s:592:0: Error: unrecognized opcode: `stfs'
/tmp/ghcca51_0/ghc_3.s:604:0: Error: unrecognized opcode: `stfd'
rts/ghc.mk:236: recipe for target 'rts/dist/build/HeapStackCheck.o' failed
make[3]: *** [rts/dist/build/HeapStackCheck.o] Error 1
Makefile:71: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/usr/src/ghc-7.10.3'
dh_auto_build: make -j1 returned exit code 2
debian/rules:109: recipe for target 'override_dh_auto_build' failed
make[1]: *** [override_dh_auto_build] Error 2
make[1]: Leaving directory '/usr/src/ghc-7.10.3'
debian/rules:47: recipe for target 'binary-arch' failed
make: *** [binary-arch] Error 2
(sid2-powerpcspe-sbuild)root@atlantis:/usr/src/ghc-7.10.3#
```
So, there is obviously more assembly code that needs to be disabled on powerpcspe.
For that, I suggest testing whether the compiler sets __NO_FPRS__which is only set on powerpc hosts without FP registers:
```
root@atlantis:~# echo | gcc -E -dM -|grep -i FP
#define __NO_FPRS__ 1
root@atlantis:~# dpkg --print-architecture
powerpcspe
root@atlantis:~# uname -m
ppc
root@atlantis:~#
```
For reference, on a real powerpc host, the output is as follows:
```
(sid_powerpc-dchroot)glaubitz@partch:~$ echo | gcc -E -dM -|grep -i FP
#define __FP_FAST_FMAF 1
#define __FP_FAST_FMA 1
(sid_powerpc-dchroot)glaubitz@partch:~$ dpkg --print-architecture
powerpc
(sid_powerpc-dchroot)glaubitz@partch:~$ uname -m
ppc
(sid_powerpc-dchroot)glaubitz@partch:~$
```
If you need any more input, please let me know.
For reference, the list of supported instructions on e500(v2) CPUs can be found here:
http://www.nxp.com/files/32bit/doc/ref_manual/E500CORERM.pdf (page 3-66 or 196)
Adrian8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/11773linux/powepc : ghc-stage1 segfaults when building unregisterised2019-07-07T18:28:36Zerikdlinux/powepc : ghc-stage1 segfaults when building unregisterisedBuilding unregisterised to test code paths that don't get tested in the registerised compile mode.
The segfault:
```
"inplace/bin/ghc-stage1" -static -O -H64m -Wall -Iincludes -Iincludes/dist \
-Iincludes/dist-derivedconstants/heade...Building unregisterised to test code paths that don't get tested in the registerised compile mode.
The segfault:
```
"inplace/bin/ghc-stage1" -static -O -H64m -Wall -Iincludes -Iincludes/dist \
-Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header \
-Irts -Irts/dist/build -DCOMPILING_RTS -this-unit-id rts -optc-DNOSMP \
-dcmm-lint -i -irts -irts/dist/build -irts/dist/build/autogen \
-Irts/dist/build -Irts/dist/build/autogen -O2 -Wnoncanonical-monad-instances \
-c rts/StgStartup.cmm -o rts/dist/build/StgStartup.o
```
seems to occur on powerpc, but not on x86_64 or armhf.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"linux/powepc : ghc-stage1 segfaults when building unregisterised","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.2.1","resolution":"Unresolved","owner":{"tag":"OwnedBy","contents":"erikd"},"version":"8.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Building unregisterised to test code paths that don't get tested in the registerised compile mode. \r\n\r\nThe segfault:\r\n\r\n{{{\r\n\"inplace/bin/ghc-stage1\" -static -O -H64m -Wall -Iincludes -Iincludes/dist \\\r\n -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header \\\r\n -Irts -Irts/dist/build -DCOMPILING_RTS -this-unit-id rts -optc-DNOSMP \\\r\n -dcmm-lint -i -irts -irts/dist/build -irts/dist/build/autogen \\\r\n -Irts/dist/build -Irts/dist/build/autogen -O2 -Wnoncanonical-monad-instances \\\r\n -c rts/StgStartup.cmm -o rts/dist/build/StgStartup.o\r\n}}}\r\n\r\nseems to occur on powerpc, but not on x86_64 or armhf.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1erikderikd