From 5ae4f2eb716e29ba66516276699973a33cb69bc9 Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz Date: Tue, 14 Nov 2023 08:48:14 +0100 Subject: [PATCH] Add support for 64-bit SPARC as a separate architecture Previously, sparc64 was defined as an alias for the 32-bit SPARC architecture which was true while SPARC mainland was mostly 32 bits. More recently, 64-bit SPARC has become a port of its own, so it needs to be treated as a separate architecture. --- Cabal-syntax/src/Distribution/System.hs | 8 ++++---- .../tests/UnitTests/Distribution/Utils/Structured.hs | 4 ++-- Cabal/src/Distribution/Simple/PreProcess.hs | 1 + changelog.d/pr-9445 | 3 +++ 4 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 changelog.d/pr-9445 diff --git a/Cabal-syntax/src/Distribution/System.hs b/Cabal-syntax/src/Distribution/System.hs index 041d13a3be7..b15d8e388e7 100644 --- a/Cabal-syntax/src/Distribution/System.hs +++ b/Cabal-syntax/src/Distribution/System.hs @@ -182,13 +182,12 @@ buildOS = classifyOS Permissive System.Info.os -- ------------------------------------------------------------ -- | These are the known Arches: I386, X86_64, PPC, PPC64, Sparc, --- Arm, AArch64, Mips, SH, IA64, S390, S390X, Alpha, Hppa, Rs6000, --- M68k, Vax, RISCV64, LoongArch64, JavaScript and Wasm32. +-- Sparc64, Arm, AArch64, Mips, SH, IA64, S390, S390X, Alpha, Hppa, +-- Rs6000, M68k, Vax, RISCV64, LoongArch64, JavaScript and Wasm32. -- -- The following aliases can also be used: -- * PPC alias: powerpc -- * PPC64 alias : powerpc64, powerpc64le --- * Sparc aliases: sparc64, sun4 -- * Mips aliases: mipsel, mipseb -- * Arm aliases: armeb, armel -- * AArch64 aliases: arm64 @@ -198,6 +197,7 @@ data Arch | PPC | PPC64 | Sparc + | Sparc64 | Arm | AArch64 | Mips @@ -228,6 +228,7 @@ knownArches = , PPC , PPC64 , Sparc + , Sparc64 , Arm , AArch64 , Mips @@ -251,7 +252,6 @@ archAliases Strict _ = [] archAliases Compat _ = [] archAliases _ PPC = ["powerpc"] archAliases _ PPC64 = ["powerpc64", "powerpc64le"] -archAliases _ Sparc = ["sparc64", "sun4"] archAliases _ Mips = ["mipsel", "mipseb"] archAliases _ Arm = ["armeb", "armel"] archAliases _ AArch64 = ["arm64"] diff --git a/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs b/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs index 900aedc0ca3..caf3e16d038 100644 --- a/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs +++ b/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs @@ -27,9 +27,9 @@ tests = testGroup "Distribution.Utils.Structured" -- The difference is in encoding of newtypes #if MIN_VERSION_base(4,7,0) , testCase "GenericPackageDescription" $ - md5Check (Proxy :: Proxy GenericPackageDescription) 0x6ad1e12c6f88291e9b8c131d239eda70 + md5Check (Proxy :: Proxy GenericPackageDescription) 0xb287a6f04e34ef990cdd15bc6cb01c76 , testCase "LocalBuildInfo" $ - md5Check (Proxy :: Proxy LocalBuildInfo) 0xbc7ac84a9bc43345c812af222c3e5ba0 + md5Check (Proxy :: Proxy LocalBuildInfo) 0x26e91a71ebd19d4d6ce37f798ede249a #endif ] diff --git a/Cabal/src/Distribution/Simple/PreProcess.hs b/Cabal/src/Distribution/Simple/PreProcess.hs index 31e228812d6..886ba7e7fd6 100644 --- a/Cabal/src/Distribution/Simple/PreProcess.hs +++ b/Cabal/src/Distribution/Simple/PreProcess.hs @@ -850,6 +850,7 @@ platformDefines lbi = PPC -> ["powerpc"] PPC64 -> ["powerpc64"] Sparc -> ["sparc"] + Sparc64 -> ["sparc64"] Arm -> ["arm"] AArch64 -> ["aarch64"] Mips -> ["mips"] diff --git a/changelog.d/pr-9445 b/changelog.d/pr-9445 new file mode 100644 index 00000000000..37f024ea060 --- /dev/null +++ b/changelog.d/pr-9445 @@ -0,0 +1,3 @@ +synopsis: Add support for 64-bit SPARC as a separate architecture +prs: #9445 +packages: Cabal Cabal-syntax