Re: [PATCH] tools build: Use -fzero-init-padding-bits=all

From: Leo Yan
Date: Fri Mar 28 2025 - 13:24:35 EST


Hi Ian,

On Fri, Mar 28, 2025 at 09:39:41AM -0700, Ian Rogers wrote:

[...]

> It'd be nice to bring in the comment for try-run that's in
> ./scripts/Makefile.compiler:
> ```
> # try-run
> # Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise)
> # Exit code chooses option. "$$TMP" serves as a temporary file and is
> # automatically cleaned up.
> ```

It is fine for me to reuse the comment from Makefile.compiler and add
a temporary folder for the try result.

> > +try-run = $(shell set -e; \
> > + if ($(1)) >/dev/null 2>&1; \
> > + then echo "$(2)"; \
> > + else echo "$(3)"; \
> > + fi)
> > +
> > +__cc-option = $(call try-run,\
> > + $(1) -Werror $(2) -c -x c /dev/null -o /dev/null,$(2),)
> > +cc-option = $(call __cc-option, $(CC),$(1))
> > +
>
> I see differences with the ./scripts/Makefile.compiler version of
> these functions:
> ```
> # __cc-option
> # Usage: MY_CFLAGS += $(call
> __cc-option,$(CC),$(MY_CFLAGS),-march=winchip-c6,-march=i586)
> __cc-option = $(call try-run,\
> $(1) -Werror $(2) $(3) -c -x c /dev/null -o "$$TMP",$(3),$(4))
>
> cc-option = $(call __cc-option, $(CC),\
> $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS),$(1),$(2))
> ```
> I'm just wondering why as if we need to update these in the future
> it'd be easier if the two were identical.

Note, I do not see a requirement for passing two options for tools
building. In the next spin, I will keep to support only one option.

Thanks for review!

Leo