All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-4.9 0/2] build: fix tools and stubdom build
@ 2017-05-16 10:47 Wei Liu
  2017-05-16 10:47 ` [PATCH for-4.9 1/2] tools/Rules.mk: honour CPPFLAGS in header check Wei Liu
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Wei Liu @ 2017-05-16 10:47 UTC (permalink / raw)
  To: Xen-devel; +Cc: Wei Liu

Wei Liu (2):
  tools/Rules.mk: honour CPPFLAGS in header check
  build: fix tools/include and stubdom build

 stubdom/Makefile       | 13 +++----------
 tools/Rules.mk         |  2 +-
 tools/include/Makefile | 34 ++++++++++++++++++----------------
 3 files changed, 22 insertions(+), 27 deletions(-)

-- 
2.11.0


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

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

* [PATCH for-4.9 1/2] tools/Rules.mk: honour CPPFLAGS in header check
  2017-05-16 10:47 [PATCH for-4.9 0/2] build: fix tools and stubdom build Wei Liu
@ 2017-05-16 10:47 ` Wei Liu
  2017-05-16 10:47 ` [PATCH for-4.9 2/2] build: fix tools/include and stubdom build Wei Liu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Wei Liu @ 2017-05-16 10:47 UTC (permalink / raw)
  To: Xen-devel; +Cc: Steven Haigh, Julien Grall, Wei Liu, Ian Jackson

It could contain vital information about header location in a
cross-build environment like stubdom.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Steven Haigh <netwiz@crc.id.au>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Julien Grall <Julien.Grall@arm.com>
---
 tools/Rules.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 7cb28f5c4e..f592241c81 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -226,7 +226,7 @@ INSTALL_PYTHON_PROG = \
 
 headers.chk:
 	for i in $(filter %.h,$^); do \
-	    $(CC) -x c -ansi -Wall -Werror $(CFLAGS_xeninclude) \
+	    $(CC) $(CPPFLAGS) -x c -ansi -Wall -Werror $(CFLAGS_xeninclude) \
 	          -S -o /dev/null $$i || exit 1; \
 	    echo $$i; \
 	done >$@.new
-- 
2.11.0


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

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

* [PATCH for-4.9 2/2] build: fix tools/include and stubdom build
  2017-05-16 10:47 [PATCH for-4.9 0/2] build: fix tools and stubdom build Wei Liu
  2017-05-16 10:47 ` [PATCH for-4.9 1/2] tools/Rules.mk: honour CPPFLAGS in header check Wei Liu
@ 2017-05-16 10:47 ` Wei Liu
  2017-05-16 11:57   ` Samuel Thibault
  2017-05-17  4:47 ` [PATCH for-4.9 0/2] build: fix tools " Steven Haigh
  2017-05-17 14:35 ` Julien Grall
  3 siblings, 1 reply; 9+ messages in thread
From: Wei Liu @ 2017-05-16 10:47 UTC (permalink / raw)
  To: Xen-devel
  Cc: Steven Haigh, Julien Grall, Wei Liu, Ian Jackson, Samuel Thibault

Build can fail if stubdom build is run before tools build because:

1. tools/include build uses relative path and depends on XEN_OS
2. stubdom needs tools/include to be built, at which time XEN_OS is
   mini-os and corresponding symlinks are created
3. libraries inside tools needs tools/include to be built, at which
   time XEN_OS is the host os name, but symlinks won't be created
   because they are already there
4. libraries get the wrong headers and fail to build

Fix this by using absolute paths in tools/include Makefile. Provide
mechanism to override the prefix in paths. Use that mechanism in
stubdom build to reduce code duplication.

Reported-by: Steven Haigh <netwiz@crc.id.au>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Steven Haigh <netwiz@crc.id.au>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Julien Grall <Julien.Grall@arm.com>
---
 stubdom/Makefile       | 13 +++----------
 tools/include/Makefile | 34 ++++++++++++++++++----------------
 2 files changed, 21 insertions(+), 26 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 54a2bdda0e..0875f0d7c2 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -353,16 +353,9 @@ LINK_DIRS := libxc-$(XEN_TARGET_ARCH) xenstore $(foreach dir,$(LINK_LIBS_DIRS),l
 LINK_STAMPS := $(foreach dir,$(LINK_DIRS),$(dir)/stamp)
 
 mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET) $(LINK_STAMPS)
-	$(MAKE) -C $(XEN_ROOT)/tools/include
-	mkdir -p include/xen && \
-          ln -sf $(wildcard $(XEN_ROOT)/xen/include/public/*.h) include/xen && \
-          ln -sf $(addprefix $(XEN_ROOT)/xen/include/public/,arch-x86 hvm io xsm) include/xen && \
-          ( [ -h include/xen/sys ] || ln -sf $(XEN_ROOT)/tools/include/xen-sys/MiniOS include/xen/sys ) && \
-          ( [ -h include/xen/libelf ] || ln -sf $(XEN_ROOT)/tools/include/xen/libelf include/xen/libelf ) && \
-	  mkdir -p include/xen-foreign && \
-	  ln -sf $(wildcard $(XEN_ROOT)/tools/include/xen-foreign/*) include/xen-foreign/ && \
-	  $(MAKE) DESTDIR= -C include/xen-foreign/ && \
-	  ( [ -h include/xen/foreign ] || ln -sf ../xen-foreign include/xen/foreign )
+	rm -rf include
+	mkdir -p include/xen/libelf
+	$(MAKE) -C $(XEN_ROOT)/tools/include TOOLS_INCLUDE_PREFIX=$(CURDIR)/include/
 	$(MAKE) DESTDIR= -C $(MINI_OS) links
 	touch mk-headers-$(XEN_TARGET_ARCH)
 
diff --git a/tools/include/Makefile b/tools/include/Makefile
index f1af91c129..8b623566b2 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -4,32 +4,34 @@ include $(XEN_ROOT)/tools/Rules.mk
 # Relative to $(XEN_ROOT)/xen/xsm/flask
 FLASK_H_DEPEND := policy/initial_sids
 
+TOOLS_INCLUDE_PREFIX ?= $(XEN_ROOT)/tools/include
+
 .PHONY: all
-all: xen-foreign xen/.dir xen-xsm/.dir
+all: $(addprefix $(TOOLS_INCLUDE_PREFIX)/, xen-foreign xen/.dir xen-xsm/.dir)
 
-.PHONY: xen-foreign
-xen-foreign:
+.PHONY: $(TOOLS_INCLUDE_PREFIX)/xen-foreign
+$(TOOLS_INCLUDE_PREFIX)/xen-foreign:
 	$(MAKE) -C xen-foreign
 
-xen/.dir:
-	@rm -rf xen
-	mkdir -p xen/libelf
-	ln -sf $(XEN_ROOT)/xen/include/public/COPYING xen
-	ln -sf $(wildcard $(XEN_ROOT)/xen/include/public/*.h) xen
-	ln -sf $(addprefix $(XEN_ROOT)/xen/include/public/,arch-x86 arch-arm hvm io xsm) xen
-	ln -sf ../xen-sys/$(XEN_OS) xen/sys
-	ln -sf $(addprefix $(XEN_ROOT)/xen/include/xen/,libelf.h elfstructs.h) xen/libelf/
-	ln -s ../xen-foreign xen/foreign
-	ln -sf $(XEN_ROOT)/xen/include/acpi acpi
+$(TOOLS_INCLUDE_PREFIX)/xen/.dir:
+	@rm -rf $(TOOLS_INCLUDE_PREFIX)/xen
+	mkdir -p $(TOOLS_INCLUDE_PREFIX)/xen/libelf
+	ln -sf $(XEN_ROOT)/xen/include/public/COPYING $(TOOLS_INCLUDE_PREFIX)/xen
+	ln -sf $(wildcard $(XEN_ROOT)/xen/include/public/*.h) $(TOOLS_INCLUDE_PREFIX)/xen
+	ln -sf $(addprefix $(XEN_ROOT)/xen/include/public/,arch-x86 arch-arm hvm io xsm) $(TOOLS_INCLUDE_PREFIX)/xen
+	ln -sf $(CURDIR)/xen-sys/$(XEN_OS) $(TOOLS_INCLUDE_PREFIX)/xen/sys
+	ln -sf $(addprefix $(XEN_ROOT)/xen/include/xen/,libelf.h elfstructs.h) $(TOOLS_INCLUDE_PREFIX)/xen/libelf/
+	ln -sf $(CURDIR)/xen-foreign $(TOOLS_INCLUDE_PREFIX)/xen/foreign
+	ln -sf $(XEN_ROOT)/xen/include/acpi $(TOOLS_INCLUDE_PREFIX)/acpi
 	touch $@
 
 # Not xen/xsm as that clashes with link to
 # $(XEN_ROOT)/xen/include/public/xsm above.
-xen-xsm/.dir: $(XEN_ROOT)/xen/xsm/flask/policy/mkflask.sh \
+$(TOOLS_INCLUDE_PREFIX)/xen-xsm/.dir: $(XEN_ROOT)/xen/xsm/flask/policy/mkflask.sh \
 	      $(patsubst %,$(XEN_ROOT)/xen/xsm/flask/%,$(FLASK_H_DEPEND))
-	mkdir -p xen-xsm/flask
+	mkdir -p $(TOOLS_INCLUDE_PREFIX)/xen-xsm/flask
 	cd $(XEN_ROOT)/xen/xsm/flask/ && \
-		$(SHELL) policy/mkflask.sh $(AWK) $(CURDIR)/xen-xsm/flask $(FLASK_H_DEPEND)
+		$(SHELL) policy/mkflask.sh $(AWK) $(TOOLS_INCLUDE_PREFIX)/xen-xsm/flask $(FLASK_H_DEPEND)
 	touch $@
 
 .PHONY: install
-- 
2.11.0


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

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

* Re: [PATCH for-4.9 2/2] build: fix tools/include and stubdom build
  2017-05-16 10:47 ` [PATCH for-4.9 2/2] build: fix tools/include and stubdom build Wei Liu
@ 2017-05-16 11:57   ` Samuel Thibault
  0 siblings, 0 replies; 9+ messages in thread
From: Samuel Thibault @ 2017-05-16 11:57 UTC (permalink / raw)
  To: Wei Liu; +Cc: Xen-devel, Julien Grall, Steven Haigh, Ian Jackson

Wei Liu, on mar. 16 mai 2017 11:47:30 +0100, wrote:
> Build can fail if stubdom build is run before tools build because:
> 
> 1. tools/include build uses relative path and depends on XEN_OS
> 2. stubdom needs tools/include to be built, at which time XEN_OS is
>    mini-os and corresponding symlinks are created
> 3. libraries inside tools needs tools/include to be built, at which
>    time XEN_OS is the host os name, but symlinks won't be created
>    because they are already there
> 4. libraries get the wrong headers and fail to build
> 
> Fix this by using absolute paths in tools/include Makefile. Provide
> mechanism to override the prefix in paths. Use that mechanism in
> stubdom build to reduce code duplication.
> 
> Reported-by: Steven Haigh <netwiz@crc.id.au>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>

Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

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

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

* Re: [PATCH for-4.9 0/2] build: fix tools and stubdom build
  2017-05-16 10:47 [PATCH for-4.9 0/2] build: fix tools and stubdom build Wei Liu
  2017-05-16 10:47 ` [PATCH for-4.9 1/2] tools/Rules.mk: honour CPPFLAGS in header check Wei Liu
  2017-05-16 10:47 ` [PATCH for-4.9 2/2] build: fix tools/include and stubdom build Wei Liu
@ 2017-05-17  4:47 ` Steven Haigh
  2017-05-17  9:37   ` Wei Liu
  2017-05-17 14:35 ` Julien Grall
  3 siblings, 1 reply; 9+ messages in thread
From: Steven Haigh @ 2017-05-17  4:47 UTC (permalink / raw)
  To: Wei Liu; +Cc: Xen-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 822 bytes --]

On 16/05/17 20:47, Wei Liu wrote:
> Wei Liu (2):
>   tools/Rules.mk: honour CPPFLAGS in header check
>   build: fix tools/include and stubdom build
> 
>  stubdom/Makefile       | 13 +++----------
>  tools/Rules.mk         |  2 +-
>  tools/include/Makefile | 34 ++++++++++++++++++----------------
>  3 files changed, 22 insertions(+), 27 deletions(-)

I have been seeing mixed results with these patches.

I can confirm that they seem to fix the problem with building on RHEL7 -
however on RHEL6, the packages still fail to build.

I have copied the build log to:
	https://cloud.crc.id.au/index.php/s/iTWJE3A1TQBhgDq

So far:
	EL7 - Successful builds: 4/4
	EL6 - Successful builds: 0/4

-- 
Steven Haigh

Email: netwiz@crc.id.au
Web: https://www.crc.id.au
Phone: (03) 9001 6090 - 0412 935 897


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

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

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

* Re: [PATCH for-4.9 0/2] build: fix tools and stubdom build
  2017-05-17  4:47 ` [PATCH for-4.9 0/2] build: fix tools " Steven Haigh
@ 2017-05-17  9:37   ` Wei Liu
  0 siblings, 0 replies; 9+ messages in thread
From: Wei Liu @ 2017-05-17  9:37 UTC (permalink / raw)
  To: Steven Haigh; +Cc: Xen-devel, Wei Liu

On Wed, May 17, 2017 at 02:47:41PM +1000, Steven Haigh wrote:
> On 16/05/17 20:47, Wei Liu wrote:
> > Wei Liu (2):
> >   tools/Rules.mk: honour CPPFLAGS in header check
> >   build: fix tools/include and stubdom build
> > 
> >  stubdom/Makefile       | 13 +++----------
> >  tools/Rules.mk         |  2 +-
> >  tools/include/Makefile | 34 ++++++++++++++++++----------------
> >  3 files changed, 22 insertions(+), 27 deletions(-)
> 
> I have been seeing mixed results with these patches.
> 
> I can confirm that they seem to fix the problem with building on RHEL7 -
> however on RHEL6, the packages still fail to build.
> 
> I have copied the build log to:
> 	https://cloud.crc.id.au/index.php/s/iTWJE3A1TQBhgDq
> 
> So far:
> 	EL7 - Successful builds: 4/4
> 	EL6 - Successful builds: 0/4

Thanks for testing.

I think there is yet another bug in the build system. Let me write a new
version.

> 
> -- 
> Steven Haigh
> 
> Email: netwiz@crc.id.au
> Web: https://www.crc.id.au
> Phone: (03) 9001 6090 - 0412 935 897
> 




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

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

* Re: [PATCH for-4.9 0/2] build: fix tools and stubdom build
  2017-05-16 10:47 [PATCH for-4.9 0/2] build: fix tools and stubdom build Wei Liu
                   ` (2 preceding siblings ...)
  2017-05-17  4:47 ` [PATCH for-4.9 0/2] build: fix tools " Steven Haigh
@ 2017-05-17 14:35 ` Julien Grall
  2017-05-17 14:44   ` Wei Liu
  3 siblings, 1 reply; 9+ messages in thread
From: Julien Grall @ 2017-05-17 14:35 UTC (permalink / raw)
  To: Wei Liu, Xen-devel; +Cc: Ian Jackson

Hi Wei,

On 16/05/17 11:47, Wei Liu wrote:
> Wei Liu (2):
>   tools/Rules.mk: honour CPPFLAGS in header check

Assuming this patch got ack...

>   build: fix tools/include and stubdom build

...

Release-acked-by: Julien Grall <julien.grall@arm.com>

Cheers,

-- 
Julien Grall

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

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

* Re: [PATCH for-4.9 0/2] build: fix tools and stubdom build
  2017-05-17 14:35 ` Julien Grall
@ 2017-05-17 14:44   ` Wei Liu
  2017-05-17 14:50     ` Julien Grall
  0 siblings, 1 reply; 9+ messages in thread
From: Wei Liu @ 2017-05-17 14:44 UTC (permalink / raw)
  To: Julien Grall; +Cc: Xen-devel, Wei Liu, Ian Jackson

On Wed, May 17, 2017 at 03:35:42PM +0100, Julien Grall wrote:
> Hi Wei,
> 
> On 16/05/17 11:47, Wei Liu wrote:
> > Wei Liu (2):
> >   tools/Rules.mk: honour CPPFLAGS in header check
> 
> Assuming this patch got ack...
> 
> >   build: fix tools/include and stubdom build
> 
> ...
> 
> Release-acked-by: Julien Grall <julien.grall@arm.com>
> 

This series is superseded by 

[PATCH for-4.9 v2] build: stubdom and tools should depend on public
header target

> Cheers,
> 
> -- 
> Julien Grall

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

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

* Re: [PATCH for-4.9 0/2] build: fix tools and stubdom build
  2017-05-17 14:44   ` Wei Liu
@ 2017-05-17 14:50     ` Julien Grall
  0 siblings, 0 replies; 9+ messages in thread
From: Julien Grall @ 2017-05-17 14:50 UTC (permalink / raw)
  To: Wei Liu; +Cc: Xen-devel, Ian Jackson



On 17/05/17 15:44, Wei Liu wrote:
> On Wed, May 17, 2017 at 03:35:42PM +0100, Julien Grall wrote:
>> Hi Wei,
>>
>> On 16/05/17 11:47, Wei Liu wrote:
>>> Wei Liu (2):
>>>   tools/Rules.mk: honour CPPFLAGS in header check
>>
>> Assuming this patch got ack...
>>
>>>   build: fix tools/include and stubdom build
>>
>> ...
>>
>> Release-acked-by: Julien Grall <julien.grall@arm.com>
>>
>
> This series is superseded by
>
> [PATCH for-4.9 v2] build: stubdom and tools should depend on public
> header target

Oh, I was not sure. Thank you for the heads-up.

Cheers,

>
>> Cheers,
>>
>> --
>> Julien Grall

-- 
Julien Grall

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

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

end of thread, other threads:[~2017-05-17 14:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-16 10:47 [PATCH for-4.9 0/2] build: fix tools and stubdom build Wei Liu
2017-05-16 10:47 ` [PATCH for-4.9 1/2] tools/Rules.mk: honour CPPFLAGS in header check Wei Liu
2017-05-16 10:47 ` [PATCH for-4.9 2/2] build: fix tools/include and stubdom build Wei Liu
2017-05-16 11:57   ` Samuel Thibault
2017-05-17  4:47 ` [PATCH for-4.9 0/2] build: fix tools " Steven Haigh
2017-05-17  9:37   ` Wei Liu
2017-05-17 14:35 ` Julien Grall
2017-05-17 14:44   ` Wei Liu
2017-05-17 14:50     ` Julien Grall

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.