[GHC] #15399: Build failure on PowerPC 64-bit big endian

#15399: Build failure on PowerPC 64-bit big endian ---------------------------------+---------------------------------------- Reporter: trommler | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.5 Keywords: | Operating System: Linux Architecture: powerpc64 | Type of failure: Building GHC failed Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: ---------------------------------+---------------------------------------- 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. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15399 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15399: Build failure on PowerPC 64-bit big endian ----------------------------------------+--------------------------------- Reporter: trommler | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Linux | Architecture: powerpc64 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------------+--------------------------------- Changes (by trommler): * cc: hvr, bgamari (added) Comment: Currently my last known good commit is commit:d78dde9. At changeset:bdfc85b I see the following tests failures during validate: {{{ Unexpected results from: TEST="ManyAlternatives ManyConstructors T10520 T10858 T12007 T12425 T12545 T12707 T13035 T13379 T13615 T13825-ghci T14894 T1969 T2182ghci T3064 T3294 T4801 T5321FD T5321Fun T5435_v_asm_b T5631 T6048 T7253 T7386 T783 T8557 T9233 duplicaterecfldsghci01 ghc-e006 ghci.prog007 ghci006 ghci039 ghci045 ghci049 ghci052 ghci053 ghcirun001 ghcirun002 heap_all print002 print003 print006 print007 print008 print010 print012 print013 print014 print018 print019 print021 print025 print031 print034" SUMMARY for test run started at Wed Jul 18 12:35:24 2018 CEST 1:18:37 spent to go through 6386 total tests, which gave rise to 19686 test cases, of which 13227 were skipped 38 had missing libraries 6190 expected passes 176 expected failures 2 caused framework failures 1 caused framework warnings }}} Note the large number of GHCi tests failing. I will now bisect in that range above. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15399#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15399: Build failure on PowerPC 64-bit big endian ----------------------------------------+--------------------------------- Reporter: trommler | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Linux | Architecture: powerpc64 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------------+--------------------------------- Comment (by trommler): The breaking commit is changeset:ec22f7dd. I have found an endianness issue with this commit in `compiler/ghci/RtClosureInspect.hs`. I am just validating a patch on ppc64. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15399#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15399: Build failure on PowerPC 64-bit big endian ----------------------------------------+--------------------------------- Reporter: trommler | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Linux | Architecture: powerpc64 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------------+--------------------------------- Comment (by trommler): My patch was not quite good enough. Here is another endianness issue: {{{ BCO -> do // removed checks let splitWord = rawWds !! 3 pure $ BCOClosure itbl (pts !! 0) (pts !! 1) (pts !! 2) // on big endian this is the wrong way around (fromIntegral splitWord) (fromIntegral $ shiftR splitWord (wORD_SIZE_IN_BITS `div` 2)) (drop 4 rawWds) }}} I need a way to tell whether I am running on a big endian system. Is there any way to know inside without access to `DynFlags`? Is there even a portable way to read the first half-word from a word in memory? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15399#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15399: Build failure on PowerPC 64-bit big endian ----------------------------------------+--------------------------------- Reporter: trommler | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Linux | Architecture: powerpc64 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------------+--------------------------------- Comment (by trommler): Actually, comment:3 applies to AP and PAP closures as well. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15399#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15399: Build failure on PowerPC 64-bit big endian ----------------------------------------+---------------------------------- Reporter: trommler | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Linux | Architecture: powerpc64 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5001 Wiki Page: | ----------------------------------------+---------------------------------- Changes (by trommler): * differential: => Phab:D5001 Comment: Here is a fix for one of the 36 failing GHCi tests. It fixes three endianness issues introduced by changeset:ec22f7dd. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15399#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15399: Build failure on PowerPC 64-bit big endian ----------------------------------------+---------------------------------- Reporter: trommler | Owner: trommler Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Linux | Architecture: powerpc64 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5001 Wiki Page: | ----------------------------------------+---------------------------------- Changes (by trommler): * owner: (none) => trommler -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15399#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15399: Build failure on PowerPC 64-bit big endian ----------------------------------------+---------------------------------- Reporter: trommler | Owner: trommler Type: bug | Status: merge Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Linux | Architecture: powerpc64 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5001 Wiki Page: | ----------------------------------------+---------------------------------- Changes (by bgamari): * status: new => merge * milestone: => 8.6.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15399#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15399: Build failure on PowerPC 64-bit big endian
----------------------------------------+----------------------------------
Reporter: trommler | Owner: trommler
Type: bug | Status: merge
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 8.5
Resolution: | Keywords:
Operating System: Linux | Architecture: powerpc64
Type of failure: Building GHC failed | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5001
Wiki Page: |
----------------------------------------+----------------------------------
Comment (by Ben Gamari

#15399: Build failure on PowerPC 64-bit big endian ----------------------------------------+---------------------------------- Reporter: trommler | Owner: trommler Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: fixed | Keywords: Operating System: Linux | Architecture: powerpc64 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5001 Wiki Page: | ----------------------------------------+---------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-8.6` in 3795b454f4b788e23fee89d81a187db089183e06. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15399#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15399: Build failure on PowerPC 64-bit big endian ----------------------------------------+---------------------------------- Reporter: trommler | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Linux | Architecture: powerpc64 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: #15411 | Differential Rev(s): Phab:D5001 Wiki Page: | ----------------------------------------+---------------------------------- Changes (by trommler): * status: closed => new * owner: trommler => (none) * resolution: fixed => * related: => #15411 Comment: The issue shown in the ticket is a duplicate of #15411. In the comments for this ticket we found the first breaking commit, which is unrelated to the issue on this ticket, and fixed (Phab:5001) one (out of 36) of the broken tests (see comment:5). I reopen the ticket so I won't forget to create a new ticket for the remaining 35 failing tests. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15399#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15399: Build failure on PowerPC 64-bit big endian ----------------------------------------+---------------------------------- Reporter: trommler | Owner: trommler Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Linux | Architecture: powerpc64 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: #15411 | Differential Rev(s): Phab:D5001 Wiki Page: | ----------------------------------------+---------------------------------- Changes (by trommler): * owner: (none) => trommler Comment: I will submit a follow-up ticket. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15399#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC