[Buildroot] [PATCH v3 2/8] security hardening: add RELFO, FORTIFY options

Nicolas Cavallari Nicolas.Cavallari at green-communications.fr
Wed Jan 10 09:41:15 UTC 2018


On 10/01/2018 05:15, Matt Weber wrote:
> +ifneq ($(BR2_OPTIMIZE_S)$(BR2_OPTIMIZE_0)$(BR2_OPTIMIZE_1)$(BR2_OPTIMIZE_2)$(BR2_OPTIMIZE_G),)
> +ifeq ($(BR2_FORTIFY_SOURCE_1),y)
> +TARGET_CPPFLAGS += -D_FORTIFY_SOURCE=1
> +else ifeq ($(BR2_FORTIFY_SOURCE_2),y)
> +TARGET_CPPFLAGS += -D_FORTIFY_SOURCE=2
> +endif
> +else
> +$(error BR2_FORTIFY_SOURCE_# requires optimization level s/1/2/3/g)
> +endif

This seems to test if the optimization level is s/0/1/2/g instead of
s/1/2/3/g

Shouldn't this actually be expressed as a dependency in Config.in
instead ? (i.e. make BR2_FORTIFY_SOURCE_{1,2} depends on !BR2_OPTIMIZE_0)


More information about the buildroot mailing list