Skip to content

Commit c68e10b

Browse files
committed
[Fix] Disable fdefine-target-os-macros for now
(cherry picked from commit c9b4bb9)
1 parent 0ed9d59 commit c68e10b

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

clang/lib/Driver/ToolChains/Darwin.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3129,10 +3129,6 @@ void Darwin::addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
31293129
// to fix the same problem with C++ headers, and is generally fragile.
31303130
if (!sdkSupportsBuiltinModules(TargetPlatform, SDKInfo))
31313131
CC1Args.push_back("-fbuiltin-headers-in-system-modules");
3132-
3133-
if (!DriverArgs.hasArgNoClaim(options::OPT_fdefine_target_os_macros,
3134-
options::OPT_fno_define_target_os_macros))
3135-
CC1Args.push_back("-fdefine-target-os-macros");
31363132
}
31373133

31383134
void Darwin::addClangCC1ASTargetOptions(

clang/test/Driver/fdefine-target-os-macros.c

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
// RUN: %clang -### --target=arm64-apple-darwin %s 2>&1 | FileCheck %s --check-prefix=DARWIN-DEFAULT
2-
// DARWIN-DEFAULT: "-fdefine-target-os-macros"
2+
// DARWIN-DEFAULT-NOT: "-fdefine-target-os-macros"
33

44
// RUN: %clang -### --target=arm-none-linux-gnu %s 2>&1 | FileCheck %s --check-prefix=NON-DARWIN-DEFAULT
55
// RUN: %clang -### --target=x86_64-pc-win32 %s 2>&1 | FileCheck %s --check-prefix=NON-DARWIN-DEFAULT
66
// NON-DARWIN-DEFAULT-NOT: "-fdefine-target-os-macros"
77

8-
// RUN: %clang -dM -E --target=arm64-apple-macos %s 2>&1 \
8+
// RUN: %clang -dM -E --target=arm64-apple-macos \
9+
// RUN: -fdefine-target-os-macros %s 2>&1 \
910
// RUN: | FileCheck %s -DMAC=1 \
1011
// RUN: -DOSX=1 \
1112
// RUN: -DIPHONE=0 \
@@ -20,7 +21,8 @@
2021
// RUN: -DLINUX=0 \
2122
// RUN: -DUNIX=0
2223

23-
// RUN: %clang -dM -E --target=arm64-apple-ios %s 2>&1 \
24+
// RUN: %clang -dM -E --target=arm64-apple-ios \
25+
// RUN: -fdefine-target-os-macros %s 2>&1 \
2426
// RUN: | FileCheck %s -DMAC=1 \
2527
// RUN: -DOSX=0 \
2628
// RUN: -DIPHONE=1 \
@@ -35,7 +37,8 @@
3537
// RUN: -DLINUX=0 \
3638
// RUN: -DUNIX=0
3739

38-
// RUN: %clang -dM -E --target=arm64-apple-ios-macabi %s 2>&1 \
40+
// RUN: %clang -dM -E --target=arm64-apple-ios-macabi \
41+
// RUN: -fdefine-target-os-macros %s 2>&1 \
3942
// RUN: | FileCheck %s -DMAC=1 \
4043
// RUN: -DOSX=0 \
4144
// RUN: -DIPHONE=1 \
@@ -50,7 +53,8 @@
5053
// RUN: -DLINUX=0 \
5154
// RUN: -DUNIX=0
5255

53-
// RUN: %clang -dM -E --target=arm64-apple-ios-simulator %s 2>&1 \
56+
// RUN: %clang -dM -E --target=arm64-apple-ios-simulator \
57+
// RUN: -fdefine-target-os-macros %s 2>&1 \
5458
// RUN: | FileCheck %s -DMAC=1 \
5559
// RUN: -DOSX=0 \
5660
// RUN: -DIPHONE=1 \
@@ -65,7 +69,8 @@
6569
// RUN: -DLINUX=0 \
6670
// RUN: -DUNIX=0
6771

68-
// RUN: %clang -dM -E --target=arm64-apple-tvos %s 2>&1 \
72+
// RUN: %clang -dM -E --target=arm64-apple-tvos \
73+
// RUN: -fdefine-target-os-macros %s 2>&1 \
6974
// RUN: | FileCheck %s -DMAC=1 \
7075
// RUN: -DOSX=0 \
7176
// RUN: -DIPHONE=1 \
@@ -80,7 +85,8 @@
8085
// RUN: -DLINUX=0 \
8186
// RUN: -DUNIX=0
8287

83-
// RUN: %clang -dM -E --target=arm64-apple-tvos-simulator %s 2>&1 \
88+
// RUN: %clang -dM -E --target=arm64-apple-tvos-simulator \
89+
// RUN: -fdefine-target-os-macros %s 2>&1 \
8490
// RUN: | FileCheck %s -DMAC=1 \
8591
// RUN: -DOSX=0 \
8692
// RUN: -DIPHONE=1 \
@@ -95,7 +101,8 @@
95101
// RUN: -DLINUX=0 \
96102
// RUN: -DUNIX=0
97103

98-
// RUN: %clang -dM -E --target=arm64-apple-watchos %s 2>&1 \
104+
// RUN: %clang -dM -E --target=arm64-apple-watchos \
105+
// RUN: -fdefine-target-os-macros %s 2>&1 \
99106
// RUN: | FileCheck %s -DMAC=1 \
100107
// RUN: -DOSX=0 \
101108
// RUN: -DIPHONE=1 \
@@ -110,7 +117,8 @@
110117
// RUN: -DLINUX=0 \
111118
// RUN: -DUNIX=0
112119

113-
// RUN: %clang -dM -E --target=arm64-apple-watchos-simulator %s 2>&1 \
120+
// RUN: %clang -dM -E --target=arm64-apple-watchos-simulator \
121+
// RUN: -fdefine-target-os-macros %s 2>&1 \
114122
// RUN: | FileCheck %s -DMAC=1 \
115123
// RUN: -DOSX=0 \
116124
// RUN: -DIPHONE=1 \
@@ -125,7 +133,8 @@
125133
// RUN: -DLINUX=0 \
126134
// RUN: -DUNIX=0
127135

128-
// RUN: %clang -dM -E --target=arm64-apple-driverkit %s 2>&1 \
136+
// RUN: %clang -dM -E --target=arm64-apple-driverkit \
137+
// RUN: -fdefine-target-os-macros %s 2>&1 \
129138
// RUN: | FileCheck %s -DMAC=1 \
130139
// RUN: -DOSX=0 \
131140
// RUN: -DIPHONE=0 \

0 commit comments

Comments
 (0)