From e80720fd2c7bf7e08daa541a21860442b8e3b5c4 Mon Sep 17 00:00:00 2001 From: xhe Date: Tue, 19 Apr 2022 14:27:19 +0800 Subject: [PATCH] fix version extraction Signed-off-by: xhe --- litex/soc/integration/export.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/litex/soc/integration/export.py b/litex/soc/integration/export.py index daa2a551a..6176f4b5b 100644 --- a/litex/soc/integration/export.py +++ b/litex/soc/integration/export.py @@ -18,6 +18,7 @@ # SPDX-License-Identifier: BSD-2-Clause import os +import re import json import time import datetime @@ -91,8 +92,8 @@ def get_cpu_mak(cpu, compile_software): selected_triple = select_triple(triple) if not clang: - binutils_version = re.match("GNU ar \(GNU Binutils\) (.+)\.(.+)", os.popen(selected_triple + "-ar -V").read()) - if int(binutils_version.group(1)) >= 2 and int(binutils_version.group(2)) >= 37 and (not re.search("zicsr", flags)): + binutils_version = re.match("GNU ar \(GNU Binutils\) (.+)", os.popen(selected_triple + "-ar -V").read()).group(1).split(".") + if int(binutils_version[1]) >= 2 and int(binutils_version[2]) >= 37 and (not re.search("zicsr", flags)): flags = re.compile("-march=([^ ]+)").sub("-march=\\1_zicsr", flags) # Return informations.