[Fix] Disable fdefine-target-os-macros for now#74886
Merged
Conversation
llvm#74676 landed the work to implement `-fdefine-target-os-macros` and enabled the extension for the Darwin driver. However it is breaking some test builds. Leave the extension disabled for now until we can fix/workaround the build failures.
Member
|
@llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-driver Author: Zixu Wang (zixu-w) Changes#74676 landed the work to implement Full diff: https://github.com/llvm/llvm-project/pull/74886.diff 2 Files Affected:
diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp
index d3005d69e92bb..f09bc27d7d2c0 100644
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -2916,10 +2916,6 @@ void Darwin::addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
// to fix the same problem with C++ headers, and is generally fragile.
if (!sdkSupportsBuiltinModules(TargetPlatform, SDKInfo))
CC1Args.push_back("-fbuiltin-headers-in-system-modules");
-
- if (!DriverArgs.hasArgNoClaim(options::OPT_fdefine_target_os_macros,
- options::OPT_fno_define_target_os_macros))
- CC1Args.push_back("-fdefine-target-os-macros");
}
void Darwin::addClangCC1ASTargetOptions(
diff --git a/clang/test/Driver/fdefine-target-os-macros.c b/clang/test/Driver/fdefine-target-os-macros.c
index d7379dd3d5396..030d4ce34cb28 100644
--- a/clang/test/Driver/fdefine-target-os-macros.c
+++ b/clang/test/Driver/fdefine-target-os-macros.c
@@ -1,11 +1,12 @@
// RUN: %clang -### --target=arm64-apple-darwin %s 2>&1 | FileCheck %s --check-prefix=DARWIN-DEFAULT
-// DARWIN-DEFAULT: "-fdefine-target-os-macros"
+// DARWIN-DEFAULT-NOT: "-fdefine-target-os-macros"
// RUN: %clang -### --target=arm-none-linux-gnu %s 2>&1 | FileCheck %s --check-prefix=NON-DARWIN-DEFAULT
// RUN: %clang -### --target=x86_64-pc-win32 %s 2>&1 | FileCheck %s --check-prefix=NON-DARWIN-DEFAULT
// NON-DARWIN-DEFAULT-NOT: "-fdefine-target-os-macros"
-// RUN: %clang -dM -E --target=arm64-apple-macos %s 2>&1 \
+// RUN: %clang -dM -E --target=arm64-apple-macos \
+// RUN: -fdefine-target-os-macros %s 2>&1 \
// RUN: | FileCheck %s -DMAC=1 \
// RUN: -DOSX=1 \
// RUN: -DIPHONE=0 \
@@ -20,7 +21,8 @@
// RUN: -DLINUX=0 \
// RUN: -DUNIX=0
-// RUN: %clang -dM -E --target=arm64-apple-ios %s 2>&1 \
+// RUN: %clang -dM -E --target=arm64-apple-ios \
+// RUN: -fdefine-target-os-macros %s 2>&1 \
// RUN: | FileCheck %s -DMAC=1 \
// RUN: -DOSX=0 \
// RUN: -DIPHONE=1 \
@@ -35,7 +37,8 @@
// RUN: -DLINUX=0 \
// RUN: -DUNIX=0
-// RUN: %clang -dM -E --target=arm64-apple-ios-macabi %s 2>&1 \
+// RUN: %clang -dM -E --target=arm64-apple-ios-macabi \
+// RUN: -fdefine-target-os-macros %s 2>&1 \
// RUN: | FileCheck %s -DMAC=1 \
// RUN: -DOSX=0 \
// RUN: -DIPHONE=1 \
@@ -50,7 +53,8 @@
// RUN: -DLINUX=0 \
// RUN: -DUNIX=0
-// RUN: %clang -dM -E --target=arm64-apple-ios-simulator %s 2>&1 \
+// RUN: %clang -dM -E --target=arm64-apple-ios-simulator \
+// RUN: -fdefine-target-os-macros %s 2>&1 \
// RUN: | FileCheck %s -DMAC=1 \
// RUN: -DOSX=0 \
// RUN: -DIPHONE=1 \
@@ -65,7 +69,8 @@
// RUN: -DLINUX=0 \
// RUN: -DUNIX=0
-// RUN: %clang -dM -E --target=arm64-apple-tvos %s 2>&1 \
+// RUN: %clang -dM -E --target=arm64-apple-tvos \
+// RUN: -fdefine-target-os-macros %s 2>&1 \
// RUN: | FileCheck %s -DMAC=1 \
// RUN: -DOSX=0 \
// RUN: -DIPHONE=1 \
@@ -80,7 +85,8 @@
// RUN: -DLINUX=0 \
// RUN: -DUNIX=0
-// RUN: %clang -dM -E --target=arm64-apple-tvos-simulator %s 2>&1 \
+// RUN: %clang -dM -E --target=arm64-apple-tvos-simulator \
+// RUN: -fdefine-target-os-macros %s 2>&1 \
// RUN: | FileCheck %s -DMAC=1 \
// RUN: -DOSX=0 \
// RUN: -DIPHONE=1 \
@@ -95,7 +101,8 @@
// RUN: -DLINUX=0 \
// RUN: -DUNIX=0
-// RUN: %clang -dM -E --target=arm64-apple-watchos %s 2>&1 \
+// RUN: %clang -dM -E --target=arm64-apple-watchos \
+// RUN: -fdefine-target-os-macros %s 2>&1 \
// RUN: | FileCheck %s -DMAC=1 \
// RUN: -DOSX=0 \
// RUN: -DIPHONE=1 \
@@ -110,7 +117,8 @@
// RUN: -DLINUX=0 \
// RUN: -DUNIX=0
-// RUN: %clang -dM -E --target=arm64-apple-watchos-simulator %s 2>&1 \
+// RUN: %clang -dM -E --target=arm64-apple-watchos-simulator \
+// RUN: -fdefine-target-os-macros %s 2>&1 \
// RUN: | FileCheck %s -DMAC=1 \
// RUN: -DOSX=0 \
// RUN: -DIPHONE=1 \
@@ -125,7 +133,8 @@
// RUN: -DLINUX=0 \
// RUN: -DUNIX=0
-// RUN: %clang -dM -E --target=arm64-apple-driverkit %s 2>&1 \
+// RUN: %clang -dM -E --target=arm64-apple-driverkit \
+// RUN: -fdefine-target-os-macros %s 2>&1 \
// RUN: | FileCheck %s -DMAC=1 \
// RUN: -DOSX=0 \
// RUN: -DIPHONE=0 \
|
fhahn
approved these changes
Dec 8, 2023
Contributor
fhahn
left a comment
There was a problem hiding this comment.
LGTM, thanks!
For reference, this is breaking llvm-test-suite builds, e.g. see https://green.lab.llvm.org/green/job/lnt-ctmark-aarch64-Os/15893/console
jroelofs
approved these changes
Dec 8, 2023
ian-twilightcoder
approved these changes
Dec 8, 2023
zixu-w
added a commit
to swiftlang/llvm-project
that referenced
this pull request
Mar 15, 2024
llvm#74676 landed the work to implement `-fdefine-target-os-macros` and enabled the extension for the Darwin driver. However it is breaking some test builds. Leave the extension disabled for now until we can fix/workaround the build failures. (cherry picked from commit c9b4bb9)
zixu-w
added a commit
to swiftlang/llvm-project
that referenced
this pull request
Mar 15, 2024
llvm#74676 landed the work to implement `-fdefine-target-os-macros` and enabled the extension for the Darwin driver. However it is breaking some test builds. Leave the extension disabled for now until we can fix/workaround the build failures. (cherry picked from commit c9b4bb9)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#74676 landed the work to implement
-fdefine-target-os-macrosand enabled the extension for the Darwin driver. However it is breaking some test builds. Leave the extension disabled for now until we can fix/workaround the build failures.