[U-Boot] [PATCH] Enable expression support for CONFIG_BOARD_SIZE_LIMIT
Fabio Estevam
festevam at gmail.com
Thu Dec 6 15:06:04 UTC 2018
Hi Philipp,
On Thu, Dec 6, 2018 at 12:50 PM Philipp Tomsich
<philipp.tomsich at theobroma-systems.com> wrote:
> If you take a look at how CONFIG_BOARD_SIZE_LIMIT is used
> ifneq ($(CONFIG_BOARD_SIZE_LIMIT),)
> BOARD_SIZE_CHECK = \
> @actual=`wc -c $@ | awk '{print $$1}'`; \
> limit=`printf "%d" $(CONFIG_BOARD_SIZE_LIMIT)`; \
> if test $$actual -gt $$limit; then \
> echo "$@ exceeds file size limit:" >&2 ; \
> echo " limit: $$limit bytes" >&2 ; \
> echo " actual: $$actual bytes" >&2 ; \
> echo " excess: $$((actual - limit)) bytes" >&2; \
> exit 1; \
> fi
> else
> BOARD_SIZE_CHECK =
> endif
> you will notice that there’s no arithmetic expansion on it prior to it being
> passed int a 'if -gt’ compare.
Yes, this the current code. The patch Wolfgang submitted in this
thread changed the Makefile.
>
> 'git grep’ also shows that no other board is requesting an arithmetic
> expansion on this (i.e. everyone else just uses a constant).
>
> Note that the C-preprocessor will not do arithmetic for you...
> So you’ll either have to change the Makefile or define this as an actual
> constant number.
Yes, Wolfgang's patch changed the Makefile to allow arithmetic
operation, but it does not work on my system.
More information about the U-Boot
mailing list