From: Denys Dmytriyenko <denis@denix.org>
To: Darren Hart <dvhart@linux.intel.com>
Cc: John Kacur <jkacur@redhat.com>,
linux-rt-users@vger.kernel.org,
Clark Williams <williams@redhat.com>
Subject: Re: [PATCH 1/3] rt-tests: Support user supplied CFLAGS and LDFLAGS
Date: Wed, 21 Mar 2012 15:10:22 -0400 [thread overview]
Message-ID: <20120321191022.GA6857@denix.org> (raw)
In-Reply-To: <4F691C88.2020907@linux.intel.com>
On Tue, Mar 20, 2012 at 05:10:48PM -0700, Darren Hart wrote:
>
>
> On 03/20/2012 04:58 PM, John Kacur wrote:
> > On Tue, Mar 20, 2012 at 8:05 PM, Darren Hart <dvhart@linux.intel.com> wrote:
> >> Accept user supplied CFLAGS and LDFLAGS, overwriting the
> >> Makefile supplied versions. This can cause the build to
> >> fail if the user does not provide at least what the Makefile
> >> defines, but so be it.
> >>
> >> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
> >> CC: Clark Williams <williams@redhat.com>
> >> CC: John Kacur <jkacur@redhat.com>
> >> CC: Denys Dmytriyenko <denis@denix.org>
> >> ---
> >
> > I was just wondering what you need LDFLAGS for? Chatting with Darren
> > on IRC, it seems like you're using -Wl to pass options via gcc to the
> > linker, and we don't have loadable libs either. Maybe you could resend
> > the patch with just the CFLAGS change until we have a real world
> > reason for LDFLAGS
>
> Denys,
>
> Am I missing a reason why we need LDFLAGS? With the current Makefile. we
> could just add anything we want to CFLAGS in a pinch anyway...
Darren,
>From OE-Core config files:
LINKER_HASH_STYLE ??= "gnu"
TARGET_LINK_HASH_STYLE ?= "${@['-Wl,--hash-style=gnu',''][d.getVar('LINKER_HASH_STYLE', True) != 'gnu']}"
export TARGET_LDFLAGS = "-Wl,-O1 ${TARGET_LINK_HASH_STYLE}"
ASNEEDED = "-Wl,--as-needed"
TARGET_LDFLAGS += "${ASNEEDED}"
export LDFLAGS = "${TARGET_LDFLAGS}"
So, those are still linker flags (altough passed through -Wl to gcc), hence
they belong to LDFLAGS, not CFLAGS. Arguably, you only need to pass CFLAGS
during compile stage and LDFLAGS during link stage. On the other hand, as a
workaround, I was passing them to TARGET_CC_ARCH, which gets embedded into CC
and won't distinguish between compile/link stages...
So rt-tests just gets away not using LDFLAGS and re-using CFLAGS for the link
stage. :) But the current Makefile as it is now won't honor CFLAGS being set
from outside, unless you pass them explicitly on the command line to make, or
call make with -e flag.
--
Denys
next prev parent reply other threads:[~2012-03-21 20:10 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-20 19:05 [PATCH 1/3] rt-tests: Support user supplied CFLAGS and LDFLAGS Darren Hart
2012-03-20 19:05 ` [PATCH 2/3] rt-tests: Silence unused-but-set warning in rt-migrate-test Darren Hart
2012-03-21 14:05 ` Steven Rostedt
2012-03-21 14:44 ` Darren Hart
2012-03-21 14:56 ` John Kacur
2012-03-21 16:18 ` Steven Rostedt
2012-03-21 16:36 ` Darren Hart
2012-03-21 16:41 ` John Kacur
2012-03-21 16:45 ` Darren Hart
2012-03-21 16:51 ` Steven Rostedt
2012-03-21 16:45 ` Steven Rostedt
2012-03-21 17:11 ` Steven Rostedt
2012-03-21 17:46 ` John Kacur
2012-03-20 19:05 ` [PATCH 3/3] rt-tests: Remove unused status variable Darren Hart
2012-03-21 13:35 ` John Kacur
2012-03-21 14:45 ` Darren Hart
2012-03-20 19:31 ` [PATCH 1/3] rt-tests: Support user supplied CFLAGS and LDFLAGS Remy Bohmer
2012-03-20 19:45 ` Darren Hart
2012-03-20 19:57 ` Remy Bohmer
2012-03-20 23:58 ` John Kacur
2012-03-21 0:10 ` Darren Hart
2012-03-21 19:10 ` Denys Dmytriyenko [this message]
2012-03-21 19:11 ` Darren Hart
2012-03-21 20:16 ` John Kacur
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=20120321191022.GA6857@denix.org \
--to=denis@denix.org \
--cc=dvhart@linux.intel.com \
--cc=jkacur@redhat.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=williams@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).