ilbers / isar

Integration System for Automated Root filesystem generation
Other
173 stars 72 forks source link

linux-libc-dev package with wrong arch headers directory #105

Open mxvisor opened 1 month ago

mxvisor commented 1 month ago

Asm headers in linux-libc-dev package built for arm64 architecture are placed in /usr/include/x86_64-linux-gnu/asm, but must be /usr/include/aarch64-linux-gnu/asm This happend after commit ac2bbd7ca249e8499f1c0d472faf2448303ebb59

log.do_dpkg_build with correct install dir:

...
++ dpkg-architecture -aarm64 -qDEB_HOST_MULTIARCH
+ host_arch=aarch64-linux-gnu
+ mkdir /<<PKGBUILDDIR>>/debian/linux-libc-dev/usr/include/aarch64-linux-gnu
+ mv /<<PKGBUILDDIR>>/debian/linux-libc-dev/usr/include/asm /<<PKGBUILDDIR>>/debian/linux-libc-dev/usr/include/aarch64-linux-gnu/
...

log.do_dpkg_build with issue:

...
++ dpkg-architecture -aarm64 -qDEB_HOST_MULTIARCH
+ host_arch=x86_64-linux-gnu
+ mkdir /<<PKGBUILDDIR>>/debian/linux-libc-dev/usr/include/x86_64-linux-gnu
+ mv /<<PKGBUILDDIR>>/debian/linux-libc-dev/usr/include/asm /<<PKGBUILDDIR>>/debian/linux-libc-dev/usr/include/x86_64-linux-gnu/
...

I found a line that give this bug in file meta/recipes-kernel/linux/files/debian/isar/common.tmpl eval $(dpkg-architecture -f -A ${DISTRO_ARCH})

I don't know exactly why the eval command is breaking the architecture detection and why this command affect the build of linux-libc-dev package , but i solved this problem for me this way:

--- a/meta/recipes-kernel/linux/files/debian/isar/common.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/isar/common.tmpl
@@ -18,7 +18,7 @@ KERNEL_PKG_KERN_KBUILD_CROSS=${KERNEL_PKG_KERN_KBUILD}-${DISTRO_ARCH}-cross
 # The scripts and tools are always created for host arch
 if echo "${DEB_BUILD_PROFILES}" | grep -q -e "cross" -e "kbuild"
 then
-    eval $(dpkg-architecture -f -A ${DISTRO_ARCH})
+    DEB_TARGET_GNU_TYPE=$(dpkg-architecture -f -A ${DISTRO_ARCH} -qDEB_TARGET_GNU_TYPE)
     CROSS_COMPILE=${DEB_TARGET_GNU_TYPE}-
 fi
amikan commented 1 month ago

Hello @mxvisor, Thanks for reporting. The fix is ready and will be merged to next branch after passing full CI testing. You can find it on our Patchwork until then.