public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] linux-custom: generate linux-libc-dev package for all arch
@ 2025-01-03  7:29 'Arulpandiyan Vadivel' via isar-users
  2025-01-03  8:23 ` 'cedric.hombourger@siemens.com' via isar-users
  2025-01-04 19:08 ` [PATCH v2] linux-custom: generate linux-libc-dev for "all" vs "any" like trixie 'Cedric Hombourger' via isar-users
  0 siblings, 2 replies; 4+ messages in thread
From: 'Arulpandiyan Vadivel' via isar-users @ 2025-01-03  7:29 UTC (permalink / raw)
  To: isar-users; +Cc: cedric.hombourger, srikanth.krishnakar, Arulpandiyan Vadivel

Generate linux-libc-dev package for all architecture instead of
desired machine architecture.

With this patch, when upstream Kernels is build above 6.11, It helps
to align with bookworm-backports, trixie versions of linux-libc-dev.

This change also fixes to build failures with libc6-dev dependencies as below
for upstream stable kernel 6.12.
| Broken libc6-dev:arm64 Depends on linux-libc-dev:arm64 < none @un pH >
|   Considering linux-libc-dev:arm64 1 as a solution to libc6-dev:arm64 10001
|   Considering linux-libc-dev:arm64 1 as a solution to libc6-dev:arm64 10001
| Done

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan.vadivel@siemens.com>
---
 meta/recipes-kernel/linux/files/debian/control.tmpl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-kernel/linux/files/debian/control.tmpl b/meta/recipes-kernel/linux/files/debian/control.tmpl
index 04ad0f4f..cc9cbd44 100644
--- a/meta/recipes-kernel/linux/files/debian/control.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/control.tmpl
@@ -26,7 +26,7 @@ Package: linux-libc-dev
 Build-Profiles: <!nolibcdev kernel>
 Section: devel
 Provides: linux-kernel-headers
-Architecture: any
+Architecture: all
 Description: Linux support headers for userspace development
  This package provides userspaces headers from the Linux kernel. These headers
  are used by the installed headers for GNU glibc and other system libraries.
-- 
2.39.5

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20250103072928.45916-1-arulpandiyan.vadivel%40siemens.com.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] linux-custom: generate linux-libc-dev package for all arch
  2025-01-03  7:29 [PATCH] linux-custom: generate linux-libc-dev package for all arch 'Arulpandiyan Vadivel' via isar-users
@ 2025-01-03  8:23 ` 'cedric.hombourger@siemens.com' via isar-users
  2025-01-04 19:08 ` [PATCH v2] linux-custom: generate linux-libc-dev for "all" vs "any" like trixie 'Cedric Hombourger' via isar-users
  1 sibling, 0 replies; 4+ messages in thread
From: 'cedric.hombourger@siemens.com' via isar-users @ 2025-01-03  8:23 UTC (permalink / raw)
  To: isar-users, Vadivel, Arulpandiyan; +Cc: srikanth.krishnakar

On Fri, 2025-01-03 at 12:59 +0530, Arulpandiyan Vadivel wrote:
> Generate linux-libc-dev package for all architecture instead of

for the "all" architecture

> desired machine architecture.
> 
> With this patch, when upstream Kernels is build above 6.11, It helps

Avoid "This patch", "This commit" in commit logs

Where are you checking for kernel version >= 6.11, this appears to be
missing in your patch and will likely break builds with kernels < 6.11

Make sure no arch-dependent headers are included in our linux-libc-dev
package. In linux-libc-dev packages built in my trees, I see header
files in e.g. usr/include/x86_64-linux-gnu

We may need to make more changes for our packages to match those now
generated by Debian

> to align with bookworm-backports, trixie versions of linux-libc-dev.
> 
> This change also fixes to build failures with libc6-dev dependencies
> as below
> for upstream stable kernel 6.12.
> > Broken libc6-dev:arm64 Depends on linux-libc-dev:arm64 < none @un
> > pH >
> >   Considering linux-libc-dev:arm64 1 as a solution to libc6-
> > dev:arm64 10001
> >   Considering linux-libc-dev:arm64 1 as a solution to libc6-
> > dev:arm64 10001
> > Done

did you run the Isar test suite to validate your changes prior to
submitting?

> 
> Signed-off-by: Arulpandiyan Vadivel
> <arulpandiyan.vadivel@siemens.com>
> ---
>  meta/recipes-kernel/linux/files/debian/control.tmpl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-kernel/linux/files/debian/control.tmpl
> b/meta/recipes-kernel/linux/files/debian/control.tmpl
> index 04ad0f4f..cc9cbd44 100644
> --- a/meta/recipes-kernel/linux/files/debian/control.tmpl
> +++ b/meta/recipes-kernel/linux/files/debian/control.tmpl
> @@ -26,7 +26,7 @@ Package: linux-libc-dev
>  Build-Profiles: <!nolibcdev kernel>
>  Section: devel
>  Provides: linux-kernel-headers
> -Architecture: any
> +Architecture: all
>  Description: Linux support headers for userspace development
>   This package provides userspaces headers from the Linux kernel.
> These headers
>   are used by the installed headers for GNU glibc and other system
> libraries.


-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/1fa6cdbf38bbc64633714fbafe2dfc987ffac209.camel%40siemens.com.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] linux-custom: generate linux-libc-dev for "all" vs "any" like trixie
  2025-01-03  7:29 [PATCH] linux-custom: generate linux-libc-dev package for all arch 'Arulpandiyan Vadivel' via isar-users
  2025-01-03  8:23 ` 'cedric.hombourger@siemens.com' via isar-users
@ 2025-01-04 19:08 ` 'Cedric Hombourger' via isar-users
  2025-01-16  7:01   ` Uladzimir Bely
  1 sibling, 1 reply; 4+ messages in thread
From: 'Cedric Hombourger' via isar-users @ 2025-01-04 19:08 UTC (permalink / raw)
  To: isar-users; +Cc: Cedric Hombourger, Arulpandiyan Vadivel

The linux-libc-dev package that comes with Debian trixie includes
arch-dependent headers for all supported architectures and has its
Architecture set to "all" rather than "any". Match this behavior
when both KERNEL_LIBC_DEV_DEPLOY and KERNEL_LIBC_DEV_ARCH_ALL are
in effect (the latter defaults to "1" for "trixie", while the former
still defaults to "0")

Reported-by: Arulpandiyan Vadivel <arulpandiyan.vadivel@siemens.com>
Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
---
 .../linux/files/debian/control.tmpl           |  2 +-
 .../linux/files/debian/isar/install.tmpl      | 37 +++++++++++++++----
 meta/recipes-kernel/linux/linux-custom.inc    |  6 +++
 3 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/meta/recipes-kernel/linux/files/debian/control.tmpl b/meta/recipes-kernel/linux/files/debian/control.tmpl
index f4273ea9..ec0da1ab 100644
--- a/meta/recipes-kernel/linux/files/debian/control.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/control.tmpl
@@ -26,7 +26,7 @@ Package: linux-libc-dev
 Build-Profiles: <!nolibcdev kernel>
 Section: devel
 Provides: linux-kernel-headers
-Architecture: any
+Architecture: ${KERNEL_LIBC_DEV_ARCH}
 Description: Linux support headers for userspace development
  This package provides userspaces headers from the Linux kernel. These headers
  are used by the installed headers for GNU glibc and other system libraries.
diff --git a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
index 0a7bdd66..6d742f02 100644
--- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
@@ -5,6 +5,16 @@
 # Load common stuff
 . ${S}/debian/isar/common
 
+get_kernel_arch() {
+    case "${1}" in
+        amd64|i386) echo "x86";;
+        arm64) echo "arm64";;
+        armhf) echo "arm";;
+        mipsel) echo "mips";;
+        riscv64) echo "riscv";;
+    esac
+}
+
 do_install() {
 
     # check if our kernel was configured
@@ -165,13 +175,26 @@ headers_check() {
 
 libc_headers() {
     mkdir -p ${deb_libc_hdr_dir}
-    ${MAKE} O=${O} headers_install INSTALL_HDR_PATH=${deb_libc_hdr_dir}/usr
-    host_arch=$(dpkg-architecture -a${DISTRO_ARCH} -qDEB_HOST_MULTIARCH)
-    mkdir ${deb_libc_hdr_dir}/usr/include/${host_arch}
-    mv ${deb_libc_hdr_dir}/usr/include/asm ${deb_libc_hdr_dir}/usr/include/${host_arch}/
-
-    mkdir -p ${deb_libc_hdr_cross_dir}
-    ${MAKE} O=${O} headers_install INSTALL_HDR_PATH=${deb_libc_hdr_cross_dir}/usr/${host_arch}
+    arches="${DISTRO_ARCH}"
+    if echo "${DEB_BUILD_PROFILES}" | grep -q "libcdev-arch-all"; then
+        arches="amd64 armhf arm64 i386 mipsel riscv64"
+    fi
+    for distro_arch in ${arches}; do
+        target_arch=$(dpkg-architecture --force -A${distro_arch} -qDEB_TARGET_MULTIARCH)
+        kernel_arch=$(get_kernel_arch ${distro_arch})
+        [ -n "${kernel_arch}" ] || {
+            echo "fatal: don't know the kernel arch for '${distro_arch}'!" >&2
+            return 1
+        }
+        ${MAKE} O=${O} headers_install ARCH=${kernel_arch} INSTALL_HDR_PATH=${deb_libc_hdr_dir}/usr
+        mkdir ${deb_libc_hdr_dir}/usr/include/${target_arch}
+        mv ${deb_libc_hdr_dir}/usr/include/asm ${deb_libc_hdr_dir}/usr/include/${target_arch}/
+
+        if [ "${distro_arch}" = "${DISTRO_ARCH}" ]; then
+            mkdir -p ${deb_libc_hdr_cross_dir}
+            ${MAKE} O=${O} headers_install INSTALL_HDR_PATH=${deb_libc_hdr_cross_dir}/usr/${target_arch}
+        fi
+    done
 }
 
 kernel_tools() {
diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index e825d29b..77700a5d 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -39,6 +39,8 @@ LIBSSL_DEP:bullseye = "libssl1.1"
 KERNEL_HEADERS_DEBIAN_DEPENDS ?= "libc6, \
                                   ${LIBSSL_DEP},"
 
+KERNEL_LIBC_DEV_ARCH_ALL = "0"
+KERNEL_LIBC_DEV_ARCH_ALL:trixie = "1"
 KERNEL_LIBC_DEV_DEPLOY ?= "0"
 
 # Settings that may be changed on a per distro, machine or layer basis
@@ -79,6 +81,7 @@ TEMPLATE_VARS += "                \
     KERNEL_BUILD_DIR              \
     KERNEL_FILE                   \
     KERNEL_HEADERS_DEBIAN_DEPENDS \
+    KERNEL_LIBC_DEV_ARCH          \
     LINUX_VERSION_EXTENSION       \
     KERNEL_NAME_PROVIDED          \
     KERNEL_CONFIG_FRAGMENTS       \
@@ -214,8 +217,11 @@ def get_additional_build_profiles(d):
     profiles = d.getVar('BASE_DISTRO')
     if not bb.utils.to_boolean(d.getVar('KERNEL_LIBC_DEV_DEPLOY')):
         profiles += ' nolibcdev'
+    elif bb.utils.to_boolean(d.getVar('KERNEL_LIBC_DEV_ARCH_ALL')):
+        profiles += ' libcdev-arch-all'
     return profiles
 
+KERNEL_LIBC_DEV_ARCH = "${@ bb.utils.contains('DEB_BUILD_PROFILES', 'libcdev-arch-all', 'all', 'any', d) }"
 DEB_BUILD_PROFILES += "${@get_additional_build_profiles(d)}"
 
 do_prepare_build:prepend() {
-- 
2.34.1

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20250104190859.1879934-1-cedric.hombourger%40siemens.com.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] linux-custom: generate linux-libc-dev for "all" vs "any" like trixie
  2025-01-04 19:08 ` [PATCH v2] linux-custom: generate linux-libc-dev for "all" vs "any" like trixie 'Cedric Hombourger' via isar-users
@ 2025-01-16  7:01   ` Uladzimir Bely
  0 siblings, 0 replies; 4+ messages in thread
From: Uladzimir Bely @ 2025-01-16  7:01 UTC (permalink / raw)
  To: Cedric Hombourger, isar-users; +Cc: Arulpandiyan Vadivel

On Sat, 2025-01-04 at 20:08 +0100, 'Cedric Hombourger' via isar-users
wrote:
> The linux-libc-dev package that comes with Debian trixie includes
> arch-dependent headers for all supported architectures and has its
> Architecture set to "all" rather than "any". Match this behavior
> when both KERNEL_LIBC_DEV_DEPLOY and KERNEL_LIBC_DEV_ARCH_ALL are
> in effect (the latter defaults to "1" for "trixie", while the former
> still defaults to "0")
> 
> Reported-by: Arulpandiyan Vadivel <arulpandiyan.vadivel@siemens.com>
> Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
> ---
>  .../linux/files/debian/control.tmpl           |  2 +-
>  .../linux/files/debian/isar/install.tmpl      | 37 +++++++++++++++--
> --
>  meta/recipes-kernel/linux/linux-custom.inc    |  6 +++
>  3 files changed, 37 insertions(+), 8 deletions(-)
> 
> diff --git a/meta/recipes-kernel/linux/files/debian/control.tmpl
> b/meta/recipes-kernel/linux/files/debian/control.tmpl
> index f4273ea9..ec0da1ab 100644
> --- a/meta/recipes-kernel/linux/files/debian/control.tmpl
> +++ b/meta/recipes-kernel/linux/files/debian/control.tmpl
> @@ -26,7 +26,7 @@ Package: linux-libc-dev
>  Build-Profiles: <!nolibcdev kernel>
>  Section: devel
>  Provides: linux-kernel-headers
> -Architecture: any
> +Architecture: ${KERNEL_LIBC_DEV_ARCH}
>  Description: Linux support headers for userspace development
>   This package provides userspaces headers from the Linux kernel.
> These headers
>   are used by the installed headers for GNU glibc and other system
> libraries.
> diff --git a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> index 0a7bdd66..6d742f02 100644
> --- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> +++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> @@ -5,6 +5,16 @@
>  # Load common stuff
>  . ${S}/debian/isar/common
>  
> +get_kernel_arch() {
> +    case "${1}" in
> +        amd64|i386) echo "x86";;
> +        arm64) echo "arm64";;
> +        armhf) echo "arm";;
> +        mipsel) echo "mips";;
> +        riscv64) echo "riscv";;
> +    esac
> +}
> +
>  do_install() {
>  
>      # check if our kernel was configured
> @@ -165,13 +175,26 @@ headers_check() {
>  
>  libc_headers() {
>      mkdir -p ${deb_libc_hdr_dir}
> -    ${MAKE} O=${O} headers_install
> INSTALL_HDR_PATH=${deb_libc_hdr_dir}/usr
> -    host_arch=$(dpkg-architecture -a${DISTRO_ARCH} -
> qDEB_HOST_MULTIARCH)
> -    mkdir ${deb_libc_hdr_dir}/usr/include/${host_arch}
> -    mv ${deb_libc_hdr_dir}/usr/include/asm
> ${deb_libc_hdr_dir}/usr/include/${host_arch}/
> -
> -    mkdir -p ${deb_libc_hdr_cross_dir}
> -    ${MAKE} O=${O} headers_install
> INSTALL_HDR_PATH=${deb_libc_hdr_cross_dir}/usr/${host_arch}
> +    arches="${DISTRO_ARCH}"
> +    if echo "${DEB_BUILD_PROFILES}" | grep -q "libcdev-arch-all";
> then
> +        arches="amd64 armhf arm64 i386 mipsel riscv64"
> +    fi
> +    for distro_arch in ${arches}; do
> +        target_arch=$(dpkg-architecture --force -A${distro_arch} -
> qDEB_TARGET_MULTIARCH)
> +        kernel_arch=$(get_kernel_arch ${distro_arch})
> +        [ -n "${kernel_arch}" ] || {
> +            echo "fatal: don't know the kernel arch for
> '${distro_arch}'!" >&2
> +            return 1
> +        }
> +        ${MAKE} O=${O} headers_install ARCH=${kernel_arch}
> INSTALL_HDR_PATH=${deb_libc_hdr_dir}/usr
> +        mkdir ${deb_libc_hdr_dir}/usr/include/${target_arch}
> +        mv ${deb_libc_hdr_dir}/usr/include/asm
> ${deb_libc_hdr_dir}/usr/include/${target_arch}/
> +
> +        if [ "${distro_arch}" = "${DISTRO_ARCH}" ]; then
> +            mkdir -p ${deb_libc_hdr_cross_dir}
> +            ${MAKE} O=${O} headers_install
> INSTALL_HDR_PATH=${deb_libc_hdr_cross_dir}/usr/${target_arch}
> +        fi
> +    done
>  }
>  
>  kernel_tools() {
> diff --git a/meta/recipes-kernel/linux/linux-custom.inc
> b/meta/recipes-kernel/linux/linux-custom.inc
> index e825d29b..77700a5d 100644
> --- a/meta/recipes-kernel/linux/linux-custom.inc
> +++ b/meta/recipes-kernel/linux/linux-custom.inc
> @@ -39,6 +39,8 @@ LIBSSL_DEP:bullseye = "libssl1.1"
>  KERNEL_HEADERS_DEBIAN_DEPENDS ?= "libc6, \
>                                    ${LIBSSL_DEP},"
>  
> +KERNEL_LIBC_DEV_ARCH_ALL = "0"
> +KERNEL_LIBC_DEV_ARCH_ALL:trixie = "1"
>  KERNEL_LIBC_DEV_DEPLOY ?= "0"
>  
>  # Settings that may be changed on a per distro, machine or layer
> basis
> @@ -79,6 +81,7 @@ TEMPLATE_VARS += "                \
>      KERNEL_BUILD_DIR              \
>      KERNEL_FILE                   \
>      KERNEL_HEADERS_DEBIAN_DEPENDS \
> +    KERNEL_LIBC_DEV_ARCH          \
>      LINUX_VERSION_EXTENSION       \
>      KERNEL_NAME_PROVIDED          \
>      KERNEL_CONFIG_FRAGMENTS       \
> @@ -214,8 +217,11 @@ def get_additional_build_profiles(d):
>      profiles = d.getVar('BASE_DISTRO')
>      if not bb.utils.to_boolean(d.getVar('KERNEL_LIBC_DEV_DEPLOY')):
>          profiles += ' nolibcdev'
> +    elif bb.utils.to_boolean(d.getVar('KERNEL_LIBC_DEV_ARCH_ALL')):
> +        profiles += ' libcdev-arch-all'
>      return profiles
>  
> +KERNEL_LIBC_DEV_ARCH = "${@ bb.utils.contains('DEB_BUILD_PROFILES',
> 'libcdev-arch-all', 'all', 'any', d) }"
>  DEB_BUILD_PROFILES += "${@get_additional_build_profiles(d)}"
>  
>  do_prepare_build:prepend() {
> -- 
> 2.34.1
> 

Applied to next, thanks.

-- 
Best regards,
Uladzimir.

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/368976bf1768630caa51c9961a20bc9bdbd66baf.camel%40ilbers.de.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-01-16  7:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-03  7:29 [PATCH] linux-custom: generate linux-libc-dev package for all arch 'Arulpandiyan Vadivel' via isar-users
2025-01-03  8:23 ` 'cedric.hombourger@siemens.com' via isar-users
2025-01-04 19:08 ` [PATCH v2] linux-custom: generate linux-libc-dev for "all" vs "any" like trixie 'Cedric Hombourger' via isar-users
2025-01-16  7:01   ` Uladzimir Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox