Skip to contentSkip to conversation

kernel-devsrc: copy arch/powerpc/tools contents

PATCH Superseded [email protected] 2 participants 4 messages Jul 16, 2025 – Jul 17, 2025 1 message not in the archive

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel-devsrc: copy arch/powerpc/tools contents

From: Chen Qi <[email protected]>

For now, using qemuppc64 as MACHINE and building things inside SDK, we'll get the following error:

ERROR: modpost: "_mcount" undefined

This is because after [1], MPROFILE_KERNEL is using arch/powerpc/tools/ contents to do the check. This in turn affects HAVE_OBJTOOL. """
arch/powerpc/Kconfig: select HAVE_OBJTOOL if ARCH_USING_PATCHABLE_FUNCTION_ENTRY || MPROFILE_KERNEL || PPC32
"""

The current MPROFILE_KERNEL for powerpc:
"""
config MPROFILE_KERNEL

            depends on PPC64_ELF_ABI_V2 && FUNCTION_TRACER
            def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh $(CC) -mlittle-endian) if CPU_LITTLE_ENDIAN
            def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh $(CC) -mbig-endian) if CPU_BIG_ENDIAN

"""

If MPROFILE_KERNEL is disabled, thus HAVE_OBJTOOL being disabled, then FTRACE_MCOUNT_USE_RECORDMCOUNT will be enabled, causing this error.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=abba759796f9b73eb24df9b734dd063839fc62e0

---
 meta/recipes-kernel/linux/kernel-devsrc.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-kernel/linux/kernel-devsrc.bb +4 -0
