diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-04-10 14:13:40 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-04-23 21:47:27 -0400 |
commit | 37ab1a25ec6af5fd16568fabe415b20f03cae1c2 (patch) | |
tree | b86bdb2198c2e12da89ebe6a17e4ed00b7ba1686 /src/test/generate-sym-test.py | |
parent | 4e4ab1c32a2dfd7ac0d03e65ea669fc58d61cc1e (diff) |
meson: add test-libsystemd-sym, fix linking of libsystemd
This is quite messy. I think libtool might have been using something
like -Wl,--whole-archive, but I don't think meson has support for that.
For now, just recompile all the sources for linking into libsystemd
directly. This should not matter much for efficiency, since it's a
few small files.
Diffstat (limited to 'src/test/generate-sym-test.py')
-rwxr-xr-x | src/test/generate-sym-test.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/generate-sym-test.py b/src/test/generate-sym-test.py new file mode 100755 index 0000000000..a3350c8a81 --- /dev/null +++ b/src/test/generate-sym-test.py @@ -0,0 +1,23 @@ +#!/usr/bin/python3 +import sys, re + +print('#include <stdio.h>') +for header in sys.argv[2:]: + print('#include "{}"'.format(header.split('/')[-1])) + +print(''' +void* functions[] = {''') + +for line in open(sys.argv[1]): + match = re.search('^ +([a-zA-Z0-9_]+);', line) + if match: + print(' {},'.format(match.group(1))) + +print('''}; + +int main(void) { + unsigned i; + for (i = 0; i < sizeof(functions)/sizeof(void*); i++) + printf("%p\\n", functions[i]); + return 0; +}''') |