diff mbox series

[SRU,focal/linux-riscv-5.8,1/1] UBUNTU: [Packaging] Use gcc-10 for riscv-5.8 kernel configs

Message ID 20210628163125.1342496-2-kleber.souza@canonical.com
State New
Headers show
Series gcc version used for kernel configs doesn't match the one used for builds | expand

Commit Message

Kleber Sacilotto de Souza June 28, 2021, 4:31 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1933856

With "UBUNTU: [Packaging] Use gcc-10 for riscv 5.8 kernel build", gcc-10
is used instead of the default gcc version in Focal for the kernel
builds. The same compiler version is also needed to generate the kernel
configs. Pass the "gcc" variable value set in debian/rules down to
debian/scripts/misc/kernelconfig so the same string is used.

Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
---
 debian/rules.d/1-maintainer.mk   | 4 ++--
 debian/scripts/misc/kernelconfig | 7 ++++---
 2 files changed, 6 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk
index 5944ca526703..549fe95232b3 100644
--- a/debian/rules.d/1-maintainer.mk
+++ b/debian/rules.d/1-maintainer.mk
@@ -45,12 +45,12 @@  printdebian:
 
 updateconfigs defaultconfigs editconfigs genconfigs dumpconfigs:
 	dh_testdir;
-	$(SHELL) $(DROOT)/scripts/misc/kernelconfig $@ "$(do_enforce_all)"
+	GCC=$(gcc) $(SHELL) $(DROOT)/scripts/misc/kernelconfig $@ "$(do_enforce_all)"
 	rm -rf build
 
 updateportsconfigs defaultportsconfigs editportsconfigs genportsconfigs askconfigs:
 	dh_testdir;
-	$(SHELL) $(DROOT)/scripts/misc/kernelconfig $@ ports
+	GCC=$(gcc) $(SHELL) $(DROOT)/scripts/misc/kernelconfig $@ ports
 	rm -rf build
 
 printenv:
diff --git a/debian/scripts/misc/kernelconfig b/debian/scripts/misc/kernelconfig
index f95396e28f28..1077afd22396 100755
--- a/debian/scripts/misc/kernelconfig
+++ b/debian/scripts/misc/kernelconfig
@@ -69,11 +69,12 @@  for arch in $archs; do
 	# we maintain the configs for hwe.
 	modify_config=true
 	env="ARCH=$kernarch DEB_ARCH=$arch"
-	compiler_path=$(which "${cross_compile}gcc" || true)
+	gcc=${GCC:-gcc}
+	compiler_path=$(which "${cross_compile}${gcc}" || true)
 	if [ "$compiler_path" != '' ]; then
-		env="$env CROSS_COMPILE=$cross_compile"
+		env="$env CC=${cross_compile}${gcc} CROSS_COMPILE=$cross_compile"
 	else
-		echo "WARNING: ${cross_compile}gcc not installed"
+		echo "WARNING: ${cross_compile}${gcc} not installed"
 		modify_config=
 		warning_partial="$warning_partial $arch"
 	fi