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

[Xen-devel] [PATCH] build: remove shim related targets



There's no need to have shim specific targets, so just use the regular
xen makefile targets in order to build the shim binary.

When the shim is build as part of the firmware directory use the
xen-syms as the shim binary.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Cc: Tim Deegan <tim@xxxxxxx>
---
 tools/firmware/xen-dir/Makefile |  6 +++---
 xen/Makefile                    | 16 +++-------------
 xen/arch/x86/Makefile           | 12 +++---------
 3 files changed, 9 insertions(+), 25 deletions(-)

diff --git a/tools/firmware/xen-dir/Makefile b/tools/firmware/xen-dir/Makefile
index 7fd36a0e15..44c3587be0 100644
--- a/tools/firmware/xen-dir/Makefile
+++ b/tools/firmware/xen-dir/Makefile
@@ -48,10 +48,10 @@ shim-%config: $(D) FORCE
                KCONFIG_CONFIG=$(CURDIR)/shim.config
 
 xen-shim: $(D) shim-olddefconfig
-       $(MAKE) -C $(D)/xen install-shim \
+       $(MAKE) -C $(D)/xen build \
                XEN_CONFIG_EXPERT=y \
-               KCONFIG_CONFIG=$(CURDIR)/shim.config \
-               DESTDIR=$(CURDIR)
+               KCONFIG_CONFIG=$(CURDIR)/shim.config
+       cp $(D)/xen/xen-syms xen-shim
 
 .PHONY: distclean clean
 distclean clean:
diff --git a/xen/Makefile b/xen/Makefile
index 027c5adfdd..044e7c82a3 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -37,10 +37,10 @@ default: build
 .PHONY: dist
 dist: install
 
-build install build-shim:: include/config/auto.conf
+build install:: include/config/auto.conf
 
-.PHONY: build install uninstall clean distclean cscope TAGS tags MAP gtags 
tests install-shim build-shim
-build install uninstall debug clean distclean cscope TAGS tags MAP gtags tests 
install-shim build-shim::
+.PHONY: build install uninstall clean distclean cscope TAGS tags MAP gtags 
tests
+build install uninstall debug clean distclean cscope TAGS tags MAP gtags 
tests::
 ifneq ($(XEN_TARGET_ARCH),x86_32)
        $(MAKE) -f Rules.mk _$@
 else
@@ -80,13 +80,6 @@ _install: $(TARGET)$(CONFIG_XEN_INSTALL_SUFFIX)
                fi; \
        fi
 
-.PHONY: _build-shim
-_build-shim: $(TARGET)-shim
-
-.PHONY: _install-shim
-_install-shim: build-shim
-       $(INSTALL_DATA) $(TARGET)-shim $(DESTDIR)
-
 .PHONY: _tests
 _tests:
        $(MAKE) -f $(BASEDIR)/Rules.mk -C test tests
@@ -151,9 +144,6 @@ $(TARGET): delete-unfresh-files
        $(MAKE) -f $(BASEDIR)/Rules.mk include/asm-$(TARGET_ARCH)/asm-offsets.h
        $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) $(TARGET)
 
-$(TARGET)-shim: $(TARGET)
-       $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) $(TARGET)-shim
-
 # drivers/char/console.o contains static banner/compile info. Blow it away.
 # Don't refresh these files during e.g., 'sudo make install'
 .PHONY: delete-unfresh-files
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 389096139c..5563c813dd 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -78,12 +78,12 @@ efi-y := $(shell if [ ! -r $(BASEDIR)/include/xen/compile.h 
-o \
                       -O $(BASEDIR)/include/xen/compile.h ]; then \
                          echo '$(TARGET).efi'; fi)
 
-shim-$(CONFIG_PVH_GUEST) := $(TARGET)-shim
-
 ifneq ($(build_id_linker),)
 notes_phdrs = --notes
 else
-notes_phdrs =
+ifeq ($(CONFIG_PVH_GUEST),y)
+notes_phdrs = --notes
+endif
 endif
 
 ifdef CONFIG_LIVEPATCH
@@ -149,11 +149,6 @@ $(TARGET)-syms: prelink.o xen.lds 
$(BASEDIR)/common/symbols-dummy.o
                >$(@D)/$(@F).map
        rm -f $(@D)/.$(@F).[0-9]*
 
-# Use elf32-x86-64 if toolchain support exists, elf32-i386 otherwise.
-$(TARGET)-shim: FORMAT = $(firstword $(filter elf32-x86-64,$(shell $(OBJCOPY) 
--help)) elf32-i386)
-$(TARGET)-shim: $(TARGET)-syms
-       $(OBJCOPY) -O $(FORMAT) $< $@
-
 note.o: $(TARGET)-syms
        $(OBJCOPY) -O binary --only-section=.note.gnu.build-id  
$(BASEDIR)/xen-syms $@.bin
        $(OBJCOPY) -I binary -O elf64-x86-64 -B i386:x86-64 \
@@ -238,6 +233,5 @@ clean::
        rm -f asm-offsets.s *.lds boot/*.o boot/*~ boot/core boot/mkelf32
        rm -f $(BASEDIR)/.xen-syms.[0-9]* boot/.*.d
        rm -f $(BASEDIR)/.xen.efi.[0-9]* efi/*.efi efi/disabled efi/mkreloc
-       rm -f $(BASEDIR)/xen-shim
        rm -f boot/cmdline.S boot/reloc.S boot/*.lnk boot/*.bin
        rm -f note.o
-- 
2.16.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.