Skip to content

Commit 0af02ed

Browse files
Kaiedeaciidgh
authored andcommitted
Add i686 Linux Support
Makes the basic changes required to build on 32-bit Linux as i686.
1 parent 54a3037 commit 0af02ed

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Sources/Build/Triple.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public struct Triple {
3232

3333
public enum Arch: String {
3434
case x86_64
35+
case i686
3536
case ppc64le
3637
case s390x
3738
case aarch64
@@ -113,7 +114,8 @@ public struct Triple {
113114
}
114115

115116
public static let macOS = try! Triple("x86_64-apple-macosx10.10")
116-
public static let x86Linux = try! Triple("x86_64-unknown-linux")
117+
public static let x86_64Linux = try! Triple("x86_64-unknown-linux")
118+
public static let i686Linux = try! Triple("i686-unknown-linux")
117119
public static let ppc64leLinux = try! Triple("powerpc64le-unknown-linux")
118120
public static let s390xLinux = try! Triple("s390x-unknown-linux")
119121
public static let arm64Linux = try! Triple("aarch64-unknown-linux")
@@ -127,7 +129,9 @@ public struct Triple {
127129
public static let hostTriple: Triple = .windows
128130
#elseif os(Linux)
129131
#if arch(x86_64)
130-
public static let hostTriple: Triple = .x86Linux
132+
public static let hostTriple: Triple = .x86_64Linux
133+
#elseif arch(i386)
134+
public static let hostTriple: Triple = .i686Linux
131135
#elseif arch(powerpc64le)
132136
public static let hostTriple: Triple = .ppc64leLinux
133137
#elseif arch(s390x)

Utilities/bootstrap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,8 @@ def main():
10351035
elif platform.system() == 'Linux':
10361036
if platform.machine() == 'x86_64':
10371037
build_target = "x86_64-unknown-linux"
1038+
elif platform.machine() == "i686":
1039+
build_target = "i686-unknown-linux"
10381040
elif platform.machine() == 's390x':
10391041
build_target = "s390x-unknown-linux"
10401042
elif platform.machine() == 'ppc64le':

0 commit comments

Comments
 (0)