Skip to content

Commit a1cdd33

Browse files
authored
Merge pull request #80420 from kubamracek/embedded-drop-mach-apple
[embedded] Stop using -D__APPLE__ and -D__MACH__
2 parents a5768a9 + 6d71f45 commit a1cdd33

18 files changed

+34
-34
lines changed

stdlib/public/Concurrency/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB AND SWIFT_SHOULD_BUILD_EMBEDDED_CONCURRENC
283283
endif()
284284

285285
if("${mod}" MATCHES "-macos$")
286-
set(extra_c_compile_flags -D__MACH__ -D__APPLE__ -ffreestanding -stdlib=libc++)
287-
set(extra_swift_compile_flags -Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc -ffreestanding)
286+
set(extra_c_compile_flags -ffreestanding -stdlib=libc++)
287+
set(extra_swift_compile_flags -Xcc -ffreestanding)
288288
endif()
289289

290290
elseif (SWIFT_HOST_VARIANT STREQUAL "wasi")

stdlib/public/Platform/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
115115
Darwin.swift.gyb
116116

117117
SWIFT_COMPILE_FLAGS
118-
-Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc -ffreestanding -enable-experimental-feature Embedded
118+
-Xcc -ffreestanding -enable-experimental-feature Embedded
119119
C_COMPILE_FLAGS
120-
-D__MACH__ -D__APPLE__ -ffreestanding
120+
-ffreestanding
121121
MODULE_DIR "${CMAKE_BINARY_DIR}/lib/swift/embedded"
122122
SDK "embedded"
123123
ARCHITECTURE "${arch}"

stdlib/public/Synchronization/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
171171

172172
SWIFT_COMPILE_FLAGS
173173
${SWIFT_SYNCHRNOIZATION_SWIFT_FLAGS}
174-
-Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc -ffreestanding -enable-experimental-feature Embedded
174+
-Xcc -ffreestanding -enable-experimental-feature Embedded
175175

176176
MODULE_DIR "${CMAKE_BINARY_DIR}/lib/swift/embedded"
177177
SDK "embedded"

stdlib/public/Volatile/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
4242
Volatile.swift
4343

4444
SWIFT_COMPILE_FLAGS
45-
-Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc -ffreestanding -enable-experimental-feature Embedded
45+
-Xcc -ffreestanding -enable-experimental-feature Embedded
4646
-parse-stdlib
4747
C_COMPILE_FLAGS
48-
-D__MACH__ -D__APPLE__ -ffreestanding
48+
-ffreestanding
4949
MODULE_DIR "${CMAKE_BINARY_DIR}/lib/swift/embedded"
5050
SDK "embedded"
5151
ARCHITECTURE "${arch}"

stdlib/public/core/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
516516
${SWIFTLIB_EMBEDDED_SOURCES}
517517
GYB_SOURCES ${SWIFTLIB_EMBEDDED_GYB_SOURCES}
518518
SWIFT_COMPILE_FLAGS
519-
${swift_stdlib_compile_flags} -Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc -ffreestanding -enable-experimental-feature Embedded
519+
${swift_stdlib_compile_flags} -Xcc -ffreestanding -enable-experimental-feature Embedded
520520
-Xfrontend -enable-ossa-modules
521521
MODULE_DIR "${CMAKE_BINARY_DIR}/lib/swift/embedded"
522522
SDK "embedded"

stdlib/public/stubs/Unicode/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
2121
if (SWIFT_HOST_VARIANT STREQUAL "linux")
2222
set(extra_c_compile_flags -ffreestanding)
2323
elseif (SWIFT_HOST_VARIANT STREQUAL "macosx")
24-
set(extra_c_compile_flags -D__MACH__ -D__APPLE__ -ffreestanding)
24+
set(extra_c_compile_flags -ffreestanding)
2525
endif()
2626
list(APPEND extra_c_compile_flags -nostdinc++)
2727

test/embedded/fragile-reference.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %target-swift-frontend -target armv7-apple-none-macho -module-name main -parse-as-library -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
2-
// RUN: %target-swift-frontend -target arm64-apple-none-macho -module-name main -parse-as-library -Xcc -D__MACH__ -Xcc -D__arm64__ -Xcc -D__APPLE__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
1+
// RUN: %target-swift-frontend -target armv7-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
2+
// RUN: %target-swift-frontend -target arm64-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
33
// REQUIRES: swift_in_compiler
44
// REQUIRES: CODEGENERATOR=ARM
55
// REQUIRES: embedded_stdlib_cross_compiling

test/embedded/no-allocations-print.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %target-swift-emit-ir %s -enable-experimental-feature Embedded -no-allocations
22

3-
// RUN: %target-swift-emit-ir -target armv7-apple-none-macho -no-allocations -Xcc -D__MACH__ %s -enable-experimental-feature Embedded
4-
// RUN: %target-swift-emit-ir -target arm64-apple-none-macho -no-allocations -Xcc -D__MACH__ -Xcc -D__arm64__ -Xcc -D__APPLE__ %s -enable-experimental-feature Embedded
3+
// RUN: %target-swift-emit-ir -target armv7-apple-none-macho -no-allocations %s -enable-experimental-feature Embedded
4+
// RUN: %target-swift-emit-ir -target arm64-apple-none-macho -no-allocations %s -enable-experimental-feature Embedded
55

66
// REQUIRES: swift_in_compiler
77
// REQUIRES: optimized_stdlib

test/embedded/optionset2.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %target-swift-frontend -target armv7-apple-none-macho -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
2-
// RUN: %target-swift-frontend -target arm64-apple-none-macho -Xcc -D__MACH__ -Xcc -D__arm64__ -Xcc -D__APPLE__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
1+
// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
2+
// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
33

44
// REQUIRES: swift_in_compiler
55
// REQUIRES: optimized_stdlib

test/embedded/ouroboros-bug.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// code, but in the embedded Swift's runtime that's somewhat reasonable thing
44
// to do (but is to be avoided because of this).
55

6-
// RUN: %target-swift-frontend -target armv7-apple-none-macho -assert-config Debug -Osize -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
7-
// RUN: %target-swift-frontend -target arm64-apple-none-macho -assert-config Debug -Osize -Xcc -D__MACH__ -Xcc -D__arm64__ -Xcc -D__APPLE__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
6+
// RUN: %target-swift-frontend -target armv7-apple-none-macho -assert-config Debug -Osize -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
7+
// RUN: %target-swift-frontend -target arm64-apple-none-macho -assert-config Debug -Osize -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
88

99
// REQUIRES: swift_in_compiler
1010
// REQUIRES: optimized_stdlib

test/embedded/ptrauth-none-macho.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %target-swift-frontend -target arm64e-apple-none-macho -enable-experimental-feature Embedded -emit-ir %s -o - -Xcc -D__APPLE__ -Xcc -D__MACH__ | %FileCheck %s
2-
// RUN: %target-swift-frontend -target arm64e-apple-macos14 -enable-experimental-feature Embedded -emit-ir %s -o - -Xcc -D__APPLE__ -Xcc -D__MACH__ | %FileCheck %s
1+
// RUN: %target-swift-frontend -target arm64e-apple-none-macho -enable-experimental-feature Embedded -emit-ir %s -o - | %FileCheck %s
2+
// RUN: %target-swift-frontend -target arm64e-apple-macos14 -enable-experimental-feature Embedded -emit-ir %s -o - | %FileCheck %s
33

44
// REQUIRES: swift_in_compiler
55
// REQUIRES: OS=macosx

test/embedded/stdlib-array.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %target-swift-frontend -target armv7-apple-none-macho -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
2-
// RUN: %target-swift-frontend -target arm64-apple-none-macho -Xcc -D__MACH__ -Xcc -D__arm64__ -Xcc -D__APPLE__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
1+
// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
2+
// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
33

44
// REQUIRES: swift_in_compiler
55
// REQUIRES: optimized_stdlib

test/embedded/stdlib-basic.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %target-swift-frontend -target armv7-apple-none-macho -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
2-
// RUN: %target-swift-frontend -target arm64-apple-none-macho -Xcc -D__MACH__ -Xcc -D__arm64__ -Xcc -D__APPLE__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
1+
// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
2+
// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
33

44
// REQUIRES: swift_in_compiler
55
// REQUIRES: CODEGENERATOR=ARM

test/embedded/stdlib-dictionary.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %target-swift-frontend -target armv7-apple-none-macho -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
2-
// RUN: %target-swift-frontend -target arm64-apple-none-macho -Xcc -D__MACH__ -Xcc -D__arm64__ -Xcc -D__APPLE__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
1+
// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
2+
// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
33

44
// REQUIRES: swift_in_compiler
55
// REQUIRES: optimized_stdlib

test/embedded/stdlib-random.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %target-swift-frontend -target armv7-apple-none-macho -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
2-
// RUN: %target-swift-frontend -target arm64-apple-none-macho -Xcc -D__MACH__ -Xcc -D__arm64__ -Xcc -D__APPLE__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
1+
// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
2+
// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
33

44
// REQUIRES: swift_in_compiler
55
// REQUIRES: optimized_stdlib

test/embedded/stdlib-set.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %target-swift-frontend -target armv7-apple-none-macho -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
2-
// RUN: %target-swift-frontend -target arm64-apple-none-macho -Xcc -D__MACH__ -Xcc -D__arm64__ -Xcc -D__APPLE__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
1+
// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
2+
// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
33

44
// REQUIRES: swift_in_compiler
55
// REQUIRES: optimized_stdlib

test/embedded/stdlib-strings-interpolation3.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// RUN: %target-swift-frontend -target armv7-apple-none-macho -module-name main -parse-as-library -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded
2-
// RUN: %target-swift-frontend -target armv7-apple-none-macho -module-name main -parse-as-library -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded -O
3-
// RUN: %target-swift-frontend -target armv7-apple-none-macho -module-name main -parse-as-library -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded -Osize
1+
// RUN: %target-swift-frontend -target armv7-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded
2+
// RUN: %target-swift-frontend -target armv7-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded -O
3+
// RUN: %target-swift-frontend -target armv7-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded -Osize
44

55
// REQUIRES: swift_in_compiler
66
// REQUIRES: CODEGENERATOR=ARM

test/embedded/stdlib-types.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %target-swift-frontend -target armv7-apple-none-macho -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
2-
// RUN: %target-swift-frontend -target arm64-apple-none-macho -Xcc -D__MACH__ -Xcc -D__arm64__ -Xcc -D__APPLE__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
1+
// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
2+
// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
33

44
// REQUIRES: swift_in_compiler
55
// REQUIRES: optimized_stdlib

0 commit comments

Comments
 (0)