File tree Expand file tree Collapse file tree 13 files changed +22
-30
lines changed Expand file tree Collapse file tree 13 files changed +22
-30
lines changed Original file line number Diff line number Diff line change @@ -631,14 +631,6 @@ importer::getNormalInvocationArguments(
631
631
});
632
632
}
633
633
634
- // To support -apple-none, -apple-none-macho, -unknown-none-wasm triples.
635
- if (triple.getVendor () == llvm::Triple::VendorType::Apple) {
636
- invocationArgStrs.insert (invocationArgStrs.end (), {" -D__APPLE__" });
637
- }
638
- if (triple.isOSBinFormatMachO ()) {
639
- invocationArgStrs.insert (invocationArgStrs.end (), {" -D__MACH__" });
640
- }
641
-
642
634
if (triple.isOSWindows ()) {
643
635
switch (triple.getArch ()) {
644
636
default : llvm_unreachable (" unsupported Windows architecture" );
Original file line number Diff line number Diff line change @@ -218,8 +218,8 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB AND SWIFT_SHOULD_BUILD_EMBEDDED_CONCURRENC
218
218
if (NOT "${mod} " MATCHES "-macos$" )
219
219
continue ()
220
220
endif ()
221
- set (extra_c_compile_flags -ffreestanding )
222
- set (extra_swift_compile_flags -Xcc -ffreestanding )
221
+ set (extra_c_compile_flags -D__MACH__ -D__APPLE__ - ffreestanding )
222
+ set (extra_swift_compile_flags -Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc - ffreestanding )
223
223
endif ()
224
224
225
225
set (SWIFT_SDK_embedded_ARCH_${mod}_MODULE "${mod} " )
Original file line number Diff line number Diff line change @@ -113,9 +113,9 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
113
113
Darwin.swift.gyb
114
114
115
115
SWIFT_COMPILE_FLAGS
116
- -Xcc -ffreestanding -enable-experimental-feature Embedded
116
+ -Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc - ffreestanding -enable-experimental-feature Embedded
117
117
C_COMPILE_FLAGS
118
- -ffreestanding
118
+ -D__MACH__ -D__APPLE__ - ffreestanding
119
119
MODULE_DIR "${CMAKE_BINARY_DIR} /lib/swift/embedded"
120
120
SDK "embedded"
121
121
ARCHITECTURE "${arch} "
Original file line number Diff line number Diff line change 134
134
// right for Windows, we have everything set up to get it right on
135
135
// other targets as well, and doing so lets the compiler use more
136
136
// efficient symbol access patterns.
137
- #if defined(__MACH__) || defined(__wasm__ )
137
+ #if defined(__MACH__) || defined(__wasi__ )
138
138
139
139
// On Mach-O and WebAssembly, we use non-hidden visibility. We just use
140
140
// default visibility on both imports and exports, both because these
Original file line number Diff line number Diff line change @@ -422,7 +422,7 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
422
422
${SWIFTLIB_EMBEDDED_SOURCES}
423
423
GYB_SOURCES ${SWIFTLIB_EMBEDDED_GYB_SOURCES}
424
424
SWIFT_COMPILE_FLAGS
425
- ${swift_stdlib_compile_flags} -Xcc -ffreestanding -enable-experimental-feature Embedded
425
+ ${swift_stdlib_compile_flags} -Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc - ffreestanding -enable-experimental-feature Embedded
426
426
-Xfrontend -enable-ossa-modules
427
427
MODULE_DIR "${CMAKE_BINARY_DIR} /lib/swift/embedded"
428
428
SDK "embedded"
Original file line number Diff line number Diff line change 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
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
3
3
// REQUIRES: swift_in_compiler
4
4
// REQUIRES: OS=macosx || OS=linux-gnu
5
5
// REQUIRES: CODEGENERATOR=ARM
Original file line number Diff line number Diff line change 3
3
// code, but in the embedded Swift's runtime that's somewhat reasonable thing
4
4
// to do (but is to be avoided because of this).
5
5
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
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
8
8
9
9
// REQUIRES: swift_in_compiler
10
10
// REQUIRES: optimized_stdlib
Original file line number Diff line number Diff line change 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
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
3
3
4
4
// REQUIRES: swift_in_compiler
5
5
// REQUIRES: optimized_stdlib
Original file line number Diff line number Diff line change 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
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
3
3
4
4
// REQUIRES: swift_in_compiler
5
5
// REQUIRES: CODEGENERATOR=ARM
Original file line number Diff line number Diff line change 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
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
3
3
4
4
// REQUIRES: swift_in_compiler
5
5
// REQUIRES: optimized_stdlib
Original file line number Diff line number Diff line change 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
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
3
3
4
4
// REQUIRES: swift_in_compiler
5
5
// REQUIRES: optimized_stdlib
Original file line number Diff line number Diff line change 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
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
3
3
4
4
// REQUIRES: swift_in_compiler
5
5
// REQUIRES: optimized_stdlib
Original file line number Diff line number Diff line change 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
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
3
3
4
4
// REQUIRES: swift_in_compiler
5
5
// REQUIRES: optimized_stdlib
You can’t perform that action at this time.
0 commit comments