[RFC 0/1][Unstable] Use cross compilers when updating Ubuntu kernel configs

Seth Forshee seth.forshee at canonical.com
Thu Aug 23 16:42:49 UTC 2018


I've pushed the following patch to the unstable kernel tree to fix a
problem I encountered, however I wanted to get some feedback on it to
see if anyone had objections or better ideas.

The problem is that Kconfig files have started invoking scripts which
test compiler features to determine values for config options. Here's an
example from arch/powerpc/Kconfig:

  config MPROFILE_KERNEL
	depends on PPC64 && CPU_LITTLE_ENDIAN
	def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh $(CC) -I$(srctree)/include -D__KERNEL__)

This test fails when updating configs on my amd64 box and the option is
set to n, however with the powerpc64le compiler the test passes and the
option is set to y. As a result, this option has been off in our config
files but then gets flipped on in the kernels we build.

The solution I came up with is to detect when the target architecture
does not match the host architecture and set CROSS_COMPILE in the
environment for "make *config" in our kernelconfig script. This works,
but it does require having cross toolchains available with the same
version and features as the ones that will be used to build the kernel.
In practice this probably means that when running updateconfigs, etc.
you'll need to use a chroot for the target series with cross toolchains
for all supported architectures installed (we should be able to add a
cranky command to ease the pain).

So, any comment or better ideas? Otherwise, I guess this serves as a
heads up of workflow changes that will be needed for cosmic onward.

Thanks,
Seth

---

Seth Forshee (1):
  UBUNTU: [Debian] set CROSS_COMPILE when generating kernel configs

 debian/scripts/misc/kernelconfig | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)





More information about the kernel-team mailing list