mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-22 13:33:32 -04:00
dev-lang/swift: add swift-5.10.1-r4, swift-6.0.3-r1
Swift is now set up to properly respect CFLAGS, CXXFLAGS, and LDFLAGS from the environment by not overriding those values in the build system. Swift 6 now also picks up on `SWIFT_EXTRA_BUILD_FLAGS` from the environment and passes those to its build system as well. Closes: https://bugs.gentoo.org/939764 Closes: https://bugs.gentoo.org/939766 Signed-off-by: Itai Ferber <itai@itaiferber.net>
This commit is contained in:
1
dev-lang/swift/files/swift-5.10.1-r4/backport-swift-75662.patch
Symbolic link
1
dev-lang/swift/files/swift-5.10.1-r4/backport-swift-75662.patch
Symbolic link
@@ -0,0 +1 @@
|
||||
../swift-5.10.1-r3/backport-swift-75662.patch
|
||||
@@ -0,0 +1 @@
|
||||
../swift-5.10.1-r3/backtracing-noexecstack.patch
|
||||
@@ -0,0 +1 @@
|
||||
../swift-5.10.1-r3/clang-indexstore-exports.patch
|
||||
@@ -0,0 +1 @@
|
||||
../swift-5.10.1-r3/disable-libdispatch-werror.patch
|
||||
1
dev-lang/swift/files/swift-5.10.1-r4/link-ncurses-tinfo.patch
Symbolic link
1
dev-lang/swift/files/swift-5.10.1-r4/link-ncurses-tinfo.patch
Symbolic link
@@ -0,0 +1 @@
|
||||
../swift-5.10.1-r3/link-ncurses-tinfo.patch
|
||||
1
dev-lang/swift/files/swift-5.10.1-r4/link-with-lld.patch
Symbolic link
1
dev-lang/swift/files/swift-5.10.1-r4/link-with-lld.patch
Symbolic link
@@ -0,0 +1 @@
|
||||
../swift-5.10.1-r3/link-with-lld.patch
|
||||
@@ -0,0 +1 @@
|
||||
../swift-5.10.1-r3/lldb-cmake-minimum-version.patch
|
||||
@@ -0,0 +1,64 @@
|
||||
# CMake automatically reads `CFLAGS`, `CXXFLAGS`, `LDFLAGS`, etc. from the
|
||||
# environment and uses them to populate its default flag variables -- but the
|
||||
# Swift build system blows away `CMAKE_C{XX}_FLAGS` without picking up the
|
||||
# environment. These need to be picked up again to not be ignored.
|
||||
|
||||
--- a/swift/utils/build-script-impl
|
||||
+++ b/swift/utils/build-script-impl
|
||||
@@ -1820,10 +1820,10 @@ for host in "${ALL_HOSTS[@]}"; do
|
||||
|
||||
cmake_options=(
|
||||
"${cmake_options[@]}"
|
||||
- -DCMAKE_C_FLAGS="$(swift_c_flags ${host})"
|
||||
- -DCMAKE_CXX_FLAGS="$(swift_c_flags ${host})"
|
||||
- -DCMAKE_C_FLAGS_RELWITHDEBINFO="-O2 -DNDEBUG"
|
||||
- -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O2 -DNDEBUG"
|
||||
+ -DCMAKE_C_FLAGS="${CFLAGS} $(swift_c_flags ${host})"
|
||||
+ -DCMAKE_CXX_FLAGS="${CXXFLAGS} $(swift_c_flags ${host})"
|
||||
+ -DCMAKE_C_FLAGS_RELWITHDEBINFO="${CFLAGS} -O2 -DNDEBUG"
|
||||
+ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="${CXXFLAGS} -O2 -DNDEBUG"
|
||||
-DCMAKE_BUILD_TYPE:STRING="${SWIFT_BUILD_TYPE}"
|
||||
-DLLVM_ENABLE_ASSERTIONS:BOOL=$(true_false "${SWIFT_ENABLE_ASSERTIONS}")
|
||||
-DBOOTSTRAPPING_MODE:STRING=$(to_bootstrapping_mode "${BOOTSTRAPPING}")
|
||||
@@ -2215,8 +2215,8 @@ for host in "${ALL_HOSTS[@]}"; do
|
||||
cmake_options=(
|
||||
"${cmake_options[@]}"
|
||||
-C${LLDB_SOURCE_DIR}/cmake/caches/${cmake_cache}
|
||||
- -DCMAKE_C_FLAGS="$(llvm_c_flags ${host})"
|
||||
- -DCMAKE_CXX_FLAGS="$(llvm_c_flags ${host})"
|
||||
+ -DCMAKE_C_FLAGS="${CFLAGS} $(llvm_c_flags ${host})"
|
||||
+ -DCMAKE_CXX_FLAGS="${CXXFLAGS} $(llvm_c_flags ${host})"
|
||||
-DCMAKE_BUILD_TYPE:STRING="${LLDB_BUILD_TYPE}"
|
||||
-DLLDB_SWIFTC:PATH=${SWIFTC_BIN}
|
||||
-DLLDB_SWIFT_LIBS:PATH="$(build_directory ${LOCAL_HOST} swift)/lib/swift"
|
||||
--- a/swift/utils/swift_build_support/swift_build_support/products/llvm.py
|
||||
+++ b/swift/utils/swift_build_support/swift_build_support/products/llvm.py
|
||||
@@ -261,10 +261,10 @@ class LLVM(cmake_product.CMakeProduct):
|
||||
# llvm/tools, e.g. to build LLDB.
|
||||
|
||||
llvm_c_flags = ' '.join(self.llvm_c_flags(platform, arch))
|
||||
- llvm_cmake_options.define('CMAKE_C_FLAGS', llvm_c_flags)
|
||||
- llvm_cmake_options.define('CMAKE_CXX_FLAGS', llvm_c_flags)
|
||||
- llvm_cmake_options.define('CMAKE_C_FLAGS_RELWITHDEBINFO', '-O2 -DNDEBUG')
|
||||
- llvm_cmake_options.define('CMAKE_CXX_FLAGS_RELWITHDEBINFO', '-O2 -DNDEBUG')
|
||||
+ llvm_cmake_options.define('CMAKE_C_FLAGS', ' '.join([os.environ.get('CFLAGS', ''), llvm_c_flags]))
|
||||
+ llvm_cmake_options.define('CMAKE_CXX_FLAGS', ' '.join([os.environ.get('CXXFLAGS', ''), llvm_c_flags]))
|
||||
+ llvm_cmake_options.define('CMAKE_C_FLAGS_RELWITHDEBINFO', ' '.join([os.environ.get('CFLAGS', ''), '-O2 -DNDEBUG']))
|
||||
+ llvm_cmake_options.define('CMAKE_CXX_FLAGS_RELWITHDEBINFO', ' '.join([os.environ.get('CXXFLAGS', ''), '-O2 -DNDEBUG']))
|
||||
llvm_cmake_options.define('CMAKE_BUILD_TYPE:STRING',
|
||||
self.args.llvm_build_variant)
|
||||
llvm_cmake_options.define('LLVM_TOOL_SWIFT_BUILD:BOOL', 'FALSE')
|
||||
--- a/swift/utils/swift_build_support/swift_build_support/products/product.py
|
||||
+++ b/swift/utils/swift_build_support/swift_build_support/products/product.py
|
||||
@@ -440,8 +440,8 @@ class Product(object):
|
||||
|
||||
(platform, arch) = host_target.split('-')
|
||||
common_c_flags = ' '.join(self.common_cross_c_flags(platform, arch))
|
||||
- self.cmake_options.define('CMAKE_C_FLAGS', common_c_flags)
|
||||
- self.cmake_options.define('CMAKE_CXX_FLAGS', common_c_flags)
|
||||
+ self.cmake_options.define('CMAKE_C_FLAGS', ' '.join([os.environ.get('CFLAGS', ''), common_c_flags]))
|
||||
+ self.cmake_options.define('CMAKE_CXX_FLAGS', ' '.join([os.environ.get('CXXFLAGS', ''), common_c_flags]))
|
||||
|
||||
toolchain_file = None
|
||||
if self.is_darwin_host(host_target):
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
../swift-6.0.3/backtracing-noexecstack.patch
|
||||
@@ -0,0 +1 @@
|
||||
../swift-6.0.3/disable-libdispatch-werror.patch
|
||||
43
dev-lang/swift/files/swift-6.0.3-r1/gentoo.ini
Normal file
43
dev-lang/swift/files/swift-6.0.3-r1/gentoo.ini
Normal file
@@ -0,0 +1,43 @@
|
||||
# Individual preset options:
|
||||
#
|
||||
# 1. mixin-preset: building for Linux, without compiler assertions, and with
|
||||
# most tests disabled
|
||||
# 2. build-ninja=0, skip-build-curl, skip-build-zlib: we'd prefer to pick these
|
||||
# up from the system
|
||||
# 3. extra-cmake-options:
|
||||
# * -DLLVM_USE_LINKER, -DCLANG_DEFAULT_LINKER: build LLVM, clang, Swift, et.
|
||||
# al. to link using lld, and ensure Clang uses it as its default
|
||||
# * -DBUILD_TESTING, -DSWIFT_INCLUDE_TESTS, -DSWIFT_INCLUDE_TEST_BINARIES:
|
||||
# the `no_test` preset disables building most, but not all tests; we don't
|
||||
# need to build any of them
|
||||
# * -DCOMPILER_RT_BUILD_ORC: the `compiler-rt` library defaults to building
|
||||
# the ORC LLVM JIT library, which we don't require; we disable it because
|
||||
# it builds with executable stacks, which trip up warnings on installation
|
||||
# * -DPython3_FIND_UNVERSIONED_NAMES: LLDB ships with Python bindings, and
|
||||
# uses CMake to search for Python. By default, CMake tries to find the
|
||||
# latest version installed on disk (currently, `python3.13`, then
|
||||
# `python3.12`, then...). This might not be the version of Python specified
|
||||
# by `PYTHON_SINGLE_TARGET`, which we want to respect. We use
|
||||
# `python_setup` to place `${EPYTHON}` at the front of `PATH` as the
|
||||
# unversioned `python3`, so we want CMake to discover and use this binary
|
||||
# first before falling back to its search
|
||||
# 5. llvm-targets-to-build: we don't currently support architectures other than
|
||||
# amd64, so there's no point in building LLVM for multiple architectures; if
|
||||
# this changes (or we start supporting cross-compilation), we'll need to
|
||||
# build for more than just the host
|
||||
|
||||
[preset: gentoo]
|
||||
mixin-preset=buildbot_linux,no_assertions,no_test
|
||||
build-ninja=0
|
||||
extra-cmake-options=
|
||||
-DLLVM_USE_LINKER:STRING=lld
|
||||
-DCLANG_DEFAULT_LINKER:STRING=lld
|
||||
-DBUILD_TESTING:BOOL=NO
|
||||
-DSWIFT_INCLUDE_TESTS:BOOL=NO
|
||||
-DSWIFT_INCLUDE_TEST_BINARIES:BOOL=NO
|
||||
-DCOMPILER_RT_BUILD_ORC:BOOL=NO
|
||||
-DPython3_FIND_UNVERSIONED_NAMES:STRING=FIRST
|
||||
llvm-targets-to-build=host
|
||||
skip-build-curl
|
||||
skip-build-zlib
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# Prior to C23, the C standard restricts enum values to the range of `int`;
|
||||
# relaxing this is a GNU extension that Clang follows. On LLVM-profile systems,
|
||||
# though, this appears to not be enabled by default, causing Clang to complain
|
||||
# that `1 << 63` is not a compile-time expression (since it overflows an `int`
|
||||
# and can't be computed at compile-time). This can be suppressed by causing the
|
||||
# enum to be interpreted explicitly as containing `unsigned long long` values
|
||||
# instead.
|
||||
|
||||
--- a/indexstore-db/include/CIndexStoreDB/CIndexStoreDB.h
|
||||
+++ b/indexstore-db/include/CIndexStoreDB/CIndexStoreDB.h
|
||||
@@ -82,7 +82,7 @@ typedef enum {
|
||||
INDEXSTOREDB_SYMBOL_ROLE_REL_IBTYPEOF = 1 << 17,
|
||||
INDEXSTOREDB_SYMBOL_ROLE_REL_SPECIALIZATIONOF = 1 << 18,
|
||||
|
||||
- INDEXSTOREDB_SYMBOL_ROLE_CANONICAL = 1 << 63,
|
||||
+ INDEXSTOREDB_SYMBOL_ROLE_CANONICAL = 1ULL << 63,
|
||||
} indexstoredb_symbol_role_t;
|
||||
|
||||
typedef enum {
|
||||
1
dev-lang/swift/files/swift-6.0.3-r1/link-ncurses-tinfo.patch
Symbolic link
1
dev-lang/swift/files/swift-6.0.3-r1/link-ncurses-tinfo.patch
Symbolic link
@@ -0,0 +1 @@
|
||||
../swift-6.0.3/link-ncurses-tinfo.patch
|
||||
1
dev-lang/swift/files/swift-6.0.3-r1/link-with-lld.patch
Symbolic link
1
dev-lang/swift/files/swift-6.0.3-r1/link-with-lld.patch
Symbolic link
@@ -0,0 +1 @@
|
||||
../swift-6.0.3/link-with-lld.patch
|
||||
1
dev-lang/swift/files/swift-6.0.3-r1/respect-c-cxx-flags.patch
Symbolic link
1
dev-lang/swift/files/swift-6.0.3-r1/respect-c-cxx-flags.patch
Symbolic link
@@ -0,0 +1 @@
|
||||
../swift-5.10.1-r4/respect-c-cxx-flags.patch
|
||||
Reference in New Issue
Block a user