From patchwork Wed Oct 23 16:48:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11207279 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C381C1747 for ; Wed, 23 Oct 2019 17:12:30 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9FD1C2086D for ; Wed, 23 Oct 2019 17:12:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="AzohAkO6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FD1C2086D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iNKAI-000354-H8; Wed, 23 Oct 2019 17:11:18 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iNKAG-00033T-KA for xen-devel@lists.xenproject.org; Wed, 23 Oct 2019 17:11:16 +0000 X-Inumbo-ID: 1a3f5e22-f5b8-11e9-bbab-bc764e2007e4 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 1a3f5e22-f5b8-11e9-bbab-bc764e2007e4; Wed, 23 Oct 2019 17:11:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1571850668; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CBfQ6dPGVZL/Q6VVNFGebn4qUfglC7w9/n2BUG61lEo=; b=AzohAkO6YQJz84wyStVsjZhR3e8dTnwKxXpqiE5+a2gEixxavNy4KF3s cpp4JeftL5au7nbM7VEVYFTQlgHbsDnJMl2DsGeOHaUESRmR96UOjEizh uTgIIUW6z+25uJs6HpKqaQLdbJsFgZd/A/hxKILs+1S9qEMS0v1qUe158 E=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 7wzMBaLYNteM0K8ie8ehDUssS+qgOPyeJz+XfBM8aIPFPSG90GU/a9dQWNJYWKTYzahwcm2Hlm CpUU6VWFN0m+lmA0SCEbBjBwJxkNAtcDIfD2nqB+DuAkYzhRNhVDxIomhr3lbnRbXCeZzDHIbt TsEfJA0VAHTRHWciGcKWOY86lNT+XrDXkMb3UVpTIA+bjOWNpsKlio3/cj+4GfVJ4M972fBJz9 mnO+8W97nHlp1XtdxCfTSWc+DVE0O/JWiEN5/z452x1o1MHbQjeH1DGy9b5WPQxmzJz6YQagzl V1A= X-SBRS: 2.7 X-MesageID: 7429246 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.68,221,1569297600"; d="scan'208";a="7429246" From: Anthony PERARD To: Date: Wed, 23 Oct 2019 17:48:34 +0100 Message-ID: <20191023164837.2700240-21-anthony.perard@citrix.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191023164837.2700240-1-anthony.perard@citrix.com> References: <20191023164837.2700240-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [RFC XEN PATCH 20/23] update arch/Makefile X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" archprepare target make asm-offsets.h make asm-macros.[ih] --- xen/Kbuild | 10 ++++++++ xen/arch/x86/Makefile | 54 +++++++++++++++++++++---------------------- 2 files changed, 37 insertions(+), 27 deletions(-) create mode 100644 xen/Kbuild diff --git a/xen/Kbuild b/xen/Kbuild new file mode 100644 index 000000000000..3b36d67226d6 --- /dev/null +++ b/xen/Kbuild @@ -0,0 +1,10 @@ +##### +# Generate asm-offsets.h + +offsets-file := include/asm-$(SRCARCH)/asm-offsets.h + +always += $(offsets-file) + +$(offsets-file): arch/$(SRCARCH)/asm-offsets.s FORCE + $(call filechk,offsets,__ASM_OFFSETS_H__) + diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 41486c512f10..9a6a0a595975 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -64,11 +64,17 @@ LDFLAGS_emulation_OpenBSD := _obsd LDFLAGS_emulation_FreeBSD := _fbsd KBUILD_LDFLAGS += -melf_x86_64$(LDFLAGS_emulation_$(XEN_OS)) +archheaders: $(objtree)/include/asm-x86/asm-macros.h + +archprepare: + $(Q)$(MAKE) $(build)=arch/$(SRCARCH) arch/$(SRCARCH)/asm-offsets.s + efi-y := $(shell if [ ! -r $(BASEDIR)/include/xen/compile.h -o \ -O $(BASEDIR)/include/xen/compile.h ]; then \ echo '$(TARGET).efi'; fi) -ALL_OBJS := $(BASEDIR)/arch/x86/boot/built_in.o $(BASEDIR)/arch/x86/efi/built_in.o $(ALL_OBJS) +head-y := arch/x86/boot/ +head-y += arch/x86/efi/ ifeq ($(CONFIG_LTO),y) # Gather all LTO objects together @@ -104,7 +110,10 @@ EFI_LDFLAGS += --major-os-version=2 --minor-os-version=0 EFI_LDFLAGS += --major-subsystem-version=2 --minor-subsystem-version=0 # Check if the compiler supports the MS ABI. -export XEN_BUILD_EFI := $(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c efi/check.c -o efi/check.o 2>/dev/null && echo y) +#export XEN_BUILD_EFI := $(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c efi/check.c -o efi/check.o 2>/dev/null && echo y) +# XXX FIXME: The subdir efi/ depends on symbolic links of files in common/efi/ +# XXX Disable EFI build for now. +override XEN_BUILD_EFI := # Check if the linker supports PE. XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsystem=10 -o efi/check.efi efi/check.o 2>/dev/null && echo y)) CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI @@ -154,31 +163,22 @@ $(TARGET).efi: prelink-efi.o $(note_file) efi.lds efi/relocs-dummy.o efi/mkreloc efi/boot.init.o efi/runtime.o efi/compat.o efi/buildid.o: $(BASEDIR)/arch/x86/efi/built_in.o efi/boot.init.o efi/runtime.o efi/compat.o efi/buildid.o: ; -$(BASEDIR)/include/asm-x86/asm-macros.h: asm-macros.i Makefile - echo '#if 0' >$@.new - echo '.if 0' >>$@.new - echo '#endif' >>$@.new - echo 'asm ( ".include \"$@\"" );' >>$@.new - echo '#if 0' >>$@.new - echo '.endif' >>$@.new - cat $< >>$@.new - echo '#endif' >>$@.new - $(call move-if-changed,$@.new,$@) +define filechk_asm-macros.h + echo '#if 0'; \ + echo '.if 0'; \ + echo '#endif'; \ + echo 'asm ( ".include \"$@\"" );'; \ + echo '#if 0'; \ + echo '.endif'; \ + cat $<; \ + echo '#endif' +endef + +$(objtree)/arch/x86/asm-macros.i: FORCE + $(Q)$(MAKE) $(build)=$(@D) $@ + +$(objtree)/include/asm-x86/asm-macros.h: $(objtree)/arch/x86/asm-macros.i Makefile FORCE + $(call filechk,asm-macros.h) efi/mkreloc: efi/mkreloc.c $(HOSTCC) $(HOSTCFLAGS) -g -o $@ $< - -.PHONY: clean -clean:: - rm -f asm-offsets.s *.lds boot/*.o boot/*~ boot/core boot/mkelf32 - rm -f asm-macros.i $(BASEDIR)/include/asm-x86/asm-macros.* - rm -f $(BASEDIR)/.xen-syms.[0-9]* boot/.*.d $(BASEDIR)/.xen.elf32 - rm -f $(BASEDIR)/.xen.efi.[0-9]* efi/*.efi efi/mkreloc - rm -f boot/cmdline.S boot/reloc.S boot/*.lnk boot/*.bin - rm -f note.o - -# Suppress loading of DEPS files for internal, temporary target files. This -# then also suppresses re-generation of the respective .*.d2 files. -ifeq ($(filter-out .xen%.o,$(notdir $(MAKECMDGOALS))),) -DEPS:= -endif