public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [RFC] HOST_{CFLAGS,LDFLAGS} definition
Date: Thu, 27 Jan 2022 11:57:00 +0100	[thread overview]
Message-ID: <YfJ6fIbFvN7rD0SR@pevik> (raw)

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

             reply	other threads:[~2022-01-27 10:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 10:57 Petr Vorel [this message]
2022-01-27 12:44 ` [LTP] [RFC] HOST_{CFLAGS,LDFLAGS} definition Joerg Vehlow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YfJ6fIbFvN7rD0SR@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox