Skip to content

Instantly share code, notes, and snippets.

View colemancda's full-sized avatar
🏎️
Working with Swift on ARM

Alsey Coleman Miller colemancda

🏎️
Working with Swift on ARM
View GitHub Profile
@colemancda
colemancda / ArtNetOEM.swift
Last active February 25, 2020 02:53
Generating code for Art-Net OEM codes
import Foundation
//("Mnemonic","OemCode","Manufacturer","Product","DMX in","DMX out","Are ports Physical","Is RDM supported","Website")),
let list: [(String, String, String, String, String, String, String, String, String)] = [("Oem0x0a92","0x0a92","Clay Paky S.p.A.","","2","2","y","y",#"http://www.claypaky.it/"#),
("Oem0x13f8","0x13f8","Imimot Kft","Mitti","1","0","n","n",#"http://imimot.com/Mitti"#),
("Oem0x13f9","0x13f9","MCSWE Technologies.INC","MCSWE LUNA 8","8","8","y","n",#"http://www.mcswe.com"#),
("Oem0x13fa","0x13fa","MCSWE Technologies.INC","MCSWE LUNA 16","16","16","y","n",#"http://www.mcswe.com"#),
("Oem0x13fb","0x13fb","Digital Sputnik Lighting","DSL1","1","1","y","y",#"http://www.digitalsputnik.com/"#),
("Oem0x13fc","0x13fc","SRS Light Design","ANGS4","4","4","y","n",#"http://www.srslight.com"#),
("Oem0x13fd","0x13fd","Chauvet DJ","DMX-AN","2","2","Y","N",#"http://www.Chauvetdj.com"#),
@colemancda
colemancda / swift-buildroot.patch
Last active May 18, 2022 06:00
Swift support for Buildroot
diff --git a/package/Config.in b/package/Config.in
index 517e66cce7..a742b540e5 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2020,6 +2020,11 @@ comment "linux-pam plugins"
endif
source "package/liquid-dsp/Config.in"
source "package/llvm/Config.in"
+ source "package/swift/Config.in"
+ source "package/libdispatch/Config.in"
@colemancda
colemancda / swift-5.5.3-ppc.patch
Created March 5, 2022 06:46
Swift 5.5.3 patched to compile for PowerPC 32-bit
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7a3cc3af07a..d0963c1804f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -285,7 +285,7 @@ set(SWIFT_ANDROID_DEPLOY_DEVICE_PATH "" CACHE STRING
#
foreach(sdk ANDROID;FREEBSD;LINUX;WINDOWS;HAIKU;WASI)
- foreach(arch aarch64;armv6;armv7;i686;powerpc64;powerpc64le;s390x;wasm32;x86_64)
+ foreach(arch aarch64;armv6;armv7;i686;powerpc;powerpc64;powerpc64le;s390x;wasm32;x86_64)
@colemancda
colemancda / swift-5.5.3-armv5.patch
Last active March 28, 2022 02:36
Swift 5.5.3 patched for Armv5
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7a3cc3af07a..d99fbc56348 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -285,7 +285,7 @@ set(SWIFT_ANDROID_DEPLOY_DEVICE_PATH "" CACHE STRING
#
foreach(sdk ANDROID;FREEBSD;LINUX;WINDOWS;HAIKU;WASI)
- foreach(arch aarch64;armv6;armv7;i686;powerpc64;powerpc64le;s390x;wasm32;x86_64)
+ foreach(arch aarch64;armv5;armv6;armv7;i686;powerpc64;powerpc64le;s390x;wasm32;x86_64)
@colemancda
colemancda / imx6slevk-config-buildroot
Created March 5, 2022 06:55
Swift 5.5.3 config for Buildroot (imx6slevk)
#
# Automatically generated file; DO NOT EDIT.
# Buildroot 2021.08-rc2-3459-ge939f55657 Configuration
#
BR2_HAVE_DOT_CONFIG=y
BR2_HOST_GCC_AT_LEAST_4_9=y
BR2_HOST_GCC_AT_LEAST_5=y
BR2_HOST_GCC_AT_LEAST_6=y
BR2_HOST_GCC_AT_LEAST_7=y
BR2_HOST_GCC_AT_LEAST_8=y
@colemancda
colemancda / swift-armv5-buildroot-config
Last active March 28, 2022 05:10
Swift 5.6 config for Buildroot (arm926ej-s)
#
# Automatically generated file; DO NOT EDIT.
# Buildroot 2022.02-398-gd5745888fa Configuration
#
BR2_HAVE_DOT_CONFIG=y
BR2_HOST_GCC_AT_LEAST_4_9=y
BR2_HOST_GCC_AT_LEAST_5=y
BR2_HOST_GCC_AT_LEAST_6=y
BR2_HOST_GCC_AT_LEAST_7=y
BR2_HOST_GCC_AT_LEAST_8=y
@colemancda
colemancda / libdispatch-5.5.3-armv5.patch
Last active March 5, 2022 12:16
Dispatch 5.5.3 patched for Armv5
diff --git a/src/shims/yield.c b/src/shims/yield.c
index 43f0017..d0c5fff 100644
--- a/src/shims/yield.c
+++ b/src/shims/yield.c
@@ -36,7 +36,7 @@ void *
_dispatch_wait_for_enqueuer(void **ptr)
{
#if !DISPATCH_HW_CONFIG_UP
-#if defined(__arm__) || defined(__arm64__)
+#if (defined(__arm__) && defined(__APPLE__)) || defined(__arm64__)
@colemancda
colemancda / swift-5.5.3-mips.patch
Last active March 19, 2022 07:42
Swift 5.5.3 patched for Mips
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7a3cc3af07a..d2f6f88c6c7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -285,7 +285,7 @@ set(SWIFT_ANDROID_DEPLOY_DEVICE_PATH "" CACHE STRING
#
foreach(sdk ANDROID;FREEBSD;LINUX;WINDOWS;HAIKU;WASI)
- foreach(arch aarch64;armv6;armv7;i686;powerpc64;powerpc64le;s390x;wasm32;x86_64)
+ foreach(arch aarch64;armv6;armv7;i686;powerpc64;powerpc64le;s390x;wasm32;x86_64;mips;mipsel;mips64;mips64el)
@colemancda
colemancda / swift-driver-5.5.3-armv5.patch
Created March 6, 2022 02:20
Swift Driver 5.5.3 patched for Armv5
diff --git a/Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift b/Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift
index 93eceb72..030a7714 100644
--- a/Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift
+++ b/Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift
@@ -40,6 +40,7 @@ extension GenericUnixToolchain {
// 'armv6', so just take a brute-force approach
if triple.archName.contains("armv7") { return "armv7" }
if triple.archName.contains("armv6") { return "armv6" }
+ if triple.archName.contains("armv5") { return "armv5" }
return triple.archName
@colemancda
colemancda / llvm-5.5.3-mips.patch
Created March 6, 2022 03:34
LLVM 5.5.3 patched for MIPS
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index c6d8942208e8..0840ea48bba4 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -7624,7 +7624,7 @@ void MSP430TargetCodeGenInfo::setTargetAttributes(
//===----------------------------------------------------------------------===//
namespace {
-class MipsABIInfo : public ABIInfo {
+class MipsABIInfo : public SwiftABIInfo {