Skip to contentSkip to conversation

buildman: Differentiate 32-bit and 64-bit LoongArch variants

PATCH Superseded Yao Zi 2 participants 2 messages Jul 31 – Aug 4

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Yao Zi

author
#0 lore raw

PATCH 1/1 buildman: Differentiate 32-bit and 64-bit LoongArch variants

Similar to RISC-V and ARM, 32-bit and 64-bit LoongArch couldn't be distinguished solely by CONFIG_SYS_ARCH, but require different toolchains if multilib is disabled in compiler, which is the case of toolchain provided by kernel.org.

Let's override the parsed arch parameter for LoongArch configs based on CONFIG_ARCH_LA64 Kconfig symbol.

---
 tools/buildman/boards.py | 11 +++++++++++
 1 file changed, 11 insertions(+)
tools/buildman/boards.py +11 -0
index 2fe43c3fc896..a878053df59d 100644
@@ -309,6 +309,17 @@ class KconfigScanner:
             else:
                 params['arch'] = 'riscv64'
 
+        # fix-up for loongarch
+        if params['arch'] == 'loongarch':
+            try:
+                value = self._conf.syms.get('ARCH_LA64').str_value
+            except:
+                value = ''
+            if value == 'y':
+                params['arch'] = 'loongarch64'
+            else:
+                params['arch'] = 'loongarch32'
+
         return params, warnings
 
 
Signature · 1 line
2.54.0
Reviewed-by on v1 1/1
#1 lore raw

Hi Yao,

Quoted 6 lines · Yao Zi

buildman: Differentiate 32-bit and 64-bit LoongArch variants

Similar to RISC-V and ARM, 32-bit and 64-bit LoongArch couldn't be distinguished solely by CONFIG_SYS_ARCH, but require different toolchains if multilib is disabled in compiler, which is the case of toolchain provided by kernel.org.

Please use present tense - 'cannot be distinguished'.

Quoted 11 lines

Let's override the parsed arch parameter for LoongArch configs based on CONFIG_ARCH_LA64 Kconfig symbol.

tools/buildman/boards.py | 11 +++++++++++

 1 file changed, 11 insertions(+)

tools/buildman/boards.py class KconfigScanner: · line 317

Quoted 9 lines
tools/buildman/boards.py +6 -0
@@ -309,6 +309,17 @@ class KconfigScanner:
             else:
                 params['arch'] = 'riscv64'
 
+        # fix-up for loongarch
+        if params['arch'] == 'loongarch':
+            try:
+                value = self._conf.syms.get('ARCH_LA64').str_value
+            except:
+                value = ''

The bare except: mirrors the RISC-V block, but pylint flags it - please use 'except AttributeError:'

With that:

Regards,
Simon