qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V8 2/4] tests/migration: Support cross compilati


From: Andrew Jones
Subject: Re: [Qemu-devel] [PATCH V8 2/4] tests/migration: Support cross compilation in generating boot header file
Date: Tue, 4 Sep 2018 20:05:10 +0200
User-agent: NeoMutt/20180716

On Tue, Sep 04, 2018 at 01:04:31PM -0400, Wei Huang wrote:
> > > +parse-cross-prefix = $(subst gcc,,$(patsubst cc,gcc,$(patsubst
> > > CROSS_CC_GUEST="%",%,$(shell grep "CROSS_CC_GUEST="
> > > $(SRC_PATH)/$(1)-softmmu/config-target.mak))))
> > > +gen-cross-prefix = $(patsubst %-,CROSS_PREFIX=%-,$(call
> > > parse-cross-prefix,$(1)))
> > >  
> > > -x86.bootsect: x86.boot
> > > - dd if=$< of=$@ bs=256 count=2 skip=124
> > > +.PHONY: all $(TARGET_LIST)
> > >  
> > > -x86.boot: x86.o
> > > - $(CROSS_PREFIX)objcopy -O binary $< $@
> > > +all: $(TARGET_LIST)
> > >  
> > > -x86.o: x86-a-b-bootblock.S
> > > - $(CROSS_PREFIX)gcc -m32 -march=i486 -c $< -o $@
> > > +$(TARGET_LIST):
> > > + $(MAKE) -C $@ $(call gen-cross-prefix,$@)
> > >  
> > >  clean:
> > > - @rm -rf *.boot *.o *.bootsect
> > > + for target in $(TARGET_LIST); do \
> > > +         $(MAKE) -C $$target clean; \
> > > + done
> > 
> > The above seems overly complicated. Does the following work?
> > 
> > $(TARGET_LIST): CROSS_PREFIX=$(CROSS_CC_GUEST)
> > $(TARGET_LIST):
> >     $(MAKE) -C $@
> 
> No, it doen't work for different reasons.
> 
> First, to have CROSS_CC_GUEST defined, we normally would use "-include" to 
> include config-target.mak file. But the end result is, the CROSS_CC_GUEST 
> only has the same definition for both architectures (due to make command's 
> multi-iteration processing and include is processed first). Secondly, 
> CROSS_CC_GUEST needs to be polished because it can be: i) not defined; ii) 
> "cc" without prefix; or iii) used-define value. We can't use it directly.
>

OK. Since I don't have any better suggestions. Then this is good
enough for me.

Thanks,
drew



reply via email to

[Prev in Thread] Current Thread [Next in Thread]