[LTP] [RFC] HOST_{CFLAGS,LDFLAGS} definition

Petr Vorel pvorel@suse.cz
Thu Jan 27 11:57:00 CET 2022


Hi,

not sure what I do wrong, but due evaluation in include/mk/config.mk.in:

ifeq ($(strip $(HOST_CFLAGS)),)
HOST_CFLAGS := $(CFLAGS)
endif

ifeq ($(strip $(HOST_LDFLAGS)),)
HOST_LDFLAGS := $(LDFLAGS)
endif

HOST_CFLAGS and HOST_LDFLAGS must be defined for make (not for configure).
Of course exporting variables works.

Also whole point of previous code was to have a default, but that's wrong.
On some embedded platforms it fails as without properly defined HOST_CFLAGS it
can inherit flags which aren't usable for host (e.g. -mlongcalls
-mauto-litpools) and whole compilation fails.

IMHO we should change it to (i.e. not inherit anything):

HOST_CFLAGS := $(HOST_CFLAGS)
HOST_LDFLAGS := $(HOST_LDFLAGS)

HOST_CFLAGS += $(WLDFLAGS)
HOST_LDFLAGS += $(DEBUG_CFLAGS) $(OPT_CFLAGS) $(WCFLAGS)

Kind regards,
Petr


More information about the ltp mailing list