Skip to contentSkip to conversation

Rename DEBUG_DIR to XEN_DEBUG_DIR

PATCH In review Olaf Hering 2 participants 3 messages Mar 12, 2018 – Mar 13, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Rename DEBUG_DIR to XEN_DEBUG_DIR

The usage of DEBUG_DIR breaks OVMF build. Rename it to XEN_DEBUG_DIR.

The default DEBUG_DIR=/usr/lib/debug can not be used for rpm builds because that directory is "owned" by rpm-packaging itself to store the autogenerated ${pkg}-debuginfo.rpm data. Thats why I set it to /boot. This worked fine until recently, only /boot/xen-syms was affected by that change, and in fact only the "xen" build needed DEBUG_DIR as make cmdline option.

Now tools/firmware/Makefile also uses DEBUG_DIR. To set DEBUG_DIR the tools build must be done like "make DEBUG_DIR=/my/dir". But this breaks build with --enable-ovmf because ovmf.git makes use of the very same variable. For some reason it can not deal with a custom value, some autogenerated file will not be found:

[ 126s] make[8]: *** No rule to make target '/boot/AutoGen.h', needed by '/home/abuild/rpmbuild/BUILD/xen-4.11.20180228T150620.cb671efbf1/non-dbg/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC5/X64/OvmfPkg/ResetVector/ResetVector/OUTPUT/ResetVector.bin'.

Fixes commit b38c4e1763 ("build: remove shim related targets")

---

In case this patch gets applied, it is also required to fix the build regression introduced by cee8bb62ff in 4.10.

 INSTALL                     |  4 ++--
 config/StdGNU.mk            |  2 +-
 config/SunOS.mk             |  2 +-
 tools/firmware/Makefile     |  2 +-
 xen/Makefile                | 14 +++++++-------
 xen/test/livepatch/Makefile |  2 +-
 6 files changed, 13 insertions(+), 13 deletions(-)
INSTALL +2 -2
index 9aa9ebdddc..3c05a7a35c 100644
@@ -196,10 +196,10 @@ OCAMLFIND_DESTDIR= and OCAMLFIND_METADIR= will have the same effect.
 OCAMLDESTDIR=
 
 The xen subsystem will install the hypervisor into fixed locations.
-BOOT_DIR defaults to /boot, DEBUG_DIR defaults to /usr/lib/debug and
+BOOT_DIR defaults to /boot, XEN_DEBUG_DIR defaults to /usr/lib/debug and
 EFI_DIR to /usr/lib64/efi.
 BOOT_DIR=
-DEBUG_DIR=
+XEN_DEBUG_DIR=
 EFI_DIR=
 
 The make target 'rpmball' will build a xen.rpm. This variable can be
config/StdGNU.mk +1 -1
index 039274ea61..f75e39782c 100644
@@ -27,7 +27,7 @@ INSTALL_DATA = $(INSTALL) -m0644 -p
 INSTALL_PROG = $(INSTALL) -m0755 -p
 
 BOOT_DIR ?= /boot
-DEBUG_DIR ?= /usr/lib/debug
+XEN_DEBUG_DIR ?= /usr/lib/debug
 
 SOCKET_LIBS =
 UTIL_LIBS = -lutil
config/SunOS.mk +1 -1
index 0fe5f45590..f36120c4a1 100644
@@ -19,7 +19,7 @@ INSTALL_DATA = $(INSTALL) -m0644 -p
 INSTALL_PROG = $(INSTALL) -m0755 -p
 
 BOOT_DIR ?= /boot
-DEBUG_DIR ?= /usr/lib/debug
+XEN_DEBUG_DIR ?= /usr/lib/debug
 
 SunOS_LIBDIR = /usr/sfw/lib
 SunOS_LIBDIR_x86_64 = /usr/sfw/lib/amd64
tools/firmware/Makefile +1 -1
index 5a7cf7766d..13cefb5ce9 100644
@@ -8,7 +8,7 @@ endif
 # hvmloader is a 32-bit protected mode binary.
 TARGET      := hvmloader/hvmloader
 INST_DIR := $(DESTDIR)$(XENFIRMWAREDIR)
-DEBG_DIR := $(DESTDIR)$(DEBUG_DIR)$(XENFIRMWAREDIR)
+DEBG_DIR := $(DESTDIR)$(XEN_DEBUG_DIR)$(XENFIRMWAREDIR)
 
 SUBDIRS-y :=
 SUBDIRS-$(CONFIG_OVMF) += ovmf-dir
xen/Makefile +7 -7
index 62d479c799..79f3a95ec1 100644
@@ -60,15 +60,15 @@ _install: $(TARGET)$(CONFIG_XEN_INSTALL_SUFFIX)
 	ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION)$(Z)
 	ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION)$(Z)
 	ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)$(Z)
-	[ -d "$(D)$(DEBUG_DIR)" ] || $(INSTALL_DIR) $(D)$(DEBUG_DIR)
-	$(INSTALL_DATA) $(TARGET)-syms $(D)$(DEBUG_DIR)/$(T)-syms-$(XEN_FULLVERSION)
-	$(INSTALL_DATA) $(TARGET)-syms.map $(D)$(DEBUG_DIR)/$(T)-syms-$(XEN_FULLVERSION).map
+	[ -d "$(D)$(XEN_DEBUG_DIR)" ] || $(INSTALL_DIR) $(D)$(XEN_DEBUG_DIR)
+	$(INSTALL_DATA) $(TARGET)-syms $(D)$(XEN_DEBUG_DIR)/$(T)-syms-$(XEN_FULLVERSION)
+	$(INSTALL_DATA) $(TARGET)-syms.map $(D)$(XEN_DEBUG_DIR)/$(T)-syms-$(XEN_FULLVERSION).map
 	$(INSTALL_DATA) $(KCONFIG_CONFIG) $(D)$(BOOT_DIR)/$(T)-$(XEN_FULLVERSION).config
 	if [ -r $(TARGET).efi -a -n '$(EFI_DIR)' ]; then \
 		[ -d $(D)$(EFI_DIR) ] || $(INSTALL_DIR) $(D)$(EFI_DIR); \
 		$(INSTALL_DATA) $(TARGET).efi $(D)$(EFI_DIR)/$(T)-$(XEN_FULLVERSION).efi; \
 		if [ -e $(TARGET).efi.map ]; then \
-			$(INSTALL_DATA) $(TARGET).efi.map $(D)$(DEBUG_DIR)/$(T)-$(XEN_FULLVERSION).efi.map; \
+			$(INSTALL_DATA) $(TARGET).efi.map $(D)$(XEN_DEBUG_DIR)/$(T)-$(XEN_FULLVERSION).efi.map; \
 		fi; \
 		ln -sf $(T)-$(XEN_FULLVERSION).efi $(D)$(EFI_DIR)/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION).efi; \
 		ln -sf $(T)-$(XEN_FULLVERSION).efi $(D)$(EFI_DIR)/$(T)-$(XEN_VERSION).efi; \
@@ -94,11 +94,11 @@ _uninstall:
 	rm -f $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION)$(Z)
 	rm -f $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION)$(Z)
 	rm -f $(D)$(BOOT_DIR)/$(T)$(Z)
-	rm -f $(D)$(DEBUG_DIR)/$(T)-syms-$(XEN_FULLVERSION)
-	rm -f $(D)$(DEBUG_DIR)/$(T)-syms-$(XEN_FULLVERSION).map
+	rm -f $(D)$(XEN_DEBUG_DIR)/$(T)-syms-$(XEN_FULLVERSION)
+	rm -f $(D)$(XEN_DEBUG_DIR)/$(T)-syms-$(XEN_FULLVERSION).map
 	rm -f $(D)$(EFI_DIR)/$(T)-$(XEN_FULLVERSION).efi
 	rm -f $(D)$(EFI_DIR)/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION).efi
-	rm -f $(D)$(DEBUG_DIR)/$(T)-$(XEN_FULLVERSION).efi.map
+	rm -f $(D)$(XEN_DEBUG_DIR)/$(T)-$(XEN_FULLVERSION).efi.map
 	rm -f $(D)$(EFI_DIR)/$(T)-$(XEN_VERSION).efi
 	rm -f $(D)$(EFI_DIR)/$(T).efi
 	rm -f $(D)$(EFI_MOUNTPOINT)/efi/$(EFI_VENDOR)/$(T)-$(XEN_FULLVERSION).efi
xen/test/livepatch/Makefile +1 -1
index 6831383db1..467da2ff00 100644
@@ -25,7 +25,7 @@ LIVEPATCHES += $(LIVEPATCH_BYE)
 LIVEPATCHES += $(LIVEPATCH_REPLACE)
 LIVEPATCHES += $(LIVEPATCH_NOP)
 
-LIVEPATCH_DEBUG_DIR ?= $(DEBUG_DIR)/xen-livepatch
+LIVEPATCH_DEBUG_DIR ?= $(XEN_DEBUG_DIR)/xen-livepatch
 
 build default: livepatch
 

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#1 lore raw
Quoted 15 lines · Olaf Hering

The usage of DEBUG_DIR breaks OVMF build. Rename it to XEN_DEBUG_DIR.

The default DEBUG_DIR=/usr/lib/debug can not be used for rpm builds because that directory is "owned" by rpm-packaging itself to store the autogenerated ${pkg}-debuginfo.rpm data. Thats why I set it to /boot. This worked fine until recently, only /boot/xen-syms was affected by that change, and in fact only the "xen" build needed DEBUG_DIR as make cmdline option.

Now tools/firmware/Makefile also uses DEBUG_DIR. To set DEBUG_DIR the tools build must be done like "make DEBUG_DIR=/my/dir". But this breaks build with --enable-ovmf because ovmf.git makes use of the very same variable. For some reason it can not deal with a custom value, some autogenerated file will not be found:

Quoted 3 lines

[ 126s] make[8]: *** No rule to make target '/boot/AutoGen.h', needed by '/home/abuild/rpmbuild/BUILD/xen-4.11.20180228T150620.cb671efbf1/non-dbg/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC5/X64/OvmfPkg/ResetVector/ResetVector/OUTPUT/ResetVector.bin'.

Fixes commit b38c4e1763 ("build: remove shim related targets")

I would rather prefer to fix this properly by setting DEBUG_DIR in config/Paths.mk.in from configure for the tools usage. This should allow the path to be set from configure and thus avoid the need of passing it from the command line when calling make. Do you think that would solve your issues?

I can prepare a patch to do that.

Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel