diff options
author | Arkadiusz Hiler <arek@hiler.eu> | 2019-04-03 17:13:53 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-04-04 22:10:40 +0300 |
commit | 690dd723f48b4130dcab960bf21a803ad6e5b2ee (patch) | |
tree | 9fb6eea8fa57f4fc68c00d85543f5debffa6c24b | |
parent | 94ba53c6b6eb44f32e4d155b3f7eeb5a68bfec83 (diff) | |
download | meson-690dd723f48b4130dcab960bf21a803ad6e5b2ee.zip meson-690dd723f48b4130dcab960bf21a803ad6e5b2ee.tar.gz meson-690dd723f48b4130dcab960bf21a803ad6e5b2ee.tar.bz2 |
Add symbol sizes to .symbols files
If we change a symbol size (e.g. array) in a .c file that is a part of
.so, executables that use it are not re-linked resulting in a runtime
error:
"Symbol xyz has different size in shared object, consider re-linking"
Adding symbol sizes to .symbol files fixes this issue.
-rw-r--r-- | mesonbuild/scripts/symbolextractor.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mesonbuild/scripts/symbolextractor.py b/mesonbuild/scripts/symbolextractor.py index 976d2f0..95ea0ec 100644 --- a/mesonbuild/scripts/symbolextractor.py +++ b/mesonbuild/scripts/symbolextractor.py @@ -68,7 +68,14 @@ def linux_syms(libfilename, outfilename): libfilename])[0:2] if pnm.returncode != 0: raise RuntimeError('nm does not work.') - result += [' '.join(x.split()[0:2]) for x in output.split('\n') if len(x) > 0] + for line in output.split('\n'): + if len(line) == 0: + continue + line_split = line.split() + entry = line_split[0:2] + if len(line_split) >= 4: + entry += [line_split[3]] + result += [' '.join(entry)] write_if_changed('\n'.join(result) + '\n', outfilename) def osx_syms(libfilename, outfilename): |