From: Paolo Bonzini <pbonzini@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
agraf@suse.de, Michael Tokarev <mjt@tls.msk.ru>,
qemu-devel@nongnu.org, Stefan Weil <sw@weilnetz.de>
Subject: Re: [Qemu-devel] [PATCH] rules.mak: Force CFLAGS for all objects in DSO
Date: Wed, 06 May 2015 17:03:39 +0200 [thread overview]
Message-ID: <554A2D4B.1050605@redhat.com> (raw)
In-Reply-To: <20150506150149.GC1535@ad.nay.redhat.com>
On 06/05/2015 17:01, Fam Zheng wrote:
>> > -%$(DSOSUF): CFLAGS += -fPIC -DBUILD_DSO
>> > +%.mo: CFLAGS += -fPIC -DBUILD_DSO
> I believe this will propagate the flags correctly. However that will affect
> non-module build, so I didn't want to do it unconditionally.
You're right. You'd need something like
$(call lif $(CONFIG_MODULES), -fPIC -DBUILD_DSO) instead.
>> > (and if so move the rule down, above "%.mo:")? If you cannot use
>> > foo.mo, foo.mo also doesn't use CFLAGS in its rules, and you should be
>> > able to remove foo.mo too.
>> >
>> > - so the other possibility is to just use $(foreach o,$($v),$($o-objs)).
>> > In this case there's already a convenient $(foreach) just above, and
>> > you can just add another $(eval) inside it.
>> >
>> > - and if that is true, you do not need .PHONY either because you have
>> > $(foreach ... $(eval)) instead of $(eval $(foreach)).
>> >
> OK.
>
> It's been a long day for me, so you can see that I'm going defensive with the
> code I'm writing, but yes, your last "if" looks about right, except we still
> need the "$(if $(CONFIG_MODULES),...)".
Understood entirely. But there's no hurry, sleep over it and take your
time to test it tomorrow.
> Sanity check: is -fPIC only ever needed in compiling, but not in (partial)
> linking, right?
Yes. It's LDFLAGS_SHARED that is used in linking (and nothing in
partial linking).
Paolo
next prev parent reply other threads:[~2015-05-06 15:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-06 13:46 [Qemu-devel] [PATCH] rules.mak: Force CFLAGS for all objects in DSO Fam Zheng
2015-05-06 14:07 ` Paolo Bonzini
2015-05-06 14:23 ` Fam Zheng
2015-05-06 14:36 ` Paolo Bonzini
2015-05-06 15:01 ` Fam Zheng
2015-05-06 15:03 ` Paolo Bonzini [this message]
2015-05-06 23:25 ` Alexander Graf
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=554A2D4B.1050605@redhat.com \
--to=pbonzini@redhat.com \
--cc=agraf@suse.de \
--cc=famz@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=sw@weilnetz.de \
/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).