Skip to content

Commit

Permalink
[18.x][Docs] Add release note about Clang-defined target OS macros (l…
Browse files Browse the repository at this point in the history
…lvm#80044)

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

(cherry picked from commit b40d5b1)
  • Loading branch information
zixu-w authored and Shivam Gupta committed Sep 5, 2024
1 parent 55eb526 commit 55546d6
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,22 @@ Clang Python Bindings Potentially Breaking Changes
but after the end of the ``SourceRange``, ``SourceRange.__contains__``
used to incorrectly return ``True``. (#GH22617), (#GH52827)

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
Expand Down Expand Up @@ -180,6 +196,15 @@ New Compiler Flags
existing ``-fno-c++-static-destructors`` flag) skips all static
destructors registration.

.. _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
-------------------------

Expand Down

0 comments on commit 55546d6

Please sign in to comment.