diff --git a/stdlib/public/Concurrency/CMakeLists.txt b/stdlib/public/Concurrency/CMakeLists.txt index c7b0e6de87f56..ef4d0d51451d8 100644 --- a/stdlib/public/Concurrency/CMakeLists.txt +++ b/stdlib/public/Concurrency/CMakeLists.txt @@ -283,8 +283,8 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB AND SWIFT_SHOULD_BUILD_EMBEDDED_CONCURRENC endif() if("${mod}" MATCHES "-macos$") - set(extra_c_compile_flags -D__MACH__ -D__APPLE__ -ffreestanding -stdlib=libc++) - set(extra_swift_compile_flags -Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc -ffreestanding) + set(extra_c_compile_flags -ffreestanding -stdlib=libc++) + set(extra_swift_compile_flags -Xcc -ffreestanding) endif() elseif (SWIFT_HOST_VARIANT STREQUAL "wasi") diff --git a/stdlib/public/Platform/CMakeLists.txt b/stdlib/public/Platform/CMakeLists.txt index 29a973ef09f47..9ae7a977ac400 100644 --- a/stdlib/public/Platform/CMakeLists.txt +++ b/stdlib/public/Platform/CMakeLists.txt @@ -115,9 +115,9 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB) Darwin.swift.gyb SWIFT_COMPILE_FLAGS - -Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc -ffreestanding -enable-experimental-feature Embedded + -Xcc -ffreestanding -enable-experimental-feature Embedded C_COMPILE_FLAGS - -D__MACH__ -D__APPLE__ -ffreestanding + -ffreestanding MODULE_DIR "${CMAKE_BINARY_DIR}/lib/swift/embedded" SDK "embedded" ARCHITECTURE "${arch}" diff --git a/stdlib/public/Synchronization/CMakeLists.txt b/stdlib/public/Synchronization/CMakeLists.txt index f7167514c9789..d924943cee70f 100644 --- a/stdlib/public/Synchronization/CMakeLists.txt +++ b/stdlib/public/Synchronization/CMakeLists.txt @@ -171,7 +171,7 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB) SWIFT_COMPILE_FLAGS ${SWIFT_SYNCHRNOIZATION_SWIFT_FLAGS} - -Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc -ffreestanding -enable-experimental-feature Embedded + -Xcc -ffreestanding -enable-experimental-feature Embedded MODULE_DIR "${CMAKE_BINARY_DIR}/lib/swift/embedded" SDK "embedded" diff --git a/stdlib/public/Volatile/CMakeLists.txt b/stdlib/public/Volatile/CMakeLists.txt index 3f890e5768c4e..bf08132740c2d 100644 --- a/stdlib/public/Volatile/CMakeLists.txt +++ b/stdlib/public/Volatile/CMakeLists.txt @@ -42,10 +42,10 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB) Volatile.swift SWIFT_COMPILE_FLAGS - -Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc -ffreestanding -enable-experimental-feature Embedded + -Xcc -ffreestanding -enable-experimental-feature Embedded -parse-stdlib C_COMPILE_FLAGS - -D__MACH__ -D__APPLE__ -ffreestanding + -ffreestanding MODULE_DIR "${CMAKE_BINARY_DIR}/lib/swift/embedded" SDK "embedded" ARCHITECTURE "${arch}" diff --git a/stdlib/public/core/CMakeLists.txt b/stdlib/public/core/CMakeLists.txt index 0565fde539898..4f58c0a2172ff 100644 --- a/stdlib/public/core/CMakeLists.txt +++ b/stdlib/public/core/CMakeLists.txt @@ -516,7 +516,7 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB) ${SWIFTLIB_EMBEDDED_SOURCES} GYB_SOURCES ${SWIFTLIB_EMBEDDED_GYB_SOURCES} SWIFT_COMPILE_FLAGS - ${swift_stdlib_compile_flags} -Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc -ffreestanding -enable-experimental-feature Embedded + ${swift_stdlib_compile_flags} -Xcc -ffreestanding -enable-experimental-feature Embedded -Xfrontend -enable-ossa-modules MODULE_DIR "${CMAKE_BINARY_DIR}/lib/swift/embedded" SDK "embedded" diff --git a/stdlib/public/stubs/Unicode/CMakeLists.txt b/stdlib/public/stubs/Unicode/CMakeLists.txt index 6c68ebb48a096..7e60f517574b2 100644 --- a/stdlib/public/stubs/Unicode/CMakeLists.txt +++ b/stdlib/public/stubs/Unicode/CMakeLists.txt @@ -21,7 +21,7 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB) if (SWIFT_HOST_VARIANT STREQUAL "linux") set(extra_c_compile_flags -ffreestanding) elseif (SWIFT_HOST_VARIANT STREQUAL "macosx") - set(extra_c_compile_flags -D__MACH__ -D__APPLE__ -ffreestanding) + set(extra_c_compile_flags -ffreestanding) endif() list(APPEND extra_c_compile_flags -nostdinc++) diff --git a/test/embedded/fragile-reference.swift b/test/embedded/fragile-reference.swift index fde4a8f8589f1..9ee8c4e6d8575 100644 --- a/test/embedded/fragile-reference.swift +++ b/test/embedded/fragile-reference.swift @@ -1,5 +1,5 @@ -// 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 -// 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 +// RUN: %target-swift-frontend -target armv7-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %target-swift-frontend -target arm64-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: CODEGENERATOR=ARM // REQUIRES: embedded_stdlib_cross_compiling diff --git a/test/embedded/no-allocations-print.swift b/test/embedded/no-allocations-print.swift index 5dad9fccb0b78..6b4ebb3ea448e 100644 --- a/test/embedded/no-allocations-print.swift +++ b/test/embedded/no-allocations-print.swift @@ -1,7 +1,7 @@ // RUN: %target-swift-emit-ir %s -enable-experimental-feature Embedded -no-allocations -// RUN: %target-swift-emit-ir -target armv7-apple-none-macho -no-allocations -Xcc -D__MACH__ %s -enable-experimental-feature Embedded -// 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 +// RUN: %target-swift-emit-ir -target armv7-apple-none-macho -no-allocations %s -enable-experimental-feature Embedded +// RUN: %target-swift-emit-ir -target arm64-apple-none-macho -no-allocations %s -enable-experimental-feature Embedded // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib diff --git a/test/embedded/optionset2.swift b/test/embedded/optionset2.swift index bb19e680f9877..59c976872fa9a 100644 --- a/test/embedded/optionset2.swift +++ b/test/embedded/optionset2.swift @@ -1,5 +1,5 @@ -// RUN: %target-swift-frontend -target armv7-apple-none-macho -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s -// 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 +// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib diff --git a/test/embedded/ouroboros-bug.swift b/test/embedded/ouroboros-bug.swift index a98be86316073..08472ab80c216 100644 --- a/test/embedded/ouroboros-bug.swift +++ b/test/embedded/ouroboros-bug.swift @@ -3,8 +3,8 @@ // code, but in the embedded Swift's runtime that's somewhat reasonable thing // to do (but is to be avoided because of this). -// 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 -// 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 +// RUN: %target-swift-frontend -target armv7-apple-none-macho -assert-config Debug -Osize -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %target-swift-frontend -target arm64-apple-none-macho -assert-config Debug -Osize -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib diff --git a/test/embedded/ptrauth-none-macho.swift b/test/embedded/ptrauth-none-macho.swift index 79467331be3d4..057a542d3f800 100644 --- a/test/embedded/ptrauth-none-macho.swift +++ b/test/embedded/ptrauth-none-macho.swift @@ -1,5 +1,5 @@ -// 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 -// RUN: %target-swift-frontend -target arm64e-apple-macos14 -enable-experimental-feature Embedded -emit-ir %s -o - -Xcc -D__APPLE__ -Xcc -D__MACH__ | %FileCheck %s +// RUN: %target-swift-frontend -target arm64e-apple-none-macho -enable-experimental-feature Embedded -emit-ir %s -o - | %FileCheck %s +// RUN: %target-swift-frontend -target arm64e-apple-macos14 -enable-experimental-feature Embedded -emit-ir %s -o - | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: OS=macosx diff --git a/test/embedded/stdlib-array.swift b/test/embedded/stdlib-array.swift index 1956186a8ac2c..9657921f5aea8 100644 --- a/test/embedded/stdlib-array.swift +++ b/test/embedded/stdlib-array.swift @@ -1,5 +1,5 @@ -// RUN: %target-swift-frontend -target armv7-apple-none-macho -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s -// 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 +// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib diff --git a/test/embedded/stdlib-basic.swift b/test/embedded/stdlib-basic.swift index 30b4f605262b2..2fa2f7e3e1d00 100644 --- a/test/embedded/stdlib-basic.swift +++ b/test/embedded/stdlib-basic.swift @@ -1,5 +1,5 @@ -// RUN: %target-swift-frontend -target armv7-apple-none-macho -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s -// 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 +// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: CODEGENERATOR=ARM diff --git a/test/embedded/stdlib-dictionary.swift b/test/embedded/stdlib-dictionary.swift index 1942b5a26ae30..53b37e7218ee7 100644 --- a/test/embedded/stdlib-dictionary.swift +++ b/test/embedded/stdlib-dictionary.swift @@ -1,5 +1,5 @@ -// RUN: %target-swift-frontend -target armv7-apple-none-macho -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s -// 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 +// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib diff --git a/test/embedded/stdlib-random.swift b/test/embedded/stdlib-random.swift index e10836109cfbc..c9472fe305d22 100644 --- a/test/embedded/stdlib-random.swift +++ b/test/embedded/stdlib-random.swift @@ -1,5 +1,5 @@ -// RUN: %target-swift-frontend -target armv7-apple-none-macho -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s -// 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 +// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib diff --git a/test/embedded/stdlib-set.swift b/test/embedded/stdlib-set.swift index 533929bd9229d..e81506d843012 100644 --- a/test/embedded/stdlib-set.swift +++ b/test/embedded/stdlib-set.swift @@ -1,5 +1,5 @@ -// RUN: %target-swift-frontend -target armv7-apple-none-macho -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s -// 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 +// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib diff --git a/test/embedded/stdlib-strings-interpolation3.swift b/test/embedded/stdlib-strings-interpolation3.swift index 4c2bb9acd93da..7631046caed3e 100644 --- a/test/embedded/stdlib-strings-interpolation3.swift +++ b/test/embedded/stdlib-strings-interpolation3.swift @@ -1,6 +1,6 @@ -// 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 -// 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 -// 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 +// RUN: %target-swift-frontend -target armv7-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded +// RUN: %target-swift-frontend -target armv7-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded -O +// RUN: %target-swift-frontend -target armv7-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded -Osize // REQUIRES: swift_in_compiler // REQUIRES: CODEGENERATOR=ARM diff --git a/test/embedded/stdlib-types.swift b/test/embedded/stdlib-types.swift index 74fb85b88f76d..cbd2b65e2d947 100644 --- a/test/embedded/stdlib-types.swift +++ b/test/embedded/stdlib-types.swift @@ -1,5 +1,5 @@ -// RUN: %target-swift-frontend -target armv7-apple-none-macho -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s -// 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 +// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib