-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Docs] Add release note about Clang-defined target OS macros #79879
Merged
Conversation
This file contains 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
@llvm/pr-subscribers-clang Author: Zixu Wang (zixu-w) ChangesFull diff: https://github.com/llvm/llvm-project/pull/79879.diff 1 Files Affected:
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 05c42f8485d4ee3..29377f9537e88f7 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -49,6 +49,24 @@ ABI Changes in This Version
AST Dumping Potentially Breaking Changes
----------------------------------------
+Clang Frontend Potentially Breaking Changes
+-------------------------------------------
+
+Target OS macros extension
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+A new Clang extension (see :ref:`here <target_os_detail>`) is enabled for
+Darwin (Apple platform) targets. Clang now defines ``TARGET_OS_*`` macros for
+these targets, which could break existing code bases with improper checks for
+the ``TARGET_OS_`` macros. For example, existing checks might fail to include
+the ``TargetConditionals.h`` header from Apple SDKs and therefore leaving the
+macros undefined and guarded code unexercised.
+
+Affected code should be checked to see if it's still intended for the specific
+target and fixed accordingly.
+
+The extension can be turned off by the option ``-fno-define-target-os-macros``
+as a workaround.
+
What's New in Clang |release|?
==============================
Some of the major new features and improvements to Clang are listed
@@ -83,6 +101,17 @@ Non-comprehensive list of changes in this release
New Compiler Flags
------------------
+.. _target_os_detail:
+
+Target OS macros extension
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+A pair of new flags ``-fdefine-target-os-macros`` and
+``-fno-define-target-os-macros`` has been added to Clang to enable/disable the
+extension to provide built-in definitions of a list of ``TARGET_OS_*`` macros
+based on the target triple.
+
+The extension is enabled by default for Darwin (Apple platform) targets.
+
Deprecated Compiler Flags
-------------------------
|
ributzka
approved these changes
Jan 29, 2024
ian-twilightcoder
approved these changes
Jan 30, 2024
zixu-w
added a commit
to zixu-w/llvm-project
that referenced
this pull request
Jan 30, 2024
) (cherry picked from commit b40d5b1)
zixu-w
added a commit
to zixu-w/llvm-project
that referenced
this pull request
Jan 30, 2024
…lvm#79879)" This reverts commit b40d5b1. The target OS macros work is included in the 18.x release. Move the release note to the release branch.
zixu-w
added a commit
to zixu-w/llvm-project
that referenced
this pull request
Feb 7, 2024
) (cherry picked from commit b40d5b1)
zixu-w
added a commit
that referenced
this pull request
Feb 21, 2024
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.
No description provided.