Skip to content
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

[18.x][Docs] Add release note about Clang-defined target OS macros #80044

Merged

Conversation

zixu-w
Copy link
Member

@zixu-w zixu-w commented Jan 30, 2024

The change is included in the 18.x release. Move the release note to the release branch and reformat.

(cherry picked from commit b40d5b1)

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jan 30, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Jan 30, 2024

@llvm/pr-subscribers-clang

Author: Zixu Wang (zixu-w)

Changes

The change is included in the 18.x release. Move the release note to the release branch and reformat.

(cherry picked from commit b40d5b1)


Full diff: https://github.com/llvm/llvm-project/pull/80044.diff

1 Files Affected:

  • (modified) clang/docs/ReleaseNotes.rst (+24)
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 060bc7669b72a..015578a6d688e 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -171,6 +171,22 @@ AST Dumping Potentially Breaking Changes
       "qualType": "foo"
     }
 
+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
@@ -344,6 +360,14 @@ New Compiler Flags
   (like other functions) with respect to visibility attributes, pragmas and
   options (e.g ``--fvisibility=``).
 
+.. _target_os_detail:
+* ``-fdefine-target-os-macros`` and its complement
+  ``-fno-define-target-os-macros``. Enables or disables the Clang 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
 -------------------------
 

@zixu-w zixu-w added this to the LLVM 18.X Release milestone Jan 30, 2024
@tstellar
Copy link
Collaborator

tstellar commented Feb 5, 2024

Looks like this patch caused the documentation build to fail.

@zixu-w zixu-w force-pushed the 18.x-release-note-target-os-macros branch from f0f63d3 to f28a33b Compare February 7, 2024 21:50
@zixu-w
Copy link
Member Author

zixu-w commented Feb 7, 2024

Looks like this patch caused the documentation build to fail.

Fixed. Thanks for checking @tstellar !

@tstellar tstellar merged commit ddc2a5f into llvm:release/18.x Feb 16, 2024
11 of 12 checks passed
zixu-w added a commit that referenced this pull request Feb 21, 2024
#80045)

…(#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
(#80044).
@zixu-w zixu-w deleted the 18.x-release-note-target-os-macros branch February 29, 2024 19:24
@pointhex pointhex mentioned this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants