Message ID | cc557aab0912160045l312a9554sbf9fc56372ed1a05@mail.gmail.com |
---|---|
State | New |
Headers | show |
On 12/16/2009 09:45 AM, Kirill A. Shutemov wrote: >>>> >>> -VPATH=$(SRC_PATH) >>>> >>> +vpath %.c $(SRC_PATH) >> > >> > This change is needed? > Yes. We dont want to take %.o from $(SRC_PATH) since they built without -fpie. I think that's fine, it's kind of the purpose of vpath to only look for sources in the vpath; so it's safer to use "vpath" than "VPATH". That said, I'd change it to vpath %.c %.h $(SRC_PATH) and I'd do so uniformly in all the directories that currently use VPATH. Paolo
On Wed, Dec 16, 2009 at 11:15 AM, Paolo Bonzini <pbonzini@redhat.com> wrote: > On 12/16/2009 09:45 AM, Kirill A. Shutemov wrote: >>>>> >>>>> >>> -VPATH=$(SRC_PATH) >>>>> >>> +vpath %.c $(SRC_PATH) >>> >>> > >>> > This change is needed? >> >> Yes. We dont want to take %.o from $(SRC_PATH) since they built without >> -fpie. > > I think that's fine, it's kind of the purpose of vpath to only look for > sources in the vpath; so it's safer to use "vpath" than "VPATH". That said, > I'd change it to > > vpath %.c %.h $(SRC_PATH) We don't have make-targets which require %.h in Makefile.user, so it's noise. > > and I'd do so uniformly in all the directories that currently use VPATH. > > Paolo > > > >
"Kirill A. Shutemov" <kirill@shutemov.name> writes: > On Wed, Dec 16, 2009 at 11:15 AM, Paolo Bonzini <pbonzini@redhat.com> wrote: >> On 12/16/2009 09:45 AM, Kirill A. Shutemov wrote: >>>>>> >>>>>> >>> -VPATH=$(SRC_PATH) >>>>>> >>> +vpath %.c $(SRC_PATH) >>>> >>>> > >>>> > This change is needed? >>> >>> Yes. We dont want to take %.o from $(SRC_PATH) since they built without >>> -fpie. >> >> I think that's fine, it's kind of the purpose of vpath to only look for >> sources in the vpath; so it's safer to use "vpath" than "VPATH". That said, >> I'd change it to >> >> vpath %.c %.h $(SRC_PATH) > > We don't have make-targets which require %.h in Makefile.user, so it's noise. It may be noise now, but it the first guy who adds one there will be grateful for it, and... >> and I'd do so uniformly in all the directories that currently use VPATH. ... doing it uniformly makes more sense.
diff --git a/Makefile.user b/Makefile.user index 907e74b..75c92d4 100644 --- a/Makefile.user +++ b/Makefile.user @@ -2,10 +2,15 @@ include ../config-host.mak include $(SRC_PATH)/rules.mak +include config.mak .PHONY: all -VPATH=$(SRC_PATH) +# Do not take %.o from $(SRC_PATH), only %.c +# All %.o for user targets should be built with -fpie, when +# configured with --enable-user-pie, so we don't want to +# take %.o from $(SRC_PATH), since they built without -fpie +vpath %.c $(SRC_PATH) QEMU_CFLAGS+=-I.. diff --git a/configure b/configure index 273b6b7..5f463b0 100755 --- a/configure +++ b/configure @@ -2652,3 +2652,6 @@ d=libuser mkdir -p $d rm -f $d/Makefile ln -s $source_path/Makefile.user $d/Makefile +if test "$static" = "no" -a "$user_pie" = "yes" ; then + echo "QEMU_CFLAGS+=-fpie" > $d/config.mak +fi