From aecfe0ed3429850477a1267ab49bb50f55b7d5f3 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 8 Jun 2022 09:10:13 +0200 Subject: [PATCH] support/scripts/gen-bootlin-toolchains: fix RISC-V 64-bit toolchain description We now support both MMU-enabled and MMU-less RISC-V 64-bit configurations. However, the Bootlin toolchain for RISC-V 64-bit only supports MMU-enabled configurations, but the current logic in toolchain/toolchain-external/toolchain-external-bootlin/ does not take this into account, and allows selecting the Booltin toolchain for MMU-less RISC-V 64-bit configurations. To fix this, the gen-bootlin-toolchains script is modified to add the BR2_USE_MMU dependency to the description of the RISC-V 64-bit toolchain. However, the BR2_USE_MMU dependency was also added for glibc and musl toolchains unconditionally, so to avoid duplicating the dependency, we now only add it only if not already present in the list of dependencies for this toolchain. This will allow to fix: http://autobuild.buildroot.net/results/d6aee9b275b1ec399aea59758ac8f69fdc5691fc/ Signed-off-by: Thomas Petazzoni Signed-off-by: Arnout Vandecappelle (Essensium/Mind) (cherry picked from commit 1f4bba5967f793add3bfd051c96926224b73eebd) Signed-off-by: Peter Korsgaard --- support/scripts/gen-bootlin-toolchains | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/support/scripts/gen-bootlin-toolchains b/support/scripts/gen-bootlin-toolchains index 404f14831e..9a81f0ac0c 100755 --- a/support/scripts/gen-bootlin-toolchains +++ b/support/scripts/gen-bootlin-toolchains @@ -159,7 +159,7 @@ arches = { 'prefix': 'riscv32', }, 'riscv64-lp64d': { - 'conditions': ['BR2_riscv', 'BR2_riscv_g', 'BR2_RISCV_64', 'BR2_RISCV_ABI_LP64D'], + 'conditions': ['BR2_riscv', 'BR2_riscv_g', 'BR2_RISCV_64', 'BR2_RISCV_ABI_LP64D', 'BR2_USE_MMU'], 'prefix': 'riscv64', }, 'sh-sh4': { @@ -308,13 +308,15 @@ class Toolchain: selects.append("BR2_TOOLCHAIN_EXTERNAL_UCLIBC") elif frag.startswith("BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC"): # glibc needs mmu support - depends.append("BR2_USE_MMU") + if "BR2_USE_MMU" not in depends: + depends.append("BR2_USE_MMU") # glibc doesn't support static only configuration depends.append("!BR2_STATIC_LIBS") selects.append("BR2_TOOLCHAIN_EXTERNAL_GLIBC") elif frag.startswith("BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL"): # musl needs mmu support - depends.append("BR2_USE_MMU") + if "BR2_USE_MMU" not in depends: + depends.append("BR2_USE_MMU") selects.append("BR2_TOOLCHAIN_EXTERNAL_MUSL") # gcc version