public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [RFC] HOST_{CFLAGS,LDFLAGS} definition
@ 2022-01-27 10:57 Petr Vorel
  2022-01-27 12:44 ` Joerg Vehlow
  0 siblings, 1 reply; 2+ messages in thread
From: Petr Vorel @ 2022-01-27 10:57 UTC (permalink / raw)
  To: ltp

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

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-27 12:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-27 10:57 [LTP] [RFC] HOST_{CFLAGS,LDFLAGS} definition Petr Vorel
2022-01-27 12:44 ` Joerg Vehlow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox