]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
Clean up compiler optimization variable FULL_OPTIMIZATION
authorHongxu Jia <hongxu.jia@windriver.com>
Mon, 22 Dec 2025 14:54:02 +0000 (22:54 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 22 Jan 2026 16:50:56 +0000 (16:50 +0000)
In bitbake.conf, remove FULL_OPTIMIZATION, set "-O2 ${DEBUG_LEVELFLAG}"
to SELECTED_OPTIMIZATION directly

In mesa.inc, due to llvmpipe is slow if compiled with
-fomit-frame-pointer (e.g. -O2), set -fno-omit-frame-pointer
to TARGET_CFLAGS only if option -O2 existed

Correct typo in clang.patch

In recipe harfbuzz, use SELECTED_OPTIMIZATION to instead of
FULL_OPTIMIZATION

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/conf/bitbake.conf
meta/conf/documentation.conf
meta/recipes-graphics/harfbuzz/harfbuzz_12.3.0.bb
meta/recipes-graphics/mesa/mesa.inc
meta/recipes-multimedia/lame/lame/clang.patch

index 653d396c79596639690ff2e6de2cd9c1e12ec847..c4e9b60ac35f124ef00d92f05ba2fd9272d2a27f 100644 (file)
@@ -659,8 +659,7 @@ DEBUG_PREFIX_MAP ?= "${DEBUG_PREFIX_MAP_EXTRA} \
 "
 DEBUG_LEVELFLAG ?= "-g"
 
-FULL_OPTIMIZATION ??= "-O2 ${DEBUG_LEVELFLAG}"
-SELECTED_OPTIMIZATION ??= "${FULL_OPTIMIZATION}"
+SELECTED_OPTIMIZATION ??= "-O2 ${DEBUG_LEVELFLAG}"
 # compiler flags for native/nativesdk
 BUILD_OPTIMIZATION ??= "-O2"
 
index 956d4a79a683a5232f7d6101e837092c2ecadf75..7d2163bae0b66dd19000a8cd790f9c38e53ae29c 100644 (file)
@@ -178,7 +178,6 @@ FILESPATH[doc] = "The default set of directories the OpenEmbedded build system u
 FILESYSTEM_PERMS_TABLES[doc] = "Allows you to define your own file permissions settings table as part of your configuration for the packaging process."
 FONT_EXTRA_RDEPENDS[doc] = "When a recipe inherits the fontcache class, this variable specifies runtime dependencies for font packages. This variable defaults to 'fontconfig-utils'."
 FONT_PACKAGES[doc] = "When a recipe inherits the fontcache class, this variable identifies packages containing font files that need to be cached by Fontconfig."
-FULL_OPTIMIZATION[doc] = "The options to pass in TARGET_CFLAGS and CFLAGS when compiling an optimized system. This variable defaults to '-O2 ${DEBUG_LEVELFLAG}'."
 
 #G
 
@@ -370,7 +369,7 @@ SDK_OUTPUT[doc] = "The location used by the OpenEmbedded build system when creat
 SDKIMAGE_FEATURES[doc] = "Equivalent to IMAGE_FEATURES. However, this variable applies to the SDK generated from an image using the command 'bitbake -c populate_sdk imagename'."
 SDKMACHINE[doc] = "Specifies the architecture (i.e. i686 or x86_64) for which to build SDK and ADT items."
 SECTION[doc] = "The section in which packages should be categorized. Package management utilities can make use of this variable."
-SELECTED_OPTIMIZATION[doc] = "The variable takes the value of FULL_OPTIMIZATION unless fragment 'core/yocto/debug-optimize' is enabled. In this case, the value of DEBUG_OPTIMIZATION is used."
+SELECTED_OPTIMIZATION[doc] = "The variable takes the value of '-O2 ${DEBUG_LEVELFLAG}' unless fragment 'core/yocto/debug-optimize' is enabled. In this case, the value of DEBUG_OPTIMIZATION is used."
 SERIAL_CONSOLES[doc] = "Defines the serial consoles (TTYs) to enable using getty."
 SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS[doc] = "A list of recipe dependencies that should not be used to determine signatures of tasks from one recipe when they depend on tasks from another recipe."
 SIGGEN_EXCLUDERECIPES_ABISAFE[doc] = "A list of recipes that are completely stable and will never change."
index d2e63f5529dde26f97edb5f4537fd8ac7fa231c5..12cc3bf2fc58bbaedda6901bb21de60c0cb3d15f 100644 (file)
@@ -21,7 +21,7 @@ GTKDOC_MESON_ENABLE_FLAG = 'enabled'
 GTKDOC_MESON_DISABLE_FLAG = 'disabled'
 
 # As per upstream CONFIG.md, it is recommended to always build with -Os.
-FULL_OPTIMIZATION = "-Os ${DEBUG_LEVELFLAG}"
+SELECTED_OPTIMIZATION ?= "-Os ${DEBUG_LEVELFLAG}"
 
 EXTRA_OEMESON = "-Dtests=disabled"
 
index 1607fddd4bad32dc5b20612698a153cb02a00375..6cf492e151dca0a7c581053cf60768be61261a09 100644 (file)
@@ -221,7 +221,7 @@ PACKAGECONFIG[video-codecs] = "-Dvideo-codecs=${VIDEO_CODECS}, -Dvideo-codecs=''
 PACKAGECONFIG[teflon] = "-Dteflon=true, -Dteflon=false"
 
 # llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2)
-FULL_OPTIMIZATION:append = " -fno-omit-frame-pointer"
+TARGET_CFLAGS += "${@bb.utils.contains('SELECTED_OPTIMIZATION', '-O2', '-fno-omit-frame-pointer', '', d)}"
 
 CFLAGS:append:armv5 = " -DMISSING_64BIT_ATOMICS"
 CFLAGS:append:armv6 = " -DMISSING_64BIT_ATOMICS"
index 116000c577b6a1a4179be2dd0d856f8fd7a2887b..183a9d321282c16eada5813645ee9bb0b5c13877 100644 (file)
@@ -9,7 +9,7 @@ and target hardware aligns, and leads to some amusing errors:
        unknown target CPU 'neoverse-n1'
        note: valid target CPU values are: i386, i486, ...
 
-Move the HAVE_CLANG block up into the FULL_OPTIMIZATION case, alongside
+Move the HAVE_CLANG block up into the OPTIMIZATION case, alongside
 HAVE_GCC.  This option is never enabled (as it's basically "use native")
 so resolves the build failure.