
#8781: check if GNU nm is really needed and if so let configure detect gnm ----------------------------------------+----------------------------- Reporter: maeder | Owner: kgardas Type: feature request | Status: patch Priority: normal | Milestone: Component: Build System | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Solaris | Architecture: x86 Type of failure: Building GHC failed | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ----------------------------------------+----------------------------- Comment (by jberthold): Maybe repetition is not good, but let me suggest to clarify which part is responsible for which variant of nm output. Also, one could use the Maybe monad instead of nested case expressions. how about this one: {{{ parseNmLine xs0 = case words xs0 of -- "_derivedConstantMAX_Vanilla_REG C b 0" Mac OS X -- "derivedConstantMAX_Vanilla_REG C 0000000b 0000000b" GNU -- "_derivedConstantMAX_Vanilla_REG C 000000b" MinGW x0 : "C" : x2 : r -> mkMapping x0 x2 -- "derivedConstantMAX_Vanilla_REG D 1 b" Solaris x0 : _ : x2 : x3 : [] -> mkMapping x0 x3 other -> Nothing mkMapping x0 x2 = do name <- stripPrefix $ dropWhile (== '_') x0 size <- case readHex x2 of [(n,"")] -> return n _ -> fail "not hex" return (name, size) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8781#comment:30 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler