diff mbox series

migration-guides/migration-5.3.rst: add note on *FLAGS behavior change

Message ID 20260211-note-on-flags-var-v1-1-81bdce729333@bootlin.com
State Under Review
Headers show
Series migration-guides/migration-5.3.rst: add note on *FLAGS behavior change | expand

Commit Message

Antonin Godard Feb. 11, 2026, 1:53 p.m. UTC
Add a note on how existing *FLAGS += assignments can lead to unexpected
behavior in the 5.3 release notes.

Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
 documentation/migration-guides/migration-5.3.rst | 42 ++++++++++++++++++++++++
 1 file changed, 42 insertions(+)


---
base-commit: 3ec23e9fb7ddc294bac6f68300591239c9cedf4b
change-id: 20260211-note-on-flags-var-debd3c9a9291

Comments

Richard Purdie Feb. 11, 2026, 4:24 p.m. UTC | #1
On Wed, 2026-02-11 at 14:53 +0100, Antonin Godard wrote:
> Add a note on how existing *FLAGS += assignments can lead to unexpected
> behavior in the 5.3 release notes.
> 
> Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
> Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
> ---
>  documentation/migration-guides/migration-5.3.rst | 42 ++++++++++++++++++++++++
>  1 file changed, 42 insertions(+)

This looks good to me, thanks. It has been a source of confusion for a
few people!

Cheers,

Richard
diff mbox series

Patch

diff --git a/documentation/migration-guides/migration-5.3.rst b/documentation/migration-guides/migration-5.3.rst
index a1586fba6..464006aaa 100644
--- a/documentation/migration-guides/migration-5.3.rst
+++ b/documentation/migration-guides/migration-5.3.rst
@@ -172,6 +172,48 @@  overridden if unlicensed firmware is needed. See :oe_git:`the recipe
 </openembedded-core/tree/meta/recipes-kernel/linux-firmware>` for a complete
 overview of the removed firmware.
 
+``*FLAGS`` variables behavior change for :ref:`ref-classes-native` and :ref:`ref-classes-nativesdk` classes
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The :term:`CPPFLAGS`, :term:`CFLAGS`, :term:`CXXFLAGS` and :term:`LDFLAGS`
+variables used to have hard assignments in the :ref:`ref-classes-native` and
+:ref:`ref-classes-nativesdk` classes, respectively::
+
+   CPPFLAGS = "${BUILD_CPPFLAGS}"
+   CFLAGS = "${BUILD_CFLAGS}"
+   CXXFLAGS = "${BUILD_CXXFLAGS}"
+   LDFLAGS = "${BUILD_LDFLAGS}"
+
+and::
+
+   CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
+   CFLAGS = "${BUILDSDK_CFLAGS}"
+   CXXFLAGS = "${BUILDSDK_CXXFLAGS}"
+   LDFLAGS = "${BUILDSDK_LDFLAGS}"
+
+This caused races when recipes tried to append to any of these variables using
+the ``+=`` operator, so recipes could use ``:append`` instead if they wanted the
+change to apply to the target, :ref:`ref-classes-native` and
+:ref:`ref-classes-nativesdk` contexts.
+
+Recipes can now safely use the ``+=`` operator to achieve this.
+
+What this change also means is that previous assignments using the ``+=``
+operator, which only used to apply to the target context, **now apply to all
+three**: target, :ref:`ref-classes-native` and :ref:`ref-classes-nativesdk`
+contexts.
+
+Recipes that unknowingly relied on this behavior should change these assignments
+to use ``TARGET_`` variables instead, for example::
+
+   CFLAGS += "something"
+
+to::
+
+   TARGET_CFLAGS += "something"
+
+See :oe_git:`/openembedded-core/commit/?id=a157b2f9d93428ca21265cc860a3b58b3698b3aa`.
+
 Supported kernel versions
 ~~~~~~~~~~~~~~~~~~~~~~~~~