diff options
| author | Rasmus Villemoes <rasmus.villemoes@prevas.dk> | 2023-12-13 11:34:09 +0800 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2023-12-22 05:23:26 -1000 |
| commit | c2bf7886048a8e70cd280c80ad27764cafc089e9 (patch) | |
| tree | 69b7bd86739afe0328a89dd2a703c4ee1d528d07 | |
| parent | e0aac6bc374cea169d20630c72dea48ca760f6b9 (diff) | |
| download | poky-c2bf7886048a8e70cd280c80ad27764cafc089e9.tar.gz | |
perf: lift TARGET_CC_ARCH modification out of security_flags.inc
Building perf without security_flags.inc being included in one's
distro results in the buildpaths warning
WARNING: perf-1.0-r9 do_package_qa: QA Issue: File /usr/bin/trace in
package perf contains reference to TMPDIR
because the ${DEBUG_PREFIX_MAP} does not get used. Most recipes get
that from CFLAGS, but the perf recipe explicitly unsets that.
Now ${SELECTED_OPTIMIZATION} of course contains more than just
${DEBUG_FLAGS}/${DEBUG_PREFIX_MAP}. For most TUs, perf's build system
adds its own optimization flags (-O6 for odd reasons), so for those
including the -O2 or -Og doesn't change anything. But looking at the
.o.cmd files show that there are some TUs which currently get built
without any -O flag. So for those adding the distro's
SELECTED_OPTIMIZATION seem to be the right thing to do.
(cherry-picked from Oe-Core rev: aa01c9122ef4a2159df503ef6ed25e802277f13a)
(From OE-Core rev: 34f2f67055a9a29765629abef28ffa6b66c8ed41)
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -rw-r--r-- | meta/conf/distro/include/security_flags.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-kernel/perf/perf.bb | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/meta/conf/distro/include/security_flags.inc b/meta/conf/distro/include/security_flags.inc index 2972f05b4e..d97a6edb0f 100644 --- a/meta/conf/distro/include/security_flags.inc +++ b/meta/conf/distro/include/security_flags.inc | |||
| @@ -69,4 +69,3 @@ SECURITY_LDFLAGS:pn-xserver-xorg = "${SECURITY_X_LDFLAGS}" | |||
| 69 | TARGET_CC_ARCH:append:pn-binutils = " ${SELECTED_OPTIMIZATION}" | 69 | TARGET_CC_ARCH:append:pn-binutils = " ${SELECTED_OPTIMIZATION}" |
| 70 | TARGET_CC_ARCH:append:pn-gcc = " ${SELECTED_OPTIMIZATION}" | 70 | TARGET_CC_ARCH:append:pn-gcc = " ${SELECTED_OPTIMIZATION}" |
| 71 | TARGET_CC_ARCH:append:pn-gdb = " ${SELECTED_OPTIMIZATION}" | 71 | TARGET_CC_ARCH:append:pn-gdb = " ${SELECTED_OPTIMIZATION}" |
| 72 | TARGET_CC_ARCH:append:pn-perf = " ${SELECTED_OPTIMIZATION}" | ||
diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb index 675acfaf26..a392166e73 100644 --- a/meta/recipes-kernel/perf/perf.bb +++ b/meta/recipes-kernel/perf/perf.bb | |||
| @@ -73,6 +73,15 @@ SPDX_S = "${S}/tools/perf" | |||
| 73 | # supported kernel. | 73 | # supported kernel. |
| 74 | LDFLAGS="-ldl -lutil" | 74 | LDFLAGS="-ldl -lutil" |
| 75 | 75 | ||
| 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 | ||
| 78 | # any -O option, so ensure the distro's chosen optimization gets used | ||
| 79 | # for those. Since ${SELECTED_OPTIMIZATION} always includes | ||
| 80 | # ${DEBUG_FLAGS} which in turn includes ${DEBUG_PREFIX_MAP}, this also | ||
| 81 | # ensures perf is built with appropriate -f*-prefix-map options, | ||
| 82 | # avoiding the 'buildpaths' QA warning. | ||
| 83 | TARGET_CC_ARCH += "${SELECTED_OPTIMIZATION}" | ||
| 84 | |||
| 76 | EXTRA_OEMAKE = '\ | 85 | EXTRA_OEMAKE = '\ |
| 77 | V=1 \ | 86 | V=1 \ |
| 78 | VF=1 \ | 87 | VF=1 \ |
