Go to file
Ricardo Martincoski 0c5472ace2 utils/check-symbols: new script
This script checks for inconsistencies on symbols declared in Config.in
and used in .mk files.
Currently it checks only symbols following the pattern BR2_\w+ .

The script first gets the list of all files in the repository (using git
ls-files like 'make check-flake8' already do).

Then it parses all relevant files, searching for symbol definitions and
usages, and add entries into a database.

At the end, the database is searched for inconsistencies:
- symbol that is part of "choice" and is referenced with "select";
- legacy symbol being referenced in packages;
- legacy symbol being redefined in packages;
- symbol referenced but not defined;
- symbol defined but not referenced;
- legacy symbol that has a Note stating it is referenced by a package
  (for legacy handling) but is referenced in the package without a
  comment "# legacy";
- legacy symbol that has a Note stating it is referenced by a package
  but it is not actually referenced.

There is also a debug parameter --search that dumps any filename or
symbol entries from the database that matches a regexp.

Sample usages:
$ utils/check-symbols
$ utils/docker-run utils/check-symbols
$ utils/check-symbols --search 'GETTEXT\b|\/openssl'

At same time the script is created:
- add unit tests for it, they can be run using:
  utils/docker-run python3 -m pytest -v utils/checksymbolslib/
- add two more GitLab CI jobs: check-symbols (to check current tree
  using the script) and check-check-symbols (to check the script against
  its unit tests)

Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
[Peter: print warnings to stderr, rename change_current_dir() to
	change_to_top_dir()]
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2023-02-06 16:30:20 +01:00
arch arch/arch.mk.xtensa: relax check on overlay file to apply only to internal toolchains 2022-11-13 22:32:31 +01:00
board board/versal/post-image.sh: do not require xilinx/ prefix for .dts files 2023-02-05 13:24:10 +01:00
boot boot/uboot: remove use of legacy xloader symbol 2023-02-06 14:22:38 +01:00
configs configs/olimex_a64_olinuxino_defconfig: bump Linux to 6.1.9, U-Boot to 2023.01 and ATF to v2.8 2023-02-05 13:18:54 +01:00
docs docs/website: better recent commits/discussions output 2023-02-06 11:59:03 +01:00
fs fs/erofs: enable support for reproducible build 2023-01-16 21:45:15 +01:00
linux {linux, linux-headers}: bump 4.{14, 19}.x / 5.{4, 10, 15}.x / 6.1.x series 2023-02-03 08:32:00 +01:00
package package/gitlab-runner: use LIBCURL_FORCE_TLS to enforce TLS support in curl 2023-02-06 16:30:20 +01:00
support utils/check-symbols: new script 2023-02-06 16:30:20 +01:00
system system: remove use of legacy md5 option 2023-02-06 14:22:38 +01:00
toolchain toolchain/toolchain-buildroot: add comment about using virtual package infra 2023-02-06 14:22:38 +01:00
utils utils/check-symbols: new script 2023-02-06 16:30:20 +01:00
.clang-format .clang-format: initial import from Linux 5.15.6 2022-01-01 15:01:13 +01:00
.defconfig
.flake8
.gitignore
.gitlab-ci.yml utils/checkpackagelib/lib_sysv: run shellcheck 2022-02-06 18:27:03 +01:00
.shellcheckrc utils/check-package: improve shellcheck reproducibility 2022-07-25 23:52:47 +02:00
CHANGES *: fix typo for separate(d|) in text 2023-02-06 11:22:17 +01:00
Config.in toolchain: make paranoid check of library/header paths unconditional 2023-02-05 15:11:25 +01:00
Config.in.legacy package/xdriver_xf86-video-imx-viv: drop package 2023-02-06 16:30:20 +01:00
COPYING
DEVELOPERS utils/check-symbols: new script 2023-02-06 16:30:20 +01:00
Makefile Makefile: fix build when $(O) ends in _defconfig 2023-02-06 14:21:42 +01:00
Makefile.legacy
README

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on OFTC IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches