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

Kleber Sacilotto de Souza kleber.souza at canonical.com
Mon Jun 28 16:31:25 UTC 2021


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 at canonical.com>
---
 debian/rules.d/1-maintainer.mk   | 4 ++--
 debian/scripts/misc/kernelconfig | 7 ++++---
 2 files changed, 6 insertions(+), 5 deletions(-)

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
-- 
2.27.0




More information about the kernel-team mailing list