[GHC] #10383: AArch64: get GHC Calling convention working

GHC ghc-devs at haskell.org
Thu Sep 17 00:56:06 UTC 2015


#10383: AArch64: get GHC Calling convention working
----------------------------------------+----------------------------------
        Reporter:  erikd                |                   Owner:  erikd
            Type:  feature request      |                  Status:  new
        Priority:  normal               |               Milestone:  8.0.1
       Component:  Compiler             |                 Version:  7.11
      Resolution:                       |                Keywords:
Operating System:  Unknown/Multiple     |            Architecture:  aarch64
 Type of failure:  Building GHC failed  |               Test Case:
      Blocked By:                       |                Blocking:
 Related Tickets:                       |  Differential Revisions:
----------------------------------------+----------------------------------

Comment (by erikd):

 With the un-reasonable effectiveness of wolf-fence debugging on #10375 I
 decided to apply it to this one as well and quickly found that the stage2
 compiler was crashing in the function `SysTools.initSysTools`.

 With my added debug that function currently looks like:

 {{{
 initSysTools :: Maybe String    -- Maybe TopDir path (without the '-B'
 prefix)
              -> IO Settings     -- Set all the mutable variables above,
 holding
                                 --      (a) the system programs
                                 --      (b) the package-config file
                                 --      (c) the GHC usage message
 initSysTools mbMinusB
   = do top_dir <- findTopDir mbMinusB
              -- see [Note topdir]
              -- NB: top_dir is assumed to be in standard Unix
              -- format, '/' separated

        let settingsFile = top_dir </> "settings"
            platformConstantsFile = top_dir </> "platformConstants"
            installed :: FilePath -> FilePath
            installed file = top_dir </> file


        putStrLn "initSysTools: About to read settingsFile"
        settingsStr <- readFile settingsFile
        putStrLn $ "initSysTools: settingsStr = \n" ++ settingsStr ++ "\n"
        mySettings <- case maybeReadFuzzy settingsStr of
                      Just s -> do
                          putStrLn "initSysTools: mySettings is Just"
                          return s
                      Nothing -> do
                          putStrLn $ "initSysTools mySettings is Nothing"
                          pgmError ("Can't parse " ++ show settingsFile)
        putStrLn $ "initSysTools " ++ show (__LINE__ :: Int)
 ...
 }}}

 and it crashes with:

 {{{
 initSysTools: About to read settingsFile
 initSysTools: settingsStr =
 [("GCC extra via C opts", " -fwrapv"),
  ("C compiler command", "/usr/bin/gcc"),
  ("C compiler flags", " -fno-stack-protector"),
  ("C compiler link flags", " -fuse-ld=gold -Wl,-z,noexecstack"),
  ("Haskell CPP command","/usr/bin/gcc"),
  ("Haskell CPP flags","-E -undef -traditional"),
  ("ld command", "/usr/bin/ld.gold"),
  ("ld flags", " -z noexecstack"),
  ("ld supports compact unwind", "YES"),
  ("ld supports build-id", "YES"),
  ("ld supports filelist", "NO"),
  ("ld is GNU ld", "YES"),
  ("ar command", "/usr/bin/ar"),
  ("ar flags", "q"),
  ("ar supports at file", "YES"),
  ("touch command", "touch"),
  ("dllwrap command", "/bin/false"),
  ("windres command", "/bin/false"),
  ("libtool command", "libtool"),
  ("perl command", "/usr/bin/perl"),
  ("cross compiling", "NO"),
  ("target os", "OSLinux"),
  ("target arch", "ArchARM64"),
  ("target word size", "8"),
  ("target has GNU nonexec stack", "True"),
  ("target has .ident directive", "True"),
  ("target has subsections via symbols", "False"),
  ("Unregisterised", "NO"),
  ("LLVM llc command", "/usr/bin/llc-3.6"),
  ("LLVM opt command", "/usr/bin/opt-3.6")
  ]

 ghc-stage2: internal error: invalid closure, info=(nil)
     (GHC version 7.11.20150916 for aarch64_unknown_linux)
     Please report this as a GHC bug:
 http://www.haskell.org/ghc/reportabug
 }}}


 It reads the `String` from `settingsFile` and prints it and then crashes
 in the pure function `maybeReadFuzzy`.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10383#comment:15>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list