Skip to content

Commit

Permalink
Merge pull request #9535 from haskell/fix9534
Browse files Browse the repository at this point in the history
Fix #9534 Add constructor `PPC64LE` to type `Arch`, for powerpc64le
  • Loading branch information
mergify[bot] authored Feb 22, 2024
2 parents 125cd2d + acf6768 commit 3a275e5
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
10 changes: 7 additions & 3 deletions Cabal-syntax/src/Distribution/System.hs
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,14 @@ buildOS = classifyOS Permissive System.Info.os

-- ------------------------------------------------------------

-- | These are the known Arches: I386, X86_64, PPC, PPC64, Sparc,
-- | These are the known Arches: I386, X86_64, PPC, PPC64, PPC64LE, Sparc,
-- 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
-- * PPC64 alias : powerpc64
-- * PPC64LE alias : powerpc64le
-- * Mips aliases: mipsel, mipseb
-- * Arm aliases: armeb, armel
-- * AArch64 aliases: arm64
Expand All @@ -196,6 +197,7 @@ data Arch
| X86_64
| PPC
| PPC64
| PPC64LE
| Sparc
| Sparc64
| Arm
Expand Down Expand Up @@ -227,6 +229,7 @@ knownArches =
, X86_64
, PPC
, PPC64
, PPC64LE
, Sparc
, Sparc64
, Arm
Expand All @@ -251,7 +254,8 @@ archAliases :: ClassificationStrictness -> Arch -> [String]
archAliases Strict _ = []
archAliases Compat _ = []
archAliases _ PPC = ["powerpc"]
archAliases _ PPC64 = ["powerpc64", "powerpc64le"]
archAliases _ PPC64 = ["powerpc64"]
archAliases _ PPC64LE = ["powerpc64le"]
archAliases _ Mips = ["mipsel", "mipseb"]
archAliases _ Arm = ["armeb", "armel"]
archAliases _ AArch64 = ["arm64"]
Expand Down
8 changes: 4 additions & 4 deletions Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ md5Check proxy md5Int = structureHash proxy @?= md5FromInteger md5Int
md5CheckGenericPackageDescription :: Proxy GenericPackageDescription -> Assertion
md5CheckGenericPackageDescription proxy = md5Check proxy
#if MIN_VERSION_base(4,19,0)
0xc638caeb7531f107f64d12773f9430d0
0xbaf013a54a9ae4dab8d9c8beecb5ac5d
#else
0x7a231bff7bb37049ec7f2ebfd98d3243
0xcbd99e3b359decfab4b25e1335067f72
#endif

md5CheckLocalBuildInfo :: Proxy LocalBuildInfo -> Assertion
md5CheckLocalBuildInfo proxy = md5Check proxy
#if MIN_VERSION_base(4,19,0)
0xceb2a9b9aa0555228a98bd875534be77
0x403539e40a138deaf1a1189aa349cff2
#else
0xc94d93ef5dd99410a5b2f1f3c9853f00
0x279674c69cfcfd5e8ffd51bc02965cd7
#endif
1 change: 1 addition & 0 deletions Cabal/src/Distribution/Simple/GHC/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,7 @@ profDetailLevelFlag forLib mpl =
ghcArchString :: Arch -> String
ghcArchString PPC = "powerpc"
ghcArchString PPC64 = "powerpc64"
ghcArchString PPC64LE = "powerpc64le"
ghcArchString other = prettyShow other

-- | GHC's rendering of its host or target 'OS' as used in its platform
Expand Down
1 change: 1 addition & 0 deletions Cabal/src/Distribution/Simple/PreProcess.hs
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,7 @@ platformDefines lbi =
X86_64 -> ["x86_64"]
PPC -> ["powerpc"]
PPC64 -> ["powerpc64"]
PPC64LE -> ["powerpc64le"]
Sparc -> ["sparc"]
Sparc64 -> ["sparc64"]
Arm -> ["arm"]
Expand Down
12 changes: 12 additions & 0 deletions changelog.d/issue-9534
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
synopsis: Distinguish `powerpc64le`, by adding `PPC64LE` constructor to type `Arch`
packages: Cabal Cabal-syntax
prs: #9535
issues: #9534

description: {

Adds constructor `PPC64LE` to type `Arch` to distinguish architecture
powerpc64le from powerpc64. Existing constructor `PPC64` now exclusively
represents powerpc64.

}

0 comments on commit 3a275e5

Please sign in to comment.