]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
build: remove shim related targets
authorRoger Pau Monné <roger.pau@citrix.com>
Fri, 23 Feb 2018 10:05:19 +0000 (11:05 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 23 Feb 2018 10:05:19 +0000 (11:05 +0100)
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 install the
stripped Xen binary to the firmware directory and place a binary with
symbols in the debug directory.

The objcopy step of the shim build is also removed in this patch:
since the shim is booted in PVH mode there's no need for the resulting
binary to be in elf32 format. Xen can load PVH kernels with either a
32 or 64bit elf header.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
tools/firmware/Makefile
tools/firmware/xen-dir/Makefile
xen/Makefile
xen/arch/x86/Makefile

index b2f011df490c0631912648e19107707dc29a8124..5a7cf7766d491e5517f4e65eb14f3f836be3d6e9 100644 (file)
@@ -8,6 +8,7 @@ endif
 # hvmloader is a 32-bit protected mode binary.
 TARGET      := hvmloader/hvmloader
 INST_DIR := $(DESTDIR)$(XENFIRMWAREDIR)
+DEBG_DIR := $(DESTDIR)$(DEBUG_DIR)$(XENFIRMWAREDIR)
 
 SUBDIRS-y :=
 SUBDIRS-$(CONFIG_OVMF) += ovmf-dir
@@ -46,6 +47,7 @@ endif
 .PHONY: install
 install: all
        [ -d $(INST_DIR) ] || $(INSTALL_DIR) $(INST_DIR)
+       [ -d $(DEBG_DIR) ] || $(INSTALL_DIR) $(DEBG_DIR)
        [ ! -e $(TARGET) ] || $(INSTALL_DATA) $(TARGET) $(INST_DIR)
 ifeq ($(CONFIG_SEABIOS),y)
        $(INSTALL_DATA) seabios-dir/out/bios.bin $(INST_DIR)/seabios.bin
@@ -55,6 +57,7 @@ ifeq ($(CONFIG_OVMF),y)
 endif
 ifeq ($(CONFIG_PV_SHIM),y)
        $(INSTALL_DATA) xen-dir/xen-shim $(INST_DIR)/xen-shim
+       $(INSTALL_DATA) xen-dir/xen-shim-syms $(DEBG_DIR)/xen-shim-syms
 endif
 
 .PHONY: uninstall
@@ -68,6 +71,7 @@ ifeq ($(CONFIG_OVMF),y)
 endif
 ifeq ($(CONFIG_PV_SHIM),y)
        rm -f $(INST_DIR)/xen-shim
+       rm -f $(DEBG_DIR)/xen-shim-syms
 endif
 
 .PHONY: clean
index 7fd36a0e15f91019d97c24dea64dac252d3b9b3e..57750bf2fd9554deda0d81d6c862971ba844c0e3 100644 (file)
@@ -48,13 +48,14 @@ 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
+       ln -sf $(D)/xen/xen $@
+       ln -sf $(D)/xen/xen-syms $@-syms
 
 .PHONY: distclean clean
 distclean clean:
-       rm -f xen-shim *.old
+       rm -f xen-shim xen-shim-syms *.old
        rm -rf $(D)
        rm -f linkfarm.stamp*
index 290dc93ddd7ff6af5eeb1ce5bbeeecbff547c7dc..62d479c799865bfa709b44cba11eda075cca6cdb 100644 (file)
@@ -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
@@ -139,8 +132,7 @@ $(TARGET).gz: $(TARGET)
        gzip -n -f -9 < $< > $@.new
        mv $@.new $@
 
-.PHONY: $(TARGET)-common
-$(TARGET)-common: delete-unfresh-files
+$(TARGET): delete-unfresh-files
        $(MAKE) -C tools
        $(MAKE) -f $(BASEDIR)/Rules.mk include/xen/compile.h
        [ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm
@@ -150,8 +142,6 @@ $(TARGET)-common: delete-unfresh-files
        $(MAKE) -f $(BASEDIR)/Rules.mk -C include
        $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) asm-offsets.s
        $(MAKE) -f $(BASEDIR)/Rules.mk include/asm-$(TARGET_ARCH)/asm-offsets.h
-
-$(TARGET) $(TARGET)-shim: $(TARGET)-common
        $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) $@
 
 # drivers/char/console.o contains static banner/compile info. Blow it away.
index 7c6e93d560175695547cf78179db08da6c729f85..5563c813dd71f3b037e14454a33190c95b8fd191 100644 (file)
@@ -81,7 +81,9 @@ efi-y := $(shell if [ ! -r $(BASEDIR)/include/xen/compile.h -o \
 ifneq ($(build_id_linker),)
 notes_phdrs = --notes
 else
-notes_phdrs =
+ifeq ($(CONFIG_PVH_GUEST),y)
+notes_phdrs = --notes
+endif
 endif
 
 ifdef CONFIG_LIVEPATCH
@@ -147,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 \
@@ -236,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