summaryrefslogtreecommitdiff
path: root/fw/tools
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2020-12-23 16:16:53 +0100
committerjaseg <git@jaseg.net>2020-12-23 16:16:53 +0100
commit278c9c79c27276188eecc0da391e006c99704d6f (patch)
treecd180bccc17a726298371dea3899ddbf4ce0873e /fw/tools
parent1f9390005f15e011ec8ffd394ba73a6119b58345 (diff)
downloadminikbd-278c9c79c27276188eecc0da391e006c99704d6f.tar.gz
minikbd-278c9c79c27276188eecc0da391e006c99704d6f.tar.bz2
minikbd-278c9c79c27276188eecc0da391e006c99704d6f.zip
Fix build on debian
Diffstat (limited to 'fw/tools')
-rw-r--r--fw/tools/linkmem.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/fw/tools/linkmem.py b/fw/tools/linkmem.py
index 934a571..bdacc0d 100644
--- a/fw/tools/linkmem.py
+++ b/fw/tools/linkmem.py
@@ -66,7 +66,8 @@ def trace_source_files(linker, cmdline, trace_sections=[], total_sections=['.tex
continue
# first part of continuation line
- if m := re.match('^(\.[0-9a-zA-Z-_.]+)$', line):
+ m = re.match('^(\.[0-9a-zA-Z-_.]+)$', line)
+ if m:
line_cont = line
sec_name = None
continue
@@ -76,7 +77,8 @@ def trace_source_files(linker, cmdline, trace_sections=[], total_sections=['.tex
line_cont = None
# -ffunction-sections/-fdata-sections section
- if m := re.match('^(\.[0-9a-zA-Z-_.]+)\.([0-9a-zA-Z-_.]+)\s+(0x[0-9a-f]+)\s+(0x[0-9a-f]+)\s+(\S+)$', line):
+ m = re.match('^(\.[0-9a-zA-Z-_.]+)\.([0-9a-zA-Z-_.]+)\s+(0x[0-9a-f]+)\s+(0x[0-9a-f]+)\s+(\S+)$', line)
+ if m:
sec, sym, loc, size, obj = m.groups()
*_, sym = sym.rpartition('.')
sym = cxxfilt.demangle(sym)
@@ -93,7 +95,8 @@ def trace_source_files(linker, cmdline, trace_sections=[], total_sections=['.tex
continue
# regular (no -ffunction-sections/-fdata-sections) section
- if m := re.match('^(\.[0-9a-zA-Z-_]+)\s+(0x[0-9a-f]+)\s+(0x[0-9a-f]+)\s+(\S+)$', line):
+ m = re.match('^(\.[0-9a-zA-Z-_]+)\s+(0x[0-9a-f]+)\s+(0x[0-9a-f]+)\s+(\S+)$', line)
+ if m:
sec, _loc, size, obj = m.groups()
size = int(size, 16)
obj = path.abspath(obj)
@@ -106,7 +109,8 @@ def trace_source_files(linker, cmdline, trace_sections=[], total_sections=['.tex
continue
# symbol def
- if m := re.match('^(0x[0-9a-f]+)\s+(\S+)$', line):
+ m = re.match('^(0x[0-9a-f]+)\s+(\S+)$', line)
+ if m:
loc, sym = m.groups()
sym = cxxfilt.demangle(sym)
loc = int(loc, 16)
@@ -129,7 +133,7 @@ def trace_source_files(linker, cmdline, trace_sections=[], total_sections=['.tex
fn = path.abspath(fn)
if member:
- subprocess.check_call(['ar', 'x', '--output', tempdir, fn, member])
+ subprocess.check_call(['ar', 'x', fn, member], cwd=tempdir)
fn = path.join(tempdir, member)
with open(fn, 'rb') as f: