-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is ghc-options not working correctly? #2708
Comments
It is not specific to arm (I believe), I'm just confused why |
It looks like the errors are coming from base and similar packages. Since base is included with ghc, you can't apply ghc-options flags to it. ghc-options are indeed currently a bit ugly, they don't work perfectly for snapshot dependencies. We really need to address this, hopefully soon - #849 |
Just to make sure I understand this: |
Correct! Not 100% sure that is what is happening here, but it seems like it. |
I'm hitting precisely this issue. |
I'm having trouble understanding how correctly passing on the ghc-options wouldn't fix this. The error trace helpfully lists exactly the arguments passed to ghc. After capturing the $ ghc -clear-package-db -global-package-db -hide-all-packages -package base -package Cabal-1.24.0.0 /tmp/Setup.hs -o /home/nick/.stack/setup-exe-cache/arm-linux/tmp-setup-Simple-Cabal-1.24.0.0-ghc-8.0.1 -rtsopts
[1 of 1] Compiling Main ( /tmp/Setup.hs, /tmp/Setup.o )
/tmp/ghc10351_0/ghc_6.s: Assembler messages:
/tmp/ghc10351_0/ghc_6.s:41:0: error:
Error: selected processor does not support ARM mode `movw r7,:lower16:stg_bh_upd_frame_info'
/tmp/ghc10351_0/ghc_6.s:42:0: error:
Error: selected processor does not support ARM mode `movt r7,:upper16:stg_bh_upd_frame_info'
/tmp/ghc10351_0/ghc_6.s:45:0: error:
Error: selected processor does not support ARM mode `movw r7,:lower16:base_GHCziTopHandler_runMainIO_closure'
/tmp/ghc10351_0/ghc_6.s:46:0: error:
Error: selected processor does not support ARM mode `movt r7,:upper16:base_GHCziTopHandler_runMainIO_closure'
/tmp/ghc10351_0/ghc_6.s:47:0: error:
Error: selected processor does not support ARM mode `movw r8,:lower16:Cabalzm1zi24zi0zi0_DistributionziSimple_defaultMain_closure'
/tmp/ghc10351_0/ghc_6.s:48:0: error:
Error: selected processor does not support ARM mode `movt r8,:upper16:Cabalzm1zi24zi0zi0_DistributionziSimple_defaultMain_closure'
`gcc' failed in phase `Assembler'. (Exit code: 1) But by simply adding the missing argument it works fine: $ ghc -opta-march=armv7-a -clear-package-db -global-package-db -hide-all-packages -package base -package Cabal-1.24.0.0 /tmp/Setup.hs -o /home/nick/.stack/setup-exe-cache/arm-linux/tmp-setup-Simple-Cabal-1.24.0.0-ghc-8.0.1 -rtsopts
[1 of 1] Compiling Main ( /tmp/Setup.hs, /tmp/Setup.o )
Linking /home/nick/.stack/setup-exe-cache/arm-linux/tmp-setup-Simple-Cabal-1.24.0.0-ghc-8.0.1 ... I don't think it's related to |
Yup, here's an ugly workaround that seems to confirm just passing on the ghc options would work. For me, !/bin/sh
ghc-8.0.1 -opta-march=armv7-a $@ And then: $ stack build
[1 of 1] Compiling Main ( /tmp/stack10569/Setup.hs, /tmp/stack10569/Setup.o )
Linking /home/nick/.stack/setup-exe-cache/arm-linux/tmp-setup-Simple-Cabal-1.24.0.0-ghc-8.0.1 ...
evergreen-terrace-0.1.0.0: configure
Configuring evergreen-terrace-0.1.0.0...
evergreen-terrace-0.1.0.0: build
Preprocessing library evergreen-terrace-0.1.0.0...
[1 of 1] Compiling Lib ( src/Lib.hs, .stack-work/dist/arm-linux/Cabal-1.24.0.0/build/Lib.o )
Preprocessing executable 'evergreen-terrace-exe' for
evergreen-terrace-0.1.0.0...
[1 of 1] Compiling Main ( app/Main.hs, .stack-work/dist/arm-linux/Cabal-1.24.0.0/build/evergreen-terrace-exe/evergreen-terrace-exe-tmp/Main.o )
Linking .stack-work/dist/arm-linux/Cabal-1.24.0.0/build/evergreen-terrace-exe/evergreen-terrace-exe ...
evergreen-terrace-0.1.0.0: copy/register
Installing library in
/mnt/seodaemun/projects/evergreen-terrace/.stack-work/install/arm-linux/lts-7.5/8.0.1/lib/arm-linux-ghc-8.0.1/evergreen-terrace-0.1.0.0-AkJh9idDwA94dRAPZXYkWM
Installing executable(s) in
/mnt/seodaemun/projects/evergreen-terrace/.stack-work/install/arm-linux/lts-7.5/8.0.1/bin
Registering evergreen-terrace-0.1.0.0... |
So it looks to me like the problem is that the I can think of a couple of ways to change the behaviour that would help:
I can't think of any cases where the extra flexibility offered by (1) would be needed (e.g. being able to have different simple Setup.hs options for some projects). |
Closing this due to lack of confirmation. I also think that this may have been an instance of an issue fixed by #3781 |
Wow, sorry, totally forgot about this. I'll re-open it if I encounter this issue again. |
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
But I can't seem to get it working together with
stack
, here's my~/.stack/config.yaml
And output from
stack build text
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 howghc-options
andapply-ghc-options
work or that there is a bug instack
.I've also tried running with
--force-dirty
to no effect.The text was updated successfully, but these errors were encountered: