Cross compiled kernel headers are installed into /usr/*-linux-gnu/include/ instead of /usr/*-linux-gnu/sys-root/usr/include/ where they can be found by default by the Fedora cross compiler toolchain.
Because the kernel-cross-headers package can be installed without the cross glibc-* binutils-* gcc-* counterparts, it has to own the sysroot directory.
Signed-off-by: Nicolas Chauvet kwizart@gmail.com --- kernel.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/kernel.spec b/kernel.spec index f6d1e2b2a..1ff196b81 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1681,9 +1681,9 @@ find $RPM_BUILD_ROOT/usr/tmp-headers/include \
# Copy all the architectures we care about to their respective asm directories for arch in arm arm64 powerpc s390 x86 ; do -mkdir -p $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include -mv $RPM_BUILD_ROOT/usr/tmp-headers/include/arch-${arch}/asm $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include/ -cp -a $RPM_BUILD_ROOT/usr/tmp-headers/include/asm-generic $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include/. +mkdir -p $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/sys-root%{_includedir} +mv $RPM_BUILD_ROOT/usr/tmp-headers/include/arch-${arch}/asm $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/sys-root%{_includedir} +cp -a $RPM_BUILD_ROOT/usr/tmp-headers/include/asm-generic $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/sys-root%{_includedir}. done
# Remove the rest of the architectures @@ -1692,7 +1692,7 @@ rm -rf $RPM_BUILD_ROOT/usr/tmp-headers/include/asm-*
# Copy the rest of the headers over for arch in arm arm64 powerpc s390 x86 ; do -cp -a $RPM_BUILD_ROOT/usr/tmp-headers/include/* $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include/. +cp -a $RPM_BUILD_ROOT/usr/tmp-headers/include/* $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/sys-root%{_includedir}/. done
rm -rf $RPM_BUILD_ROOT/usr/tmp-headers @@ -1817,7 +1817,7 @@ fi
%if %{with_cross_headers} %files cross-headers -/usr/*-linux-gnu/include/* +/usr/*-linux-gnu/sysroot %endif
# empty meta-package
FYI, I'm still testing the patch, so this is a early sent. Also adding Tom who maintains glibc-arm-linux-gnu-
Le mar. 23 oct. 2018 à 16:20, Nicolas Chauvet kwizart@gmail.com a écrit :
Cross compiled kernel headers are installed into /usr/*-linux-gnu/include/ instead of /usr/*-linux-gnu/sys-root/usr/include/ where they can be found by default by the Fedora cross compiler toolchain.
Because the kernel-cross-headers package can be installed without the cross glibc-* binutils-* gcc-* counterparts, it has to own the sysroot directory.
Signed-off-by: Nicolas Chauvet kwizart@gmail.com
kernel.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/kernel.spec b/kernel.spec index f6d1e2b2a..1ff196b81 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1681,9 +1681,9 @@ find $RPM_BUILD_ROOT/usr/tmp-headers/include \
# Copy all the architectures we care about to their respective asm directories for arch in arm arm64 powerpc s390 x86 ; do -mkdir -p $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include -mv $RPM_BUILD_ROOT/usr/tmp-headers/include/arch-${arch}/asm $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include/ -cp -a $RPM_BUILD_ROOT/usr/tmp-headers/include/asm-generic $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include/. +mkdir -p $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/sys-root%{_includedir} +mv $RPM_BUILD_ROOT/usr/tmp-headers/include/arch-${arch}/asm $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/sys-root%{_includedir} +cp -a $RPM_BUILD_ROOT/usr/tmp-headers/include/asm-generic $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/sys-root%{_includedir}. done
# Remove the rest of the architectures @@ -1692,7 +1692,7 @@ rm -rf $RPM_BUILD_ROOT/usr/tmp-headers/include/asm-*
# Copy the rest of the headers over for arch in arm arm64 powerpc s390 x86 ; do -cp -a $RPM_BUILD_ROOT/usr/tmp-headers/include/* $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include/. +cp -a $RPM_BUILD_ROOT/usr/tmp-headers/include/* $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/sys-root%{_includedir}/. done
rm -rf $RPM_BUILD_ROOT/usr/tmp-headers @@ -1817,7 +1817,7 @@ fi
%if %{with_cross_headers} %files cross-headers -/usr/*-linux-gnu/include/* +/usr/*-linux-gnu/sysroot %endif
# empty meta-package
2.17.2
On Tue, Oct 23, 2018 at 11:12 AM Nicolas Chauvet kwizart@gmail.com wrote:
Cross compiled kernel headers are installed into /usr/*-linux-gnu/include/ instead of /usr/*-linux-gnu/sys-root/usr/include/ where they can be found by default by the Fedora cross compiler toolchain.
Is that a new change in how the cross compilers work? The original patch was added a long time ago based on the cross compiler behavior in Fedora at the time. If that's changed, where can we see that documented?
josh
Because the kernel-cross-headers package can be installed without the cross glibc-* binutils-* gcc-* counterparts, it has to own the sysroot directory.
Signed-off-by: Nicolas Chauvet kwizart@gmail.com
kernel.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/kernel.spec b/kernel.spec index f6d1e2b2a..1ff196b81 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1681,9 +1681,9 @@ find $RPM_BUILD_ROOT/usr/tmp-headers/include \
# Copy all the architectures we care about to their respective asm directories for arch in arm arm64 powerpc s390 x86 ; do -mkdir -p $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include -mv $RPM_BUILD_ROOT/usr/tmp-headers/include/arch-${arch}/asm $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include/ -cp -a $RPM_BUILD_ROOT/usr/tmp-headers/include/asm-generic $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include/. +mkdir -p $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/sys-root%{_includedir} +mv $RPM_BUILD_ROOT/usr/tmp-headers/include/arch-${arch}/asm $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/sys-root%{_includedir} +cp -a $RPM_BUILD_ROOT/usr/tmp-headers/include/asm-generic $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/sys-root%{_includedir}. done
# Remove the rest of the architectures @@ -1692,7 +1692,7 @@ rm -rf $RPM_BUILD_ROOT/usr/tmp-headers/include/asm-*
# Copy the rest of the headers over for arch in arm arm64 powerpc s390 x86 ; do -cp -a $RPM_BUILD_ROOT/usr/tmp-headers/include/* $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include/. +cp -a $RPM_BUILD_ROOT/usr/tmp-headers/include/* $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/sys-root%{_includedir}/. done
rm -rf $RPM_BUILD_ROOT/usr/tmp-headers @@ -1817,7 +1817,7 @@ fi
%if %{with_cross_headers} %files cross-headers -/usr/*-linux-gnu/include/* +/usr/*-linux-gnu/sysroot %endif
# empty meta-package
2.17.2 _______________________________________________ kernel mailing list -- kernel@lists.fedoraproject.org To unsubscribe send an email to kernel-leave@lists.fedoraproject.org Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Le mar. 23 oct. 2018 à 17:54, Josh Boyer jwboyer@fedoraproject.org a écrit :
On Tue, Oct 23, 2018 at 11:12 AM Nicolas Chauvet kwizart@gmail.com wrote:
Cross compiled kernel headers are installed into /usr/*-linux-gnu/include/ instead of /usr/*-linux-gnu/sys-root/usr/include/ where they can be found by default by the Fedora cross compiler toolchain.
Is that a new change in how the cross compilers work? The original patch was added a long time ago based on the cross compiler behavior in Fedora at the time. If that's changed, where can we see that documented?
Hi Josh,
Thx for rising this point. I've tried to sum-up my current understanding in rhbz#1642037.
Basically this is the first time I'm using the fedora cross toolchain to build userland applications. I've reproduced this error in f28, f29. I haven't tested in in f27 yet. I confirm it's possible to build some applications with the arm-linux-gnu fedora toolchain once the glibc-arm-linux-gnu is installed. But as an example, the bug occurs as soon as the <errno.h> header is included from a hello.c.
As a side note I will be AFAIK later today until one week. So unless a solution is found I won't be able to work on this issue until back.
Thx
On Thu, Oct 25, 2018 at 7:50 AM Nicolas Chauvet kwizart@gmail.com wrote:
Le mar. 23 oct. 2018 à 17:54, Josh Boyer jwboyer@fedoraproject.org a écrit :
On Tue, Oct 23, 2018 at 11:12 AM Nicolas Chauvet kwizart@gmail.com wrote:
Cross compiled kernel headers are installed into /usr/*-linux-gnu/include/ instead of /usr/*-linux-gnu/sys-root/usr/include/ where they can be found by default by the Fedora cross compiler toolchain.
Is that a new change in how the cross compilers work? The original patch was added a long time ago based on the cross compiler behavior in Fedora at the time. If that's changed, where can we see that documented?
Hi Josh,
Thx for rising this point. I've tried to sum-up my current understanding in rhbz#1642037.
Basically this is the first time I'm using the fedora cross toolchain to build userland applications.
The Fedora cross toolchains are only built to cross-compile kernels. It even says so right in the description:
Description : Cross-build GNU C compiler. : : Only building kernels is currently supported. Support for : cross-building user space programs is not currently provided as : that would massively multiply the number of packages.
I think you've hit an error in a usecase the toolchains don't even support.
josh
I've reproduced this error in f28, f29. I haven't tested in in f27 yet. I confirm it's possible to build some applications with the arm-linux-gnu fedora toolchain once the glibc-arm-linux-gnu is installed. But as an example, the bug occurs as soon as the <errno.h> header is included from a hello.c.
As a side note I will be AFAIK later today until one week. So unless a solution is found I won't be able to work on this issue until back.
Thx
Nicolas (kwizart)
kernel@lists.fedoraproject.org