index 3d2eb3929e..c4b5d0e5a6 100644
@@ -208,6 +208,10 @@ do_install() {
         fi
 
         if [ "${ARCH}" = "powerpc" ]; then
+            # 4.18+ needs these files for MPROFILE_KERNEL, but don't error if they aren't present in the source
+            # See https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=abba759796f9b73eb24df9b734dd063839fc62e0
+            cp -a --parents arch/powerpc/tools $kerneldir/build/ 2>/dev/null || :
+
             # 5.0 needs these files, but don't error if they aren't present in the source
             cp -a --parents arch/${ARCH}/kernel/syscalls/syscall.tbl $kerneldir/build/ 2>/dev/null || :
             cp -a --parents arch/${ARCH}/kernel/syscalls/syscalltbl.sh $kerneldir/build/ 2>/dev/null || :
Signature · 1 line
2.49.0
#1 lore raw
Quoted 47 lines · Chen Qi via lists.openembedded.org

From: Chen Qi <[email protected]>

For now, using qemuppc64 as MACHINE and building things inside SDK, we'll get the following error:

ERROR: modpost: "_mcount" undefined

This is because after [1], MPROFILE_KERNEL is using arch/powerpc/tools/ contents to do the check. This in turn affects HAVE_OBJTOOL. """
arch/powerpc/Kconfig: select HAVE_OBJTOOL if
ARCH_USING_PATCHABLE_FUNCTION_ENTRY || MPROFILE_KERNEL || PPC32 """

The current MPROFILE_KERNEL for powerpc:
"""
config MPROFILE_KERNEL

            depends on PPC64_ELF_ABI_V2 && FUNCTION_TRACER
            def_bool

$(success,$(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh $(CC) -mlittle-endian) if CPU_LITTLE_ENDIAN
def_bool
$(success,$(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh $(CC) -mbig-endian) if CPU_BIG_ENDIAN
"""

If MPROFILE_KERNEL is disabled, thus HAVE_OBJTOOL being disabled, then FTRACE_MCOUNT_USE_RECORDMCOUNT will be enabled, causing this error.

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=abba759796f9b73eb24df9b734dd063839fc62e0

---
 meta/recipes-kernel/linux/kernel-devsrc.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-kernel/linux/kernel-devsrc.bb +1 -0
index 3d2eb3929e..c4b5d0e5a6 100644
@@ -208,6 +208,10 @@ do_install() {
         fi
 
         if [ "${ARCH}" = "powerpc" ]; then
+            # 4.18+ needs these files for MPROFILE_KERNEL, but don't
Quoted 7 lines

error if they aren't present in the source
+ # See
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=abba759796f9b73eb24df9b734dd063839fc62e0
+ cp -a --parents arch/powerpc/tools $kerneldir/build/
2>/dev/null || :
+

We don't copy the entire tools directory, just copy what you need out of it.

Cheers,

Bruce

Quoted 21 lines

# 5.0 needs these files, but don't error if they aren't
present in the source

             cp -a --parents arch/${ARCH}/kernel/syscalls/syscall.tbl
$kerneldir/build/ 2>/dev/null || :
             cp -a --parents arch/${ARCH}/kernel/syscalls/syscalltbl.sh

$kerneldir/build/ 2>/dev/null || :
--
2.49.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#220434):
https://lists.openembedded.org/g/openembedded-core/message/220434
Mute This Topic: https://lists.openembedded.org/mt/114181303/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II
author
#2 lore raw

I’ll check further and send out V2.

Regards,
Qi

From: Bruce Ashfield <[email protected]>
Sent: Wednesday, July 16, 2025 9:24 PM
To: Chen, Qi <[email protected]>
Cc: [email protected]
Subject: Re: [OE-core][PATCH] kernel-devsrc: copy arch/powerpc/tools contents

On Wed, Jul 16, 2025 at 3:21 AM Chen Qi via lists.openembedded.org<https://urldefense.com/v3/__http:/lists.openembedded.org__;!!AjveYdw8EvQ!akzd6CsdohTRT7LitLF9Cok-HEpNa4QTmm73hP6s15S4bE4KZrJ7ekyYljAjbSYtTyWmpxTm_p_U2XY0UiCMr1KQSg$> <[email protected]<mailto:[email protected]>> wrote:
From: Chen Qi <[email protected]<mailto:[email protected]>>

For now, using qemuppc64 as MACHINE and building things inside SDK, we'll get the following error:

ERROR: modpost: "_mcount" undefined

This is because after [1], MPROFILE_KERNEL is using arch/powerpc/tools/ contents to do the check. This in turn affects HAVE_OBJTOOL. """
arch/powerpc/Kconfig: select HAVE_OBJTOOL if ARCH_USING_PATCHABLE_FUNCTION_ENTRY || MPROFILE_KERNEL || PPC32
"""

The current MPROFILE_KERNEL for powerpc:
"""
config MPROFILE_KERNEL

            depends on PPC64_ELF_ABI_V2 && FUNCTION_TRACER
            def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh<https://urldefense.com/v3/__http:/gcc-check-mprofile-kernel.sh__;!!AjveYdw8EvQ!akzd6CsdohTRT7LitLF9Cok-HEpNa4QTmm73hP6s15S4bE4KZrJ7ekyYljAjbSYtTyWmpxTm_p_U2XY0UiCT2fzJMg$> $(CC) -mlittle-endian) if CPU_LITTLE_ENDIAN
            def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh<https://urldefense.com/v3/__http:/gcc-check-mprofile-kernel.sh__;!!AjveYdw8EvQ!akzd6CsdohTRT7LitLF9Cok-HEpNa4QTmm73hP6s15S4bE4KZrJ7ekyYljAjbSYtTyWmpxTm_p_U2XY0UiCT2fzJMg$> $(CC) -mbig-endian) if CPU_BIG_ENDIAN

"""

If MPROFILE_KERNEL is disabled, thus HAVE_OBJTOOL being disabled, then FTRACE_MCOUNT_USE_RECORDMCOUNT will be enabled, causing this error.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=abba759796f9b73eb24df9b734dd063839fc62e0<https://urldefense.com/v3/__https:/git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=abba759796f9b73eb24df9b734dd063839fc62e0__;!!AjveYdw8EvQ!akzd6CsdohTRT7LitLF9Cok-HEpNa4QTmm73hP6s15S4bE4KZrJ7ekyYljAjbSYtTyWmpxTm_p_U2XY0UiD9foQYxw$>

---
 meta/recipes-kernel/linux/kernel-devsrc.bb<https://urldefense.com/v3/__http:/kernel-devsrc.bb__;!!AjveYdw8EvQ!akzd6CsdohTRT7LitLF9Cok-HEpNa4QTmm73hP6s15S4bE4KZrJ7ekyYljAjbSYtTyWmpxTm_p_U2XY0UiD4hhRWcg$> | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-kernel/linux/kernel-devsrc.bb<https://urldefense.com/v3/__http:/kernel-devsrc.bb__;!!AjveYdw8EvQ!akzd6CsdohTRT7LitLF9Cok-HEpNa4QTmm73hP6s15S4bE4KZrJ7ekyYljAjbSYtTyWmpxTm_p_U2XY0UiD4hhRWcg$> +4 -0
index 3d2eb3929e..c4b5d0e5a6 100644
@@ -208,6 +208,10 @@ do_install() {
         fi
 
         if [ "${ARCH}" = "powerpc" ]; then
+            # 4.18+ needs these files for MPROFILE_KERNEL, but don't error if they aren't present in the source
+            # See https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=abba759796f9b73eb24df9b734dd063839fc62e0<https://urldefense.com/v3/__https:/git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=abba759796f9b73eb24df9b734dd063839fc62e0__;!!AjveYdw8EvQ!akzd6CsdohTRT7LitLF9Cok-HEpNa4QTmm73hP6s15S4bE4KZrJ7ekyYljAjbSYtTyWmpxTm_p_U2XY0UiD9foQYxw$>
+            cp -a --parents arch/powerpc/tools $kerneldir/build/ 2>/dev/null || :
+
 

We don't copy the entire tools directory, just copy what you need out of it.

Cheers,

Bruce

             # 5.0 needs these files, but don't error if they aren't present in the source
             cp -a --parents arch/${ARCH}/kernel/syscalls/syscall.tbl $kerneldir/build/ 2>/dev/null || :
             cp -a --parents arch/${ARCH}/kernel/syscalls/syscalltbl.sh<https://urldefense.com/v3/__http:/syscalltbl.sh__;!!AjveYdw8EvQ!akzd6CsdohTRT7LitLF9Cok-HEpNa4QTmm73hP6s15S4bE4KZrJ7ekyYljAjbSYtTyWmpxTm_p_U2XY0UiBtir5Akw$> $kerneldir/build/ 2>/dev/null || :

--
2.49.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#220434): https://lists.openembedded.org/g/openembedded-core/message/220434<https://urldefense.com/v3/__https:/lists.openembedded.org/g/openembedded-core/message/220434__;!!AjveYdw8EvQ!akzd6CsdohTRT7LitLF9Cok-HEpNa4QTmm73hP6s15S4bE4KZrJ7ekyYljAjbSYtTyWmpxTm_p_U2XY0UiAubD_nTg$>
Mute This Topic: https://lists.openembedded.org/mt/114181303/1050810<https://urldefense.com/v3/__https:/lists.openembedded.org/mt/114181303/1050810__;!!AjveYdw8EvQ!akzd6CsdohTRT7LitLF9Cok-HEpNa4QTmm73hP6s15S4bE4KZrJ7ekyYljAjbSYtTyWmpxTm_p_U2XY0UiDaMcUjwA$>
Group Owner: [email protected]<mailto:openembedded-core%[email protected]>
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub<https://urldefense.com/v3/__https:/lists.openembedded.org/g/openembedded-core/unsub__;!!AjveYdw8EvQ!akzd6CsdohTRT7LitLF9Cok-HEpNa4QTmm73hP6s15S4bE4KZrJ7ekyYljAjbSYtTyWmpxTm_p_U2XY0UiAdjZncxw$> [[email protected]<mailto:[email protected]>]
-=-=-=-=-=-=-=-=-=-=-=-

--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#4 lore raw

Hi Bruce,

With further check, I found all contents (6 shell scripts) under tools are needed.
They are needed either in Kconfig or Makefile in the same way as MPROFILE_KERNEL needs gcc-check-mprofile-kernel.sh.

Take gcc-check-fpatchable-function-entry.sh as an example:
“””
config ARCH_USING_PATCHABLE_FUNCTION_ENTRY

        depends on FUNCTION_TRACER && (PPC32 || PPC64_ELF_ABI_V2)
        depends on $(cc-option,-fpatchable-function-entry=2)
        def_bool y if PPC32
        def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh $(CC) -mlittle\
-endian) if PPC64 && CPU_LITTLE_ENDIAN
        def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh $(CC) -mbig-en\

dian) if PPC64 && CPU_BIG_ENDIAN
“””

I’ll send out V2 detailing the reason.

Regards,
Qi

From: [email protected] <[email protected]> On Behalf Of Chen Qi via lists.openembedded.org
Sent: Thursday, July 17, 2025 10:30 AM
To: Bruce Ashfield <[email protected]>
Cc: [email protected]
Subject: Re: [OE-core][PATCH] kernel-devsrc: copy arch/powerpc/tools contents

I’ll check further and send out V2.

Regards,
Qi

From: Bruce Ashfield <[email protected]<mailto:[email protected]>>
Sent: Wednesday, July 16, 2025 9:24 PM
To: Chen, Qi <[email protected]<mailto:[email protected]>>
Cc: [email protected]<mailto:[email protected]>
Subject: Re: [OE-core][PATCH] kernel-devsrc: copy arch/powerpc/tools contents

On Wed, Jul 16, 2025 at 3:21 AM Chen Qi via lists.openembedded.org<https://urldefense.com/v3/__http:/lists.openembedded.org__;!!AjveYdw8EvQ!akzd6CsdohTRT7LitLF9Cok-HEpNa4QTmm73hP6s15S4bE4KZrJ7ekyYljAjbSYtTyWmpxTm_p_U2XY0UiCMr1KQSg$> <[email protected]<mailto:[email protected]>> wrote:
From: Chen Qi <[email protected]<mailto:[email protected]>>

For now, using qemuppc64 as MACHINE and building things inside SDK, we'll get the following error:

ERROR: modpost: "_mcount" undefined

This is because after [1], MPROFILE_KERNEL is using arch/powerpc/tools/ contents to do the check. This in turn affects HAVE_OBJTOOL. """
arch/powerpc/Kconfig: select HAVE_OBJTOOL if ARCH_USING_PATCHABLE_FUNCTION_ENTRY || MPROFILE_KERNEL || PPC32
"""

The current MPROFILE_KERNEL for powerpc:
"""
config MPROFILE_KERNEL

            depends on PPC64_ELF_ABI_V2 && FUNCTION_TRACER
            def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh<https://urldefense.com/v3/__http:/gcc-check-mprofile-kernel.sh__;!!AjveYdw8EvQ!akzd6CsdohTRT7LitLF9Cok-HEpNa4QTmm73hP6s15S4bE4KZrJ7ekyYljAjbSYtTyWmpxTm_p_U2XY0UiCT2fzJMg$> $(CC) -mlittle-endian) if CPU_LITTLE_ENDIAN
            def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh<https://urldefense.com/v3/__http:/gcc-check-mprofile-kernel.sh__;!!AjveYdw8EvQ!akzd6CsdohTRT7LitLF9Cok-HEpNa4QTmm73hP6s15S4bE4KZrJ7ekyYljAjbSYtTyWmpxTm_p_U2XY0UiCT2fzJMg$> $(CC) -mbig-endian) if CPU_BIG_ENDIAN

"""

If MPROFILE_KERNEL is disabled, thus HAVE_OBJTOOL being disabled, then FTRACE_MCOUNT_USE_RECORDMCOUNT will be enabled, causing this error.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=abba759796f9b73eb24df9b734dd063839fc62e0<https://urldefense.com/v3/__https:/git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=abba759796f9b73eb24df9b734dd063839fc62e0__;!!AjveYdw8EvQ!akzd6CsdohTRT7LitLF9Cok-HEpNa4QTmm73hP6s15S4bE4KZrJ7ekyYljAjbSYtTyWmpxTm_p_U2XY0UiD9foQYxw$>

---
 meta/recipes-kernel/linux/kernel-devsrc.bb<https://urldefense.com/v3/__http:/kernel-devsrc.bb__;!!AjveYdw8EvQ!akzd6CsdohTRT7LitLF9Cok-HEpNa4QTmm73hP6s15S4bE4KZrJ7ekyYljAjbSYtTyWmpxTm_p_U2XY0UiD4hhRWcg$> | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-kernel/linux/kernel-devsrc.bb<https://urldefense.com/v3/__http:/kernel-devsrc.bb__;!!AjveYdw8EvQ!akzd6CsdohTRT7LitLF9Cok-HEpNa4QTmm73hP6s15S4bE4KZrJ7ekyYljAjbSYtTyWmpxTm_p_U2XY0UiD4hhRWcg$> +4 -0
index 3d2eb3929e..c4b5d0e5a6 100644
@@ -208,6 +208,10 @@ do_install() {
         fi
 
         if [ "${ARCH}" = "powerpc" ]; then
+            # 4.18+ needs these files for MPROFILE_KERNEL, but don't error if they aren't present in the source
+            # See https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=abba759796f9b73eb24df9b734dd063839fc62e0<https://urldefense.com/v3/__https:/git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=abba759796f9b73eb24df9b734dd063839fc62e0__;!!AjveYdw8EvQ!akzd6CsdohTRT7LitLF9Cok-HEpNa4QTmm73hP6s15S4bE4KZrJ7ekyYljAjbSYtTyWmpxTm_p_U2XY0UiD9foQYxw$>
+            cp -a --parents arch/powerpc/tools $kerneldir/build/ 2>/dev/null || :
+
 

We don't copy the entire tools directory, just copy what you need out of it.

Cheers,

Bruce

             # 5.0 needs these files, but don't error if they aren't present in the source
             cp -a --parents arch/${ARCH}/kernel/syscalls/syscall.tbl $kerneldir/build/ 2>/dev/null || :
             cp -a --parents arch/${ARCH}/kernel/syscalls/syscalltbl.sh<https://urldefense.com/v3/__http:/syscalltbl.sh__;!!AjveYdw8EvQ!akzd6CsdohTRT7LitLF9Cok-HEpNa4QTmm73hP6s15S4bE4KZrJ7ekyYljAjbSYtTyWmpxTm_p_U2XY0UiBtir5Akw$> $kerneldir/build/ 2>/dev/null || :

--
2.49.0

--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II