I’m very new to this. I’m trying to use stack to run a tool. I have installed it via ghcup (ghcup installed view brew) on my Apple M1 running OS X Sonoma.
I cannot go through the basics: I follow the instructions found here The Haskell Tool Stack (Quick Start guide).
- stack new my-project works smoothly.
- when I run stuck build (n the my-project directory) I get the following error:
➜ my-project stack build
[3 of 3] Linking /Users/carbonem/.stack/setup-exe-cache/aarch64-osx/tmp-Cabal-simple_6HauvNHV_3.8.1.0_ghc-9.4.7
ld: unknown options: --gc-sections
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ghc-9.4.7: `gcc' failed in phase `Linker'. (Exit code: 1)
Error: [S-6374]
While building simple Setup.hs (scroll up to its section to see the
error) using:
/Users/carbonem/.stack/programs/aarch64-osx/ghc-9.4.7/bin/ghc-9.4.7 -rtsopts -threaded -clear-package-db -global-package-db -hide-all-packages -package base -main-is StackSetupShim.mainOverride -package Cabal-3.8.1.0 /Users/carbonem/.stack/setup-exe-src/setup-6HauvNHV.hs /Users/carbonem/.stack/setup-exe-src/setup-shim-6HauvNHV.hs -o /Users/carbonem/.stack/setup-exe-cache/aarch64-osx/tmp-Cabal-simple_6HauvNHV_3.8.1.0_ghc-9.4.7
Process exited with code: ExitFailure 1
Perhaps this is an obvious issue but I really cannot find out how to solve it. Please help
Thank you.