[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] rules.mak: Force CFLAGS for all objects in DSO
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] rules.mak: Force CFLAGS for all objects in DSO |
Date: |
Wed, 06 May 2015 17:03:39 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
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
Re: [Qemu-devel] [PATCH] rules.mak: Force CFLAGS for all objects in DSO, Alexander Graf, 2015/05/06