diff options
Diffstat (limited to 'debug_info_test')
-rw-r--r-- | debug_info_test/check_cus.py | 4 | ||||
-rw-r--r-- | debug_info_test/check_ngcc.py (renamed from debug_info_test/check_clang.py) | 10 | ||||
-rw-r--r-- | debug_info_test/clang_comp_path.whitelist | 4 | ||||
-rw-r--r-- | debug_info_test/ngcc_comp_path.whitelist | 15 | ||||
-rw-r--r-- | debug_info_test/ngcc_dso_path.whitelist (renamed from debug_info_test/clang_dso_path.whitelist) | 5 | ||||
-rw-r--r-- | debug_info_test/whitelist.py | 2 |
6 files changed, 26 insertions, 14 deletions
diff --git a/debug_info_test/check_cus.py b/debug_info_test/check_cus.py index 88fcf275..f68fe9cb 100644 --- a/debug_info_test/check_cus.py +++ b/debug_info_test/check_cus.py @@ -5,9 +5,9 @@ import os import subprocess -import check_clang +import check_ngcc -cu_checks = [check_clang.is_built_with_clang] +cu_checks = [check_ngcc.not_by_gcc] def check_compile_unit(dso_path, producer, comp_path): """check all compiler flags used to build the compile unit. diff --git a/debug_info_test/check_clang.py b/debug_info_test/check_ngcc.py index a6d056ed..eecbb85e 100644 --- a/debug_info_test/check_clang.py +++ b/debug_info_test/check_ngcc.py @@ -4,8 +4,8 @@ from whitelist import is_whitelisted -def is_built_with_clang(dso_path, producer, comp_path): - """Check whether the compile unit is built by clang. +def not_by_gcc(dso_path, producer, comp_path): + """Check whether the compile unit is not built by gcc. Args: dso_path: path to the elf/dso @@ -15,12 +15,12 @@ def is_built_with_clang(dso_path, producer, comp_path): Returns: False if compiled by gcc otherwise True """ - if is_whitelisted('clang_comp_path', comp_path): + if is_whitelisted('ngcc_comp_path', comp_path): return True - if is_whitelisted('clang_dso_path', dso_path): + if is_whitelisted('ngcc_dso_path', dso_path): return True - if 'clang version' not in producer: + if 'GNU C' in producer: return False return True diff --git a/debug_info_test/clang_comp_path.whitelist b/debug_info_test/clang_comp_path.whitelist deleted file mode 100644 index 45df0547..00000000 --- a/debug_info_test/clang_comp_path.whitelist +++ /dev/null @@ -1,4 +0,0 @@ -# These are generally objects linked from system libraries such as glibc -# and libgcc. -.*/glibc-.*/ -.*/libgcc/.* diff --git a/debug_info_test/ngcc_comp_path.whitelist b/debug_info_test/ngcc_comp_path.whitelist new file mode 100644 index 00000000..1d6d0ade --- /dev/null +++ b/debug_info_test/ngcc_comp_path.whitelist @@ -0,0 +1,15 @@ +# CrOS packages are compiled in /tmp/$board/portage/${CATEGORY}/${P}. +# They can be matched by .*/portage/${CATEGORY}/${PN}-.* +.*/portage/chromeos-base/ec-utils-.* +.*/portage/dev-libs/elfutils-.* +.*/portage/dev-libs/libusb-.* +.*/portage/dev-util/perf-.* +.*/portage/sys-apps/busybox-.* +.*/portage/sys-boot/syslinux-.* +.*/portage/sys-kernel/chromeos-kernel-.* +.*/portage/sys-libs/gcc-libs-.* +# glibc and libgcc are built in different ways. +# and libstdc++. +.*/glibc-.*/ +.*/libgcc/.* +.*/libstdc\+\+-.* diff --git a/debug_info_test/clang_dso_path.whitelist b/debug_info_test/ngcc_dso_path.whitelist index 74f520ea..213e60df 100644 --- a/debug_info_test/clang_dso_path.whitelist +++ b/debug_info_test/ngcc_dso_path.whitelist @@ -1,3 +1,5 @@ +# DSOs specified here are not CrOS packages compiled within CrOS SDK. +# CrOS packages should be whitelisted in *_comp_path.whitelist # modules we don't care: .*/binutils/.* .*/binutils-bin/.* @@ -7,6 +9,5 @@ .*/unixbench/.* .*/opt/google/containers/android/.* .*/libmali\.so.*\.debug +.*/pyelftools/examples/sample_exe64.elf.debug # todos: -.*/flashrom_s.debug -.*/ec_ctl.debug diff --git a/debug_info_test/whitelist.py b/debug_info_test/whitelist.py index 99a457c0..383fcc3d 100644 --- a/debug_info_test/whitelist.py +++ b/debug_info_test/whitelist.py @@ -48,8 +48,8 @@ def load_whitelists(dirname): key = os.path.splitext(os.path.basename(fn))[0] with open(fn, 'r') as f: patterns = f.read().splitlines() - patterns = [l for l in patterns if l[0] != '#'] patterns = [l for l in patterns if l != ''] + patterns = [l for l in patterns if l[0] != '#'] wlist[key] = prepare_whitelist(patterns) return wlist |