Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82f28823fd | ||
|
|
c21258489f |
14 changed files with 515 additions and 190 deletions
13
cmake.patch
13
cmake.patch
|
|
@ -10,16 +10,3 @@ index 9d14f6b70f..491f023493 100644
|
|||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
|
||||
--- cmake.orig/Source/cmake.cxx
|
||||
+++ cmake/Source/cmake.cxx
|
||||
@@ -131,7 +131,9 @@
|
||||
// NOTE: the __linux__ macro is predefined on Android host too, but
|
||||
// main CMakeLists.txt filters out this generator by host name.
|
||||
#if (defined(__linux__) && !defined(__ANDROID__)) || defined(_WIN32)
|
||||
+#if !defined(CMAKE_BOOTSTRAP)
|
||||
# include "cmGlobalGhsMultiGenerator.h"
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
|
|
|
|||
32
cython_updates.patch
Normal file
32
cython_updates.patch
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
diff --color -Naur llvm-project-orig/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
|
||||
--- llvm-project-orig/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp 2024-06-21 17:13:30.216450095 -0500
|
||||
+++ llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp 2024-06-21 17:17:12.418191122 -0500
|
||||
@@ -76,7 +76,7 @@
|
||||
#elif PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 7
|
||||
return _Py_Finalizing != nullptr;
|
||||
#else
|
||||
- return _Py_IsFinalizing();
|
||||
+ return Py_IsFinalizing();
|
||||
#endif
|
||||
}
|
||||
|
||||
diff --color -Naur llvm-project-orig/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
|
||||
--- llvm-project-orig/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp 2024-06-21 17:13:30.217450161 -0500
|
||||
+++ llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp 2024-06-21 17:18:29.299291469 -0500
|
||||
@@ -201,16 +201,6 @@
|
||||
return;
|
||||
#endif
|
||||
|
||||
- if (PyEval_ThreadsInitialized()) {
|
||||
- Log *log = GetLog(LLDBLog::Script);
|
||||
-
|
||||
- m_was_already_initialized = true;
|
||||
- m_gil_state = PyGILState_Ensure();
|
||||
- LLDB_LOGV(log, "Ensured PyGILState. Previous state = {0}locked\n",
|
||||
- m_gil_state == PyGILState_UNLOCKED ? "un" : "");
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
// InitThreads acquires the GIL if it hasn't been called before.
|
||||
PyEval_InitThreads();
|
||||
}
|
||||
11
debug_build.patch
Normal file
11
debug_build.patch
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
--- swift/utils/build-presets.ini.orig 2024-12-18 16:04:59.478543323 -0600
|
||||
+++ swift/utils/build-presets.ini 2024-12-18 16:07:08.704085878 -0600
|
||||
@@ -857,7 +857,7 @@
|
||||
mixin_linux_installation
|
||||
build-subdir=buildbot_linux
|
||||
lldb
|
||||
-release
|
||||
+debug
|
||||
test
|
||||
validation-test
|
||||
long-test
|
||||
39
disable_warning.patch
Normal file
39
disable_warning.patch
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
diff --color -Naur swift-corelibs-libdispatch-orig/src/apply.c swift-corelibs-libdispatch/src/apply.c
|
||||
--- swift-corelibs-libdispatch-orig/src/apply.c 2022-10-01 10:48:05.000000000 -0500
|
||||
+++ swift-corelibs-libdispatch/src/apply.c 2024-12-17 14:56:01.110477562 -0600
|
||||
@@ -20,6 +20,9 @@
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
+#pragma GCC diagnostic push
|
||||
+#pragma GCC diagnostic ignored "-Wcast-function-type-mismatch"
|
||||
+
|
||||
typedef void (*dispatch_apply_function_t)(void *, size_t);
|
||||
static char const * const _dispatch_apply_key = "apply";
|
||||
|
||||
@@ -366,3 +369,6 @@
|
||||
(dispatch_apply_function_t)_dispatch_Block_invoke(work));
|
||||
}
|
||||
#endif
|
||||
+
|
||||
+#pragma GCC diagnostic pop
|
||||
+
|
||||
diff --color -Naur swift-corelibs-libdispatch-orig/src/data.c swift-corelibs-libdispatch/src/data.c
|
||||
--- swift-corelibs-libdispatch-orig/src/data.c 2022-10-01 10:48:05.000000000 -0500
|
||||
+++ swift-corelibs-libdispatch/src/data.c 2024-12-17 14:57:39.514903781 -0600
|
||||
@@ -20,6 +20,9 @@
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
+#pragma GCC diagnostic push
|
||||
+#pragma GCC diagnostic ignored "-Wcast-function-type-mismatch"
|
||||
+
|
||||
/*
|
||||
* Dispatch data objects are dispatch objects with standard retain/release
|
||||
* memory management. A dispatch data object either points to a number of other
|
||||
@@ -738,3 +741,5 @@
|
||||
return mep;
|
||||
}
|
||||
#endif // HAVE_MACH
|
||||
+
|
||||
+#pragma GCC diagnostic pop
|
||||
11
enablelzma.patch
Normal file
11
enablelzma.patch
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
--- swift/utils/build-script-impl.orig 2022-04-12 11:12:59.832022240 -0500
|
||||
+++ swift/utils/build-script-impl 2022-04-12 11:13:19.694223857 -0500
|
||||
@@ -2272,7 +2272,7 @@
|
||||
-DLLDB_ENABLE_CURSES=ON
|
||||
-DLLDB_ENABLE_LIBEDIT=ON
|
||||
-DLLDB_ENABLE_PYTHON=ON
|
||||
- -DLLDB_ENABLE_LZMA=OFF
|
||||
+ -DLLDB_ENABLE_LZMA=ON
|
||||
-DLLDB_ENABLE_LUA=OFF
|
||||
-DLLDB_INCLUDE_TESTS:BOOL=$(false_true ${BUILD_TOOLCHAIN_ONLY})
|
||||
-DLLDB_TEST_USER_ARGS="${DOTEST_ARGS}"
|
||||
40
fclose_issues.patch
Normal file
40
fclose_issues.patch
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
--- swift-tools-support-core/Sources/TSCBasic/FileSystem.swift.orig 2024-06-07 15:57:58.282574272 -0500
|
||||
+++ swift-tools-support-core/Sources/TSCBasic/FileSystem.swift 2024-06-07 16:00:41.442339293 -0500
|
||||
@@ -425,19 +425,19 @@
|
||||
if fp == nil {
|
||||
throw FileSystemError(errno: errno, path)
|
||||
}
|
||||
- defer { fclose(fp) }
|
||||
+ defer { fclose(fp!) }
|
||||
|
||||
// Read the data one block at a time.
|
||||
let data = BufferedOutputByteStream()
|
||||
var tmpBuffer = [UInt8](repeating: 0, count: 1 << 12)
|
||||
while true {
|
||||
- let n = fread(&tmpBuffer, 1, tmpBuffer.count, fp)
|
||||
+ let n = fread(&tmpBuffer, 1, tmpBuffer.count, fp!)
|
||||
if n < 0 {
|
||||
if errno == EINTR { continue }
|
||||
throw FileSystemError(.ioError(code: errno), path)
|
||||
}
|
||||
if n == 0 {
|
||||
- let errno = ferror(fp)
|
||||
+ let errno = ferror(fp!)
|
||||
if errno != 0 {
|
||||
throw FileSystemError(.ioError(code: errno), path)
|
||||
}
|
||||
@@ -455,12 +455,12 @@
|
||||
if fp == nil {
|
||||
throw FileSystemError(errno: errno, path)
|
||||
}
|
||||
- defer { fclose(fp) }
|
||||
+ defer { fclose(fp!) }
|
||||
|
||||
// Write the data in one chunk.
|
||||
var contents = bytes.contents
|
||||
while true {
|
||||
- let n = fwrite(&contents, 1, contents.count, fp)
|
||||
+ let n = fwrite(&contents, 1, contents.count, fp!)
|
||||
if n < 0 {
|
||||
if errno == EINTR { continue }
|
||||
throw FileSystemError(.ioError(code: errno), path)
|
||||
15
fs.patch
Normal file
15
fs.patch
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
--- llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp.orig 2022-08-03 19:13:51.591055629 -0500
|
||||
+++ llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp 2022-08-03 19:13:56.112348435 -0500
|
||||
@@ -73,7 +73,11 @@
|
||||
#include <sys/vt.h>
|
||||
#include <linux/cdrom.h>
|
||||
#include <linux/fd.h>
|
||||
-#include <linux/fs.h>
|
||||
+//#include <linux/fs.h>
|
||||
+#define FS_IOC_GETFLAGS _IOR('f', 1, long)
|
||||
+#define FS_IOC_SETFLAGS _IOW('f', 2, long)
|
||||
+#define FS_IOC_GETVERSION _IOR('v', 1, long)
|
||||
+#define FS_IOC_SETVERSION _IOW('v', 2, long)
|
||||
#include <linux/hdreg.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/ioctl.h>
|
||||
27
new_glibc.patch
Normal file
27
new_glibc.patch
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
diff --color -Naur swift-corelibs-foundation-orig/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h swift-corelibs-foundation/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h
|
||||
--- swift-corelibs-foundation-orig/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h 2023-07-06 10:02:48.000000000 -0500
|
||||
+++ swift-corelibs-foundation/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h 2023-08-16 12:53:42.332226574 -0500
|
||||
@@ -189,7 +189,7 @@
|
||||
#define CF_RETAIN_BALANCED_ELSEWHERE(obj, identified_location) do { } while (0)
|
||||
#endif
|
||||
|
||||
-#if (TARGET_OS_LINUX && !TARGET_OS_ANDROID && !TARGET_OS_CYGWIN) || TARGET_OS_WIN32
|
||||
+#if (TARGET_OS_LINUX && !TARGET_OS_ANDROID && !TARGET_OS_CYGWIN && !ALREADY_HAVE_STRL_FUNCS) || TARGET_OS_WIN32
|
||||
CF_INLINE size_t
|
||||
strlcpy(char * dst, const char * src, size_t maxlen) {
|
||||
const size_t srclen = strlen(src);
|
||||
diff --color -Naur swift-corelibs-foundation-orig/CoreFoundation/CMakeLists.txt swift-corelibs-foundation/CoreFoundation/CMakeLists.txt
|
||||
--- swift-corelibs-foundation-orig/CoreFoundation/CMakeLists.txt 2023-07-06 10:02:48.000000000 -0500
|
||||
+++ swift-corelibs-foundation/CoreFoundation/CMakeLists.txt 2023-08-16 12:53:44.851386844 -0500
|
||||
@@ -80,6 +80,11 @@
|
||||
add_compile_definitions($<$<COMPILE_LANGUAGE:C>:HAVE_SCHED_GETAFFINITY>)
|
||||
endif()
|
||||
endif()
|
||||
+ # XYZZY
|
||||
+ check_symbol_exists(strlcpy "string.h" HAVE_NEW_GLIBC)
|
||||
+ if(HAVE_NEW_GLIBC)
|
||||
+ add_compile_definitions($<$<COMPILE_LANGUAGE:C>:ALREADY_HAVE_STRL_FUNCS>)
|
||||
+ endif()
|
||||
endif()
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL Windows)
|
||||
# NOTE(compnerd) we only support building with the dynamic CRT as using the
|
||||
11
no-test.patch
Normal file
11
no-test.patch
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
--- swift/utils/build-presets.ini.orig 2023-02-06 19:59:52.297617075 -0600
|
||||
+++ swift/utils/build-presets.ini 2023-02-06 20:00:17.131186971 -0600
|
||||
@@ -834,7 +834,7 @@
|
||||
# Executes the lit tests for the installable package that is created
|
||||
# Assumes the swift-integration-tests repo is checked out
|
||||
|
||||
-test-installable-package
|
||||
+#test-installable-package
|
||||
|
||||
# Build the benchmarks against the toolchain.
|
||||
toolchain-benchmarks
|
||||
270
no_pipes_58.patch
Normal file
270
no_pipes_58.patch
Normal file
|
|
@ -0,0 +1,270 @@
|
|||
diff --color -Naur llvm-project/clang/utils/creduce-clang-crash.py llvm-project/clang/utils/creduce-clang-crash.py
|
||||
--- llvm-project/clang/utils/creduce-clang-crash.py 2024-06-20 13:38:53.943180833 -0500
|
||||
+++ llvm-project/clang/utils/creduce-clang-crash.py 2024-06-20 13:42:30.244711005 -0500
|
||||
@@ -14,7 +14,6 @@
|
||||
import stat
|
||||
import sys
|
||||
import subprocess
|
||||
-import pipes
|
||||
import shlex
|
||||
import tempfile
|
||||
import shutil
|
||||
@@ -57,7 +56,7 @@
|
||||
sys.exit("ERROR: `%s` not found in %s" % (cmd_name, cmd_dir))
|
||||
|
||||
def quote_cmd(cmd):
|
||||
- return ' '.join(pipes.quote(arg) for arg in cmd)
|
||||
+ return ' '.join(shlex.quote(arg) for arg in cmd)
|
||||
|
||||
def write_to_script(text, filename):
|
||||
with open(filename, 'w') as f:
|
||||
@@ -199,7 +198,7 @@
|
||||
""" % (disable_symbolization, quote_cmd(self.get_crash_cmd()))
|
||||
|
||||
for msg in self.expected_output:
|
||||
- output += 'grep -F %s t.log || exit 1\n' % pipes.quote(msg)
|
||||
+ output += 'grep -F %s t.log || exit 1\n' % shlex.quote(msg)
|
||||
|
||||
write_to_script(output, self.testfile)
|
||||
self.check_interestingness()
|
||||
diff --color -Naur llvm-project/compiler-rt/test/asan/lit.cfg.py llvm-project/compiler-rt/test/asan/lit.cfg.py
|
||||
--- llvm-project/compiler-rt/test/asan/lit.cfg.py 2024-06-20 13:38:17.808753484 -0500
|
||||
+++ llvm-project/compiler-rt/test/asan/lit.cfg.py 2024-06-20 13:43:18.446949016 -0500
|
||||
@@ -6,14 +6,8 @@
|
||||
|
||||
import lit.formats
|
||||
|
||||
-# Get shlex.quote if available (added in 3.3), and fall back to pipes.quote if
|
||||
-# it's not available.
|
||||
-try:
|
||||
- import shlex
|
||||
- sh_quote = shlex.quote
|
||||
-except:
|
||||
- import pipes
|
||||
- sh_quote = pipes.quote
|
||||
+import shlex
|
||||
+sh_quote = shlex.quote
|
||||
|
||||
def get_required_attr(config, attr_name):
|
||||
attr_value = getattr(config, attr_name, None)
|
||||
diff --color -Naur llvm-project/compiler-rt/test/lit.common.cfg.py llvm-project/compiler-rt/test/lit.common.cfg.py
|
||||
--- llvm-project/compiler-rt/test/lit.common.cfg.py 2024-06-20 13:38:17.788752141 -0500
|
||||
+++ llvm-project/compiler-rt/test/lit.common.cfg.py 2024-06-20 13:43:44.961730162 -0500
|
||||
@@ -12,14 +12,8 @@
|
||||
import lit.formats
|
||||
import lit.util
|
||||
|
||||
-# Get shlex.quote if available (added in 3.3), and fall back to pipes.quote if
|
||||
-# it's not available.
|
||||
-try:
|
||||
- import shlex
|
||||
- sh_quote = shlex.quote
|
||||
-except:
|
||||
- import pipes
|
||||
- sh_quote = pipes.quote
|
||||
+import shlex
|
||||
+sh_quote = shlex.quote
|
||||
|
||||
def find_compiler_libdir():
|
||||
"""
|
||||
diff --color -Naur llvm-project/compiler-rt/test/memprof/lit.cfg.py llvm-project/compiler-rt/test/memprof/lit.cfg.py
|
||||
--- llvm-project/compiler-rt/test/memprof/lit.cfg.py 2024-06-20 13:38:17.852756440 -0500
|
||||
+++ llvm-project/compiler-rt/test/memprof/lit.cfg.py 2024-06-20 13:44:09.179356996 -0500
|
||||
@@ -6,14 +6,8 @@
|
||||
|
||||
import lit.formats
|
||||
|
||||
-# Get shlex.quote if available (added in 3.3), and fall back to pipes.quote if
|
||||
-# it's not available.
|
||||
-try:
|
||||
- import shlex
|
||||
- sh_quote = shlex.quote
|
||||
-except:
|
||||
- import pipes
|
||||
- sh_quote = pipes.quote
|
||||
+import shlex
|
||||
+sh_quote = shlex.quote
|
||||
|
||||
def get_required_attr(config, attr_name):
|
||||
attr_value = getattr(config, attr_name, None)
|
||||
diff --color -Naur llvm-project/compiler-rt/test/sanitizer_common/ios_commands/iossim_run.py llvm-project/compiler-rt/test/sanitizer_common/ios_commands/iossim_run.py
|
||||
--- llvm-project/compiler-rt/test/sanitizer_common/ios_commands/iossim_run.py 2024-06-20 13:38:17.946762755 -0500
|
||||
+++ llvm-project/compiler-rt/test/sanitizer_common/ios_commands/iossim_run.py 2024-06-20 13:48:37.348371396 -0500
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
-import glob, os, pipes, sys, subprocess
|
||||
+import glob, os, shlex, sys, subprocess
|
||||
|
||||
|
||||
device_id = os.environ.get('SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER')
|
||||
@@ -39,7 +39,7 @@
|
||||
rm_args.append(arg)
|
||||
else:
|
||||
# FIXME(dliew): pipes.quote() is deprecated
|
||||
- rm_args.append(pipes.quote(arg))
|
||||
+ rm_args.append(shlex.quote(arg))
|
||||
rm_cmd_line = ["/bin/rm"] + rm_args
|
||||
rm_cmd_line_str = ' '.join(rm_cmd_line)
|
||||
# We use `shell=True` so that any wildcard globs get expanded by the shell.
|
||||
diff --color -Naur llvm-project/libcxx/utils/libcxx/test/config.py llvm-project/libcxx/utils/libcxx/test/config.py
|
||||
--- llvm-project/libcxx/utils/libcxx/test/config.py 2024-06-20 13:38:59.394547032 -0500
|
||||
+++ llvm-project/libcxx/utils/libcxx/test/config.py 2024-06-20 13:45:49.931125052 -0500
|
||||
@@ -9,7 +9,6 @@
|
||||
import copy
|
||||
import os
|
||||
import pkgutil
|
||||
-import pipes
|
||||
import platform
|
||||
import re
|
||||
import shlex
|
||||
@@ -434,7 +433,7 @@
|
||||
def quote(self, s):
|
||||
if platform.system() == 'Windows':
|
||||
return lit.TestRunner.quote_windows_command([s])
|
||||
- return pipes.quote(s)
|
||||
+ return shlex.quote(s)
|
||||
|
||||
def configure_substitutions(self):
|
||||
sub = self.config.substitutions
|
||||
diff --color -Naur llvm-project/libcxx/utils/libcxx/test/dsl.py llvm-project/libcxx/utils/libcxx/test/dsl.py
|
||||
--- llvm-project/libcxx/utils/libcxx/test/dsl.py 2024-06-20 13:38:59.394547032 -0500
|
||||
+++ llvm-project/libcxx/utils/libcxx/test/dsl.py 2024-06-20 13:45:11.318531231 -0500
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import os
|
||||
import pickle
|
||||
-import pipes
|
||||
+import shlex
|
||||
import platform
|
||||
import re
|
||||
import shutil
|
||||
@@ -261,7 +261,7 @@
|
||||
}
|
||||
#endif
|
||||
"""
|
||||
- return programSucceeds(config, program, args=[pipes.quote(l) for l in locales])
|
||||
+ return programSucceeds(config, program, args=[shlex.quote(l) for l in locales])
|
||||
|
||||
@_memoizeExpensiveOperation(lambda c, flags='': (c.substitutions, c.environment, flags))
|
||||
def compilerMacros(config, flags=''):
|
||||
diff --color -Naur llvm-project/libcxx/utils/libcxx/test/format.py llvm-project/libcxx/utils/libcxx/test/format.py
|
||||
--- llvm-project/libcxx/utils/libcxx/test/format.py 2024-06-20 13:38:59.394547032 -0500
|
||||
+++ llvm-project/libcxx/utils/libcxx/test/format.py 2024-06-20 13:45:31.689899688 -0500
|
||||
@@ -9,7 +9,7 @@
|
||||
import lit
|
||||
import lit.formats
|
||||
import os
|
||||
-import pipes
|
||||
+import shlex
|
||||
import re
|
||||
import shutil
|
||||
|
||||
diff --color -Naur ninja/configure.py ninja/configure.py
|
||||
--- ninja/configure.py 2024-06-20 13:38:14.957561954 -0500
|
||||
+++ ninja/configure.py 2024-06-20 13:46:12.859665292 -0500
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
from optparse import OptionParser
|
||||
import os
|
||||
-import pipes
|
||||
+import shlex
|
||||
import string
|
||||
import subprocess
|
||||
import sys
|
||||
@@ -264,7 +264,7 @@
|
||||
env_keys = set(['CXX', 'AR', 'CFLAGS', 'CXXFLAGS', 'LDFLAGS'])
|
||||
configure_env = dict((k, os.environ[k]) for k in os.environ if k in env_keys)
|
||||
if configure_env:
|
||||
- config_str = ' '.join([k + '=' + pipes.quote(configure_env[k])
|
||||
+ config_str = ' '.join([k + '=' + shlex.quote(configure_env[k])
|
||||
for k in configure_env])
|
||||
n.variable('configure_env', config_str + '$ ')
|
||||
n.newline()
|
||||
diff --color -Naur swift/utils/build_swift/build_swift/shell.py swift/utils/build_swift/build_swift/shell.py
|
||||
--- swift/utils/build_swift/build_swift/shell.py 2024-06-20 13:39:16.267680494 -0500
|
||||
+++ swift/utils/build_swift/build_swift/shell.py 2024-06-20 13:47:56.850650939 -0500
|
||||
@@ -23,7 +23,7 @@
|
||||
import sys
|
||||
from copy import copy as _copy
|
||||
from pathlib import Path
|
||||
-from pipes import quote as _quote
|
||||
+from shlex import quote as _quote
|
||||
from shlex import split
|
||||
from subprocess import CalledProcessError
|
||||
|
||||
diff --color -Naur swift/utils/sil-opt-verify-all-modules.py swift/utils/sil-opt-verify-all-modules.py
|
||||
--- swift/utils/sil-opt-verify-all-modules.py 2024-06-20 13:39:17.951793627 -0500
|
||||
+++ swift/utils/sil-opt-verify-all-modules.py 2024-06-20 13:40:50.278995757 -0500
|
||||
@@ -13,7 +13,7 @@
|
||||
import glob
|
||||
import multiprocessing
|
||||
import os
|
||||
-import pipes
|
||||
+import shlex
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
@@ -91,7 +91,7 @@
|
||||
|
||||
|
||||
def quote_shell_command(args):
|
||||
- return " ".join([pipes.quote(a) for a in args])
|
||||
+ return " ".join([shlex.quote(a) for a in args])
|
||||
|
||||
|
||||
def run_commands_in_parallel(commands):
|
||||
diff --color -Naur swift/utils/swift_build_support/swift_build_support/build_script_invocation.py swift/utils/swift_build_support/swift_build_support/build_script_invocation.py
|
||||
--- swift/utils/swift_build_support/swift_build_support/build_script_invocation.py 2024-06-20 13:39:16.270680695 -0500
|
||||
+++ swift/utils/swift_build_support/swift_build_support/build_script_invocation.py 2024-06-20 13:41:40.348359192 -0500
|
||||
@@ -11,7 +11,7 @@
|
||||
# ===---------------------------------------------------------------------===#
|
||||
|
||||
import os
|
||||
-import pipes
|
||||
+import shlex
|
||||
import platform
|
||||
|
||||
from build_swift.build_swift import argparse
|
||||
@@ -128,9 +128,9 @@
|
||||
"--build-jobs", str(args.build_jobs),
|
||||
"--lit-jobs", str(args.lit_jobs),
|
||||
"--common-cmake-options=%s" % ' '.join(
|
||||
- pipes.quote(opt) for opt in cmake.common_options()),
|
||||
+ shlex.quote(opt) for opt in cmake.common_options()),
|
||||
"--build-args=%s" % ' '.join(
|
||||
- pipes.quote(arg) for arg in cmake.build_args()),
|
||||
+ shlex.quote(arg) for arg in cmake.build_args()),
|
||||
"--dsymutil-jobs", str(args.dsymutil_jobs),
|
||||
]
|
||||
|
||||
@@ -388,7 +388,7 @@
|
||||
if args.extra_cmake_options:
|
||||
impl_args += [
|
||||
"--extra-cmake-options=%s" % ' '.join(
|
||||
- pipes.quote(opt) for opt in args.extra_cmake_options)
|
||||
+ shlex.quote(opt) for opt in args.extra_cmake_options)
|
||||
]
|
||||
|
||||
if args.lto_type is not None:
|
||||
diff --color -Naur swift/utils/swift_build_support/swift_build_support/shell.py swift/utils/swift_build_support/swift_build_support/shell.py
|
||||
--- swift/utils/swift_build_support/swift_build_support/shell.py 2024-06-20 13:39:16.271680762 -0500
|
||||
+++ swift/utils/swift_build_support/swift_build_support/shell.py 2024-06-20 13:42:02.214828084 -0500
|
||||
@@ -14,7 +14,7 @@
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
import os
|
||||
-import pipes
|
||||
+import shlex
|
||||
import platform
|
||||
import shutil
|
||||
import subprocess
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
|
||||
def _quote(arg):
|
||||
- return pipes.quote(str(arg))
|
||||
+ return shlex.quote(str(arg))
|
||||
|
||||
|
||||
def quote_command(args):
|
||||
208
swift-lang.spec
208
swift-lang.spec
|
|
@ -278,7 +278,6 @@ BuildRequires: kernel-cross-headers
|
|||
Requires: glibc-devel
|
||||
Requires: lld
|
||||
Requires: gcc
|
||||
Requires: %{name}-runtime = %{version}-%{release}
|
||||
|
||||
Recommends: libstdc++-devel
|
||||
Recommends: gcc-c++
|
||||
|
|
@ -316,22 +315,11 @@ and desktop apps, scaling up to cloud services. Most
|
|||
importantly, Swift is designed to make writing and maintaining
|
||||
correct programs easier for the developer.
|
||||
|
||||
%package runtime
|
||||
Summary: Swift runtime libraries
|
||||
|
||||
%description runtime
|
||||
Swift is a general-purpose programming language built using
|
||||
a modern approach to safety, performance, and software design
|
||||
patterns.
|
||||
|
||||
This package contains the Swift runtime libraries needed to run
|
||||
applications built with Swift.
|
||||
|
||||
|
||||
|
||||
%prep
|
||||
%forgesetup -a
|
||||
cd %{builddir}
|
||||
%setup -q -D -T -n .
|
||||
cd %{_builddir}
|
||||
%{lua:
|
||||
for i = 0, 53 do
|
||||
local subdir = rpm.expand("%{?subdir" .. i .. "}")
|
||||
|
|
@ -345,26 +333,26 @@ end
|
|||
%patch 44
|
||||
%patch 15
|
||||
%patch 5
|
||||
%patch 7
|
||||
%patch 7
|
||||
%patch 13
|
||||
%patch 25
|
||||
%patch 9
|
||||
|
||||
# Install custom Fedora preset
|
||||
cp %{SOURCE100} swift/utils/fedora-presets.ini
|
||||
cp %{SOURCE100} %{_builddir}/fedora-presets.ini
|
||||
|
||||
# Fix python to python3
|
||||
%py3_shebang_fix swift/utils/api_checker/swift-api-checker.py
|
||||
%py3_shebang_fix llvm-project/compiler-rt/lib/hwasan/scripts/hwasan_symbolize
|
||||
|
||||
# Force lld instead of gold for stage 0 and 1 bootstrapping
|
||||
sed -i 's/use_linker="gold"/use_linker="lld"/g' swift/utils/build-script-impl
|
||||
sed -i 's/-fuse-ld=gold/-fuse-ld=lld/g' swift/utils/build-script-impl
|
||||
|
||||
%global buildsubdir %{nil}
|
||||
%build
|
||||
export VERBOSE=1
|
||||
|
||||
# Workaround for GCC 16 ICE in cmath / riemann_zeta
|
||||
export CFLAGS="-O2 -g -fno-builtin-logf"
|
||||
export CXXFLAGS="-O2 -g -fno-builtin-logf"
|
||||
|
||||
# Four-stage bootstrap to build Swift from scratch without external Swift compiler
|
||||
# Stage 0: Build minimal Swift toolchain from C++ using gold linker
|
||||
# Produces: Swift compiler with C++ legacy driver (no SwiftPM, no swift-driver)
|
||||
|
|
@ -380,7 +368,7 @@ export CXXFLAGS="-O2 -g -fno-builtin-logf"
|
|||
# This matches upstream first-party distributions
|
||||
|
||||
echo "=== Bootstrap Stage 0: Building minimal Swift from C++ ==="
|
||||
%{builddir}/swift/utils/build-script --preset=bootstrap_stage0 \
|
||||
%{_builddir}/swift/utils/build-script --preset=bootstrap_stage0 \
|
||||
build_subdir=bootstrap_stage0 \
|
||||
install_destdir=%{_builddir}/stage0 \
|
||||
installable_package=%{_builddir}/swift-%{version}-stage0.tar.gz \
|
||||
|
|
@ -389,7 +377,7 @@ echo "=== Bootstrap Stage 0: Building minimal Swift from C++ ==="
|
|||
|
||||
echo "=== Bootstrap Stage 1: Rebuilding Swift with Stage 0 ==="
|
||||
export PATH=%{_builddir}/stage0/usr/bin:$PATH
|
||||
%{builddir}/swift/utils/build-script --preset=bootstrap_stage1 \
|
||||
%{_builddir}/swift/utils/build-script --preset=bootstrap_stage1 \
|
||||
build_subdir=bootstrap_stage1 \
|
||||
install_destdir=%{_builddir}/stage1 \
|
||||
installable_package=%{_builddir}/swift-%{version}-stage1.tar.gz \
|
||||
|
|
@ -398,7 +386,7 @@ export PATH=%{_builddir}/stage0/usr/bin:$PATH
|
|||
|
||||
echo "=== Bootstrap Stage 2: Building toolchain with SwiftPM ==="
|
||||
export PATH=%{_builddir}/stage1/usr/bin:%{_builddir}/stage0/usr/bin:$PATH
|
||||
%{builddir}/swift/utils/build-script --preset=bootstrap_stage2 \
|
||||
%{_builddir}/swift/utils/build-script --preset=bootstrap_stage2 \
|
||||
build_subdir=bootstrap_stage2 \
|
||||
install_destdir=%{_builddir}/stage2 \
|
||||
installable_package=%{_builddir}/swift-%{version}-stage2.tar.gz \
|
||||
|
|
@ -407,8 +395,8 @@ export PATH=%{_builddir}/stage1/usr/bin:%{_builddir}/stage0/usr/bin:$PATH
|
|||
|
||||
echo "=== Stage 3: Building final production toolchain with swift-driver ==="
|
||||
export PATH=%{_builddir}/stage2/usr/bin:%{_builddir}/stage1/usr/bin:%{_builddir}/stage0/usr/bin:$PATH
|
||||
%{builddir}/swift/utils/build-script --preset=fedora_final \
|
||||
--preset-file=%{builddir}/swift/utils/fedora-presets.ini \
|
||||
%{_builddir}/swift/utils/build-script --preset=fedora_final \
|
||||
--preset-file=%{_builddir}/fedora-presets.ini \
|
||||
build_subdir=fedora_final \
|
||||
install_destdir=%{_builddir} \
|
||||
installable_package=%{_builddir}/swift-%{version}-f%{fedora}.tar.gz \
|
||||
|
|
@ -417,117 +405,25 @@ export PATH=%{_builddir}/stage2/usr/bin:%{_builddir}/stage1/usr/bin:%{_builddir}
|
|||
|
||||
|
||||
%install
|
||||
# Create directory structure
|
||||
mkdir -p %{buildroot}%{_libexecdir}/swift/%{version}
|
||||
cp -r %{_builddir}/usr/* %{buildroot}%{_libexecdir}/swift/%{version}
|
||||
mkdir -p %{buildroot}%{_bindir}
|
||||
mkdir -p %{buildroot}%{_libdir}
|
||||
mkdir -p %{buildroot}%{_libexecdir}/swift/%{version}/bin
|
||||
mkdir -p %{buildroot}%{_libexecdir}/swift/%{version}/lib
|
||||
mkdir -p %{buildroot}%{_libexecdir}/swift/%{version}/include
|
||||
mkdir -p %{buildroot}%{_includedir}/swift
|
||||
mkdir -p %{buildroot}%{_datadir}/swift
|
||||
ln -fs %{_libexecdir}/swift/%{version}/bin/swift %{buildroot}%{_bindir}/swift
|
||||
ln -fs %{_libexecdir}/swift/%{version}/bin/swiftc %{buildroot}%{_bindir}/swiftc
|
||||
ln -fs %{_libexecdir}/swift/%{version}/bin/swift-build %{buildroot}%{_bindir}/swift-build
|
||||
ln -fs %{_libexecdir}/swift/%{version}/bin/swift-run %{buildroot}%{_bindir}/swift-run
|
||||
ln -fs %{_libexecdir}/swift/%{version}/bin/sourcekit-lsp %{buildroot}%{_bindir}/sourcekit-lsp
|
||||
mkdir -p %{buildroot}%{_mandir}/man1
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
|
||||
|
||||
# Install executables to %{_libexecdir} to maintain Swift's internal directory structure
|
||||
cp -a %{_builddir}/usr/bin/* %{buildroot}%{_libexecdir}/swift/%{version}/bin/
|
||||
|
||||
# Create symlinks in %{_bindir} for user-facing tools
|
||||
TOOLS="swift swiftc swift-build swift-run swift-package swift-test sourcekit-lsp swift-format swift-demangle"
|
||||
for tool in ${TOOLS}; do
|
||||
if [ -f %{buildroot}%{_libexecdir}/swift/%{version}/bin/$tool ]; then
|
||||
ln -sf %{_libexecdir}/swift/%{version}/bin/$tool %{buildroot}%{_bindir}/$tool
|
||||
fi
|
||||
done
|
||||
|
||||
# Install Swift runtime libraries to %{_libdir}
|
||||
if [ -d %{_builddir}/usr/lib/swift/linux ]; then
|
||||
for lib in %{_builddir}/usr/lib/swift/linux/*.so*; do
|
||||
[ -L "$lib" ] && continue # Skip symlinks, we'll handle them later
|
||||
[ -f "$lib" ] && install -m 0755 "$lib" %{buildroot}%{_libdir}/
|
||||
done
|
||||
# Now create symlinks
|
||||
for link in %{_builddir}/usr/lib/swift/linux/*.so*; do
|
||||
[ -L "$link" ] || continue
|
||||
target=$(readlink "$link")
|
||||
linkname=$(basename "$link")
|
||||
ln -sf "$target" %{buildroot}%{_libdir}/$linkname
|
||||
done
|
||||
fi
|
||||
|
||||
# Install libsourcekitdInProc.so from build directory to %%{_builddir}/usr/lib (it's not installed by CMake)
|
||||
if [ -f %{_builddir}/build/fedora_final/swift-linux-%{_arch}/lib/libsourcekitdInProc.so ]; then
|
||||
cp -a %{_builddir}/build/fedora_final/swift-linux-%{_arch}/lib/libsourcekitdInProc.so %{_builddir}/usr/lib/
|
||||
fi
|
||||
|
||||
# Install private libraries to toolchain lib dir
|
||||
for lib in libIndexStore.so libIndexStore.so.17.0 libsourcekitdInProc.so libswiftDemangle.so; do
|
||||
if [ -f %{_builddir}/usr/lib/$lib ]; then
|
||||
install -m 0755 %{_builddir}/usr/lib/$lib %{buildroot}%{_libexecdir}/swift/%{version}/lib/
|
||||
fi
|
||||
done
|
||||
# Create any missing version symlinks in private dir
|
||||
if [ -f %{buildroot}%{_libexecdir}/swift/%{version}/lib/libIndexStore.so.17.0 ] && [ ! -e %{buildroot}%{_libexecdir}/swift/%{version}/lib/libIndexStore.so ]; then
|
||||
ln -sf libIndexStore.so.17.0 %{buildroot}%{_libexecdir}/swift/%{version}/lib/libIndexStore.so
|
||||
fi
|
||||
|
||||
# Install lldb libraries to %{_libexecdir} (private, bundled with Swift toolchain)
|
||||
if [ -d %{_builddir}/usr/lib ]; then
|
||||
for lib in %{_builddir}/usr/lib/liblldb.so*; do
|
||||
if [ -e "$lib" ]; then
|
||||
mkdir -p %{buildroot}%{_libexecdir}/swift/%{version}/lib
|
||||
cp -a "$lib" %{buildroot}%{_libexecdir}/swift/%{version}/lib/
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Install lldb Python bindings
|
||||
if [ -d %{_builddir}/usr/lib64/python%{python3_version}/site-packages/lldb ]; then
|
||||
mkdir -p %{buildroot}%{_libexecdir}/swift/%{version}/lib64/python%{python3_version}/site-packages
|
||||
cp -a %{_builddir}/usr/lib64/python%{python3_version}/site-packages/lldb \
|
||||
%{buildroot}%{_libexecdir}/swift/%{version}/lib64/python%{python3_version}/site-packages/
|
||||
fi
|
||||
|
||||
# Install compiler private libraries and modules to %{_libexecdir}
|
||||
mkdir -p %{buildroot}%{_libexecdir}/swift/%{version}/lib/swift
|
||||
cp -a %{_builddir}/usr/lib/swift/* %{buildroot}%{_libexecdir}/swift/%{version}/lib/swift/
|
||||
# Remove the runtime .so files we already installed to %{_libdir}
|
||||
if [ -d %{buildroot}%{_libexecdir}/swift/%{version}/lib/swift/linux ]; then
|
||||
find %{buildroot}%{_libexecdir}/swift/%{version}/lib/swift/linux -name '*.so*' -type f -delete
|
||||
find %{buildroot}%{_libexecdir}/swift/%{version}/lib/swift/linux -name '*.so*' -type l -delete
|
||||
fi
|
||||
|
||||
# Install clang resource directory (sanitizer libraries, builtins)
|
||||
# Keep only what Swift needs internally
|
||||
if [ -d %{_builddir}/usr/lib/clang ]; then
|
||||
mkdir -p %{buildroot}%{_libexecdir}/swift/%{version}/lib/clang
|
||||
cp -a %{_builddir}/usr/lib/clang/* %{buildroot}%{_libexecdir}/swift/%{version}/lib/clang/
|
||||
fi
|
||||
|
||||
# Install SwiftDemangle headers (public API)
|
||||
if [ -d %{_builddir}/swift/include/swift/SwiftDemangle ]; then
|
||||
cp -a %{_builddir}/swift/include/swift/SwiftDemangle %{buildroot}%{_includedir}/swift/
|
||||
fi
|
||||
|
||||
# Install Swift headers and modulemaps (for C interop)
|
||||
if [ -d %{_builddir}/usr/include ]; then
|
||||
cp -a %{_builddir}/usr/include/* %{buildroot}%{_libexecdir}/swift/%{version}/include/
|
||||
fi
|
||||
|
||||
# Install data files
|
||||
if [ -d %{_builddir}/usr/share/swift ]; then
|
||||
cp -a %{_builddir}/usr/share/swift/* %{buildroot}%{_datadir}/swift/
|
||||
fi
|
||||
|
||||
# Install man pages
|
||||
if [ -f %{_builddir}/usr/share/man/man1/swift.1 ]; then
|
||||
install -m 0644 %{_builddir}/usr/share/man/man1/swift.1 %{buildroot}%{_mandir}/man1/
|
||||
fi
|
||||
|
||||
# Create compatibility symlink for module lookup
|
||||
ln -sf %{_libexecdir}/swift/%{version}/lib/swift %{buildroot}%{_libdir}/swift
|
||||
|
||||
# Install ld.so.conf.d configuration
|
||||
install -m 0644 %{SOURCE99} %{buildroot}%{_sysconfdir}/ld.so.conf.d/swiftlang.conf
|
||||
cp %{_builddir}/usr/share/man/man1/swift.1 %{buildroot}%{_mandir}/man1/swift.1
|
||||
mkdir -p %{buildroot}/usr/lib
|
||||
ln -fs %{_libexecdir}/swift/%{package_version}/lib/swift %{buildroot}/usr/lib/swift
|
||||
mkdir -p %{buildroot}%{_libdir}
|
||||
ln -fs %{_libexecdir}/swift/%{version}/lib/libIndexStore.so %{buildroot}%{_libdir}/
|
||||
ln -fs %{_libexecdir}/swift/%{version}/lib/libIndexStore.so.17 %{buildroot}%{_libdir}/
|
||||
ln -fs %{_libexecdir}/swift/%{version}/lib/libsourcekitdInProc.so %{buildroot}%{_libdir}/
|
||||
ln -fs %{_libexecdir}/swift/%{version}/lib/libswiftDemangle.so %{buildroot}%{_libdir}/
|
||||
mkdir -p %{buildroot}/%{_sysconfdir}/ld.so.conf.d/
|
||||
install -m 0644 %{SOURCE99} %{buildroot}/%{_sysconfdir}/ld.so.conf.d/swiftlang.conf
|
||||
|
||||
|
||||
# This is to fix an issue with check-rpaths complaining about
|
||||
|
|
@ -537,59 +433,23 @@ export QA_SKIP_RPATHS=1
|
|||
|
||||
%files
|
||||
%license swift/LICENSE.txt
|
||||
|
||||
# User-facing executables (symlinks to %%{_libexecdir}/swift/%%{version}/bin/)
|
||||
%{_bindir}/swift
|
||||
%{_bindir}/swiftc
|
||||
%{_bindir}/swift-build
|
||||
%{_bindir}/swift-run
|
||||
%{_bindir}/swift-package
|
||||
%{_bindir}/swift-test
|
||||
%{_bindir}/sourcekit-lsp
|
||||
%{_bindir}/swift-format
|
||||
%{_bindir}/swift-demangle
|
||||
|
||||
# Man pages
|
||||
%{_mandir}/man1/swift.1.gz
|
||||
|
||||
# SourceKit/IndexStore/SwiftDemangle private libraries
|
||||
%{_libexecdir}/swift/%{version}/lib/libIndexStore.so*
|
||||
%{_libexecdir}/swift/%{version}/lib/libsourcekitdInProc.so*
|
||||
%{_libexecdir}/swift/%{version}/lib/libswiftDemangle.so*
|
||||
|
||||
# Compatibility symlink for module lookup
|
||||
%{_libdir}/swift
|
||||
|
||||
# Backend tools and compiler internals
|
||||
%{_libexecdir}/swift/
|
||||
|
||||
# Public headers
|
||||
%{_includedir}/swift/
|
||||
|
||||
# Data files (diagnostics, features.json, etc.)
|
||||
%{_datadir}/swift/
|
||||
|
||||
%files runtime
|
||||
%license swift/LICENSE.txt
|
||||
|
||||
%{_libdir}/libswift*.so*
|
||||
%{_libdir}/libFoundation*.so*
|
||||
%{_libdir}/libdispatch.so*
|
||||
%{_libdir}/libBlocksRuntime.so*
|
||||
%{_libdir}/libTesting.so*
|
||||
%{_libdir}/libXCTest.so*
|
||||
%{_libdir}/lib_*.so*
|
||||
|
||||
# Dynamic linker configuration
|
||||
%{_usr}/lib/swift
|
||||
%{_libdir}/libIndexStore.so*
|
||||
%{_libdir}/libsourcekitdInProc.so
|
||||
%{_libdir}/libswiftDemangle.so
|
||||
%{_sysconfdir}/ld.so.conf.d/swiftlang.conf
|
||||
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
%post runtime -p /sbin/ldconfig
|
||||
%postun runtime -p /sbin/ldconfig
|
||||
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
||||
|
|
|
|||
|
|
@ -1,3 +1 @@
|
|||
# Swift runtime libraries are installed to /usr/lib64
|
||||
# This is already in the default library search path
|
||||
# This file is kept for potential future use but is currently not needed
|
||||
/usr/lib/swift/linux
|
||||
|
|
|
|||
10
uintptr.patch
Normal file
10
uintptr.patch
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
--- llvm-project/llvm/include/llvm/Support/Signals.h.orig 2023-01-25 12:42:42.006799309 -0600
|
||||
+++ llvm-project/llvm/include/llvm/Support/Signals.h 2023-01-25 12:43:15.856946625 -0600
|
||||
@@ -15,6 +15,7 @@
|
||||
#define LLVM_SUPPORT_SIGNALS_H
|
||||
|
||||
#include <string>
|
||||
+#include <stdint.h>
|
||||
|
||||
namespace llvm {
|
||||
class StringRef;
|
||||
14
unusedvars.patch
Normal file
14
unusedvars.patch
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
--- swift-corelibs-libdispatch/src/shims/yield.c.orig 2022-09-16 12:04:16.691448773 -0500
|
||||
+++ swift-corelibs-libdispatch/src/shims/yield.c 2022-09-16 12:05:43.047145102 -0500
|
||||
@@ -25,6 +25,11 @@
|
||||
__DISPATCH_WAIT_FOR_ENQUEUER__(void **ptr)
|
||||
{
|
||||
int spins = 0;
|
||||
+ int nothing = spins;
|
||||
+ nothing = 23;
|
||||
+ spins = nothing;
|
||||
+ spins = 0;
|
||||
+
|
||||
void *value;
|
||||
while ((value = os_atomic_load(ptr, relaxed)) == NULL) {
|
||||
_dispatch_preemption_yield(++spins);
|
||||
Loading…
Add table
Add a link
Reference in a new issue