Skip to content

Commit 3a275e5

Browse files
authored
Merge pull request #9535 from haskell/fix9534
Fix #9534 Add constructor `PPC64LE` to type `Arch`, for powerpc64le
2 parents 125cd2d + acf6768 commit 3a275e5

File tree

5 files changed

+25
-7
lines changed

5 files changed

+25
-7
lines changed

Cabal-syntax/src/Distribution/System.hs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,14 @@ buildOS = classifyOS Permissive System.Info.os
181181

182182
-- ------------------------------------------------------------
183183

184-
-- | These are the known Arches: I386, X86_64, PPC, PPC64, Sparc,
184+
-- | These are the known Arches: I386, X86_64, PPC, PPC64, PPC64LE, Sparc,
185185
-- Sparc64, Arm, AArch64, Mips, SH, IA64, S390, S390X, Alpha, Hppa,
186186
-- Rs6000, M68k, Vax, RISCV64, LoongArch64, JavaScript and Wasm32.
187187
--
188188
-- The following aliases can also be used:
189189
-- * PPC alias: powerpc
190-
-- * PPC64 alias : powerpc64, powerpc64le
190+
-- * PPC64 alias : powerpc64
191+
-- * PPC64LE alias : powerpc64le
191192
-- * Mips aliases: mipsel, mipseb
192193
-- * Arm aliases: armeb, armel
193194
-- * AArch64 aliases: arm64
@@ -196,6 +197,7 @@ data Arch
196197
| X86_64
197198
| PPC
198199
| PPC64
200+
| PPC64LE
199201
| Sparc
200202
| Sparc64
201203
| Arm
@@ -227,6 +229,7 @@ knownArches =
227229
, X86_64
228230
, PPC
229231
, PPC64
232+
, PPC64LE
230233
, Sparc
231234
, Sparc64
232235
, Arm
@@ -251,7 +254,8 @@ archAliases :: ClassificationStrictness -> Arch -> [String]
251254
archAliases Strict _ = []
252255
archAliases Compat _ = []
253256
archAliases _ PPC = ["powerpc"]
254-
archAliases _ PPC64 = ["powerpc64", "powerpc64le"]
257+
archAliases _ PPC64 = ["powerpc64"]
258+
archAliases _ PPC64LE = ["powerpc64le"]
255259
archAliases _ Mips = ["mipsel", "mipseb"]
256260
archAliases _ Arm = ["armeb", "armel"]
257261
archAliases _ AArch64 = ["arm64"]

Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ md5Check proxy md5Int = structureHash proxy @?= md5FromInteger md5Int
3333
md5CheckGenericPackageDescription :: Proxy GenericPackageDescription -> Assertion
3434
md5CheckGenericPackageDescription proxy = md5Check proxy
3535
#if MIN_VERSION_base(4,19,0)
36-
0xc638caeb7531f107f64d12773f9430d0
36+
0xbaf013a54a9ae4dab8d9c8beecb5ac5d
3737
#else
38-
0x7a231bff7bb37049ec7f2ebfd98d3243
38+
0xcbd99e3b359decfab4b25e1335067f72
3939
#endif
4040

4141
md5CheckLocalBuildInfo :: Proxy LocalBuildInfo -> Assertion
4242
md5CheckLocalBuildInfo proxy = md5Check proxy
4343
#if MIN_VERSION_base(4,19,0)
44-
0xceb2a9b9aa0555228a98bd875534be77
44+
0x403539e40a138deaf1a1189aa349cff2
4545
#else
46-
0xc94d93ef5dd99410a5b2f1f3c9853f00
46+
0x279674c69cfcfd5e8ffd51bc02965cd7
4747
#endif

Cabal/src/Distribution/Simple/GHC/Internal.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,7 @@ profDetailLevelFlag forLib mpl =
774774
ghcArchString :: Arch -> String
775775
ghcArchString PPC = "powerpc"
776776
ghcArchString PPC64 = "powerpc64"
777+
ghcArchString PPC64LE = "powerpc64le"
777778
ghcArchString other = prettyShow other
778779

779780
-- | GHC's rendering of its host or target 'OS' as used in its platform

Cabal/src/Distribution/Simple/PreProcess.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,7 @@ platformDefines lbi =
788788
X86_64 -> ["x86_64"]
789789
PPC -> ["powerpc"]
790790
PPC64 -> ["powerpc64"]
791+
PPC64LE -> ["powerpc64le"]
791792
Sparc -> ["sparc"]
792793
Sparc64 -> ["sparc64"]
793794
Arm -> ["arm"]

changelog.d/issue-9534

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
synopsis: Distinguish `powerpc64le`, by adding `PPC64LE` constructor to type `Arch`
2+
packages: Cabal Cabal-syntax
3+
prs: #9535
4+
issues: #9534
5+
6+
description: {
7+
8+
Adds constructor `PPC64LE` to type `Arch` to distinguish architecture
9+
powerpc64le from powerpc64. Existing constructor `PPC64` now exclusively
10+
represents powerpc64.
11+
12+
}

0 commit comments

Comments
 (0)