Changeset View
Changeset View
Standalone View
Standalone View
contrib/devtools/symbol-check.py
Show All 11 Lines | Example usage: | ||||
find ../gitian-builder/build -type f -executable | xargs python contrib/devtools/symbol-check.py | find ../gitian-builder/build -type f -executable | xargs python contrib/devtools/symbol-check.py | ||||
''' | ''' | ||||
from __future__ import division, print_function, unicode_literals | from __future__ import division, print_function, unicode_literals | ||||
import subprocess | import subprocess | ||||
import re | import re | ||||
import sys | import sys | ||||
import os | import os | ||||
# Debian 6.0.9 (Squeeze) has: | # Debian 8.11 (Jessie) has: | ||||
# | # | ||||
# - g++ version 4.4.5 (https://packages.debian.org/search?suite=default§ion=all&arch=any&searchon=names&keywords=g%2B%2B) | # - g++ version 4.9.2 (https://packages.debian.org/search?suite=default§ion=all&arch=any&searchon=names&keywords=g%2B%2B) | ||||
# - libc version 2.11.3 (https://packages.debian.org/search?suite=default§ion=all&arch=any&searchon=names&keywords=libc6) | # - libc version 2.19.18 (https://packages.debian.org/search?suite=default§ion=all&arch=any&searchon=names&keywords=libc6) | ||||
# - libstdc++ version 4.4.5 (https://packages.debian.org/search?suite=default§ion=all&arch=any&searchon=names&keywords=libstdc%2B%2B6) | # - libstdc++ version 4.8.4 (https://packages.debian.org/search?suite=default§ion=all&arch=any&searchon=names&keywords=libstdc%2B%2B6) | ||||
# | # | ||||
# Ubuntu 10.04.4 (Lucid Lynx) has: | # Ubuntu 14.04 (Trusty Tahr) has: | ||||
# | # | ||||
# - g++ version 4.4.3 (http://packages.ubuntu.com/search?keywords=g%2B%2B&searchon=names&suite=lucid§ion=all) | # - g++ version 4.8.2 (https://packages.ubuntu.com/search?suite=trusty§ion=all&arch=any&keywords=g%2B%2B&searchon=names) | ||||
# - libc version 2.11.1 (http://packages.ubuntu.com/search?keywords=libc6&searchon=names&suite=lucid§ion=all) | # - libc version 2.19.0 (https://packages.ubuntu.com/search?suite=trusty§ion=all&arch=any&keywords=libc6&searchon=names) | ||||
# - libstdc++ version 4.4.3 (http://packages.ubuntu.com/search?suite=lucid§ion=all&arch=any&keywords=libstdc%2B%2B&searchon=names) | # - libstdc++ version 4.8.2 (https://packages.ubuntu.com/search?suite=trusty§ion=all&arch=any&keywords=libstdc%2B%2B&searchon=names) | ||||
# | # | ||||
# Taking the minimum of these as our target. | # Taking the minimum of these as our target. | ||||
# | # | ||||
# According to GNU ABI document (http://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html) this corresponds to: | # According to GNU ABI document (http://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html) this corresponds to: | ||||
# GCC 4.4.0: GCC_4.4.0 | # GCC 4.8.0: GCC_4.8.0 | ||||
# GCC 4.4.2: GLIBCXX_3.4.13, CXXABI_1.3.3 | # GCC 4.8.0: GLIBCXX_3.4.18, CXXABI_1.3.7 | ||||
# (glibc) GLIBC_2_11 | # (glibc) GLIBC_2_19 | ||||
# | # | ||||
MAX_VERSIONS = { | MAX_VERSIONS = { | ||||
'GCC': (4, 4, 0), | 'GCC': (4, 8, 0), | ||||
'CXXABI': (1, 3, 3), | 'CXXABI': (1, 3, 7), | ||||
'GLIBCXX': (3, 4, 13), | 'GLIBCXX': (3, 4, 18), | ||||
'GLIBC': (2, 11) | 'GLIBC': (2, 19) | ||||
} | } | ||||
# See here for a description of _IO_stdin_used: | # See here for a description of _IO_stdin_used: | ||||
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634261#109 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634261#109 | ||||
# Ignore symbols that are exported as part of every executable | # Ignore symbols that are exported as part of every executable | ||||
IGNORE_EXPORTS = { | IGNORE_EXPORTS = { | ||||
'_edata', '_end', '_init', '__bss_start', '_fini', '_IO_stdin_used', 'stdin', 'stdout', 'stderr', | '_edata', '_end', '_init', '__bss_start', '_fini', '_IO_stdin_used', 'stdin', 'stdout', 'stderr', | ||||
# Figure out why we get these symbols exported on xenial. | # Figure out why we get these symbols exported on xenial. | ||||
▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines |