Go to file
Yann E. MORIN a344a5b7cb Makefile: fix show-vars for good this time
Commit 5c54c3ef3d (Makefile: workaround make 4.3 issue for 'printvars
and 'show-vars') did not fully fix the show-vars case, which still
segfaults.

Overall, show-vars generates a JSON blurb. That is supposed to be
machine-readable, so we do not care that the variables are sorted, so
we get rid of it to (slightly) simplify the code.

Then, we currently iterate twice on the list of variables: the first one
to filter-out the 'internal' variables, and the second one to filter
only the variables matching the pattern. We can do away by iterating
only once, and applying both filters at once.

Since we now have an 'and' condition, we can take advantage of it: when
none of the items in $(and) are empty, $(and) evaluates to the last
item, while it evaluates to empty if any of the items is empty. So we
can coalesce the $(if) and $(and) together: $(if $(and a,b),c) is
equivalent to: $(and a,b,c) ; this gains us one parentheses depth.

Finally, the cause for the segfault is an overly-long call to $(info).
Reducing that is not easy: we want to call clean-json on the whole of
the JSON blurb, so we can't emit the individual variables one by one, or
the trailing comma would not be trimmed away.

So, we go crazy: we just output each word from clean-json with $(info).

We can do that, because mk-json-str transforms all spaces in a string
to an escaped UTF-8 sequence, so we will never have spaces in values;
the keys are the variables, so they won't have spaces either; spaces in
the rest of the JSON blurb are totally optional, so we don't care how
many there are. We know there are spaces, because we explicitly
introduce some (after "expanded" or "raw", for example), so we should
never hit a too-big word for $(info) to print.

Thanks to Henri for the suggestion to push $(info) further inside the
macro.

Reported-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Roosen Henri <Henri.Roosen@ginzinger.com>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Tested-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit 83f71e7ceb)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2022-09-14 11:25:51 +02:00
arch arch/Config.in.riscv: lp64f ABI is only supported if MMU is enabled 2022-08-29 22:12:43 +02:00
board board/qemu/ppc-bamboo: use path to vmlinux image for copy and paste users 2022-06-07 11:40:53 +02:00
boot boot/arm-trusted-firmware: set CFLAGS from environment, not override 2022-09-13 16:34:39 +02:00
configs configs/galileo_defconfig: add missing double quotes around BR2_GLOBAL_PATCH_DIR value 2022-09-13 13:54:22 +02:00
docs docs/manual/prerequisite.txt: add diffutils 2022-08-29 13:11:42 +02:00
fs fs/oci: entrypoint and command are space-separated lists 2022-05-29 10:33:32 +02:00
linux {linux, linux-headers}: bump 4.{9, 14, 19}.x / 5.{4, 10, 15, 17}.x series 2022-08-03 22:26:24 +02:00
package package/go: security bump to version 1.17.13 2022-09-14 11:11:54 +02:00
support support/scripts: fix TABs/spaces in check-host-rpath 2022-09-13 16:38:59 +02:00
system system/skeleton: provide run/lock directory 2022-01-12 20:38:09 +01:00
toolchain toolchain/Config.in: update gcc bug 99410 2022-09-13 16:11:36 +02:00
utils utils/readme.txt: Fix typo "get-developers" 2022-08-14 21:20:35 +02: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-08-18 07:59:26 +02:00
CHANGES Update for 2022.02.5 2022-08-31 22:08:58 +02:00
Config.in support/download: Add SFTP support 2022-01-06 09:34:05 +01:00
Config.in.legacy package/php: remove wddx extension 2022-07-18 09:12:01 +02:00
COPYING
DEVELOPERS DEVELOPERS: remove useless whitespaces before tabs 2022-09-13 16:43:18 +02:00
Makefile Makefile: fix show-vars for good this time 2022-09-14 11:25:51 +02: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