Skip to content

Is ghc-options not working correctly? #2708

@Prillan

Description

@Prillan

I'm trying to get stack + ghc running on my raspberry pi 3 and I'm almost there.

I need to specify the ghc-option -opta-march=armv7-a (found it here)

I can get it building with

$ stack ghc -- -opta-march=armv7-a Test.hs
Run from outside a project, using implicit global project config
Using resolver: lts-7.3 from implicit global project's config file: /home/pi/.stack/global-project/stack.yaml
[1 of 1] Compiling Main             ( Test.hs, Test.o )
Linking Test ...

But I can't seem to get it working together with stack, here's my ~/.stack/config.yaml

ghc-options:
  "*": -opta-march=armv7-a
apply-ghc-options: everything

And output from stack build text

 $ stack build text
Run from outside a project, using implicit global project config
Using resolver: lts-7.3 from implicit global project's config file: /home/pi/.stack/global-project/stack.yaml
[1 of 1] Compiling Main             ( /tmp/stack9073/Setup.hs, /tmp/stack9073/Setup.o )
/tmp/ghc9102_0/ghc_6.s: Assembler messages:

/tmp/ghc9102_0/ghc_6.s:41:0: error:
     Error: selected processor does not support `movw r7,:lower16:stg_bh_upd_frame_info' in ARM mode

/tmp/ghc9102_0/ghc_6.s:42:0: error:
     Error: selected processor does not support `movt r7,:upper16:stg_bh_upd_frame_info' in ARM mode

/tmp/ghc9102_0/ghc_6.s:45:0: error:
     Error: selected processor does not support `movw r7,:lower16:base_GHCziTopHandler_runMainIO_closure' in ARM mode

/tmp/ghc9102_0/ghc_6.s:46:0: error:
     Error: selected processor does not support `movt r7,:upper16:base_GHCziTopHandler_runMainIO_closure' in ARM mode

/tmp/ghc9102_0/ghc_6.s:47:0: error:
     Error: selected processor does not support `movw r8,:lower16:Cabalzm1zi24zi0zi0_DistributionziSimple_defaultMain_closure' in ARM mode

/tmp/ghc9102_0/ghc_6.s:48:0: error:
     Error: selected processor does not support `movt r8,:upper16:Cabalzm1zi24zi0zi0_DistributionziSimple_defaultMain_closure' in ARM mode
`gcc' failed in phase `Assembler'. (Exit code: 1)
Exit code ExitFailure 1 while running ["ghc","-clear-package-db","-global-package-db","-hide-all-packages","-package","base","-package","Cabal-1.24.0.0","/tmp/stack9073/Setup.hs","-o","/home/pi/.stack/setup-exe-cache/arm-linux/tmp-setup-Simple-Cabal-1.24.0.0-ghc-8.0.1","-rtsopts"] in /tmp/stack9073/

As the last line is missing my option -opta-march=armv7-a I'm assuming it never reaches GHC, leading me to think that I've either misunderstood how ghc-options and apply-ghc-options work or that there is a bug in stack.

I've also tried running with --force-dirty to no effect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions