<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I’ve observed on my M1 box that stack-based ports no longer build because of compiler issues with mixed architecture libraries, as more ports become native ARM. I’ve done enough troubleshooting (reinstalling CLT, Xcode, use_code=yes and so forth) to believe that this is a general problem—error messages are below.<div class=""><br class=""></div><div class="">Before addressing the obvious possible fix of migrating to the recently supported ARM-based cabal+ghc-based toolchain for Haskell ports, I’d like to ask the community two questions:</div><div class=""><br class=""></div><div class=""><ul class="MailOutline"><li class="">Do others see this issue and are unable to build stack-based ports on ARM?</li><li class="">Is anyone aware of a fix for compiler issue below? (Not holding my breath because the libunwind link dependency is now native ARM.)</li></ul></div><div class=""><br class=""></div><div class="">stack has been a decent solution until now because it’s quite robust, provides a ready-made approach to Haskell world bootstrapping, and at least used to be able to produce x86_64 binaries on arm64. But even if stack provides a native arm binary (see <a href="https://github.com/commercialhaskell/stack/issues/5709" class="">https://github.com/commercialhaskell/stack/issues/5709</a>), stack will still want to download older x86_64 ghc compilers specified by the LTS in stack.yaml, so I’m not sure how viable stack is for MacPorts on ARM with this fundamental compiler issue.</div><div class=""><br class=""></div><div class="">If there’s not an obvious path forward with stack, then we’ll have to rework a different Haskell bootstrap approach within Macports. Fortunately, we will soon have native ghc and cabal ports (see <a href="https://github.com/macports/macports-ports/pull/15795" class="">https://github.com/macports/macports-ports/pull/15795</a>, <a href="https://github.com/macports/macports-ports/pull/15770" class="">https://github.com/macports/macports-ports/pull/15770</a>), and will simply need to bootstrap a small number of Haskell tools necessary to bootstrap these binaries.</div><div class=""><br class=""><div class=""><br class=""></div><div class="">MacPorts main.log:</div><div class=""><blockquote type="cite" class=""><div style="margin: 0px; font-stretch: normal; font-size: 24px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">:info:configure Configuring GHC ...</span></div><div style="margin: 0px; font-stretch: normal; font-size: 24px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">:info:configure configure: error: in `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_alex/alex/work/.home/.stack/programs/x86_64-osx/ghc-9.0.2.temp/ghc-9.0.2-x86_64-apple-darwin':</span></div><div style="margin: 0px; font-stretch: normal; font-size: 24px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">:info:configure configure: error: C compiler cannot create executables</span></div><div style="margin: 0px; font-stretch: normal; font-size: 24px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">:info:configure See `config.log' for more details</span></div></blockquote><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 24px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></div><div class=""><br class=""></div><div class="">stack config.log:</div></div><div class=""><blockquote type="cite" class=""><div style="margin: 0px; font-stretch: normal; font-size: 24px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">configure:4368: checking whether the C compiler works</span></div><div style="margin: 0px; font-stretch: normal; font-size: 24px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">configure:4390: /usr/bin/clang -pipe -Os -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -arch x86_64 -I/opt/local/include -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -arch x86_64 conftest.c >&5</span></div><div style="margin: 0px; font-stretch: normal; font-size: 24px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">ld: in '/opt/local/lib/libunwind.dylib', building for macOS-x86_64 but attempting to link with file built for macOS-arm64</span></div><div style="margin: 0px; font-stretch: normal; font-size: 24px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">clang: error: linker command failed with exit code 1 (use -v to see invocation)</span></div></blockquote></div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 24px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></div></div></body></html>