#1121496 ghc: FTBFS on sparc64 due to ghc not detecting the target architecture

Package:
src:ghc
Source:
src:ghc
Submitter:
John Paul Adrian Glaubitz
Date:
2025-11-27 13:23:01 UTC
Severity:
normal
Tags:
#1121496#5
Date:
2025-11-27 12:57:08 UTC
From:
To:
Hi,

on sparc64, ghc currently fails to build from source because the compiler does
not properly detect the target architecture:

Configuring rts-1.0.2...
Warning: Packages using 'cabal-version: >= 1.10' and before 'cabal-version:
3.4' must specify the 'default-language' field for each component (e.g.
Haskell98 or Haskell2010). If a component uses different languages in
different modules then list the other ones in the 'other-languages' field.
Warning: Using ${pkgroot} in prefix ${pkgroot}/.. will not work if you rely on
the Path_* module or other hard coded paths. Cabal does not yet support fully
relocatable builds! See #462 #2302 #2994 #3305 #3473 #3586 #3909 #4097 #4291
#4872
configure: WARNING: unrecognized options: --with-compiler, --with-cc
checking build system type... sparc64-unknown-linux-gnu
checking host system type... Invalid configuration 'unknown-linux': machine 'unknown-unknown' not recognized
configure: error: /bin/bash //build/reproducible-path/ghc-9.10.3/rts/../config.sub unknown-linux failed
Error when running Shake build system:
  at want, called at src/Main.hs:126:44 in main:Main
* Depends on: binary-dist-dir
  at apply1, called at src/Development/Shake/Internal/Rules/Oracle.hs:159:32 in shake-0.19.8-3XwrCJSiRChB7EP7yLNDvP:Development.Shake.Internal.Rules.Oracle
* Depends on: OracleQ (ContextDataKey (Context {stage = Stage1, package = Package {pkgType = Library, pkgName = "rts", pkgPath = "rts"}, way = v, iplace = Final}))
  at need, called at src/Hadrian/Oracles/Cabal/Rules.hs:54:9 in main:Hadrian.Oracles.Cabal.Rules
* Depends on: _build/stage1/rts/setup-config
* Raised the exception:
ExitFailure 1

With ghc 9.6.6, the target architecture is detected properly:

(experimental_sparc64-dchroot)glaubitz@stadler:~/ghc-exp/ghc-9.10.3$ /usr/bin/ghc --info| grep 'Target platform'
 ,("Target platform","sparc64-unknown-linux")
(experimental_sparc64-dchroot)glaubitz@stadler:~/ghc-exp/ghc-9.10.3$

with ghc 9.10.3, this is no longer the case:

(experimental_sparc64-dchroot)glaubitz@stadler:~/ghc-exp/ghc-9.10.3$ ./_build/stage0/bin/ghc --info| grep 'Target platform'
 ,("Target platform","unknown-unknown-linux")
(experimental_sparc64-dchroot)glaubitz@stadler:~/ghc-exp/ghc-9.10.3$

The issue has been reported upstream [2] and is tracked in the sparclinux issue
tracker on GitHub. I have not been able yet to figure out what's wrong.

Thanks,
Adrian