Re: [kvm-unit-tests PATCH v2 2/2] powerpc: select endianness

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

 



On 26/02/2016 19:45, Andrew Jones wrote:
...
>> diff --git a/powerpc/Makefile.common b/powerpc/Makefile.common
>> > index cc27ac8..b088af6 100644
>> > --- a/powerpc/Makefile.common
>> > +++ b/powerpc/Makefile.common
>> > @@ -11,14 +11,15 @@ all: $(TEST_DIR)/boot_rom.bin test_cases
>> >  
>> >  ##################################################################
>> >  
>> > -CFLAGS += $(arch_CFLAGS)
>> > -CFLAGS += -std=gnu99
>> > -CFLAGS += -ffreestanding
>> > -CFLAGS += -Wextra
>> > -CFLAGS += -O2
>> > -CFLAGS += -I lib -I lib/libfdt
>> > -CFLAGS += -Wa,-mregnames
>> > -CFLAGS += -fpie
>> > +common_CFLAGS = -std=gnu99
>> > +common_CFLAGS += -ffreestanding
>> > +common_CFLAGS += -Wextra
>> > +common_CFLAGS += -O2
>> > +common_CFLAGS += -I lib -I lib/libfdt
>> > +common_CFLAGS += -Wa,-mregnames
>> > +common_CFLAGS += -fpie
>> > +
>> > +CFLAGS += $(arch_CFLAGS) $(common_CFLAGS)
> I'm not sure what we gain by renaming to common_CFLAGS. Doesn't just
> 
> %.elf: CFLAGS += $(arch_CFLAGS)
> 
> work?
> 
>> >  
>> >  asm-offsets = lib/$(ARCH)/asm-offsets.h
>> >  include scripts/asm-offsets.mak
>> > @@ -48,6 +49,7 @@ $(TEST_DIR)/boot_rom.bin: $(TEST_DIR)/boot_rom.elf
>> >  	dd if=/dev/zero of=$@ bs=256 count=1
>> >  	$(OBJCOPY) -O binary $^ >(cat - >>$@)
>> >  
>> > +$(TEST_DIR)/boot_rom.elf: CFLAGS = -mbig-endian $(common_CFLAGS) $(main_CFLAGS)
> And just
> $(TEST_DIR)/boot_rom.elf: CFLAGS += -mbig-endian
> 

We can't do that because boot_rom.elf is also a .elf, so the both rules
apply and we end up with in the case of boot_rom.elf (and --endian=little):

  CFLAGS += -mlittle-endian -mbig-endian

and it doesn't work. We must overwrite CFLAGS in the case of boot_rom.elf.

But boot_rom.S is a one line of assembly language, we don't need the
other flags, in fact...

Laurent
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux