Skip to contentSkip to conversation

perf: backport a fix for confusing non-fatal error

PATCH In review Martin Jansa 2 participants 3 messages Aug 18, 2020 1 message not in the archive

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 perf: backport a fix for confusing non-fatal error

In reply to a message not in the archive

* add V=1 to make log.do_compile a bit more useful, with this it shows:
/bin/sh '/OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/perf/1.0-r9/perf-1.0/tools/perf/trace/beauty/arch_errno_names.sh' x86_64-oe-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=/OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/perf/1.0-r9/recipe-sysroot /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/perf/1.0-r9/perf-1.0/tools > /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/perf/1.0-r9/perf-1.0/trace/beauty/generated/arch_errno_name_array.c
find: unknown predicate `-m64/arch'
x86_64-oe-linux-gcc: error: unrecognized command-line option '-m64/include/uapi/asm-generic/errno.h'
x86_64-oe-linux-gcc: fatal error: no input files
compilation terminated.
x86_64-oe-linux-gcc: error: unrecognized command-line option '-m64/include/uapi/asm-generic/errno.h'
x86_64-oe-linux-gcc: fatal error: no input files
compilation terminated.

* apply https://github.com/torvalds/linux/commit/e4ffd066ff440a57097e9140fa9e16ceef905de8
with sed call to fix this

---
 meta/recipes-kernel/perf/perf.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-kernel/perf/perf.bb +4 -0
index cf95df710f..868cde7353 100644
@@ -70,6 +70,7 @@ SPDX_S = "${S}/tools/perf"
 LDFLAGS="-ldl -lutil"
 
 EXTRA_OEMAKE = '\
+    V=1 \
     -C ${S}/tools/perf \
     O=${B} \
     CROSS_COMPILE=${TARGET_PREFIX} \
@@ -201,6 +202,9 @@ do_configure_prepend () {
             ${S}/tools/perf/Makefile.perf
         sed -i -e "s,prefix='\$(DESTDIR_SQ)/usr'$,prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(DESTDIR)\$(PYTHON_SITEPACKAGES_DIR)',g" \
             ${S}/tools/perf/Makefile.perf
+        # backport https://github.com/torvalds/linux/commit/e4ffd066ff440a57097e9140fa9e16ceef905de8
+        sed -i -e 's,\($(Q)$(SHELL) .$(arch_errno_tbl).\) $(CC) $(arch_errno_hdr_dir),\1 $(firstword $(CC)) $(arch_errno_hdr_dir),g' \
+            ${S}/tools/perf/Makefile.perf
     fi
     sed -i -e "s,--root='/\$(DESTDIR_SQ)',--prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(DESTDIR)\$(PYTHON_SITEPACKAGES_DIR)',g" \
         ${S}/tools/perf/Makefile*
Signature · 1 line
2.25.1
#2 lore raw
Quoted 32 lines · Martin Jansa

* add V=1 to make log.do_compile a bit more useful, with this it shows:
/bin/sh '/OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/perf/1.0-r9/perf-1.0/tools/perf/trace/beauty/arch_errno_names.sh' x86_64-oe-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=/OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/perf/1.0-r9/recipe-sysroot /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/perf/1.0-r9/perf-1.0/tools > /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/perf/1.0-r9/perf-1.0/trace/beauty/generated/arch_errno_name_array.c
find: unknown predicate `-m64/arch'
x86_64-oe-linux-gcc: error: unrecognized command-line option '-m64/include/uapi/asm-generic/errno.h'
x86_64-oe-linux-gcc: fatal error: no input files
compilation terminated.
x86_64-oe-linux-gcc: error: unrecognized command-line option '-m64/include/uapi/asm-generic/errno.h'
x86_64-oe-linux-gcc: fatal error: no input files
compilation terminated.

* apply https://github.com/torvalds/linux/commit/e4ffd066ff440a57097e9140fa9e16ceef905de8
with sed call to fix this

---
 meta/recipes-kernel/perf/perf.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-kernel/perf/perf.bb +1 -0
index cf95df710f..868cde7353 100644
@@ -70,6 +70,7 @@ SPDX_S = "${S}/tools/perf"
 LDFLAGS="-ldl -lutil"
 
 EXTRA_OEMAKE = '\
+    V=1 \
     -C ${S}/tools/perf \
     O=${B} \
     CROSS_COMPILE=${TARGET_PREFIX} \

meta/recipes-kernel/perf/perf.bb do_configure_prepend () { · line 207

Quoted 6 lines
meta/recipes-kernel/perf/perf.bb +3 -0
@@ -201,6 +202,9 @@ do_configure_prepend () {
             ${S}/tools/perf/Makefile.perf
         sed -i -e "s,prefix='\$(DESTDIR_SQ)/usr'$,prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(DESTDIR)\$(PYTHON_SITEPACKAGES_DIR)',g" \
             ${S}/tools/perf/Makefile.perf
+        # backport https://github.com/torvalds/linux/commit/e4ffd066ff440a57097e9140fa9e16ceef905de8
+        sed -i -e 's,\($(Q)$(SHELL) .$(arch_errno_tbl).\) $(CC) $(arch_errno_hdr_dir),\1 $(firstword $(CC)) $(arch_errno_hdr_dir),g' \
+            ${S}/tools/perf/Makefile.perf

This is good instead of patching every BSP kernel
how far back will it go patching ?

Quoted 7 lines
meta/recipes-kernel/perf/perf.bb +0 -1
     fi
     sed -i -e "s,--root='/\$(DESTDIR_SQ)',--prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(DESTDIR)\$(PYTHON_SITEPACKAGES_DIR)',g" \
         ${S}/tools/perf/Makefile*
--

2.25.1

#3 lore raw

This patch fixes only the non-fatal find/CC concatenation issue.

For other fixes it might be cleaner to just patch BSP kernels, I've listed some perf gcc-10 fixes in the linux-raspberrypi upgrade:
https://github.com/agherzan/meta-raspberrypi/pull/705
but sadly it shows that even relatively recent 5.4.51 isn't good enough for perf and this wasn't even without -fcommon discussed in the another thread.

Quoted 67 lines · Khem Raj
Quoted 3 lines · Martin Jansa

* add V=1 to make log.do_compile a bit more useful, with this it shows:
/bin/sh

'/OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/perf/1.0-r9/perf-1.0/tools/perf/trace/beauty/arch_errno_names.sh' x86_64-oe-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=/OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/perf/1.0-r9/recipe-sysroot /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/perf/1.0-r9/perf-1.0/tools

Quoted 1 line

/OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/perf/1.0-r9/perf-1.0/trace/beauty/generated/arch_errno_name_array.c

Quoted 2 lines

find: unknown predicate `-m64/arch'
x86_64-oe-linux-gcc: error: unrecognized command-line option

'-m64/include/uapi/asm-generic/errno.h'

Quoted 3 lines

x86_64-oe-linux-gcc: fatal error: no input files compilation terminated.
x86_64-oe-linux-gcc: error: unrecognized command-line option

'-m64/include/uapi/asm-generic/errno.h'

Quoted 4 lines

x86_64-oe-linux-gcc: fatal error: no input files compilation terminated.

* apply

https://github.com/torvalds/linux/commit/e4ffd066ff440a57097e9140fa9e16ceef905de8

Review

Quoted 8 lines

with sed call to fix this

---
 meta/recipes-kernel/perf/perf.bb | 4 ++++
 1 file changed, 4 insertions(+)
(quoted diff) +0 -0

b/meta/recipes-kernel/perf/perf.bb

Quoted 12 lines

index cf95df710f..868cde7353 100644

meta/recipes-kernel/perf/perf.bb +1 -0
@@ -70,6 +70,7 @@ SPDX_S = "${S}/tools/perf"
 LDFLAGS="-ldl -lutil"
 
 EXTRA_OEMAKE = '\
+    V=1 \
     -C ${S}/tools/perf \
     O=${B} \
     CROSS_COMPILE=${TARGET_PREFIX} \

meta/recipes-kernel/perf/perf.bb do_configure_prepend () { · line 203

Quoted 2 lines
meta/recipes-kernel/perf/perf.bb +0 -0
@@ -201,6 +202,9 @@ do_configure_prepend () {
             ${S}/tools/perf/Makefile.perf
         sed -i -e

"s,prefix='\$(DESTDIR_SQ)/usr'$,prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(DESTDIR)\$(PYTHON_SITEPACKAGES_DIR)',g" \

meta/recipes-kernel/perf/perf.bb do_configure_prepend () { · line 205

Quoted 2 lines
meta/recipes-kernel/perf/perf.bb +1 -0
             ${S}/tools/perf/Makefile.perf
+        # backport

https://github.com/torvalds/linux/commit/e4ffd066ff440a57097e9140fa9e16ceef905de8

meta/recipes-kernel/perf/perf.bb do_configure_prepend () { · line 206

Quoted 1 line
meta/recipes-kernel/perf/perf.bb +1 -0
+        sed -i -e 's,\($(Q)$(SHELL) .$(arch_errno_tbl).\) $(CC)

$(arch_errno_hdr_dir),\1 $(firstword $(CC)) $(arch_errno_hdr_dir),g' \

meta/recipes-kernel/perf/perf.bb do_configure_prepend () { · line 207

Quoted 1 line
meta/recipes-kernel/perf/perf.bb +1 -0
+            ${S}/tools/perf/Makefile.perf

This is good instead of patching every BSP kernel
how far back will it go patching ?

meta/recipes-kernel/perf/perf.bb do_configure_prepend () { · line 209

Quoted 2 lines
meta/recipes-kernel/perf/perf.bb +0 -0
     fi
     sed -i -e "s,--root='/\$(DESTDIR_SQ)',--prefix='\$(DESTDIR_SQ)/usr'

--install-lib='\$(DESTDIR)\$(PYTHON_SITEPACKAGES_DIR)',g" \

Quoted 5 lines
meta/recipes-kernel/perf/perf.bb +0 -1
         ${S}/tools/perf/Makefile*
--

2.25.1