summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRon Olson <tachoknight@gmail.com>2019-03-14 12:17:47 -0500
committerRon Olson <tachoknight@gmail.com>2019-03-14 12:17:47 -0500
commitd66b7758bfaba0518558ac5217e50069bd34ff90 (patch)
treec61857dec1205fcc3a8813ff4236bccf82014528
parent52ecfbd29d8a0272cec9cfa381a8c1bb07da4b56 (diff)
downloadswift-lang-d66b7758bfaba0518558ac5217e50069bd34ff90.tar.gz
swift-lang-d66b7758bfaba0518558ac5217e50069bd34ff90.tar.xz
swift-lang-d66b7758bfaba0518558ac5217e50069bd34ff90.zip
Updated to handle latest Swift changes upstream
-rw-r--r--swift-lang.spec12
-rw-r--r--swift-unwrapped.patch20
2 files changed, 32 insertions, 0 deletions
diff --git a/swift-lang.spec b/swift-lang.spec
index d01e900..894f0a2 100644
--- a/swift-lang.spec
+++ b/swift-lang.spec
@@ -30,6 +30,8 @@ Patch0: change-lldb-location.patch
Patch1: no-ninja-build.patch
Patch2: clangloc.patch
Patch3: compiler-rt-fuzzer.patch
+Patch4: gettid.patch
+Patch5: swift-unwrapped.patch
BuildRequires: clang
BuildRequires: cmake
@@ -116,6 +118,14 @@ mv swift-xcode-playground-support-swift-%{swifttag} swift-xcode-playground-suppo
# Fixes an issue with using std::thread in a vector in compiler-rt
%patch3 -p0
+# Fixes issue with local, static copy of gettid() function colliding with
+# the glibc version
+%patch4 -p0
+
+# Patch for handling optional issue with pthreads functions in Swift file
+# in the package mananger
+%patch5 -p0
+
%build
export VERBOSE=1
@@ -160,6 +170,8 @@ ln -fs %{_bindir}/swift %{buildroot}%{_libexecdir}/swift-lldb/swift
mkdir -p %{buildroot}/usr/lib/swift
cp -r %{_builddir}/usr/lib/swift/* %{buildroot}/usr/lib/swift
+rm %{buildroot}/usr/lib/swift/clang
+cp -r %{_builddir}/usr/lib/clang %{buildroot}/usr/lib/swift
ln -fs /usr/lib/swift %{buildroot}/usr/lib/swift-lldb/swift
chmod 0755 %{buildroot}/usr/lib/swift/linux/libswiftDispatch.so
chmod 0755 %{buildroot}/usr/lib/swift/linux/libFoundation.so
diff --git a/swift-unwrapped.patch b/swift-unwrapped.patch
new file mode 100644
index 0000000..0f88eb0
--- /dev/null
+++ b/swift-unwrapped.patch
@@ -0,0 +1,20 @@
+--- swiftpm/Sources/Basic/Process.swift.orig 2019-03-13 14:27:25.426760197 -0500
++++ swiftpm/Sources/Basic/Process.swift 2019-03-13 14:28:45.656837626 -0500
+@@ -327,7 +327,7 @@
+ let devNull = strdup("/dev/null")
+ defer { free(devNull) }
+ // Open /dev/null as stdin.
+- posix_spawn_file_actions_addopen(&fileActions, 0, devNull, O_RDONLY, 0)
++ posix_spawn_file_actions_addopen(&fileActions, 0, devNull!, O_RDONLY, 0)
+
+ var outputPipe: [Int32] = [0, 0]
+ var stderrPipe: [Int32] = [0, 0]
+@@ -350,7 +350,7 @@
+
+ let argv = CStringArray(arguments)
+ let env = CStringArray(environment.map({ "\($0.0)=\($0.1)" }))
+- let rv = posix_spawnp(&processID, argv.cArray[0], &fileActions, &attributes, argv.cArray, env.cArray)
++ let rv = posix_spawnp(&processID, argv.cArray[0]!, &fileActions, &attributes, argv.cArray, env.cArray)
+
+ guard rv == 0 else {
+ throw SystemError.posix_spawn(rv, arguments)