From: Hongxu Jia Date: Mon, 22 Dec 2025 14:54:02 +0000 (+0800) Subject: Clean up compiler optimization variable FULL_OPTIMIZATION X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fb3bcbba551a3be0c5a8718ee84f506ffdd829f;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git Clean up compiler optimization variable FULL_OPTIMIZATION 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 Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 653d396c79..c4e9b60ac3 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -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" diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf index 956d4a79a6..7d2163bae0 100644 --- a/meta/conf/documentation.conf +++ b/meta/conf/documentation.conf @@ -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." diff --git a/meta/recipes-graphics/harfbuzz/harfbuzz_12.3.0.bb b/meta/recipes-graphics/harfbuzz/harfbuzz_12.3.0.bb index d2e63f5529..12cc3bf2fc 100644 --- a/meta/recipes-graphics/harfbuzz/harfbuzz_12.3.0.bb +++ b/meta/recipes-graphics/harfbuzz/harfbuzz_12.3.0.bb @@ -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" diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index 1607fddd4b..6cf492e151 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -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" diff --git a/meta/recipes-multimedia/lame/lame/clang.patch b/meta/recipes-multimedia/lame/lame/clang.patch index 116000c577..183a9d3212 100644 --- a/meta/recipes-multimedia/lame/lame/clang.patch +++ b/meta/recipes-multimedia/lame/lame/clang.patch @@ -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.