[GHC] #14889: ghc-HEAD broke cross-compilation on multiple tagets due to --via-asm switch

GHC ghc-devs at haskell.org
Sun Mar 4 10:38:30 UTC 2018


#14889: ghc-HEAD broke cross-compilation on multiple tagets due to --via-asm switch
-------------------------------------+-------------------------------------
           Reporter:  slyfox         |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.5
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Commit
 http://git.haskell.org/ghc.git/commitdiff/5f6fcf7808b16d066ad0fb2068225b3f2e8363f7

 enables '''--via-asm''' for all targets:

 {{{
  ifeq "$(CrossCompiling)" "YES"
 -SRC_HSC2HS_OPTS_STAGE1 += --cross-compile
 -SRC_HSC2HS_OPTS_STAGE2 += --cross-compile
 +# We'll assume we compile with gcc or clang, and both support `-S` and
 can as such use the
 +# --via-asm pass, which should be faster and is required for cross
 compiling to windows, as
 +# the c compiler complains about non-constant expressions even though
 they are constant and
 +# end up as constants in the assembly.
 +SRC_HSC2HS_OPTS_STAGE1 += --cross-compile --via-asm
 +SRC_HSC2HS_OPTS_STAGE2 += --cross-compile --via-asm
  endif
 }}}

 But the discussion in original submission
 https://github.com/haskell/hsc2hs/pull/5 talks about opt-in and mostly x86
 assembly support.

 Before this change targets like sparc were cross-compiling just fine. Now
 '''sparc-unknown-linux-gnu''' fails as:

 {{{
 hsc2hs: Failed to extract integer
 CallStack (from HasCallStack):
   error, called at utils/hsc2hs/CrossCodegen.hs:606:27 in
 main:CrossCodegen
 make[1]: *** [libraries/unix/ghc.mk:4: libraries/unix/dist-
 install/build/System/Posix/Files.hs] Error 1
 }}}

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


More information about the ghc-tickets mailing list