build: fix tools and stubdom build
PATCH 1/2 tools/Rules.mk: honour CPPFLAGS in header check
In reply to Wei LiuIt could contain vital information about header location in a cross-build environment like stubdom.
---
Cc: Steven Haigh <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Julien Grall <[email protected]>
--- tools/Rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/Rules.mk +1 -1
@@ -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 >[email protected]
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
cover build: fix tools and stubdom build
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(-)
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
PATCH 2/2 build: fix tools/include and stubdom build
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.
---
Cc: Steven Haigh <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Samuel Thibault <[email protected]>
Cc: Julien Grall <[email protected]>
--- stubdom/Makefile | 13 +++---------- tools/include/Makefile | 34 ++++++++++++++++++---------------- 2 files changed, 21 insertions(+), 26 deletions(-)
stubdom/Makefile +3 -10
@@ -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)
tools/include/Makefile +18 -16
@@ -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
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH for-4.9 2/2] build: fix tools/include and stubdom build
Quoted 10 lines · 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/includebuild uses relative path and depends onXEN_OS
2. stubdom needstools/includeto be built, at which timeXEN_OSis mini-os and corresponding symlinks are created
3. libraries inside tools needstools/includeto be built, at which timeXEN_OSis 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
Quoted 6 lines
Fix this by using absolute paths in
tools/includeMakefile. Provide mechanism to override the prefix in paths. Use that mechanism in stubdom build to reduce code duplication.Reported-by Steven Haigh <[email protected]>Signed-off-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 8 lines · Wei Liu
Wei Liu (2):
tools/Rules.mk: honour CPPFLAGS in header check
build: fixtools/includeand stubdom buildstubdom/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
Signature · 5 lines
Steven Haigh Email: [email protected] Web: https://www.crc.id.au Phone: (03) 9001 6090 - 0412 935 897
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 15 lines · Steven Haigh
Quoted 8 lines · Wei Liu
Wei Liu (2):
tools/Rules.mk: honour CPPFLAGS in header check
build: fixtools/includeand stubdom buildstubdom/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.
Quoted 6 lines
I have copied the build log to:
https://cloud.crc.id.au/index.php/s/iTWJE3A1TQBhgDqSo 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.
Quoted 8 lines
Signature · 6 lines
-- Steven Haigh Email: [email protected] Web: https://www.crc.id.au Phone: (03) 9001 6090 - 0412 935 897
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Hi Wei,
Quoted 2 lines · Wei Liu
Wei Liu (2):
tools/Rules.mk: honour CPPFLAGS in header check
Assuming this patch got ack...
Quoted 1 line
build: fix
tools/includeand stubdom build
...
Cheers,
Signature · 6 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 6 lines · Julien Grall
Hi Wei,
Quoted 2 lines · Wei Liu
Wei Liu (2):
tools/Rules.mk: honour CPPFLAGS in header check
Quoted 8 lines
Assuming this patch got ack...
Quoted 1 line
build: fix
tools/includeand stubdom build...
Release-acked-by Julien Grall <[email protected]>
This series is superseded by
[PATCH for-4.9 v2] build: stubdom and tools should depend on public header target
Quoted 4 lines
Cheers,
Signature · 1 line
Julien Grall
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 13 lines · Wei Liu
Quoted 12 lines · Julien Grall
Hi Wei,
Quoted 2 lines · Wei Liu
Wei Liu (2):
tools/Rules.mk: honour CPPFLAGS in header checkAssuming this patch got ack...
Quoted 1 line
build: fix
tools/includeand stubdom build...
Quoted 7 lines
Quoted 2 lines
Release-acked-by Julien Grall <[email protected]>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,
Quoted 5 lines
Quoted 5 lines
Cheers,
--
Julien Grall
Signature · 6 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel