All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] build: remove shim related targets
@ 2018-02-21 12:22 Roger Pau Monne
  2018-02-21 12:39 ` Wei Liu
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Roger Pau Monne @ 2018-02-21 12:22 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, Jan Beulich, Roger Pau Monne

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>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Tim Deegan <tim@xen.org>
---
Changes since v2:
 - Rebase to staging.
 - Remove $(TARGET)-common.
 - Use $@ in the xen-shim target rule.

Changes since v1:
 - Copy a shim binary with symbols to the debug dir.
 - Use ln to link xen-shim and xen-shim-syms instead of cp.
 - Expand commit message to explain the reason for dropping the
   objcopy step.
---
 tools/firmware/Makefile         |  4 ++++
 tools/firmware/xen-dir/Makefile |  9 +++++----
 xen/Makefile                    | 18 ++++--------------
 xen/arch/x86/Makefile           | 10 +++-------
 4 files changed, 16 insertions(+), 25 deletions(-)

diff --git a/tools/firmware/Makefile b/tools/firmware/Makefile
index b2f011df49..5a7cf7766d 100644
--- a/tools/firmware/Makefile
+++ b/tools/firmware/Makefile
@@ -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
diff --git a/tools/firmware/xen-dir/Makefile b/tools/firmware/xen-dir/Makefile
index 7fd36a0e15..57750bf2fd 100644
--- a/tools/firmware/xen-dir/Makefile
+++ b/tools/firmware/xen-dir/Makefile
@@ -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*
diff --git a/xen/Makefile b/xen/Makefile
index 290dc93ddd..62d479c799 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
@@ -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.
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 7c6e93d560..5563c813dd 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -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
-- 
2.16.1


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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v3] build: remove shim related targets
  2018-02-21 12:22 [PATCH v3] build: remove shim related targets Roger Pau Monne
@ 2018-02-21 12:39 ` Wei Liu
  2018-02-21 12:45 ` Andrew Cooper
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Wei Liu @ 2018-02-21 12:39 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, Jan Beulich, xen-devel

On Wed, Feb 21, 2018 at 12:22:18PM +0000, Roger Pau Monne wrote:
> 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>

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3] build: remove shim related targets
  2018-02-21 12:22 [PATCH v3] build: remove shim related targets Roger Pau Monne
  2018-02-21 12:39 ` Wei Liu
@ 2018-02-21 12:45 ` Andrew Cooper
  2018-02-21 13:06 ` Jan Beulich
  2018-02-28 11:02 ` Jan Beulich
  3 siblings, 0 replies; 13+ messages in thread
From: Andrew Cooper @ 2018-02-21 12:45 UTC (permalink / raw)
  To: Roger Pau Monne, xen-devel
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Tim Deegan,
	Ian Jackson, Jan Beulich

On 21/02/18 12:22, Roger Pau Monne wrote:
> 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>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3] build: remove shim related targets
  2018-02-21 12:22 [PATCH v3] build: remove shim related targets Roger Pau Monne
  2018-02-21 12:39 ` Wei Liu
  2018-02-21 12:45 ` Andrew Cooper
@ 2018-02-21 13:06 ` Jan Beulich
  2018-02-28 11:02 ` Jan Beulich
  3 siblings, 0 replies; 13+ messages in thread
From: Jan Beulich @ 2018-02-21 13:06 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, xen-devel

>>> On 21.02.18 at 13:22, <roger.pau@citrix.com> wrote:
> --- a/tools/firmware/xen-dir/Makefile
> +++ b/tools/firmware/xen-dir/Makefile
> @@ -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

Hmm, this having been cp before, I'm somewhat surprised to see
you use symlinks now, rather than hard ones. But if it works, that's
probably fine.

Jan


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3] build: remove shim related targets
  2018-02-21 12:22 [PATCH v3] build: remove shim related targets Roger Pau Monne
                   ` (2 preceding siblings ...)
  2018-02-21 13:06 ` Jan Beulich
@ 2018-02-28 11:02 ` Jan Beulich
  2018-02-28 11:47   ` Roger Pau Monné
  3 siblings, 1 reply; 13+ messages in thread
From: Jan Beulich @ 2018-02-28 11:02 UTC (permalink / raw)
  To: Roger Pau Monne, Ian Jackson
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Tim Deegan, xen-devel

>>> On 21.02.18 at 13:22, <roger.pau@citrix.com> wrote:
> --- a/tools/firmware/Makefile
> +++ b/tools/firmware/Makefile
> @@ -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)

This is screwing up my build, and looking again I can't see how
this can be right: Both $(XENFIRMWAREDIR) and $(DEBUG_DIR)
are supposed to be ${prefix}-able, yet there clearly should not
be an infix resulting from the construction of this path.

In that context I wonder why DEBUG_DIR is set in
{StdGNU,SunOS}.mk instead of having a template in
Paths.mk.in.

Jan


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3] build: remove shim related targets
  2018-02-28 11:02 ` Jan Beulich
@ 2018-02-28 11:47   ` Roger Pau Monné
  2018-02-28 12:29     ` Jan Beulich
  0 siblings, 1 reply; 13+ messages in thread
From: Roger Pau Monné @ 2018-02-28 11:47 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, xen-devel

On Wed, Feb 28, 2018 at 04:02:53AM -0700, Jan Beulich wrote:
> >>> On 21.02.18 at 13:22, <roger.pau@citrix.com> wrote:
> > --- a/tools/firmware/Makefile
> > +++ b/tools/firmware/Makefile
> > @@ -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)
> 
> This is screwing up my build, and looking again I can't see how
> this can be right: Both $(XENFIRMWAREDIR) and $(DEBUG_DIR)
> are supposed to be ${prefix}-able, yet there clearly should not
> be an infix resulting from the construction of this path.

By being prefixable you mean that both XENFIRMWAREDIR and DEBUG_DIR
can be relative paths?

> In that context I wonder why DEBUG_DIR is set in
> {StdGNU,SunOS}.mk instead of having a template in
> Paths.mk.in.

Then you would have to run configure before installing the hypervisor,
because the install hypervisor target uses DEBUG_DIR.

Roger.

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3] build: remove shim related targets
  2018-02-28 11:47   ` Roger Pau Monné
@ 2018-02-28 12:29     ` Jan Beulich
  2018-02-28 13:02       ` Roger Pau Monné
  0 siblings, 1 reply; 13+ messages in thread
From: Jan Beulich @ 2018-02-28 12:29 UTC (permalink / raw)
  To: Roger Pau Monné
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, xen-devel

>>> On 28.02.18 at 12:47, <roger.pau@citrix.com> wrote:
> On Wed, Feb 28, 2018 at 04:02:53AM -0700, Jan Beulich wrote:
>> >>> On 21.02.18 at 13:22, <roger.pau@citrix.com> wrote:
>> > --- a/tools/firmware/Makefile
>> > +++ b/tools/firmware/Makefile
>> > @@ -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)
>> 
>> This is screwing up my build, and looking again I can't see how
>> this can be right: Both $(XENFIRMWAREDIR) and $(DEBUG_DIR)
>> are supposed to be ${prefix}-able, yet there clearly should not
>> be an infix resulting from the construction of this path.
> 
> By being prefixable you mean that both XENFIRMWAREDIR and DEBUG_DIR
> can be relative paths?

Both should be possible to live in /usr/lib or /usr/local/lib,
for example.

>> In that context I wonder why DEBUG_DIR is set in
>> {StdGNU,SunOS}.mk instead of having a template in
>> Paths.mk.in.
> 
> Then you would have to run configure before installing the hypervisor,
> because the install hypervisor target uses DEBUG_DIR.

I don't think so, no. The hypervisor subtree is (for now) fine to
use whatever {StdGNU,SunOS}.mk say, but the tools/ subtree
shouldn't use any hard-coded paths.

Jan


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3] build: remove shim related targets
  2018-02-28 12:29     ` Jan Beulich
@ 2018-02-28 13:02       ` Roger Pau Monné
  2018-02-28 13:25         ` Jan Beulich
  0 siblings, 1 reply; 13+ messages in thread
From: Roger Pau Monné @ 2018-02-28 13:02 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, xen-devel

On Wed, Feb 28, 2018 at 05:29:06AM -0700, Jan Beulich wrote:
> >>> On 28.02.18 at 12:47, <roger.pau@citrix.com> wrote:
> > On Wed, Feb 28, 2018 at 04:02:53AM -0700, Jan Beulich wrote:
> >> >>> On 21.02.18 at 13:22, <roger.pau@citrix.com> wrote:
> >> > --- a/tools/firmware/Makefile
> >> > +++ b/tools/firmware/Makefile
> >> > @@ -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)
> >> 
> >> This is screwing up my build, and looking again I can't see how
> >> this can be right: Both $(XENFIRMWAREDIR) and $(DEBUG_DIR)
> >> are supposed to be ${prefix}-able, yet there clearly should not
> >> be an infix resulting from the construction of this path.
> > 
> > By being prefixable you mean that both XENFIRMWAREDIR and DEBUG_DIR
> > can be relative paths?
> 
> Both should be possible to live in /usr/lib or /usr/local/lib,
> for example.

I'm afraid I don't see the issue, could you provide the values of
DESTDIR, DEBUG_DIR and XENFIRMWAREDIR that are causing the issue?

Is this because you end up with something like:

/usr/local/lib/debug/usr/local/... in the debug path?

> >> In that context I wonder why DEBUG_DIR is set in
> >> {StdGNU,SunOS}.mk instead of having a template in
> >> Paths.mk.in.
> > 
> > Then you would have to run configure before installing the hypervisor,
> > because the install hypervisor target uses DEBUG_DIR.
> 
> I don't think so, no. The hypervisor subtree is (for now) fine to
> use whatever {StdGNU,SunOS}.mk say, but the tools/ subtree
> shouldn't use any hard-coded paths.

Oh, so you mean to keep the current DEBUG_DIR in {StdGNU,SunOS}.mk but
add a template to Paths.mk.in for the tools? That seems fine.

Roger.

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3] build: remove shim related targets
  2018-02-28 13:02       ` Roger Pau Monné
@ 2018-02-28 13:25         ` Jan Beulich
  2018-02-28 15:02           ` Roger Pau Monné
  0 siblings, 1 reply; 13+ messages in thread
From: Jan Beulich @ 2018-02-28 13:25 UTC (permalink / raw)
  To: Roger Pau Monné
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, xen-devel

>>> On 28.02.18 at 14:02, <roger.pau@citrix.com> wrote:
> On Wed, Feb 28, 2018 at 05:29:06AM -0700, Jan Beulich wrote:
>> >>> On 28.02.18 at 12:47, <roger.pau@citrix.com> wrote:
>> > On Wed, Feb 28, 2018 at 04:02:53AM -0700, Jan Beulich wrote:
>> >> >>> On 21.02.18 at 13:22, <roger.pau@citrix.com> wrote:
>> >> > --- a/tools/firmware/Makefile
>> >> > +++ b/tools/firmware/Makefile
>> >> > @@ -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)
>> >> 
>> >> This is screwing up my build, and looking again I can't see how
>> >> this can be right: Both $(XENFIRMWAREDIR) and $(DEBUG_DIR)
>> >> are supposed to be ${prefix}-able, yet there clearly should not
>> >> be an infix resulting from the construction of this path.
>> > 
>> > By being prefixable you mean that both XENFIRMWAREDIR and DEBUG_DIR
>> > can be relative paths?
>> 
>> Both should be possible to live in /usr/lib or /usr/local/lib,
>> for example.
> 
> I'm afraid I don't see the issue, could you provide the values of
> DESTDIR, DEBUG_DIR and XENFIRMWAREDIR that are causing the issue?

My build issue is because of some tweaking I have to do in order to
be able to run the tools from the build directory (it's quite sad that
this still isn't supported "out of the box").

> Is this because you end up with something like:
> 
> /usr/local/lib/debug/usr/local/... in the debug path?

Indeed (except the first "local" you show wrongly isn't there), just
that there's some /home/jbeulich/.../ infix, but _no_ such prefix
(DESTDIR for the reason mentioned above can't be set to
/home/jbeulich/..., or [I don't recall] either the build breaks or
things don't work in the end, but needs to be forced to / on the
make command line; as said I have a compensating tweak
elsewhere so that the full resulting path is correct everywhere
_except_ now for DEBG_DIR).

>> >> In that context I wonder why DEBUG_DIR is set in
>> >> {StdGNU,SunOS}.mk instead of having a template in
>> >> Paths.mk.in.
>> > 
>> > Then you would have to run configure before installing the hypervisor,
>> > because the install hypervisor target uses DEBUG_DIR.
>> 
>> I don't think so, no. The hypervisor subtree is (for now) fine to
>> use whatever {StdGNU,SunOS}.mk say, but the tools/ subtree
>> shouldn't use any hard-coded paths.
> 
> Oh, so you mean to keep the current DEBUG_DIR in {StdGNU,SunOS}.mk but
> add a template to Paths.mk.in for the tools? That seems fine.

That's a possible route; whether to keep two different things
named identically is another question.

Jan


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3] build: remove shim related targets
  2018-02-28 13:25         ` Jan Beulich
@ 2018-02-28 15:02           ` Roger Pau Monné
  2018-02-28 15:30             ` Jan Beulich
  0 siblings, 1 reply; 13+ messages in thread
From: Roger Pau Monné @ 2018-02-28 15:02 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, xen-devel

On Wed, Feb 28, 2018 at 06:25:23AM -0700, Jan Beulich wrote:
> >>> On 28.02.18 at 14:02, <roger.pau@citrix.com> wrote:
> > On Wed, Feb 28, 2018 at 05:29:06AM -0700, Jan Beulich wrote:
> >> >>> On 28.02.18 at 12:47, <roger.pau@citrix.com> wrote:
> >> > On Wed, Feb 28, 2018 at 04:02:53AM -0700, Jan Beulich wrote:
> >> >> >>> On 21.02.18 at 13:22, <roger.pau@citrix.com> wrote:
> >> >> > --- a/tools/firmware/Makefile
> >> >> > +++ b/tools/firmware/Makefile
> >> >> > @@ -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)
> >> >> 
> >> >> This is screwing up my build, and looking again I can't see how
> >> >> this can be right: Both $(XENFIRMWAREDIR) and $(DEBUG_DIR)
> >> >> are supposed to be ${prefix}-able, yet there clearly should not
> >> >> be an infix resulting from the construction of this path.
> >> > 
> >> > By being prefixable you mean that both XENFIRMWAREDIR and DEBUG_DIR
> >> > can be relative paths?
> >> 
> >> Both should be possible to live in /usr/lib or /usr/local/lib,
> >> for example.
> > 
> > I'm afraid I don't see the issue, could you provide the values of
> > DESTDIR, DEBUG_DIR and XENFIRMWAREDIR that are causing the issue?
> 
> My build issue is because of some tweaking I have to do in order to
> be able to run the tools from the build directory (it's quite sad that
> this still isn't supported "out of the box").
> 
> > Is this because you end up with something like:
> > 
> > /usr/local/lib/debug/usr/local/... in the debug path?
> 
> Indeed (except the first "local" you show wrongly isn't there), just
> that there's some /home/jbeulich/.../ infix, but _no_ such prefix
> (DESTDIR for the reason mentioned above can't be set to
> /home/jbeulich/..., or [I don't recall] either the build breaks or
> things don't work in the end, but needs to be forced to / on the
> make command line; as said I have a compensating tweak
> elsewhere so that the full resulting path is correct everywhere
> _except_ now for DEBG_DIR).

OK, I *think* I understand what's missing here. This would be more
correct as $(DESTDIR)$(prefix)$(DEBUG_DIR)$(XENFIRMWAREDIR).

It looks like DEBUG_DIR wants to be set in Paths.mk.in as you
suggested.

But that raises the question, if prefix=/usr/local this will become:

/usr/local/lib/usr/local/lib/xen/...

Should this instead be:

/usr/local/lib/usr/lib/xen/...

I don't think so, but want to be sure.

Thanks, Roger.

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3] build: remove shim related targets
  2018-02-28 15:02           ` Roger Pau Monné
@ 2018-02-28 15:30             ` Jan Beulich
  2018-02-28 15:47               ` Roger Pau Monné
  0 siblings, 1 reply; 13+ messages in thread
From: Jan Beulich @ 2018-02-28 15:30 UTC (permalink / raw)
  To: Roger Pau Monné
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, xen-devel

>>> On 28.02.18 at 16:02, <roger.pau@citrix.com> wrote:
> But that raises the question, if prefix=/usr/local this will become:
> 
> /usr/local/lib/usr/local/lib/xen/...

/usr/local/lib/debug/usr/local/lib/xen/...

> Should this instead be:
> 
> /usr/local/lib/usr/lib/xen/...

/usr/local/lib/debug/usr/lib/xen/...

> I don't think so, but want to be sure.

Neither, I would say (without knowing whether there are any
conventions for ${prefix}/lib/debug) - what has the full path got to
do in the middle in there? The more when it's /home/... or
something even more obscure?

Jan


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3] build: remove shim related targets
  2018-02-28 15:30             ` Jan Beulich
@ 2018-02-28 15:47               ` Roger Pau Monné
  2018-02-28 16:27                 ` Jan Beulich
  0 siblings, 1 reply; 13+ messages in thread
From: Roger Pau Monné @ 2018-02-28 15:47 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, xen-devel

On Wed, Feb 28, 2018 at 08:30:12AM -0700, Jan Beulich wrote:
> >>> On 28.02.18 at 16:02, <roger.pau@citrix.com> wrote:
> > But that raises the question, if prefix=/usr/local this will become:
> > 
> > /usr/local/lib/usr/local/lib/xen/...
> 
> /usr/local/lib/debug/usr/local/lib/xen/...
> 
> > Should this instead be:
> > 
> > /usr/local/lib/usr/lib/xen/...
> 
> /usr/local/lib/debug/usr/lib/xen/...

Right.

> > I don't think so, but want to be sure.
> 
> Neither, I would say (without knowing whether there are any
> conventions for ${prefix}/lib/debug) - what has the full path got to
> do in the middle in there? The more when it's /home/... or
> something even more obscure?

I would expect debuggers like gdb to search /usr/lib/debug and
/usr/local/lib/debug in order to find the debug symbols of a binary,
so that what's inside the debug/ directory needs to have the same path
as where the binary resides, hence I think it should be:

/usr/local/lib/debug/usr/local/lib/xen/

Roger.

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3] build: remove shim related targets
  2018-02-28 15:47               ` Roger Pau Monné
@ 2018-02-28 16:27                 ` Jan Beulich
  0 siblings, 0 replies; 13+ messages in thread
From: Jan Beulich @ 2018-02-28 16:27 UTC (permalink / raw)
  To: Roger Pau Monné
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, xen-devel

>>> On 28.02.18 at 16:47, <roger.pau@citrix.com> wrote:
> On Wed, Feb 28, 2018 at 08:30:12AM -0700, Jan Beulich wrote:
>> >>> On 28.02.18 at 16:02, <roger.pau@citrix.com> wrote:
>> > But that raises the question, if prefix=/usr/local this will become:
>> > 
>> > /usr/local/lib/usr/local/lib/xen/...
>> 
>> /usr/local/lib/debug/usr/local/lib/xen/...
>> 
>> > Should this instead be:
>> > 
>> > /usr/local/lib/usr/lib/xen/...
>> 
>> /usr/local/lib/debug/usr/lib/xen/...
> 
> Right.
> 
>> > I don't think so, but want to be sure.
>> 
>> Neither, I would say (without knowing whether there are any
>> conventions for ${prefix}/lib/debug) - what has the full path got to
>> do in the middle in there? The more when it's /home/... or
>> something even more obscure?
> 
> I would expect debuggers like gdb to search /usr/lib/debug and
> /usr/local/lib/debug in order to find the debug symbols of a binary,
> so that what's inside the debug/ directory needs to have the same path
> as where the binary resides, hence I think it should be:
> 
> /usr/local/lib/debug/usr/local/lib/xen/

Makes sense for stuff under /usr and /usr/local, but not really
for stuff under e.g. /home or some network mount.

Jan


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-02-28 16:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-21 12:22 [PATCH v3] build: remove shim related targets Roger Pau Monne
2018-02-21 12:39 ` Wei Liu
2018-02-21 12:45 ` Andrew Cooper
2018-02-21 13:06 ` Jan Beulich
2018-02-28 11:02 ` Jan Beulich
2018-02-28 11:47   ` Roger Pau Monné
2018-02-28 12:29     ` Jan Beulich
2018-02-28 13:02       ` Roger Pau Monné
2018-02-28 13:25         ` Jan Beulich
2018-02-28 15:02           ` Roger Pau Monné
2018-02-28 15:30             ` Jan Beulich
2018-02-28 15:47               ` Roger Pau Monné
2018-02-28 16:27                 ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.