From fa9823907405bd775e43d24c00fe2ab5cda050a0 Mon Sep 17 00:00:00 2001 From: Julien Olivain Date: Thu, 23 Jan 2025 22:35:41 +0100 Subject: [PATCH] utils/check-symbols: allow BR2_BROKEN to be unused Commit [1] introduced the BR2_BROKEN hidden symbol. The intent of this symbol is to temporarily mark a configuration known to be broken. This commit was added to fix an undefined usage of the symbol, in a previous commit [2]. With this somewhat special symbol, it is also perfectly normal to have no use of it. Running the command "utils/check-symbols" in a state there is no usage of the BR2_BROKEN, the script fails with output: Config.in:15: BR2_BROKEN defined but not referenced This commit adds an exception for this symbol, allowing it to be unused in the whole Buildroot tree. Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/8925433382 [1] https://gitlab.com/buildroot.org/buildroot/-/commit/2ddc5808cd19f577917566ad83e2a3835d6d43b9 [2] https://gitlab.com/buildroot.org/buildroot/-/commit/11a8cdd2bbbd0ef4adf600e4792d75f6f2122ec8 Signed-off-by: Julien Olivain Signed-off-by: Romain Naour --- utils/checksymbolslib/br.py | 4 ++++ utils/checksymbolslib/db.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/utils/checksymbolslib/br.py b/utils/checksymbolslib/br.py index f9dc336e64..a4c1b84c56 100644 --- a/utils/checksymbolslib/br.py +++ b/utils/checksymbolslib/br.py @@ -45,6 +45,10 @@ symbols_not_defined_for_fake_virtual_packages = [ 'BR2_PACKAGE_PROVIDES_TOOLCHAIN_BUILDROOT', 'BR2_PACKAGE_PROVIDES_TOOLCHAIN_BARE_METAL_BUILDROOT', ] +# Config.in +symbols_possibly_unused = [ + 'BR2_BROKEN', +] # fs/common.mk suffixes_not_defined_for_all_rootfs_types = [ '_BZIP2', diff --git a/utils/checksymbolslib/db.py b/utils/checksymbolslib/db.py index 71b1e9e816..cb0dfa476f 100644 --- a/utils/checksymbolslib/db.py +++ b/utils/checksymbolslib/db.py @@ -155,6 +155,8 @@ class DB: continue if legacy_usage in entries: continue + if symbol in br.symbols_possibly_unused: + continue if symbol in br.symbols_used_only_in_source_code: continue if symbol in br.symbols_used_only_for_host_variant: