Skip to content

Commit 3146921

Browse files
Merge pull request #18678 from aschwaighofer/codesign_4.2
Cherry-pick the codesign changes to 4.2
2 parents d611af8 + 26a6acc commit 3146921

File tree

250 files changed

+430
-122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

250 files changed

+430
-122
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2187,6 +2187,21 @@ function(add_swift_target_executable name)
21872187
${SWIFTEXE_TARGET_EXCLUDE_FROM_ALL_FLAG_CURRENT}
21882188
${SWIFTEXE_TARGET_DONT_STRIP_NON_MAIN_SYMBOLS_FLAG}
21892189
${SWIFTEXE_DISABLE_ASLR_FLAG})
2190+
2191+
is_darwin_based_sdk("${sdk}" IS_DARWIN)
2192+
if(IS_DARWIN)
2193+
add_custom_command_target(unused_var2
2194+
COMMAND "codesign" "-f" "-s" "-" "${SWIFT_RUNTIME_OUTPUT_INTDIR}/${VARIANT_NAME}"
2195+
CUSTOM_TARGET_NAME "${VARIANT_NAME}_signed"
2196+
OUTPUT "${SWIFT_RUNTIME_OUTPUT_INTDIR}/${VARIANT_NAME}_signed"
2197+
DEPENDS ${VARIANT_NAME})
2198+
else()
2199+
# No code signing on other platforms.
2200+
add_custom_command_target(unused_var2
2201+
CUSTOM_TARGET_NAME "${VARIANT_NAME}_signed"
2202+
OUTPUT "${SWIFT_RUNTIME_OUTPUT_INTDIR}/${VARIANT_NAME}_signed"
2203+
DEPENDS ${VARIANT_NAME})
2204+
endif()
21902205
endforeach()
21912206
endforeach()
21922207
endfunction()

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ foreach(SDK ${SWIFT_SDKS})
196196

197197
if(SWIFT_BUILD_STDLIB AND SWIFT_INCLUDE_TESTS)
198198
list(APPEND test_dependencies
199-
"swift-reflection-test${VARIANT_SUFFIX}")
199+
"swift-reflection-test${VARIANT_SUFFIX}_signed")
200200
endif()
201201

202202
if(NOT "${COVERAGE_DB}" STREQUAL "")

test/DebuggerTestingTransform/basic-assignments.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
// REQUIRES: executable_test
44
// RUN: %target-build-swift -Xfrontend -debugger-testing-transform %s -o %t
5+
// RUN: %target-codesign %t
56
// RUN: %target-run %t | %FileCheck %s -check-prefix=CHECK-E2E
67
// RUN: rm -rf %t
78

test/Driver/batch_mode_with_supplementary_filelist_execution.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
// Also use some characters outside the BMP.
88
//
99
// RUN: %target-build-swift -emit-dependencies -serialize-diagnostics -driver-filelist-threshold=0 -j2 %t/main.swift %t/𝔼-file-01.swift %t/😂-file-02.swift %t/Ω-file-03.swift -o %t/a.out
10+
// RUN: %target-codesign %t/a.out
1011
// RUN: %target-run %t/a.out | %FileCheck %s -check-prefix=CHECK-HELLO-WORLD
1112
// CHECK-HELLO-WORLD: Hello, World!

test/Driver/emit-sib-single-file.swift

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
// RUN: %target-build-swift -Onone -emit-sib %s -o %t.sib
22
// RUN: %target-build-swift %t.sib -o %t
3+
// RUN: %target-codesign %t
34
// RUN: %target-run %t | %FileCheck %s
45

56
// RUN: %target-build-swift -Onone -c %t.sib -o %t.o
6-
// RUN: %target-build-swift %t.o -o %t
7-
// RUN: %target-run %t | %FileCheck %s
7+
// RUN: %target-build-swift %t.o -o %t-2
8+
// RUN: %target-codesign %t-2
9+
// RUN: %target-run %t-2 | %FileCheck %s
810

911
// RUN: %target-build-swift -Onone -emit-sibgen %s -o %t.sib
10-
// RUN: %target-build-swift %t.sib -o %t
11-
// RUN: %target-run %t | %FileCheck %s
12+
// RUN: %target-build-swift %t.sib -o %t-3
13+
// RUN: %target-codesign %t-3
14+
// RUN: %target-run %t-3 | %FileCheck %s
1215

1316
// RUN: %target-build-swift -Onone -c %t.sib -o %t.o
14-
// RUN: %target-build-swift %t.o -o %t
15-
// RUN: %target-run %t | %FileCheck %s
17+
// RUN: %target-build-swift %t.o -o %t-4
18+
// RUN: %target-codesign %t-4
19+
// RUN: %target-run %t-4 | %FileCheck %s
1620
// REQUIRES: executable_test
1721

1822
// CHECK: Hello World

test/Driver/sdk-link.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend -emit-module -o %t/test.swiftmodule %s
33
// RUN: %target-build-swift -g -o %t/sdk-link %s
4+
// RUN: %target-codesign %t/sdk-link
45
// RUN: %target-run %t/sdk-link | %FileCheck %s
56
// REQUIRES: executable_test
67

test/Frontend/sil-primary-file-with-sib.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// RUN: %llvm-link %t/test-orig.ll -override %t/test-func.ll -o %t/test.bc
77
// RUN: %target-swift-frontend -c %t/test.bc -o %t/test.o
88
// RUN: %target-build-swift %t/test.o -o %t/test
9+
// RUN: %target-codesign %t/test
910
// RUN: %target-run %t/test | %FileCheck %s
1011
// REQUIRES: executable_test
1112

test/IRGen/meta_meta_type.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift %s -o %t/a.out
3+
// RUN: %target-codesign %t/a.out
34
// RUN: %target-run %t/a.out | %FileCheck %s
45
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -primary-file %s -emit-ir | %FileCheck -check-prefix=CHECKIR %s
56
// REQUIRES: executable_test

test/IRGen/multithread_module.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -c %S/Inputs/multithread_module/main.swift -o %t/main.o %s -o %t/mt_module.o -num-threads 2 -O -g -module-name test
88
// RUN: %target-build-swift %t/main.o %t/mt_module.o -o %t/a.out
9+
// RUN: %target-codesign %t/a.out
910
// RUN: %target-run %t/a.out | %FileCheck %s
1011
// REQUIRES: executable_test
1112

test/IRGen/object_type.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift -O %s -o %t/a.out
33
// RUN: %target-build-swift -O %s -emit-ir | %FileCheck --check-prefix=CHECK-IR %s
4+
// RUN: %target-codesign %t/a.out
45
// RUN: %target-run %t/a.out | %FileCheck %s
56
// REQUIRES: executable_test
67

0 commit comments

Comments
 (0)