From patchwork Wed May 17 13:04:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9731077 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 47506602DB for ; Wed, 17 May 2017 13:07:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 397F31FF1E for ; Wed, 17 May 2017 13:07:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D96228795; Wed, 17 May 2017 13:07:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 51E4828793 for ; Wed, 17 May 2017 13:07:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dAydU-0001Ll-Ex; Wed, 17 May 2017 13:05:04 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dAydT-0001Lc-V6 for xen-devel@lists.xenproject.org; Wed, 17 May 2017 13:05:04 +0000 Received: from [85.158.143.35] by server-6.bemta-6.messagelabs.com id 6E/5B-03920-F7A4C195; Wed, 17 May 2017 13:05:03 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLLMWRWlGSWpSXmKPExsXitHSDvW6dl0y kwYrbihbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8a+m0eYC1ZJVzyZwdfAOE+8i5GTQ0LAX2JW Uw87iM0moCzxs7OXDcQWEdCTaDrwnLGLkYuDWeAQo8TsO4eZQRLCAuESFxYuZASxWQRUJXZ9P cIKYvMKWEhsOHCeDWKovMSutotgcSEBBYmO6ceYIGoEJU7OfMICYjMLSEgcfPGCeQIj9ywkqV lIUgsYmVYxahSnFpWlFukaWuolFWWmZ5TkJmbm6BoamOnlphYXJ6an5iQmFesl5+duYgQGAwM Q7GD8sSzgEKMkB5OSKO/+B9KRQnxJ+SmVGYnFGfFFpTmpxYcYZTg4lCR42TxlIoUEi1LTUyvS MnOAYQmTluDgURLhXeUBlOYtLkjMLc5Mh0idYlSUEucVBekTAElklObBtcFi4RKjrJQwLyPQI UI8BalFuZklqPKvGMU5GJWEeY1BpvBk5pXATX8FtJgJaHEzyM28xSWJCCmpBsYpZ14zC2yK5d Cb7z3bSjVjptWhRLneBS0qIbtMI73U1/r9vHqm5bbNowRXzZw1zZd/di8TuHcuddJvwfgTYiY LxKZGJVZovNp76pbQOicZo2sq8Y17S0za/PvMLVY8iKh67Lp1etv71i6RZ6cuLcjwynzNV87/ 73NXel9qi/96oQ38Cp53mZVYijMSDbWYi4oTAfeQ5tWAAgAA X-Env-Sender: prvs=303496ddb=wei.liu2@citrix.com X-Msg-Ref: server-4.tower-21.messagelabs.com!1495026300!62928534!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 9397 invoked from network); 17 May 2017 13:05:02 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 17 May 2017 13:05:02 -0000 X-IronPort-AV: E=Sophos;i="5.38,354,1491264000"; d="scan'208";a="432812740" From: Wei Liu To: Xen-devel Date: Wed, 17 May 2017 14:04:42 +0100 Message-ID: <20170517130442.16393-1-wei.liu2@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Cc: Steven Haigh , Julien Grall , Wei Liu , Ian Jackson , Samuel Thibault Subject: [Xen-devel] [PATCH for-4.9] build: stubdom and tools should depend on public header target X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Since both tools and stubdom build need the public headers, we build tools/include before stubdom and tools. Remove runes in stubdom and tools to avoid building tools/include more than once. The new arrangement ensures tools build gets the correct headers because XEN_OS is set to host os when building tools/include. As for stubdom, it explicitly links to the mini-os directory without relying on XEN_OS so it should fine. Reported-by: Steven Haigh Signed-off-by: Wei Liu Acked-by: Ian Jackson --- Cc: Steven Haigh Cc: Ian Jackson Cc: Samuel Thibault Cc: Julien Grall --- Makefile | 10 +++++++--- stubdom/Makefile | 1 - tools/Makefile | 3 +-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 084588e11e..6c837d7522 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,10 @@ mini-os-dir-force-update: mini-os-dir export XEN_TARGET_ARCH export DESTDIR +.PHONY: tools_public_headers +tools_public_headers: + $(MAKE) -C tools/include + # build and install everything into the standard system directories .PHONY: install install: $(TARGS_INSTALL) @@ -50,11 +54,11 @@ build-xen: $(MAKE) -C xen build .PHONY: build-tools -build-tools: +build-tools: tools_public_headers $(MAKE) -C tools build .PHONY: build-stubdom -build-stubdom: mini-os-dir +build-stubdom: mini-os-dir tools_public_headers $(MAKE) -C stubdom build ifeq (x86_64,$(XEN_TARGET_ARCH)) XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom pv-grub @@ -101,7 +105,7 @@ install-tools: $(MAKE) -C tools install .PHONY: install-stubdom -install-stubdom: mini-os-dir +install-stubdom: mini-os-dir tools_public_headers $(MAKE) -C stubdom install ifeq (x86_64,$(XEN_TARGET_ARCH)) XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom install-grub diff --git a/stubdom/Makefile b/stubdom/Makefile index aef705dd1e..db01827070 100644 --- a/stubdom/Makefile +++ b/stubdom/Makefile @@ -355,7 +355,6 @@ 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 && \ diff --git a/tools/Makefile b/tools/Makefile index 1396d95b50..496428e3a9 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -5,7 +5,6 @@ export PKG_CONFIG_DIR = $(CURDIR)/pkg-config include $(XEN_ROOT)/tools/Rules.mk SUBDIRS-y := -SUBDIRS-y += include SUBDIRS-y += libs SUBDIRS-y += libxc SUBDIRS-y += flask @@ -50,7 +49,7 @@ SUBDIRS-$(OCAML_TOOLS) += ocaml endif ifeq ($(CONFIG_RUMP),y) -SUBDIRS-y := include libxc xenstore +SUBDIRS-y := libxc xenstore endif # For the sake of linking, set the sys-root