<div style="font-family: Arial, sans-serif; font-size: 14px;">Hello,</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br>I am a FreeBSD user, running FreeBSD 13.1 with Clang 13 and GCC 12.2, and still fairly new to the Haskell Platform.</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">When I tried to upgrade a hobby project to Stackage's latest LTS 20.15, I realized that neither the GHC 9.2.6 nor</div><div style="font-family: Arial, sans-serif; font-size: 14px;">the GHC 9.2.7 binary packages from GHCUP work anymore.</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">There are two issues - and I wrote a detailed article about my investigation on Medium:</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><a href="https://medium.com/@martin.baulig/ghc-9-2-7-on-freebsd-22afab71c715">https://medium.com/@martin.baulig/ghc-9-2-7-on-freebsd-22afab71c715</a><br><br>The first one is a trivial one-line change - in hadrian/src/Rules/BinaryDist.hs, we need to change</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><blockquote style="border-color: rgb(200, 200, 200); border-left: 3px solid rgb(200, 200, 200); padding-left: 10px; color: rgb(102, 102, 102);"><div style="font-family: Arial, sans-serif; font-size: 14px;">( "HSC2HS_EXTRA=\"" <> unwords ccArgs <> unwords ldFlags <> "\""
</div></blockquote><div style=""><br></div><div style="">into</div><div style=""><br></div><blockquote style="border-color: rgb(200, 200, 200); border-left: 3px solid rgb(200, 200, 200); padding-left: 10px; color: rgb(102, 102, 102);"><div style="">( "HSC2HS_EXTRA=\"" <> unwords (ccArgs <> ldFlags) <> "\""</div></blockquote><div style=""><br></div><div style="">Otherwise, this will break when both ccArgs and ldFlags are non-empty:</div><div style=""><br></div><blockquote style="border-color: rgb(200, 200, 200); border-left: 3px solid rgb(200, 200, 200); padding-left: 10px; color: rgb(102, 102, 102);"><div style="">HSC2HS_EXTRA="--cflag=--target=x86_64-portbld-freebsd--lflag=--target=x86_64-portbld-freebsd --lflag=-fuse-ld=lld"</div></blockquote><div style=""><br></div><div style="">Unfortunately, this is not quite it just yet.</div><div style=""><br></div><div style="">The problem is that Clang supports the --target= argument, but GCC does not - and it looks like Cabal insists on always</div><div style="">invoking hsc2hs with an explicit --cc= argument.</div><div style=""><br></div><div style="">Overriding that in ~/.cabal/config doesn't work either - because then Cabal passes "-pgmc /usr/bin/cc" to GHC, but no<br>"-pgma" and GHC tries to invoke GCC for assembling with a Clang-only argument.</div><div style=""><br></div><div style="">I am a bit lost here now about what the correct path forward is, but would very much like to help fixing this problem,</div><div style="">so I created an account on gitlab.haskell.org to report this issue, but got a message saying that it is awaiting admin</div><div style="">approval.  Looking a bit further in the documentation for new contributors, I saw a comment suggesting I should</div><div style="">post on this mailing list and ask for approval.  Could an admin please have a look at that?  My user name is my last</div><div style="">name in lowercase, baulig.<br><br>Looking forward to hear back from you,</div><div style=""><br></div><div style="">Martin</div><div style=""><br></div>
<div class="protonmail_signature_block protonmail_signature_block-empty" style="font-family: Arial, sans-serif; font-size: 14px;">
    <div class="protonmail_signature_block-user protonmail_signature_block-empty">
        
            </div>
    
            <div class="protonmail_signature_block-proton protonmail_signature_block-empty">
        
            </div>
</div>