fix version extraction
Signed-off-by: xhe <xw897002528@gmail.com>
This commit is contained in:
parent
89fdb49884
commit
e80720fd2c
|
@ -18,6 +18,7 @@
|
||||||
# SPDX-License-Identifier: BSD-2-Clause
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
import datetime
|
import datetime
|
||||||
|
@ -91,8 +92,8 @@ def get_cpu_mak(cpu, compile_software):
|
||||||
|
|
||||||
selected_triple = select_triple(triple)
|
selected_triple = select_triple(triple)
|
||||||
if not clang:
|
if not clang:
|
||||||
binutils_version = re.match("GNU ar \(GNU Binutils\) (.+)\.(.+)", os.popen(selected_triple + "-ar -V").read())
|
binutils_version = re.match("GNU ar \(GNU Binutils\) (.+)", os.popen(selected_triple + "-ar -V").read()).group(1).split(".")
|
||||||
if int(binutils_version.group(1)) >= 2 and int(binutils_version.group(2)) >= 37 and (not re.search("zicsr", flags)):
|
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)
|
flags = re.compile("-march=([^ ]+)").sub("-march=\\1_zicsr", flags)
|
||||||
|
|
||||||
# Return informations.
|
# Return informations.
|
||||||
|
|
Loading…
Reference in New Issue