diff mbox series

[master,v3,3/3] ti-jailhouse: Fix buildpaths QA warning and cleanup

Message ID 20260311150100.3275513-4-s-sadik@ti.com
State Superseded
Delegated to: Ryan Eatmon
Headers show
Series jailhouse: Fix build issues and QA warnings | expand

Commit Message

Mahammed Sadik Shaik March 11, 2026, 3:01 p.m. UTC
Add -ffile-prefix-map flags to KCFLAGS to remove build path
references from kernel module compilation, ensuring reproducible
builds and preventing absolute path leakage in binaries.

inherit module-base kernel-module-split for building kernel modules

move V=1 into EXTRA_OEMAKE and remove overriding do_compile()

This resolves buildpaths QA warnings during packaging.

Signed-off-by: Mahammed Sadik Shaik <s-sadik@ti.com>
---
 .../recipes-ti/jailhouse/ti-jailhouse.inc     | 32 ++++++++++---------
 1 file changed, 17 insertions(+), 15 deletions(-)

Comments

Ryan Eatmon March 11, 2026, 3:18 p.m. UTC | #1
On 3/11/2026 10:01 AM, Mahammed Sadik Shaik wrote:
> Add -ffile-prefix-map flags to KCFLAGS to remove build path
> references from kernel module compilation, ensuring reproducible
> builds and preventing absolute path leakage in binaries.
> 
> inherit module-base kernel-module-split for building kernel modules
> 
> move V=1 into EXTRA_OEMAKE and remove overriding do_compile()
> 
> This resolves buildpaths QA warnings during packaging.
> 
> Signed-off-by: Mahammed Sadik Shaik <s-sadik@ti.com>
> ---
>   .../recipes-ti/jailhouse/ti-jailhouse.inc     | 32 ++++++++++---------
>   1 file changed, 17 insertions(+), 15 deletions(-)
> 
> diff --git a/meta-ti-extras/recipes-ti/jailhouse/ti-jailhouse.inc b/meta-ti-extras/recipes-ti/jailhouse/ti-jailhouse.inc
> index 91076c9e..58603dac 100644
> --- a/meta-ti-extras/recipes-ti/jailhouse/ti-jailhouse.inc
> +++ b/meta-ti-extras/recipes-ti/jailhouse/ti-jailhouse.inc
> @@ -47,7 +47,7 @@ B = "${S}"
>   
>   DEPENDS = "virtual/kernel dtc-native python3-mako-native python3-mako make-native"
>   
> -inherit module python3native bash-completion deploy setuptools3
> +inherit module-base kernel-module-split python3native bash-completion deploy
>   
>   PACKAGE_ARCH = "${MACHINE_ARCH}"
>   COMPATIBLE_MACHINE = "(ti-soc)"
> @@ -66,22 +66,24 @@ JH_SYSCONFIG_CELL:am62lxx ?= "k3-am62l3-evm.cell"
>   JH_SYSCONFIG_CELL:j7 ?= "k3-j721e-evm.cell"
>   JH_SYSCONFIG_CELL:j7200-evm ?= "k3-j7200-evm.cell"
>   
> -do_configure() {
> -        if [ -d ${STAGING_DIR_HOST}/${CELLCONF_DIR} ];
> -        then
> -            cp ${STAGING_DIR_HOST}/${CELLCONF_DIR}/*.c ${S}/configs/
> -        fi
> -}
> +EXTRA_OEMAKE = "V=1 \
> +    ARCH=${JH_ARCH} \
> +    CROSS_COMPILE=${TARGET_PREFIX} \
> +    CC="${CC}" \
> +    KDIR=${STAGING_KERNEL_BUILDDIR} \
> +    KCFLAGS='-ffile-prefix-map=${STAGING_KERNEL_BUILDDIR}/= \
> +             -ffile-prefix-map=${STAGING_KERNEL_DIR}/='"
>   
> -USER_SPACE_CFLAGS = '${CFLAGS} -DLIBEXECDIR=\\\"${libexecdir}\\\" \
> -                    -DJAILHOUSE_VERSION=\\\"$JAILHOUSE_VERSION\\\" \
> -                    -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Werror \
> -                    -I../driver'
> +USER_SPACE_CFLAGS = '${CFLAGS} \
> +    -DLIBEXECDIR=\\\"${libexecdir}\\\" \
> +    -DJAILHOUSE_VERSION=\\\"$JAILHOUSE_VERSION\\\" \
> +    -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Werror \
> +    -I../driver'

Usually when we do line wraps with the follow on lines not lining up 
with the opening ' then we try to move all of the lines down, not just 
the follow on lines.  And also move the final ' or " to its own line.

For example:

FOO = "\
   arg1 \
   arg2 \
   arg3 \
"

That way when you are reading the variable you don't visually miss that 
there was an extra bit on the original line or where the closing " is.

FOO = "arg1 \
   arg2 \
   arg3"

Can you fix both EXTRA_OEMAKE and USER_SPACE_CFLAGS?



>   TOOLS_SRC_DIR = "${S}/tools"
>   
> -EXTRA_OEMAKE = "ARCH=${JH_ARCH} CROSS_COMPILE=${TARGET_PREFIX} CC="${CC}" KDIR=${STAGING_KERNEL_BUILDDIR}"
> -
> -do_compile() {
> -        oe_runmake V=1
> +do_configure() {
> +    if [ -d ${STAGING_DIR_HOST}/${CELLCONF_DIR} ]; then
> +        cp ${STAGING_DIR_HOST}/${CELLCONF_DIR}/*.c ${S}/configs/
> +    fi
>   }
diff mbox series

Patch

diff --git a/meta-ti-extras/recipes-ti/jailhouse/ti-jailhouse.inc b/meta-ti-extras/recipes-ti/jailhouse/ti-jailhouse.inc
index 91076c9e..58603dac 100644
--- a/meta-ti-extras/recipes-ti/jailhouse/ti-jailhouse.inc
+++ b/meta-ti-extras/recipes-ti/jailhouse/ti-jailhouse.inc
@@ -47,7 +47,7 @@  B = "${S}"
 
 DEPENDS = "virtual/kernel dtc-native python3-mako-native python3-mako make-native"
 
-inherit module python3native bash-completion deploy setuptools3
+inherit module-base kernel-module-split python3native bash-completion deploy
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 COMPATIBLE_MACHINE = "(ti-soc)"
@@ -66,22 +66,24 @@  JH_SYSCONFIG_CELL:am62lxx ?= "k3-am62l3-evm.cell"
 JH_SYSCONFIG_CELL:j7 ?= "k3-j721e-evm.cell"
 JH_SYSCONFIG_CELL:j7200-evm ?= "k3-j7200-evm.cell"
 
-do_configure() {
-        if [ -d ${STAGING_DIR_HOST}/${CELLCONF_DIR} ];
-        then
-            cp ${STAGING_DIR_HOST}/${CELLCONF_DIR}/*.c ${S}/configs/
-        fi
-}
+EXTRA_OEMAKE = "V=1 \
+    ARCH=${JH_ARCH} \
+    CROSS_COMPILE=${TARGET_PREFIX} \
+    CC="${CC}" \
+    KDIR=${STAGING_KERNEL_BUILDDIR} \
+    KCFLAGS='-ffile-prefix-map=${STAGING_KERNEL_BUILDDIR}/= \
+             -ffile-prefix-map=${STAGING_KERNEL_DIR}/='"
 
-USER_SPACE_CFLAGS = '${CFLAGS} -DLIBEXECDIR=\\\"${libexecdir}\\\" \
-                    -DJAILHOUSE_VERSION=\\\"$JAILHOUSE_VERSION\\\" \
-                    -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Werror \
-                    -I../driver'
+USER_SPACE_CFLAGS = '${CFLAGS} \
+    -DLIBEXECDIR=\\\"${libexecdir}\\\" \
+    -DJAILHOUSE_VERSION=\\\"$JAILHOUSE_VERSION\\\" \
+    -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Werror \
+    -I../driver'
 
 TOOLS_SRC_DIR = "${S}/tools"
 
-EXTRA_OEMAKE = "ARCH=${JH_ARCH} CROSS_COMPILE=${TARGET_PREFIX} CC="${CC}" KDIR=${STAGING_KERNEL_BUILDDIR}"
-
-do_compile() {
-        oe_runmake V=1
+do_configure() {
+    if [ -d ${STAGING_DIR_HOST}/${CELLCONF_DIR} ]; then
+        cp ${STAGING_DIR_HOST}/${CELLCONF_DIR}/*.c ${S}/configs/
+    fi
 }