summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2024-07-12 07:35:48 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-07-13 23:28:30 +0100
commit1cf0974ad242f7eb2815a4ef0e3e5b6507ca56ea (patch)
tree41ef242b95aa4468862e728bef229545a77d9c11
parent3891414b6b929cc3eed9d7ea62e9cda70bba29a0 (diff)
downloadpoky-1cf0974ad242f7eb2815a4ef0e3e5b6507ca56ea.tar.gz
bitbake.conf: Further cleanup compiler optimization flags
Move the -pipe option out of the optimization flags and directly into the flags variables since we always use it now. Also move the debug prefix mapping there to match the nativesdk case which already does this. Fix the documentation and two recipe usages to match the change. (From OE-Core rev: 9badf68d78d995f7d5d4cf27e045f029fc6d4044) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/conf/bitbake.conf15
-rw-r--r--meta/conf/documentation.conf4
-rw-r--r--meta/recipes-core/ovmf/ovmf_git.bb2
-rw-r--r--meta/recipes-devtools/valgrind/valgrind_3.23.0.bb2
-rw-r--r--meta/recipes-kernel/perf/perf.bb7
-rw-r--r--meta/recipes-sato/webkit/webkitgtk_2.44.1.bb2
6 files changed, 16 insertions, 16 deletions
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 02fe872d2c..5c875f34f8 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -610,10 +610,10 @@ BUILDSDK_CPPFLAGS = ""
610export CPPFLAGS = "${TARGET_CPPFLAGS}" 610export CPPFLAGS = "${TARGET_CPPFLAGS}"
611TARGET_CPPFLAGS = "" 611TARGET_CPPFLAGS = ""
612 612
613export BUILD_CFLAGS = "${BUILD_CPPFLAGS} ${BUILD_OPTIMIZATION}" 613export BUILD_CFLAGS = "${BUILD_CPPFLAGS} ${BUILD_OPTIMIZATION} -pipe"
614BUILDSDK_CFLAGS = "${BUILDSDK_CPPFLAGS} ${BUILD_OPTIMIZATION} ${DEBUG_PREFIX_MAP}" 614BUILDSDK_CFLAGS = "${BUILDSDK_CPPFLAGS} ${BUILD_OPTIMIZATION} ${DEBUG_PREFIX_MAP} -pipe"
615export CFLAGS = "${TARGET_CFLAGS}" 615export CFLAGS = "${TARGET_CFLAGS}"
616TARGET_CFLAGS = "${TARGET_CPPFLAGS} ${SELECTED_OPTIMIZATION}" 616TARGET_CFLAGS = "${TARGET_CPPFLAGS} ${SELECTED_OPTIMIZATION} ${DEBUG_PREFIX_MAP} -pipe"
617 617
618export BUILD_CXXFLAGS = "${BUILD_CFLAGS}" 618export BUILD_CXXFLAGS = "${BUILD_CFLAGS}"
619BUILDSDK_CXXFLAGS = "${BUILDSDK_CFLAGS}" 619BUILDSDK_CXXFLAGS = "${BUILDSDK_CFLAGS}"
@@ -663,13 +663,14 @@ DEBUG_PREFIX_MAP ?= "-fcanon-prefix-map \
663 -fmacro-prefix-map=${STAGING_DIR_HOST}= \ 663 -fmacro-prefix-map=${STAGING_DIR_HOST}= \
664 -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \ 664 -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
665" 665"
666DEBUG_FLAGS ?= "-g ${DEBUG_PREFIX_MAP}" 666DEBUG_LEVELFLAG ?= "-g"
667 667
668FULL_OPTIMIZATION = "-O2 -pipe ${DEBUG_FLAGS}" 668FULL_OPTIMIZATION = "-O2 ${DEBUG_LEVELFLAG}"
669DEBUG_OPTIMIZATION = "-Og ${DEBUG_FLAGS} -pipe" 669DEBUG_OPTIMIZATION = "-Og ${DEBUG_LEVELFLAG}"
670SELECTED_OPTIMIZATION = "${@d.getVar(oe.utils.vartrue('DEBUG_BUILD', 'DEBUG_OPTIMIZATION', 'FULL_OPTIMIZATION', d))}" 670SELECTED_OPTIMIZATION = "${@d.getVar(oe.utils.vartrue('DEBUG_BUILD', 'DEBUG_OPTIMIZATION', 'FULL_OPTIMIZATION', d))}"
671SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_OPTIMIZATION DEBUG_BUILD" 671SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_OPTIMIZATION DEBUG_BUILD"
672BUILD_OPTIMIZATION = "${@oe.utils.vartrue('DEBUG_BUILD', '-Og -g', '-O2', d)} -pipe" 672# compiler flags for native/nativesdk
673BUILD_OPTIMIZATION = "${@oe.utils.vartrue('DEBUG_BUILD', '-Og -g', '-O2', d)}"
673BUILD_OPTIMIZATION[vardeps] += "DEBUG_BUILD" 674BUILD_OPTIMIZATION[vardeps] += "DEBUG_BUILD"
674 675
675################################################################## 676##################################################################
diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf
index b0591881ba..155353eafc 100644
--- a/meta/conf/documentation.conf
+++ b/meta/conf/documentation.conf
@@ -132,7 +132,7 @@ D[doc] = "The destination directory."
132DATE[doc] = "The date the build was started using YMD format." 132DATE[doc] = "The date the build was started using YMD format."
133DATETIME[doc] = "The date and time the build was started." 133DATETIME[doc] = "The date and time the build was started."
134DEBUG_BUILD[doc] = "Specifies to build packages with debugging information. This influences the value of the SELECTED_OPTIMIZATION variable." 134DEBUG_BUILD[doc] = "Specifies to build packages with debugging information. This influences the value of the SELECTED_OPTIMIZATION variable."
135DEBUG_OPTIMIZATION[doc] = "The options to pass in TARGET_CFLAGS and CFLAGS when compiling a system for debugging. This variable defaults to '-Og ${DEBUG_FLAGS} -pipe'." 135DEBUG_OPTIMIZATION[doc] = "The options to pass in TARGET_CFLAGS and CFLAGS when compiling a system for debugging. This variable defaults to '-Og ${DEBUG_LEVELFLAG}'."
136DEFAULT_PREFERENCE[doc] = "Specifies a weak bias for recipe selection priority." 136DEFAULT_PREFERENCE[doc] = "Specifies a weak bias for recipe selection priority."
137DEPENDS[doc] = "Lists a recipe's build-time dependencies (i.e. other recipe files)." 137DEPENDS[doc] = "Lists a recipe's build-time dependencies (i.e. other recipe files)."
138DEPLOY_DIR[doc] = "Points to the general area that the OpenEmbedded build system uses to place images, packages, SDKs and other output files that are ready to be used outside of the build system." 138DEPLOY_DIR[doc] = "Points to the general area that the OpenEmbedded build system uses to place images, packages, SDKs and other output files that are ready to be used outside of the build system."
@@ -180,7 +180,7 @@ FILESPATH[doc] = "The default set of directories the OpenEmbedded build system u
180FILESYSTEM_PERMS_TABLES[doc] = "Allows you to define your own file permissions settings table as part of your configuration for the packaging process." 180FILESYSTEM_PERMS_TABLES[doc] = "Allows you to define your own file permissions settings table as part of your configuration for the packaging process."
181FONT_EXTRA_RDEPENDS[doc] = "When a recipe inherits the fontcache class, this variable specifies runtime dependencies for font packages. This variable defaults to 'fontconfig-utils'." 181FONT_EXTRA_RDEPENDS[doc] = "When a recipe inherits the fontcache class, this variable specifies runtime dependencies for font packages. This variable defaults to 'fontconfig-utils'."
182FONT_PACKAGES[doc] = "When a recipe inherits the fontcache class, this variable identifies packages containing font files that need to be cached by Fontconfig." 182FONT_PACKAGES[doc] = "When a recipe inherits the fontcache class, this variable identifies packages containing font files that need to be cached by Fontconfig."
183FULL_OPTIMIZATION[doc]= "The options to pass in TARGET_CFLAGS and CFLAGS when compiling an optimized system. This variable defaults to '-O2 -pipe ${DEBUG_FLAGS}'." 183FULL_OPTIMIZATION[doc]= "The options to pass in TARGET_CFLAGS and CFLAGS when compiling an optimized system. This variable defaults to '-O2 ${DEBUG_LEVELFLAG}'."
184 184
185#G 185#G
186 186
diff --git a/meta/recipes-core/ovmf/ovmf_git.bb b/meta/recipes-core/ovmf/ovmf_git.bb
index 35ca8d1834..085574c0cb 100644
--- a/meta/recipes-core/ovmf/ovmf_git.bb
+++ b/meta/recipes-core/ovmf/ovmf_git.bb
@@ -55,7 +55,7 @@ DEPENDS = "nasm-native acpica-native ovmf-native util-linux-native"
55EDK_TOOLS_DIR="edk2_basetools" 55EDK_TOOLS_DIR="edk2_basetools"
56 56
57# OVMF has trouble building with the default optimization of -O2. 57# OVMF has trouble building with the default optimization of -O2.
58BUILD_OPTIMIZATION="-pipe" 58BUILD_OPTIMIZATION = ""
59 59
60# OVMF supports IA only, although it could conceivably support ARM someday. 60# OVMF supports IA only, although it could conceivably support ARM someday.
61COMPATIBLE_HOST:class-target='(i.86|x86_64).*' 61COMPATIBLE_HOST:class-target='(i.86|x86_64).*'
diff --git a/meta/recipes-devtools/valgrind/valgrind_3.23.0.bb b/meta/recipes-devtools/valgrind/valgrind_3.23.0.bb
index ad9e26cb6b..494a3c0df9 100644
--- a/meta/recipes-devtools/valgrind/valgrind_3.23.0.bb
+++ b/meta/recipes-devtools/valgrind/valgrind_3.23.0.bb
@@ -88,7 +88,7 @@ CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
88# to -O2 but uses -O0 for some specific test apps etc. Passing our own flags 88# to -O2 but uses -O0 for some specific test apps etc. Passing our own flags
89# (via CFLAGS) means we interfere with that. Only pass DEBUG_FLAGS to it 89# (via CFLAGS) means we interfere with that. Only pass DEBUG_FLAGS to it
90# which fixes build path issue in DWARF. 90# which fixes build path issue in DWARF.
91SELECTED_OPTIMIZATION = "${DEBUG_FLAGS}" 91SELECTED_OPTIMIZATION = "${DEBUG_LEVELFLAG}"
92 92
93# Split out various helper scripts to separate packages to avoid the 93# Split out various helper scripts to separate packages to avoid the
94# main package depending on perl and python. 94# main package depending on perl and python.
diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index 058f887b86..ab2dc5ae62 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -76,11 +76,10 @@ LDFLAGS="-ldl -lutil"
76# Perf's build system adds its own optimization flags for most TUs, 76# Perf's build system adds its own optimization flags for most TUs,
77# overriding the flags included here. But for some, perf does not add 77# overriding the flags included here. But for some, perf does not add
78# any -O option, so ensure the distro's chosen optimization gets used 78# any -O option, so ensure the distro's chosen optimization gets used
79# for those. Since ${SELECTED_OPTIMIZATION} always includes 79# for those. Also include ${DEBUG_PREFIX_MAP} which nsures perf is
80# ${DEBUG_FLAGS} which in turn includes ${DEBUG_PREFIX_MAP}, this also 80# built with appropriate -f*-prefix-map options,
81# ensures perf is built with appropriate -f*-prefix-map options,
82# avoiding the 'buildpaths' QA warning. 81# avoiding the 'buildpaths' QA warning.
83TARGET_CC_ARCH += "${SELECTED_OPTIMIZATION}" 82TARGET_CC_ARCH += "${SELECTED_OPTIMIZATION} ${DEBUG_PREFIX_MAP}"
84 83
85EXTRA_OEMAKE = '\ 84EXTRA_OEMAKE = '\
86 V=1 \ 85 V=1 \
diff --git a/meta/recipes-sato/webkit/webkitgtk_2.44.1.bb b/meta/recipes-sato/webkit/webkitgtk_2.44.1.bb
index 29e12bb8c5..d927d81a43 100644
--- a/meta/recipes-sato/webkit/webkitgtk_2.44.1.bb
+++ b/meta/recipes-sato/webkit/webkitgtk_2.44.1.bb
@@ -93,7 +93,7 @@ EXTRA_OECMAKE = " \
93 93
94# Unless DEBUG_BUILD is enabled, pass -g1 to massively reduce the size of the 94# Unless DEBUG_BUILD is enabled, pass -g1 to massively reduce the size of the
95# debug symbols (4.3GB to 700M at time of writing) 95# debug symbols (4.3GB to 700M at time of writing)
96DEBUG_FLAGS:append = "${@oe.utils.vartrue('DEBUG_BUILD', '', ' -g1', d)}" 96DEBUG_LEVELFLAG = "-g1"
97 97
98# Javascript JIT is not supported on ARC 98# Javascript JIT is not supported on ARC
99EXTRA_OECMAKE:append:arc = " -DENABLE_JIT=OFF " 99EXTRA_OECMAKE:append:arc = " -DENABLE_JIT=OFF "